Bert Leunis pushed to branch feature/CHANNELMGR-1725 at cms-community / hippo-addon-channel-manager
Commits: b46f75b2 by Bert Leunis at 2018-02-16T12:23:32+01:00 CHANNELMGR-1725 show an extra continue button for create content alternative step 2 Alternative step 2 occurs when a document type has required fields that are not supported by the editor yet. The user cannot save the document in the channel manager and must continue editing in the content perspective. There the document can be saved. Two components use the content editor: the edit content component (for existing documents), and the create content step 2 component. With transclude they passed the content of the message at the top. The transclude is changed to support multiple slots: one for the message, one for extra buttons. More of the message markup has moved to both parent component templates now. The multiple slot transclusion setup also allows (demands?) that the content-editor component gets names child component parts, which makes the transclusion better readable and less magic. - - - - - 4 changed files: - frontend-ng/src/app/channel/sidePanels/rightSidePanel/contentEditor/contentEditor.component.js - frontend-ng/src/app/channel/sidePanels/rightSidePanel/contentEditor/contentEditor.html - frontend-ng/src/app/channel/sidePanels/rightSidePanel/createContent/step2/step2.html - frontend-ng/src/app/channel/sidePanels/rightSidePanel/editContent/editContentMain.html Changes: ===================================== frontend-ng/src/app/channel/sidePanels/rightSidePanel/contentEditor/contentEditor.component.js ===================================== --- a/frontend-ng/src/app/channel/sidePanels/rightSidePanel/contentEditor/contentEditor.component.js +++ b/frontend-ng/src/app/channel/sidePanels/rightSidePanel/contentEditor/contentEditor.component.js @@ -21,7 +21,10 @@ import template from './contentEditor.html'; const contentEditorComponent = { controller, template, - transclude: true, + transclude: { + message: '?contentEditorMessage', + extraButton: '?contentEditorExtraButton', + }, bindings: { allowSave: '<', cancelLabel: '@', @@ -29,7 +32,6 @@ const contentEditorComponent = { onClose: '&', onSave: '&', onSwitchEditor: '&', - showMessage: '<', }, }; ===================================== frontend-ng/src/app/channel/sidePanels/rightSidePanel/contentEditor/contentEditor.html ===================================== --- a/frontend-ng/src/app/channel/sidePanels/rightSidePanel/contentEditor/contentEditor.html +++ b/frontend-ng/src/app/channel/sidePanels/rightSidePanel/contentEditor/contentEditor.html @@ -20,11 +20,7 @@ layout="column" class="rightSidePanel-content"> - <md-subheader ng-if="$ctrl.showMessage" - class="md-no-sticky" - md-colors="{background: 'hippo-grey-200'}"> - <ng-transclude></ng-transclude> - </md-subheader> + <div ng-transclude="message"></div> <div ng-if="$ctrl.getError()" class="md-padding feedback qa-feedback" @@ -68,11 +64,7 @@ {{ ::'SAVE' | translate }} </md-button> - <md-button class="qa-continue" - ng-click="$ctrl.onSwitchEditor()" - ng-if="!$ctrl.isSaveAllowed()"> - {{ 'CONTINUE' | translate }} - </md-button> + <div ng-transclude="extraButton"></div> </div> </md-toolbar> ===================================== frontend-ng/src/app/channel/sidePanels/rightSidePanel/createContent/step2/step2.html ===================================== --- a/frontend-ng/src/app/channel/sidePanels/rightSidePanel/createContent/step2/step2.html +++ b/frontend-ng/src/app/channel/sidePanels/rightSidePanel/createContent/step2/step2.html @@ -30,16 +30,31 @@ <content-editor flex="grow" layout="column" - show-message="!$ctrl.allMandatoryFieldsShown()" cancel-label="{{ ::'DISCARD' | translate }}" close-label="{{ ::'DISCARD' | translate }}" allow-save="$ctrl.allMandatoryFieldsShown()" on-switch-editor="$ctrl.switchEditor()" on-save="$ctrl.save()" on-close="$ctrl.close()"> - <div>{{ ::'NOT_ALL_MANDATORY_FIELDS_SHOWN' | translate }}</div> - <!-- use double quotes in the click action expression so we can use single quotes in the translation value --> - <div translate="NOT_ALL_MANDATORY_FIELDS_SHOWN_LINK" translate-value-click-action='$ctrl.switchEditor()' translate-compile></div> + + <content-editor-message> + <md-subheader ng-if="!$ctrl.allMandatoryFieldsShown()" + class="md-no-sticky" + md-colors="{background: 'hippo-grey-200'}"> + <div>{{ ::'NOT_ALL_MANDATORY_FIELDS_SHOWN' | translate }}</div> + <!-- use double quotes in the click action expression so we can use single quotes in the translation value --> + <div translate="NOT_ALL_MANDATORY_FIELDS_SHOWN_LINK" translate-value-click-action='$ctrl.switchEditor()' translate-compile></div> + </md-subheader> + </content-editor-message> + + <content-editor-extra-button> + <md-button class="qa-continue" + ng-click="$ctrl.switchEditor()" + ng-if="!$ctrl.allMandatoryFieldsShown()"> + {{ 'CONTINUE' | translate }} + </md-button> + </content-editor-extra-button> + </content-editor> </div> ===================================== frontend-ng/src/app/channel/sidePanels/rightSidePanel/editContent/editContentMain.html ===================================== --- a/frontend-ng/src/app/channel/sidePanels/rightSidePanel/editContent/editContentMain.html +++ b/frontend-ng/src/app/channel/sidePanels/rightSidePanel/editContent/editContentMain.html @@ -19,12 +19,19 @@ <content-editor ng-show="!$ctrl.showAddToProject()" flex="grow" layout="column" - show-message="$ctrl.notAllFieldsShown()" allow-save="true" on-switch-editor="$ctrl.switchEditor()" on-save="$ctrl.save()" on-close="$ctrl.close()"> - <div>{{ ::'NOT_ALL_FIELDS_SHOWN' | translate }}</div> - <!-- use double quotes in the click action expression so we can use single quotes in the translation value --> - <div translate="NOT_ALL_FIELDS_SHOWN_LINK" translate-value-click-action='$ctrl.switchEditor()' translate-compile></div> + + <content-editor-message> + <md-subheader ng-if="$ctrl.notAllFieldsShown()" + class="md-no-sticky" + md-colors="{background: 'hippo-grey-200'}"> + <div>{{ ::'NOT_ALL_FIELDS_SHOWN' | translate }}</div> + <!-- use double quotes in the click action expression so we can use single quotes in the translation value --> + <div translate="NOT_ALL_FIELDS_SHOWN_LINK" translate-value-click-action='$ctrl.switchEditor()' translate-compile></div> + </md-subheader> + </content-editor-message> + </content-editor> View it on GitLab: https://code.onehippo.org/cms-community/hippo-addon-channel-manager/commit/b46f75b25ad3e03b167b096e1db488bc9e7027e6 --- View it on GitLab: https://code.onehippo.org/cms-community/hippo-addon-channel-manager/commit/b46f75b25ad3e03b167b096e1db488bc9e7027e6 You're receiving this email because of your account on code.onehippo.org.
_______________________________________________ Hippocms-svn mailing list Hippocms-svn@lists.onehippo.org https://lists.onehippo.org/mailman/listinfo/hippocms-svn