Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Changing the text for wrong file error #256

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/src/app/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -2040,7 +2040,7 @@ function getOpenFileErrorDialog(options) {
let seperator = '';

if (isLast) {
seperator = ' or ';
seperator = '';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You tackled the correct helper function called getOpenFileErrorDialog. However, the seperator is not the root cause of this problem.

in the Zeebe Modeler we currently only have one single tab provider, that's why providerNames coming from the options is only including one provider name

function getOpenFileErrorDialog(options) {
  const {
    name,
    providerNames
  } = options;

// providerNames = ['BPMN']

// ...

}

Therefore, the logic for getting the providerNamesString is not working for only one provider name and results in this weird dialog text. So I think a better solution would be either

  1. Make the helper work in case the array has a size of 1
  2. Simplify the whole function by only using the single array value

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, Can you explain a bit about how to only run the helper function only if the array size is 1?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how to only run the helper function only if the array size is 1?

why you would want to do it? What I mean is to update the helper function to make it aware for the case the providerNames is a single value array. Currently, it doesn't do it.

} else if (!isFirst) {
seperator = ', ';
}
Expand Down