-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(28713): fix default name when no ui:name given
- Loading branch information
Showing
4 changed files
with
15 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 6 additions & 3 deletions
9
hivemq-edge/src/frontend/src/components/rjsf/utils/array-items.utils.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
const FORMAT_INDEX_MARKER = '#' | ||
const FORMAT_SEPARATOR = '-' | ||
|
||
export const formatItemName = (stub: string, index: number, description?: string) => { | ||
if (!description) return `${stub} ${FORMAT_INDEX_MARKER}${index}` | ||
return `${stub} ${FORMAT_INDEX_MARKER}${index} ${FORMAT_SEPARATOR} ${description}` | ||
import i18n from '@/config/i18n.config.ts' | ||
|
||
export const formatItemName = (stub: string | undefined, index: number, description?: string) => { | ||
const token = stub || i18n.t('rjsf.ArrayFieldItem.item', { ns: 'components' }) | ||
if (!description) return `${token} ${FORMAT_INDEX_MARKER}${index}` | ||
return `${token} ${FORMAT_INDEX_MARKER}${index} ${FORMAT_SEPARATOR} ${description}` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters