From f5666eed009be13d710f3420954a9cfbb4378c88 Mon Sep 17 00:00:00 2001 From: Shu Muto Date: Wed, 11 Jul 2018 16:56:52 +0900 Subject: [PATCH] Use new style for help in Angular ModalFormService ModalFormService (horizon.framework.widgets.form.ModalFormService, used in create key pair dialog or create user dialog) and WizardModalService (horizon.framework.widgets.modal.wizard-modal.service, used in create instance dialog or create image dialog) are used in dialogs for create/edit/etc in Angularized panel. But their help descriptions are shown in different style. Angularization proposes new look and feel, so ModalFormService should follow new style for help description like WizardModalService. This patch proposes new style for help in dialogs that uses ModalFormService. And "?" button for opening help panel is overlaped on input field on the first row, so this patch moves it up little bit. In this new style, if the help contents is too simple, it is not needed to make description space in the right harf of dialog for looks consistency, it is prefer not to add help panel, i.e. simply do not show "?" button. Change-Id: Ia720180c7aaef1f3d9c5e24dbebe3fe2d796d6c7 Closes-Bug: #1781151 --- .../widgets/form/modal-form.controller.js | 1 + .../form/modal-form.controller.spec.js | 7 ++++++- .../framework/widgets/form/modal-form.html | 3 +++ .../widgets/form/modal-form.service.js | 3 ++- .../widgets/form/modal-form.service.spec.js | 4 +++- .../roles/actions/create.action.service.js | 4 +++- .../roles/actions/edit.action.service.js | 4 +++- .../actions/workflow/workflow.service.js | 7 ++----- .../containers/containers.controller.js | 10 ++++------ .../containers/create-container.help.html | 20 +++++++++---------- .../core/keypairs/actions/create.service.js | 16 ++++----------- .../core/keypairs/actions/import.service.js | 16 ++++----------- .../scss/components/_help_panel.scss | 3 ++- 13 files changed, 46 insertions(+), 52 deletions(-) diff --git a/horizon/static/framework/widgets/form/modal-form.controller.js b/horizon/static/framework/widgets/form/modal-form.controller.js index 2a725f00b8..3c3e8f06b4 100644 --- a/horizon/static/framework/widgets/form/modal-form.controller.js +++ b/horizon/static/framework/widgets/form/modal-form.controller.js @@ -50,6 +50,7 @@ ctrl.submitText = context.submitText; ctrl.submitIcon = context.submitIcon; ctrl.cancel = cancel; + ctrl.helpUrl = context.helpUrl; function submit($event, schemaForm) { $event.preventDefault(); diff --git a/horizon/static/framework/widgets/form/modal-form.controller.spec.js b/horizon/static/framework/widgets/form/modal-form.controller.spec.js index 45779cf972..d70b6c3350 100644 --- a/horizon/static/framework/widgets/form/modal-form.controller.spec.js +++ b/horizon/static/framework/widgets/form/modal-form.controller.spec.js @@ -31,7 +31,8 @@ title: "title", form: "form", schema: "schema", - model: "model" + model: "model", + helpUrl: "help.html" }; ctrl = $controller( 'horizon.framework.widgets.form.ModalFormController', @@ -63,6 +64,10 @@ expect(ctrl.model).toEqual('model'); }); + it('sets helpUrl on scope', function() { + expect(ctrl.helpUrl).toEqual('help.html'); + }); + it('calls modalInstance close on submit', function() { spyOn(modalInstance, 'close'); ctrl.submit(mockEvent, mockSchemaValidForm); diff --git a/horizon/static/framework/widgets/form/modal-form.html b/horizon/static/framework/widgets/form/modal-form.html index d1e7452812..b4413b703c 100644 --- a/horizon/static/framework/widgets/form/modal-form.html +++ b/horizon/static/framework/widgets/form/modal-form.html @@ -16,6 +16,9 @@ pristine: { errors: false, success: false } }" ng-submit="ctrl.submit($event, schemaForm)"> + + +