bpmn-io / bpmn-js-properties-panel

A properties panel for bpmn-js.
MIT License
290 stars 196 forks source link

Property panel form validation not effective #951

Closed wangshunshun closed 1 year ago

wangshunshun commented 1 year ago

image When assigning an XML value obtained from the interface to bpmn, the message 'Element must have a unique id' is always reported. However, after modifying the value in the input box, the prompt is no longer present. The code is as follows: onMounted(() => { const customTranslateModle = { translate: ['value', customTranslate] } modeler.value = new Modeler({ container: '#workFlowCanvas', propertiesPanel: { parent: '#js-properties-panel' }, additionalModules: [propertiesPanelModule, propertiesProviderModule, magicPropertiesProviderModule, customTranslateModle], moddleExtensions: { camunda: CamundaBpmnModdle, task: taskjobModdleDescriptor } })

id.value = route.query.id getDetails() }) const getDetails = () => { processTemplateDetailAPI(route.query.id).then(res => { if (res.code == 200) { templateInfo = Object.assign({}, res.data) createNewDiagram() } }) } const createNewDiagram = async () => { let diagramXML = `` if (templateInfo.bpmnStr) { diagramXML = templateInfo.bpmnStr } try { const result = await modeler.value.importXML(diagramXML) const { err } = result if (!err) { success() } } catch (err) { console.log(err.message, err.warnings); } }

nikku commented 1 year ago

The message does exactly what it should do, or am I wrong?

If there is an ID duplication then it shows an error. If you change the ID to be unique, then the error vanishes.

wangshunshun commented 1 year ago

The message does exactly what it should do, or am I wrong?

If there is an ID duplication then it shows an error. If you change the ID to be unique, then the error vanishes.

The ID is the unique value. When I first entered the page, I reported an error with a duplicate ID. Then I casually added a number and deleted the prompt, which disappeared.

nikku commented 1 year ago

Unfortunately I cannot reproduce your issue. Or maybe we miss-understand each other.

52Tiantian commented 2 weeks ago

I have also encountered the same problem. Have you solved it? This issue occurred in version 0.46

barmac commented 2 weeks ago

We are not going to fix issues with v0.x of this repository. Please upgrade to the latest, and if the issue is still present, comment.

52Tiantian commented 2 weeks ago

我们不会修复此存储库 v0.x 中的问题。请升级到最新版本,如果问题仍然存在,请发表评论。

I have upgraded the version to 5. x, but this issue still exists. As long as the content is imported by the importXML method, it will trigger this problem, which looks like the update of the content has not been monitored

barmac commented 2 weeks ago

Can you please share a codesandbox which reproduces the issue?