Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edit kanban's main field #6048

Open
FelixMalfait opened this issue Jun 26, 2024 · 1 comment
Open

Edit kanban's main field #6048

FelixMalfait opened this issue Jun 26, 2024 · 1 comment

Comments

@FelixMalfait
Copy link
Member

FelixMalfait commented Jun 26, 2024

After creating a kanban it's not possible to view the field that was used to create the kanban or to modify it to another type of select field:

Screenshot 2024-06-26 at 18 47 03

Edit: we might as well allow viewing or even changing the view type if we do this...

Copy link

greptile-apps bot commented Jun 26, 2024

To enable editing the main field of a Kanban, follow these steps:

  1. Locate the Kanban Creation Logic: The main field for Kanban creation is managed in src/components/Kanban/KanbanCreation.js. Identify where the field is set during creation.

  2. Add Field Editing Capability: Modify src/components/Kanban/KanbanEdit.js to include a dropdown or input for selecting a new main field. Ensure it fetches available fields from the backend.

  3. Update State Management: In src/hooks/useKanban.js, add a function to update the main field state. This should handle the logic for changing the field and ensuring the Kanban updates accordingly.

  4. Backend Integration: Ensure the backend API supports updating the main field. Check src/api/kanban.js for the relevant endpoint and update it if necessary.

  5. UI Update: In src/components/Kanban/KanbanView.js, ensure the UI reflects the updated main field after it is changed.

Example code snippet for KanbanEdit.js:

import React, { useState } from 'react';
import { updateKanbanField } from 'src/api/kanban';

const KanbanEdit = ({ kanban }) => {
  const [mainField, setMainField] = useState(kanban.mainField);

  const handleFieldChange = (e) => {
    setMainField(e.target.value);
    updateKanbanField(kanban.id, e.target.value);
  };

  return (
    <select value={mainField} onChange={handleFieldChange}>
      {/* Options fetched from backend */}
    </select>
  );
};

export default KanbanEdit;

References

Edit Issue Bot Settings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🆕 New
Development

No branches or pull requests

1 participant