Skip to content

Commit

Permalink
Merge pull request #1996 from Heigvd/WEG-114-task-label
Browse files Browse the repository at this point in the history
WEG-114 Task label : add index
  • Loading branch information
TehAwol authored Nov 20, 2024
2 parents ad1f08e + d864901 commit ea79ed0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,9 @@ export function WindowedEditor<T extends IMergeable>({
? (entity as { editorTag?: string }).editorTag
: undefined,
name: getClassLabel(pathEntity),
index: entity
? (entity as { index?: string }).index
: undefined,
})}
</>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,13 @@ export function editorLabel(vd?: {
label?: ITranslatableContent;
editorTag?: string | null;
name?: string;
index?: string;
}) {
const label = translate(vd?.label);
let label = translate(vd?.label);
if (vd?.index) {
label = `${vd?.index}. ${label}`;
}

// if (!showTag && label) {
// return label;
// }
Expand All @@ -33,12 +38,16 @@ export function editorLabel(vd?: {
return (vd && (vd.editorTag || label || vd.name)) || '';
}

export function editorTitle({label, editorTag, name}: {
export function editorTitle({label, editorTag, name, index}: {
label?: ITranslatableContent;
editorTag?: string | null;
name?: string;
index?: string;
}) {
const trLabel = translate(label);
let trLabel = translate(label);
if (index) {
trLabel = `${index}. ${trLabel}`;
}
return [editorTag, trLabel, name].filter(s => s).join(' - ');
}

Expand Down

0 comments on commit ea79ed0

Please sign in to comment.