mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-05-12 17:04:46 +00:00
[ACS-9386] Fix wrong dialog title & button text on edit rule dialog (#4445)
This commit is contained in:
parent
801d671f98
commit
73d4743b62
@ -87,6 +87,11 @@ describe('EditRuleDialogSmartComponent', () => {
|
||||
|
||||
expect(titleElement.innerText.trim()).toBe('ACA_FOLDER_RULES.EDIT_RULE_DIALOG.CREATE');
|
||||
});
|
||||
|
||||
it('should set correct title and submitLabel for create mode', () => {
|
||||
expect(fixture.componentInstance.title).toBe('ACA_FOLDER_RULES.EDIT_RULE_DIALOG.CREATE_TITLE');
|
||||
expect(fixture.componentInstance.submitLabel).toBe('ACA_FOLDER_RULES.EDIT_RULE_DIALOG.CREATE');
|
||||
});
|
||||
});
|
||||
|
||||
describe('With dialog options passed', () => {
|
||||
@ -113,5 +118,10 @@ describe('EditRuleDialogSmartComponent', () => {
|
||||
|
||||
expect(titleElement.innerText.trim()).toBe('ACA_FOLDER_RULES.EDIT_RULE_DIALOG.UPDATE');
|
||||
});
|
||||
|
||||
it('should set correct title and submitLabel for update mode', () => {
|
||||
expect(fixture.componentInstance.title).toBe('ACA_FOLDER_RULES.EDIT_RULE_DIALOG.UPDATE_TITLE');
|
||||
expect(fixture.componentInstance.submitLabel).toBe('ACA_FOLDER_RULES.EDIT_RULE_DIALOG.UPDATE');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -54,19 +54,21 @@ export class EditRuleDialogUiComponent {
|
||||
formValid = false;
|
||||
model: Partial<Rule>;
|
||||
nodeId = '';
|
||||
title = '';
|
||||
submitLabel = '';
|
||||
actionDefinitions$;
|
||||
parameterConstraints$;
|
||||
formValue: Partial<Rule>;
|
||||
@Output() submitted = new EventEmitter<Partial<Rule>>();
|
||||
|
||||
title = 'ACA_FOLDER_RULES.EDIT_RULE_DIALOG.' + (this.isUpdateMode ? 'UPDATE_TITLE' : 'CREATE_TITLE');
|
||||
submitLabel = 'ACA_FOLDER_RULES.EDIT_RULE_DIALOG.' + (this.isUpdateMode ? 'UPDATE' : 'CREATE');
|
||||
|
||||
constructor(@Inject(MAT_DIALOG_DATA) public data: EditRuleDialogOptions) {
|
||||
this.model = this.data?.model || {};
|
||||
this.nodeId = this.data?.nodeId;
|
||||
this.actionDefinitions$ = this.data?.actionDefinitions$;
|
||||
this.parameterConstraints$ = this.data?.parameterConstraints$;
|
||||
|
||||
this.title = 'ACA_FOLDER_RULES.EDIT_RULE_DIALOG.' + (this.isUpdateMode ? 'UPDATE_TITLE' : 'CREATE_TITLE');
|
||||
this.submitLabel = 'ACA_FOLDER_RULES.EDIT_RULE_DIALOG.' + (this.isUpdateMode ? 'UPDATE' : 'CREATE');
|
||||
}
|
||||
|
||||
get isUpdateMode(): boolean {
|
||||
|
Loading…
x
Reference in New Issue
Block a user