[CST-12043] fix: translation for custom switch

This commit is contained in:
Vlad Nouski
2023-10-24 12:05:12 +02:00
parent 16327955a6
commit ae93cc0076
3 changed files with 5 additions and 4 deletions

View File

@@ -14,7 +14,7 @@
(change)="onChange($event)"
(focus)="onFocus($event)"/>
<label class="form-check-label custom-control-label" [for]="bindId && model.id">
<span [innerHTML]="model.label"
<span [innerHTML]="model.label | translate"
[ngClass]="[getClass('element', 'label'), getClass('grid', 'label')]"></span>
</label>
</div>

View File

@@ -29,6 +29,7 @@ import {
BITSTREAM_FORM_ACCESS_CONDITION_TYPE_CONFIG,
BITSTREAM_FORM_ACCESS_CONDITION_TYPE_LAYOUT,
BITSTREAM_FORM_PRIMARY,
BITSTREAM_FORM_PRIMARY_LAYOUT,
BITSTREAM_METADATA_FORM_GROUP_CONFIG,
BITSTREAM_METADATA_FORM_GROUP_LAYOUT
} from './section-upload-file-edit.model';
@@ -305,7 +306,7 @@ export class SubmissionSectionUploadFileEditComponent
});
const formModel: DynamicFormControlModel[] = [];
formModel.push(new DynamicCustomSwitchModel(BITSTREAM_FORM_PRIMARY, BITSTREAM_METADATA_FORM_GROUP_LAYOUT));
formModel.push(new DynamicCustomSwitchModel(BITSTREAM_FORM_PRIMARY, BITSTREAM_FORM_PRIMARY_LAYOUT));
const metadataGroupModelConfig = Object.assign({}, BITSTREAM_METADATA_FORM_GROUP_CONFIG);
metadataGroupModelConfig.group = this.formBuilderService.modelFromConfiguration(

View File

@@ -58,7 +58,7 @@ export const BITSTREAM_FORM_ACCESS_CONDITION_TYPE_LAYOUT: DynamicFormControlLayo
}
};
export const BITSTREAM_FORM_PRIMARY_LAYOUT: DynamicFormControlLayout = {
grid: {
element: {
host: 'col-6'
}
};
@@ -66,7 +66,7 @@ export const BITSTREAM_FORM_PRIMARY_LAYOUT: DynamicFormControlLayout = {
export const BITSTREAM_FORM_PRIMARY: DynamicSwitchModelConfig = {
id: 'primary',
name: 'primary',
label: 'Primary bitstream',
label: 'bitstream.edit.form.primaryBitstream.label'
};