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

Process-editor: Enable editing of taskID in config panel #12272

Closed
Tracked by #12018
nkylstad opened this issue Feb 8, 2024 · 4 comments
Closed
Tracked by #12018

Process-editor: Enable editing of taskID in config panel #12272

nkylstad opened this issue Feb 8, 2024 · 4 comments
Labels
area/process Area: Related to app process (e.g. signing, receipt, fill inn, payment, etc).

Comments

@nkylstad
Copy link
Member

nkylstad commented Feb 8, 2024

Description

It should be possible to edit the ID of a process element in the config panel.

Suggestion for config panel

After some experimentation and googling, I found a relatively simple way to use the modeler in the bpmn-js package to make the changes in the XML without having to implement the bpmn-js-properties-panel package:

import React, { useEffect } from 'react';
import { Textfield } from '@digdir/design-system-react';
import { useBpmnContext } from '../../../contexts/BpmnContext';

export const EditElementId = () => {
  const { bpmnDetails, setBpmnDetails, modelerRef } = useBpmnContext();
  const modeler = modelerRef.current;
  const modeling: any = modeler.get('modeling');

  const [idValue, setIdValue] = React.useState(bpmnDetails.id);

  useEffect(() => {
    setIdValue(bpmnDetails.id);
  }, [bpmnDetails.id]);

  const updateId = (value: string) => {
    modeling.updateProperties(bpmnDetails.element, {
      id: value
    });
    setBpmnDetails({
      ...bpmnDetails,
      id: value
    });
  }

  if (!bpmnDetails || !bpmnDetails.id) return null;

  return <Textfield
    label='ID'
    value={idValue}
    onChange={(e: any) => setIdValue(e.target.value)}
    onBlur={(e: any) => updateId(e.target.value)}
  />;
}

Should probably use the same design for ID here as for components.

@nkylstad nkylstad added status/ready-for-specification Status: Used for issues that are ready for functional decription og detailed design. area/process Area: Related to app process (e.g. signing, receipt, fill inn, payment, etc). labels Feb 8, 2024
@framitdavid
Copy link
Collaborator

Great suggestion! 👏 Perhaps useBpmnContext could directly export the modeling object?

@nkylstad nkylstad moved this to 📈 Todo in Team Studio Feb 12, 2024
@framitdavid framitdavid moved this from 📈 Todo to 👷 In Progress in Team Studio Feb 21, 2024
@framitdavid framitdavid self-assigned this Feb 21, 2024
@framitdavid framitdavid moved this from 👷 In Progress to ⚠️ Blocked in Team Studio Feb 29, 2024
@framitdavid framitdavid removed their assignment Feb 29, 2024
@framitdavid framitdavid moved this from ⚠️ Blocked to 👷 In Progress in Team Studio Feb 29, 2024
@framitdavid framitdavid self-assigned this Feb 29, 2024
@framitdavid framitdavid removed the status/ready-for-specification Status: Used for issues that are ready for functional decription og detailed design. label Mar 11, 2024
@framitdavid framitdavid moved this from 👷 In Progress to ⚠️ Blocked in Team Studio Mar 18, 2024
@framitdavid
Copy link
Collaborator

waiting for #12494 is merged due to up-cooming conflicts.

@framitdavid framitdavid moved this from ⚠️ Blocked to 🔎 Review in Team Studio Mar 21, 2024
@framitdavid framitdavid removed their assignment Mar 21, 2024
@framitdavid
Copy link
Collaborator

This issue does implement metaDataForm to be sent along with the BPMN XML to inform the backend about what kind of changes have been made within the XML. So that should be verified during testing of this issue as well. Hence I have closed issue #12218, due to it is resolved by this issue.

@framitdavid framitdavid moved this from 🔎 Review to 🧪 Test in Team Studio Apr 2, 2024
@framitdavid
Copy link
Collaborator

Tested OK in dev and @standeren has used the feature when implementing her feature.

@framitdavid framitdavid moved this from 🧪 Test to ✅ Done in Team Studio Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/process Area: Related to app process (e.g. signing, receipt, fill inn, payment, etc).
Projects
Archived in project
Development

No branches or pull requests

4 participants