Skip to content
This repository has been archived by the owner on Dec 16, 2024. It is now read-only.

dotCMS/core#13270 Add dialog to choose edit template or layout #506

Merged
merged 6 commits into from
Jan 8, 2018

Conversation

fmontes
Copy link
Member

@fmontes fmontes commented Jan 6, 2018

No description provided.

@@ -42,7 +42,13 @@ export class DotMessageService {
}

get(key: string): string {
return this.messagesLoaded[key];
if (arguments.length > 1) {

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

Copy link
Member Author

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>

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'

Copy link
Member Author

@fmontes fmontes Jan 8, 2018

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;

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;
}

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;
Copy link
Member Author

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.

@fmontes fmontes merged commit a24e0c5 into master Jan 8, 2018
@fmontes fmontes deleted the issue-13270-edit-layout-dialog branch January 8, 2018 19:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants