Giter Club home page Giter Club logo

Comments (1)

greptile-apps avatar greptile-apps commented on August 18, 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

from twenty.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.