Skip to content

Commit

Permalink
fix structure control-card labels
Browse files Browse the repository at this point in the history
  • Loading branch information
elpoelma committed Jul 19, 2024
1 parent cc3c5e2 commit 3f90b8a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/brave-camels-ring.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@lblod/ember-rdfa-editor-lblod-plugins': patch
---

Fix structure-control card labels
6 changes: 5 additions & 1 deletion addon/components/structure-plugin/_private/control-card.gts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,13 @@ import { not } from 'ember-truth-helpers';
import { recalculateNumbers } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/structure-plugin/recalculate-structure-numbers';
import { moveStructure } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/structure-plugin/move-structure';
import { transactionCombinator } from '@lblod/ember-rdfa-editor/utils/transaction-utils';
import { service } from '@ember/service';
import IntlService from 'ember-intl/services/intl';
interface Sig {
Args: { controller: SayController };
}
export default class StructureControlCardComponent extends Component<Sig> {
@service declare intl: IntlService;
get controller(): SayController {
return this.args.controller;
}
Expand All @@ -43,7 +46,8 @@ export default class StructureControlCardComponent extends Component<Sig> {
return null;
}
get structureName(): string {
return this.structure?.node.attrs.structureName ?? 'Unknown structure';
const type = this.structure?.node.attrs.structureType;
return this.intl.t(`structure-plugin.types.${type}`) ?? 'Unknown structure';
}
get canMoveUp() {
return this.controller.checkCommand(moveStructure('up'));
Expand Down

0 comments on commit 3f90b8a

Please sign in to comment.