-
Notifications
You must be signed in to change notification settings - Fork 34
dotCMS/core#13270 Add dialog to choose edit template or layout #506
Conversation
@@ -42,7 +42,13 @@ export class DotMessageService { | |||
} | |||
|
|||
get(key: string): string { | |||
return this.messagesLoaded[key]; | |||
if (arguments.length > 1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is not better use something like:
get(key: string, arguments: any[]): string
we have to add doc to this method too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need that because arguments is a "special JS code.
@@ -4,7 +4,7 @@ | |||
<h3 class="dot-edit-layout__page-title" *ngIf="!saveAsTemplate">{{pageView.page.title}}</h3> | |||
<input #templateName pInputText type="text" placeholder="{{dotMessageService.get('editpage.layout.toolbar.template.name')}}" class="dot-edit-layout__toolbar-template-name" *ngIf="saveAsTemplate" formControlName="title"> | |||
<div class="dot-edit-layout__toolbar-actions"> | |||
<p-checkbox class="dot-edit-layout__toolbar-save-template" label="{{dotMessageService.get('editpage.layout.toolbar.save.template')}}" *ngIf="isLayout()" binary="true" (onChange)="saveAsTemplateHandleChange($event)"></p-checkbox> | |||
<p-checkbox class="dot-edit-layout__toolbar-save-template" label="{{dotMessageService.get('editpage.layout.toolbar.save.template')}}" *ngIf="isLayout() || form.get('title').value === null" binary="true" (onChange)="saveAsTemplateHandleChange($event)"></p-checkbox> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need this condition?
'form.get('title').value === null'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because a template
anonymous: false
Could be a layout and the only way to differentiate (in the front end) is by setting the name to null and I need to have in the template so when I set the name null the change propagate to the template.
pageView: DotPageView; | ||
saveAsTemplate: boolean; | ||
showDialogSelection = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont know if this is a good name for this attribute
|
||
if (!this.isLayout()) { | ||
this.showDialogSelection = true; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we can move this for a method and give it a a good name
this.initForm(pageView); | ||
|
||
if (!this.isLayout()) { | ||
this.showTemplateLayoutSelectionDialog = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think with this new name and because we only do this here and once we don't need a method for this, I think it's pretty clear what this 3 lines does.
No description provided.