From 088d51a03086dd7c289fd6ced4af319b5c2ceebc Mon Sep 17 00:00:00 2001 From: Karl Tarvas Date: Thu, 26 Sep 2024 10:47:11 +0300 Subject: [PATCH] Bootstrap migration feature branch (#9117) (#25317) * Fix custom column classes in the updated theme * Fix missing leading slash in search pathname * Fix alert layout in formula catalog in the updated theme * Fix layout mismatch in patches management * Improved viewport size check * Refactor deployment to remove code duplication and support multiple deployment modes * Fixed stretched button issue * Fix input addon sizing * Refactor deployment to remove code duplication and support multiple deployment modes * Migrate HTTP proxy, fix setup wizard layout issues (#9162) * Fix setup wizard alignment issues * Fix http proxy setup page * Fix image alignment * Initial migration work for CLM pages * Fix form group offset * Hard integrate UI stories (#9220) * Add ui debug page controller * Add build time tooling to bundle stories * Add ui debug page frontend * Add missing types --------- Co-authored-by: Thomas Florio Co-authored-by: Richa --- .../src/com/suse/manager/webui/Router.java | 4 + .../controllers/StorybookController.java | 56 +++ .../webui/templates/storybook/storybook.jade | 10 + .../suse/manager/webui/utils/ViewHelper.java | 14 +- .../admin/setup/mirror-credentials-list.jsp | 4 +- .../pages/admin/setup/proxy-settings.jsp | 12 +- .../pages/admin/users/disabledlist.jsp | 4 +- .../WEB-INF/pages/audit/auditsearch.jsp | 2 +- .../pages/configuration/files/deletefile.jsp | 12 +- .../pages/configuration/files/deleterev.jsp | 12 +- ...s.bisht-richa.fixed-stretched-button-issue | 1 + ...cewalk-java.changes.eth.patches-management | 1 + java/spacewalk-java.changes.eth.rows | 1 + java/spacewalk-java.changes.eth.ui-debug | 1 + web/html/javascript/spacewalk-essentials.js | 2 +- ...susemanager-setup-wizard-proxy-settings.js | 19 +- web/html/src/.eslintrc.js | 2 + web/html/src/branding/css/base/fixes.scss | 13 - web/html/src/branding/css/base/forms.scss | 13 +- .../src/branding/css/base/setup-wizard.less | 18 +- .../src/branding/css/base/setup-wizard.scss | 18 +- web/html/src/branding/css/base/theme.less | 4 - web/html/src/branding/css/base/theme.scss | 4 - .../branding/css/bootstrap5-grid-patch.scss | 15 + .../src/branding/css/susemanager-dark.scss | 1 + .../src/branding/css/susemanager-light.scss | 1 + .../css/susemanager/components/alerts.scss | 4 + .../css/susemanager/components/buttons.less | 1 + .../css/susemanager/components/buttons.scss | 2 + .../css/susemanager/components/collapse.scss | 34 ++ .../susemanager/components/help-block.scss | 8 + .../css/susemanager/components/inputs.less | 5 + .../css/susemanager/components/inputs.scss | 7 +- .../css/susemanager/components/modal.scss | 2 + .../css/susemanager/components/panels.less | 4 + .../css/susemanager/components/panels.scss | 4 + .../css/susemanager/components/text.scss | 13 + .../src/branding/css/susemanager/index.less | 1 + .../src/branding/css/susemanager/index.scss | 4 +- web/html/src/branding/css/uyuni.scss | 1 + .../build/plugins/generate-stories-plugin.js | 96 +++++ web/html/src/build/webpack.config.js | 31 +- web/html/src/components/CoCoScansList.tsx | 2 +- web/html/src/components/FormulaForm.tsx | 2 +- web/html/src/components/action-schedule.tsx | 2 +- .../components/action/ActionStatus.stories.md | 6 - .../action/ActionStatus.stories.tsx | 12 + web/html/src/components/buttons.stories.tsx | 56 +++ web/html/src/components/buttons.tsx | 22 +- web/html/src/components/combobox.tsx | 2 +- web/html/src/components/config-channels.tsx | 2 +- .../datetime/DateTimePicker.stories.md | 71 ---- .../datetime/DateTimePicker.stories.tsx | 84 ++++ .../components/datetime/FromNow.stories.md | 32 -- .../components/datetime/FromNow.stories.tsx | 35 ++ .../src/components/dialog/Dialog.stories.md | 63 --- .../dialog/action-confirm.stories.tsx | 41 ++ .../src/components/dialog/delete.stories.tsx | 27 ++ web/html/src/components/formula-selection.tsx | 2 +- web/html/src/components/icontag.tsx | 2 + .../src/components/input/Check.stories.md | 23 -- .../src/components/input/DateTime.stories.md | 27 -- web/html/src/components/input/Form.stories.md | 31 -- .../input/FormMultiInput.stories.md | 204 ---------- .../src/components/input/InputBase.test.tsx | 2 +- web/html/src/components/input/InputBase.tsx | 2 +- .../src/components/input/Password.stories.md | 31 -- .../src/components/input/Radio.stories.md | 149 ------- .../src/components/input/Range.stories.md | 31 -- .../src/components/input/Select.stories.md | 148 ------- web/html/src/components/input/Text.stories.md | 39 -- .../components/input/check/Check.stories.tsx | 25 ++ .../components/input/{ => check}/Check.tsx | 4 +- .../input/datetime/DateTime.stories.tsx | 29 ++ .../input/{ => datetime}/DateTime.tsx | 4 +- .../{ => form-multi-input}/FormMultiInput.tsx | 2 +- .../multiple-fields.stories.tsx | 70 ++++ .../form-multi-input/single-field.stories.tsx | 59 +++ .../form-multi-input/table-fields.stories.tsx | 79 ++++ .../components/input/form/Form.stories.tsx | 33 ++ .../src/components/input/{ => form}/Form.tsx | 2 +- web/html/src/components/input/index.ts | 18 +- .../input/password/Password.stories.tsx | 33 ++ .../input/{ => password}/Password.tsx | 4 +- .../input/{ => radio}/Radio.module.css | 0 .../components/input/{ => radio}/Radio.tsx | 4 +- .../input/radio/horizontal-open.stories.tsx | 41 ++ .../input/radio/horizontal.stories.tsx | 40 ++ .../input/radio/vertical-open.stories.tsx | 40 ++ .../input/radio/vertical.stories.tsx | 39 ++ .../components/input/range/Range.stories.tsx | 27 ++ .../input/{ => range}/Range.test.tsx | 2 +- .../components/input/{ => range}/Range.tsx | 4 +- .../input/{ => select}/Select.test.tsx | 2 +- .../components/input/{ => select}/Select.tsx | 4 +- .../components/input/select/async.stories.tsx | 54 +++ .../input/select/custom.stories.tsx | 66 ++++ .../{ => select}/select-test-attributes.tsx | 0 .../input/select/simple.stories.tsx | 36 ++ .../components/input/text/Text.stories.tsx | 41 ++ .../src/components/input/{ => text}/Text.tsx | 4 +- web/html/src/components/messages.stories.md | 22 -- .../components/{ => messages}/messages.tsx | 0 .../messages/severities.stories.tsx | 17 + .../components/messages/utilities.stories.tsx | 10 + .../package/PackageListActionScheduler.tsx | 2 +- .../panels/BootstrapPanel.stories.md | 7 - .../panels/BootstrapPanel.stories.tsx | 12 + .../src/components/panels/TopPanel.stories.md | 13 - .../components/panels/TopPanel.stories.tsx | 12 + .../picker/recurring-event-picker.tsx | 4 +- web/html/src/components/states-picker.tsx | 4 +- web/html/src/components/table/SearchField.tsx | 4 +- web/html/src/components/table/TableFilter.tsx | 2 +- .../src/components/toastr/toastr.stories.md | 9 - .../src/components/toastr/toastr.stories.tsx | 12 + web/html/src/components/tree/tree.stories.md | 60 --- web/html/src/components/tree/tree.stories.tsx | 57 +++ .../src/components/utils/HelpIcon.stories.md | 5 - .../src/components/utils/HelpIcon.stories.tsx | 5 + .../src/components/utils/HelpLink.stories.md | 5 - .../src/components/utils/HelpLink.stories.tsx | 5 + .../src/components/utils/Loading.stories.md | 23 -- web/html/src/components/utils/index.ts | 2 +- .../utils/{ => loading}/Loading.tsx | 0 .../utils/loading/simple.stories.tsx | 10 + .../utils/loading/text-border.stories.tsx | 10 + .../components/utils/loading/text.stories.tsx | 10 + .../api/use-mandatory-channels-api.ts | 2 +- web/html/src/core/debugUtils/index.ts | 14 +- web/html/src/core/spa/view-helper.ts | 17 +- web/html/src/imports.d.ts | 1 + .../manager/admin/config/monitoring-admin.tsx | 2 +- .../admin/config/use-monitoring-api.ts | 2 +- .../admin/list-payg/list-payg.renderer.tsx | 2 +- .../src/manager/admin/list-payg/list-payg.tsx | 2 +- .../admin/payg-shared/info/payg-info-view.tsx | 12 +- .../sshData/payg-ssh-data-view.tsx | 24 +- .../setup/products/products-scc-dialog.tsx | 6 +- .../manager/admin/setup/products/products.tsx | 4 +- .../admin/task-engine-status/taskotop.tsx | 2 +- .../src/manager/appstreams/appstreams.tsx | 2 +- .../src/manager/audit/cveaudit/cveaudit.tsx | 2 +- .../subscription-matching.tsx | 4 +- .../list-filters/filter-edit.tsx | 2 +- .../list-projects/list-projects.renderer.tsx | 2 +- .../list-projects/list-projects.tsx | 2 +- .../shared/components/messages/messages.tsx | 2 +- .../shared/components/panels/build/build.tsx | 8 +- .../environment-lifecycle.tsx | 154 ++++---- .../environment-view.tsx | 24 +- .../filters-project-selection.tsx | 2 +- .../components/panels/promote/promote.tsx | 10 +- .../panels/properties/properties-edit.tsx | 2 +- .../panels/properties/properties-view.tsx | 16 +- .../sources/channels/channels-selection.tsx | 4 +- .../components/panels/sources/sources.tsx | 10 +- .../config-channels/group-config-channels.tsx | 2 +- web/html/src/manager/images/image-build.tsx | 10 +- web/html/src/manager/images/image-import.tsx | 10 +- .../src/manager/images/image-profile-edit.tsx | 8 +- .../src/manager/images/image-profiles.tsx | 2 +- .../src/manager/images/image-store-edit.tsx | 12 +- web/html/src/manager/images/image-stores.tsx | 2 +- .../manager/images/image-view-overview.tsx | 4 +- web/html/src/manager/images/image-view.tsx | 4 +- web/html/src/manager/index.ts | 13 +- web/html/src/manager/login/messages.tsx | 2 +- .../src/manager/login/susemanager/login.tsx | 2 +- web/html/src/manager/login/uyuni/login.tsx | 2 +- .../maintenance/calendar/web-calendar.tsx | 2 +- .../maintenance/details/calendar-details.tsx | 6 +- .../details/maintenance-windows-details.tsx | 2 +- .../maintenance/details/schedule-details.tsx | 4 +- .../maintenance/edit/calendar-edit.tsx | 8 +- .../maintenance/edit/schedule-edit.tsx | 8 +- .../maintenance/list/calendar-list.tsx | 4 +- .../maintenance/maintenance-windows.tsx | 4 +- .../maintenance/ssm/schedule-picker.tsx | 10 +- .../maintenance/ssm/system-assignment.tsx | 2 +- .../minion/ansible/accordion-path-content.tsx | 24 +- .../minion/ansible/ansible-control-node.tsx | 4 +- .../minion/ansible/ansible-path-content.tsx | 4 +- .../minion/ansible/schedule-playbook.tsx | 4 +- .../src/manager/minion/coco/coco-settings.tsx | 2 +- .../minion-config-channels.tsx | 2 +- .../minion/packages/package-states.tsx | 2 +- .../packages/use-package-states.api.tsx | 2 +- .../minion/ptf/ptf-overview.renderer.tsx | 2 +- .../notifications/notification-messages.tsx | 2 +- .../config-channels/org-config-channels.tsx | 2 +- .../proxy/container-config-messages.tsx | 2 +- .../src/manager/proxy/container-config.tsx | 8 +- .../recurring/recurring-actions-details.tsx | 2 +- .../recurring/recurring-actions-edit.tsx | 2 +- .../recurring/recurring-actions-list.tsx | 2 +- .../manager/recurring/recurring-actions.tsx | 4 +- .../org-formula-catalog.renderer.tsx | 2 +- .../formula-catalog/org-formula-catalog.tsx | 2 +- web/html/src/manager/state/highstate.tsx | 4 +- web/html/src/manager/storybook/index.ts | 3 + .../src/manager/storybook/layout.module.less | 29 ++ web/html/src/manager/storybook/layout.tsx | 31 ++ .../manager/storybook/stories.generated.ts | 370 ++++++++++++++++++ web/html/src/manager/storybook/stories.ts | 5 + .../manager/storybook/storybook.module.less | 29 ++ .../manager/storybook/storybook.renderer.tsx | 16 + web/html/src/manager/storybook/storybook.tsx | 113 ++++++ .../activation-key-channels.tsx | 6 +- .../activation-keys-appstreams.tsx | 2 +- .../systems/activation-key/child-channels.tsx | 2 +- .../systems/bootstrap/bootstrap-minions.tsx | 2 +- .../src/manager/systems/coco/ssm-schedule.tsx | 2 +- .../src/manager/systems/coco/ssm-settings.tsx | 2 +- .../src/manager/systems/delete-system.tsx | 4 +- .../systems/details/mgr-server-info.tsx | 28 +- web/html/src/manager/systems/proxy.tsx | 4 +- .../systems/ssm/ssm-subscribe-channels.tsx | 4 +- .../subscribe-channels/subscribe-channels.tsx | 4 +- .../virtualhostmanager-details.tsx | 4 +- .../virtualhostmanager-edit.tsx | 10 +- .../virtualhostmanager/virtualhostmanager.tsx | 4 +- .../src/manager/virtualization/ActionApi.tsx | 4 +- .../virtualization/HypervisorCheck.tsx | 4 +- .../src/manager/virtualization/ListTab.tsx | 6 +- .../virtualization/guests/GuestProperties.tsx | 14 +- .../guests/console/MessagePopUp.tsx | 6 +- .../guests/create/guests-create.tsx | 4 +- .../guests/edit/guests-edit.tsx | 4 +- .../guests/list/MigrateDialog.tsx | 4 +- .../guests/properties/GuestDiskFields.tsx | 8 +- .../guests/properties/GuestDiskFileFields.tsx | 6 +- .../properties/GuestDiskVolumeFields.tsx | 6 +- .../guests/properties/GuestDisksPanel.tsx | 10 +- .../guests/properties/guest-nics-panel.tsx | 12 +- .../properties/guest-properties-form.tsx | 6 +- .../guest-properties-traditional.tsx | 6 +- .../guests/virtualization-domains-caps-api.ts | 2 +- .../virtualization-guest-definition-api.ts | 2 +- .../virtualization/nets/edit/nets-edit.tsx | 2 +- .../virtualization/nets/list/nets-list.tsx | 2 +- .../nets/network-properties.tsx | 18 +- .../nets/properties/DnsConfig.tsx | 8 +- .../nets/properties/IpConfig.tsx | 8 +- .../nets/properties/NetworkAddress.tsx | 2 +- .../nets/properties/VirtualPortFields.tsx | 6 +- .../virtualization/nets/properties/Vlans.tsx | 8 +- .../virtualization-network-definition-api.tsx | 4 +- .../nets/virtualization-network-devs-api.ts | 2 +- .../virtualization/pools/edit/pools-edit.tsx | 2 +- .../virtualization/pools/list/pools-list.tsx | 6 +- .../virtualization/pools/pool-properties.tsx | 18 +- .../virtualization-pool-definition-api.tsx | 4 +- .../pools/virtualization-pools-action-api.tsx | 2 +- .../virtualization-pools-capabilities-api.ts | 2 +- web/html/src/object.d.ts | 21 + web/html/src/tsconfig.json | 3 +- web/html/src/utils/network.ts | 2 +- ...s.bisht-richa.fixed-stretched-button-issue | 1 + web/spacewalk-web.changes.eth.alert-margin | 1 + ...acewalk-web.changes.eth.patches-management | 1 + web/spacewalk-web.changes.eth.rows | 1 + web/spacewalk-web.changes.eth.ui-debug | 1 + 263 files changed, 2599 insertions(+), 1540 deletions(-) create mode 100644 java/code/src/com/suse/manager/webui/controllers/StorybookController.java create mode 100644 java/code/src/com/suse/manager/webui/templates/storybook/storybook.jade create mode 100644 java/spacewalk-java.changes.bisht-richa.fixed-stretched-button-issue create mode 100644 java/spacewalk-java.changes.eth.patches-management create mode 100644 java/spacewalk-java.changes.eth.rows create mode 100644 java/spacewalk-java.changes.eth.ui-debug create mode 100644 web/html/src/branding/css/bootstrap5-grid-patch.scss create mode 100644 web/html/src/branding/css/susemanager/components/collapse.scss create mode 100644 web/html/src/branding/css/susemanager/components/help-block.scss create mode 100644 web/html/src/build/plugins/generate-stories-plugin.js delete mode 100644 web/html/src/components/action/ActionStatus.stories.md create mode 100644 web/html/src/components/action/ActionStatus.stories.tsx create mode 100644 web/html/src/components/buttons.stories.tsx delete mode 100644 web/html/src/components/datetime/DateTimePicker.stories.md create mode 100644 web/html/src/components/datetime/DateTimePicker.stories.tsx delete mode 100644 web/html/src/components/datetime/FromNow.stories.md create mode 100644 web/html/src/components/datetime/FromNow.stories.tsx delete mode 100644 web/html/src/components/dialog/Dialog.stories.md create mode 100644 web/html/src/components/dialog/action-confirm.stories.tsx create mode 100644 web/html/src/components/dialog/delete.stories.tsx delete mode 100644 web/html/src/components/input/Check.stories.md delete mode 100644 web/html/src/components/input/DateTime.stories.md delete mode 100644 web/html/src/components/input/Form.stories.md delete mode 100644 web/html/src/components/input/FormMultiInput.stories.md delete mode 100644 web/html/src/components/input/Password.stories.md delete mode 100644 web/html/src/components/input/Radio.stories.md delete mode 100644 web/html/src/components/input/Range.stories.md delete mode 100644 web/html/src/components/input/Select.stories.md delete mode 100644 web/html/src/components/input/Text.stories.md create mode 100644 web/html/src/components/input/check/Check.stories.tsx rename web/html/src/components/input/{ => check}/Check.tsx (93%) create mode 100644 web/html/src/components/input/datetime/DateTime.stories.tsx rename web/html/src/components/input/{ => datetime}/DateTime.tsx (91%) rename web/html/src/components/input/{ => form-multi-input}/FormMultiInput.tsx (99%) create mode 100644 web/html/src/components/input/form-multi-input/multiple-fields.stories.tsx create mode 100644 web/html/src/components/input/form-multi-input/single-field.stories.tsx create mode 100644 web/html/src/components/input/form-multi-input/table-fields.stories.tsx create mode 100644 web/html/src/components/input/form/Form.stories.tsx rename web/html/src/components/input/{ => form}/Form.tsx (99%) create mode 100644 web/html/src/components/input/password/Password.stories.tsx rename web/html/src/components/input/{ => password}/Password.tsx (88%) rename web/html/src/components/input/{ => radio}/Radio.module.css (100%) rename web/html/src/components/input/{ => radio}/Radio.tsx (96%) create mode 100644 web/html/src/components/input/radio/horizontal-open.stories.tsx create mode 100644 web/html/src/components/input/radio/horizontal.stories.tsx create mode 100644 web/html/src/components/input/radio/vertical-open.stories.tsx create mode 100644 web/html/src/components/input/radio/vertical.stories.tsx create mode 100644 web/html/src/components/input/range/Range.stories.tsx rename web/html/src/components/input/{ => range}/Range.test.tsx (98%) rename web/html/src/components/input/{ => range}/Range.tsx (96%) rename web/html/src/components/input/{ => select}/Select.test.tsx (98%) rename web/html/src/components/input/{ => select}/Select.tsx (98%) create mode 100644 web/html/src/components/input/select/async.stories.tsx create mode 100644 web/html/src/components/input/select/custom.stories.tsx rename web/html/src/components/input/{ => select}/select-test-attributes.tsx (100%) create mode 100644 web/html/src/components/input/select/simple.stories.tsx create mode 100644 web/html/src/components/input/text/Text.stories.tsx rename web/html/src/components/input/{ => text}/Text.tsx (94%) delete mode 100644 web/html/src/components/messages.stories.md rename web/html/src/components/{ => messages}/messages.tsx (100%) create mode 100644 web/html/src/components/messages/severities.stories.tsx create mode 100644 web/html/src/components/messages/utilities.stories.tsx delete mode 100644 web/html/src/components/panels/BootstrapPanel.stories.md create mode 100644 web/html/src/components/panels/BootstrapPanel.stories.tsx delete mode 100644 web/html/src/components/panels/TopPanel.stories.md create mode 100644 web/html/src/components/panels/TopPanel.stories.tsx delete mode 100644 web/html/src/components/toastr/toastr.stories.md create mode 100644 web/html/src/components/toastr/toastr.stories.tsx delete mode 100644 web/html/src/components/tree/tree.stories.md create mode 100644 web/html/src/components/tree/tree.stories.tsx delete mode 100644 web/html/src/components/utils/HelpIcon.stories.md create mode 100644 web/html/src/components/utils/HelpIcon.stories.tsx delete mode 100644 web/html/src/components/utils/HelpLink.stories.md create mode 100644 web/html/src/components/utils/HelpLink.stories.tsx delete mode 100644 web/html/src/components/utils/Loading.stories.md rename web/html/src/components/utils/{ => loading}/Loading.tsx (100%) create mode 100644 web/html/src/components/utils/loading/simple.stories.tsx create mode 100644 web/html/src/components/utils/loading/text-border.stories.tsx create mode 100644 web/html/src/components/utils/loading/text.stories.tsx create mode 100644 web/html/src/manager/storybook/index.ts create mode 100644 web/html/src/manager/storybook/layout.module.less create mode 100644 web/html/src/manager/storybook/layout.tsx create mode 100644 web/html/src/manager/storybook/stories.generated.ts create mode 100644 web/html/src/manager/storybook/stories.ts create mode 100644 web/html/src/manager/storybook/storybook.module.less create mode 100644 web/html/src/manager/storybook/storybook.renderer.tsx create mode 100644 web/html/src/manager/storybook/storybook.tsx create mode 100644 web/html/src/object.d.ts create mode 100644 web/spacewalk-web.changes.bisht-richa.fixed-stretched-button-issue create mode 100644 web/spacewalk-web.changes.eth.alert-margin create mode 100644 web/spacewalk-web.changes.eth.patches-management create mode 100644 web/spacewalk-web.changes.eth.rows create mode 100644 web/spacewalk-web.changes.eth.ui-debug diff --git a/java/code/src/com/suse/manager/webui/Router.java b/java/code/src/com/suse/manager/webui/Router.java index 19adc6f1a3ae..ffc0dd911478 100644 --- a/java/code/src/com/suse/manager/webui/Router.java +++ b/java/code/src/com/suse/manager/webui/Router.java @@ -59,6 +59,7 @@ import com.suse.manager.webui.controllers.SetController; import com.suse.manager.webui.controllers.SsmController; import com.suse.manager.webui.controllers.StatesAPI; +import com.suse.manager.webui.controllers.StorybookController; import com.suse.manager.webui.controllers.SubscriptionMatchingController; import com.suse.manager.webui.controllers.SystemsController; import com.suse.manager.webui.controllers.TaskoTop; @@ -249,6 +250,9 @@ public void init() { // Saltboot SaltbootController.initRoutes(); + // Storybook + StorybookController.initRoutes(jade); + // if the calls above opened Hibernate session, close it now HibernateFactory.closeSession(); } diff --git a/java/code/src/com/suse/manager/webui/controllers/StorybookController.java b/java/code/src/com/suse/manager/webui/controllers/StorybookController.java new file mode 100644 index 000000000000..2d6987fc6bae --- /dev/null +++ b/java/code/src/com/suse/manager/webui/controllers/StorybookController.java @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2024 SUSE LLC + * + * This software is licensed to you under the GNU General Public License, + * version 2 (GPLv2). There is NO WARRANTY for this software, express or + * implied, including the implied warranties of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 + * along with this software; if not, see + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. + * + * Red Hat trademarks are not licensed under GPLv2. No permission is + * granted to use or replicate Red Hat trademarks that are incorporated + * in this software or its documentation. + */ + +package com.suse.manager.webui.controllers; + +import static com.suse.manager.webui.utils.SparkApplicationHelper.withCsrfToken; +import static com.suse.manager.webui.utils.SparkApplicationHelper.withUser; +import static com.suse.manager.webui.utils.SparkApplicationHelper.withUserPreferences; +import static spark.Spark.get; + +import com.redhat.rhn.domain.user.User; + +import java.util.HashMap; + +import spark.ModelAndView; +import spark.Request; +import spark.Response; +import spark.template.jade.JadeTemplateEngine; + +public class StorybookController { + private StorybookController() { } + + /** + * Initialize routes + * + * @param jade the Jade engine to use to render the pages + */ + public static void initRoutes(JadeTemplateEngine jade) { + get("/manager/storybook", + withUserPreferences(withCsrfToken(withUser(StorybookController::view))), jade); + } + + /** + * Returns the ui debug page + * + * @param req the request object + * @param res the response object + * @param user the authorized user + * @return the model and view + */ + public static ModelAndView view(Request req, Response res, User user) { + return new ModelAndView(new HashMap(), "templates/storybook/storybook.jade"); + } +} diff --git a/java/code/src/com/suse/manager/webui/templates/storybook/storybook.jade b/java/code/src/com/suse/manager/webui/templates/storybook/storybook.jade new file mode 100644 index 000000000000..80df7429d425 --- /dev/null +++ b/java/code/src/com/suse/manager/webui/templates/storybook/storybook.jade @@ -0,0 +1,10 @@ +include ../common.jade + +#storybook + +script(type='text/javascript'). + window.csrfToken = "#{csrf_token}"; + +script(type='text/javascript'). + spaImportReactPage('storybook') + .then(function(module) { module.renderer('storybook') }); diff --git a/java/code/src/com/suse/manager/webui/utils/ViewHelper.java b/java/code/src/com/suse/manager/webui/utils/ViewHelper.java index 03c9859d2560..bf197a37fbdb 100644 --- a/java/code/src/com/suse/manager/webui/utils/ViewHelper.java +++ b/java/code/src/com/suse/manager/webui/utils/ViewHelper.java @@ -68,14 +68,13 @@ public enum ViewHelper { "/rhn/account/EditAddress.do", "/rhn/multiorg/OrgConfigDetails.do", "/rhn/manager/notification-messages", - "rhn/channels/software/Search.do", + "/rhn/channels/software/Search.do", "/rhn/activationkeys/List.do", "/rhn/manager/systems/list/all", "/rhn/manager/contentmanagement/projects", "/rhn/kickstart/cobbler/DefaultSnippetList.do", "/rhn/systems/details/packages/PackageList.do", "/rhn/software/channels/All.do", - "rhn/channels/software/Search.do", "/rhn/manager/systems/ssm/coco/settings", "/rhn/systems/ssm/audit/ScheduleXccdf.do", "/rhn/systems/ssm/provisioning/PowerManagementConfiguration.do", @@ -103,7 +102,16 @@ public enum ViewHelper { "/rhn/manager/systems/details/recurring-actions", "/rhn/manager/cm/build", "/rhn/admin/ScheduleDetail.do", - "/rhn/manager/systems/cmd" + "/rhn/manager/systems/cmd", + "/rhn/kickstart/KickstartIpRanges.do", + "/rhn/channels/manage/repos/RepoCreate.do", + "/rhn/systems/details/Overview", + "/rhn/manager/formula-catalog", + "/rhn/errata/manage/CloneErrata.do", + "/rhn/admin/setup/ProxySettings.do", + "/rhn/admin/setup/MirrorCredentials.do", + "/rhn/manager/admin/setup/payg", + "/rhn/manager/storybook" ); ViewHelper() { } diff --git a/java/code/webapp/WEB-INF/pages/admin/setup/mirror-credentials-list.jsp b/java/code/webapp/WEB-INF/pages/admin/setup/mirror-credentials-list.jsp index 3f13a425eeb2..b31537d78888 100644 --- a/java/code/webapp/WEB-INF/pages/admin/setup/mirror-credentials-list.jsp +++ b/java/code/webapp/WEB-INF/pages/admin/setup/mirror-credentials-list.jsp @@ -12,7 +12,7 @@