From 2d84b62fe22f353486642d36bd1e6ceb0f2b1b3b Mon Sep 17 00:00:00 2001 From: Will Sun <30999793+AllForNothing@users.noreply.github.com> Date: Thu, 18 Feb 2021 09:12:23 +0800 Subject: [PATCH] Refactor UI routing and remove redundant code (#14166) Signed-off-by: AllForNothing --- src/portal/.browserslistrc | 17 + src/portal/README.md | 98 ++++- src/portal/angular.json | 16 +- src/portal/browserslist | 11 - src/portal/favicon.ico | Bin 7455 -> 0 bytes src/portal/package-lock.json | 30 +- src/portal/package.json | 6 +- .../scripts/generate-build-timestamp.js | 22 +- src/portal/server/controllers/scanners.ts | 2 +- src/portal/server/src/mock-api.ts | 2 +- src/portal/src/app/account/account.module.ts | 45 +- .../reset-password.component.html | 40 -- .../reset-password.component.scss | 0 .../reset-password.component.spec.ts | 51 --- .../reset-password.component.ts | 155 ------- .../sign-in}/sign-in-credential.ts | 0 .../sign-in/sign-in.component.html | 0 .../sign-in/sign-in.component.scss | 0 .../sign-in/sign-in.component.spec.ts | 8 +- .../sign-in/sign-in.component.ts | 26 +- .../sign-in/sign-in.service.spec.ts | 0 .../{ => account}/sign-in/sign-in.service.ts | 4 +- .../sign-in/top-repo/top-repo.component.html | 0 .../sign-in/top-repo/top-repo.component.scss | 0 .../top-repo/top-repo.component.spec.ts | 2 +- .../sign-in/top-repo/top-repo.component.ts | 6 +- .../top-repo/top-repository.service.spec.ts | 0 .../top-repo/top-repository.service.ts | 4 +- .../sign-in/top-repo/top-repository.ts | 0 .../sign-up/sign-up-page.component.spec.ts | 8 +- .../account/sign-up/sign-up-page.component.ts | 10 +- .../account/sign-up/sign-up.component.spec.ts | 10 +- .../app/account/sign-up/sign-up.component.ts | 14 +- .../src/app/all-pipes/all-pipes.module.ts | 16 - .../select-artifact-icon.pipe.spec.ts | 19 - .../select-artifact-icon.pipe.ts | 18 - src/portal/src/app/app.component.spec.ts | 2 +- src/portal/src/app/app.component.ts | 46 +- src/portal/src/app/app.module.ts | 107 ++--- ...unt-settings-modal-service.service.spec.ts | 0 .../account-settings-modal-service.service.ts | 6 +- .../account-settings-modal.component.html | 0 .../account-settings-modal.component.scss | 0 .../account-settings-modal.component.spec.ts | 18 +- .../account-settings-modal.component.ts | 31 +- .../account-settings/account.ts | 0 src/portal/src/app/base/base.module.ts | 136 +++++- .../src/app/base/footer/footer.component.html | 0 .../app/base/footer/footer.component.spec.ts | 25 -- .../confirmation-batch-message.ts | 0 .../confirmation-dialog.service.spec.ts | 0 .../confirmation-dialog.service.ts | 4 +- .../confirmation-message.ts | 2 +- .../confirmation-state-message.ts | 2 +- ...global-confirmation-dialog.component.html} | 0 ...global-confirmation-dialog.component.scss} | 0 ...bal-confirmation-dialog.component.spec.ts} | 12 +- .../global-confirmation-dialog.component.ts} | 16 +- .../harbor-shell/harbor-shell.component.html | 2 +- .../harbor-shell.component.spec.ts | 22 +- .../harbor-shell/harbor-shell.component.ts | 20 +- .../config/auth/config-auth.component.html | 0 .../config/auth/config-auth.component.scss | 0 .../config/auth/config-auth.component.spec.ts | 16 +- .../config/auth/config-auth.component.ts | 28 +- .../config/config.component.html | 0 .../config/config.component.scss | 0 .../config/config.component.spec.ts | 16 +- .../left-side-nav}/config/config.component.ts | 18 +- .../left-side-nav}/config/config.module.ts | 32 +- .../left-side-nav}/config/config.msg.utils.ts | 6 +- .../base/left-side-nav}/config/config.ts | 0 .../config/email/config-email.component.html | 0 .../config/email/config-email.component.scss | 0 .../email/config-email.component.spec.ts | 6 +- .../config/email/config-email.component.ts | 12 +- .../system/system-settings.component.html | 0 .../system/system-settings.component.scss | 24 ++ .../system/system-settings.component.spec.ts | 20 +- .../system/system-settings.component.ts | 32 +- .../left-side-nav}/distribution/base.scss | 0 .../distribution-instances.component.html | 0 .../distribution-instances.component.scss | 2 +- .../distribution-instances.component.spec.ts | 10 +- .../distribution-instances.component.ts | 26 +- .../distribution/distribution-interface.ts | 2 +- .../distribution-setup-modal.component.html | 0 .../distribution-setup-modal.component.scss | 0 ...distribution-setup-modal.component.spec.ts | 8 +- .../distribution-setup-modal.component.ts | 18 +- .../distribution/distribution.module.ts | 16 +- .../gc-page/gc-page.component.html | 0 .../gc-page/gc-page.component.scss | 0 .../gc-page/gc-page.component.spec.ts | 2 +- .../gc-page/gc-page.component.ts | 2 +- .../base/left-side-nav/gc-page/gc.module.ts | 33 ++ .../gc/gc-history/gc-history.component.html | 0 .../gc/gc-history/gc-history.component.scss | 0 .../gc-history/gc-history.component.spec.ts | 8 +- .../gc/gc-history/gc-history.component.ts | 4 +- .../gc-page}/gc/gc.api.repository.ts | 24 +- .../gc-page}/gc/gc.component.html | 0 .../gc-page}/gc/gc.component.scss | 0 .../gc-page}/gc/gc.component.spec.ts | 17 +- .../left-side-nav/gc-page}/gc/gc.component.ts | 6 +- .../left-side-nav/gc-page}/gc/gc.const.ts | 2 +- .../left-side-nav/gc-page}/gc/gc.service.ts | 5 +- .../gc-page}/gc/gc.viewmodel.factory.ts | 0 .../base/left-side-nav/gc-page}/gc/gcLog.ts | 0 .../add-group-modal.component.html | 0 .../add-group-modal.component.scss | 0 .../add-group-modal.component.spec.ts | 9 +- .../add-group-modal.component.ts | 10 +- .../left-side-nav}/group/group.component.html | 0 .../left-side-nav}/group/group.component.scss | 0 .../group/group.component.spec.ts | 10 +- .../left-side-nav}/group/group.component.ts | 29 +- .../base/left-side-nav/group/group.module.ts | 23 + .../group/group.service.spec.ts | 0 .../left-side-nav}/group/group.service.ts | 6 +- .../{ => base/left-side-nav}/group/group.ts | 0 .../interrogation-services.component.html | 0 .../interrogation-services.component.scss | 0 .../interrogation-services.component.spec.ts | 4 +- .../interrogation-services.component.ts | 0 .../interrogation-services.module.ts | 70 +++ .../scanner/config-scanner.component.html | 0 .../scanner/config-scanner.component.scss | 0 .../scanner/config-scanner.component.spec.ts | 10 +- .../scanner/config-scanner.component.ts | 14 +- .../scanner/config-scanner.service.spec.ts | 4 +- .../scanner/config-scanner.service.ts | 6 +- .../new-scanner-form.component.html | 0 .../new-scanner-form.component.scss | 0 .../new-scanner-form.component.spec.ts | 4 +- .../new-scanner-form.component.ts | 0 .../new-scanner-modal.component.html | 0 .../new-scanner-modal.component.spec.ts | 8 +- .../new-scanner-modal.component.ts | 6 +- .../scanner/scanner-metadata.ts | 0 .../scanner-metadata.component.spec.ts | 6 +- .../scanner-metadata.component.ts | 5 +- .../scanner-metadata/scanner-metadata.html | 0 .../scanner-metadata/scanner-metadata.scss | 0 .../scanner/scanner.ts | 0 .../vulnerability/scanAll.api.repository.ts | 15 +- .../vulnerability/scanAll.service.ts | 9 +- .../vulnerability-config.component.html | 0 .../vulnerability-config.component.scss | 24 ++ .../vulnerability-config.component.spec.ts | 18 +- .../vulnerability-config.component.ts | 36 +- .../labels/labels.component.html | 0 .../labels/labels.component.spec.ts | 4 +- .../left-side-nav}/labels/labels.component.ts | 0 .../left-side-nav/labels/labels.module.ts} | 27 +- .../left-side-nav}/log/log.module.ts | 25 +- .../log/recent-log.component.html | 0 .../log/recent-log.component.scss | 0 .../log/recent-log.component.spec.ts | 27 +- .../log/recent-log.component.ts | 9 +- .../project-quotas-container.component.html} | 0 .../project-quotas-container.component.scss} | 0 ...roject-quotas-container.component.spec.ts} | 27 +- .../project-quotas-container.component.ts} | 14 +- .../project-quotas/project-quotas.module.ts | 42 ++ .../edit-project-quotas.component.html | 2 +- .../edit-project-quotas.component.scss | 0 .../edit-project-quotas.component.spec.ts | 38 ++ .../edit-project-quotas.component.ts | 15 +- .../project-quotas.component.html | 2 +- .../project-quotas.component.scss | 0 .../project-quotas.component.spec.ts | 53 +-- .../project-quotas.component.ts | 18 +- .../create-project.component.html | 0 .../create-project.component.spec.ts | 17 +- .../create-project.component.ts | 13 +- .../create-project/create-project.scss | 0 .../list-project/list-project.component.html | 0 .../list-project.component.spec.ts | 16 +- .../list-project/list-project.component.ts | 34 +- .../projects/projects.component.html} | 0 .../projects/projects.component.scss} | 2 +- .../projects/projects.component.spec.ts} | 20 +- .../projects/projects.component.ts} | 24 +- .../left-side-nav/projects/projects.module.ts | 45 ++ .../statistic-handler.service.spec.ts | 0 .../statictics/statistic-handler.service.ts | 4 +- .../statistics-panel.component.html | 0 .../statistics-panel.component.spec.ts | 6 +- .../statictics/statistics-panel.component.ts | 6 +- .../statictics/statistics.component.html | 0 .../statictics/statistics.component.scss | 0 .../statictics/statistics.component.spec.ts | 0 .../statictics/statistics.component.ts | 0 .../statictics/statistics.service.spec.ts | 0 .../statictics/statistics.service.ts | 2 +- .../projects}/statictics/statistics.ts | 0 .../projects}/statictics/volumes.ts | 0 .../create-edit-endpoint.component.html | 2 +- .../create-edit-endpoint.component.scss | 0 .../create-edit-endpoint.component.spec.ts | 31 +- .../create-edit-endpoint.component.ts | 13 +- .../registries}/endpoint.component.html | 3 +- .../registries}/endpoint.component.scss | 5 +- .../registries}/endpoint.component.spec.ts | 42 +- .../registries}/endpoint.component.ts | 39 +- .../registries/endpoint.module.ts} | 28 +- .../replication/replication.module.ts | 55 +++ .../create-edit-rule.component.html | 2 +- .../create-edit-rule.component.scss | 0 .../create-edit-rule.component.spec.ts | 45 +- .../create-edit-rule.component.ts | 17 +- .../list-replication-rule.component.html | 0 .../list-replication-rule.component.scss | 0 .../list-replication-rule.component.spec.ts | 27 +- .../list-replication-rule.component.ts | 37 +- .../replication-tasks.component.html | 0 .../replication-tasks.component.scss | 0 .../replication-tasks.component.spec.ts | 10 +- .../replication-tasks.component.ts | 14 +- .../replication/replication.component.html | 0 .../replication/replication.component.scss | 0 .../replication/replication.component.spec.ts | 38 +- .../replication/replication.component.ts | 49 +-- .../total-replication-page.component.html | 0 .../total-replication-page.component.scss} | 0 .../total-replication-page.component.spec.ts | 4 +- .../total-replication-page.component.ts | 8 +- .../list-all-projects.component.html | 0 .../list-all-projects.component.scss | 0 .../list-all-projects.component.spec.ts | 4 +- .../list-all-projects.component.ts | 7 +- .../new-robot/new-robot.component.html | 0 .../new-robot/new-robot.component.scss | 0 .../new-robot/new-robot.component.spec.ts | 14 +- .../new-robot/new-robot.component.ts | 21 +- .../projects-modal.component.html | 0 .../projects-modal.component.scss | 0 .../projects-modal.component.spec.ts | 4 +- .../projects-modal.component.ts | 6 +- .../system-robot-accounts.component.html | 0 .../system-robot-accounts.component.scss | 0 .../system-robot-accounts.component.spec.ts | 14 +- .../system-robot-accounts.component.ts | 33 +- .../system-robot-accounts.module.ts | 15 +- .../system-robot-util.ts | 6 +- .../change-password.component.html | 0 .../change-password.component.scss | 0 .../change-password.component.spec.ts | 5 +- .../change-password.component.ts | 7 +- .../user/new-user-madal.component.scss | 0 .../user/new-user-modal.component.html | 0 .../user/new-user-modal.component.spec.ts | 8 +- .../user/new-user-modal.component.ts | 12 +- .../left-side-nav}/user/user.component.html | 0 .../left-side-nav}/user/user.component.scss | 0 .../user/user.component.spec.ts | 10 +- .../left-side-nav}/user/user.component.ts | 25 +- .../left-side-nav}/user/user.module.ts | 16 +- .../left-side-nav}/user/user.service.spec.ts | 0 .../left-side-nav}/user/user.service.ts | 6 +- .../app/{ => base/left-side-nav}/user/user.ts | 0 .../forgot-password.component.html | 0 .../forgot-password.component.scss | 0 .../forgot-password.component.spec.ts | 4 +- .../forgot-password.component.ts | 3 +- .../password-setting.component.html | 0 .../password-setting.component.scss | 0 .../password-setting.component.spec.ts | 8 +- .../password-setting.component.ts | 9 +- .../password-setting.service.spec.ts | 2 +- .../password-setting.service.ts | 6 +- .../password-setting/password-setting.ts | 0 .../chart-detail.component.html | 0 .../chart-detail.component.scss | 0 .../chart-detail.component.spec.ts | 27 +- .../chart-detail.component.ts | 10 +- .../chart-detail-dependency.component.html | 0 .../chart-detail-dependency.component.scss | 0 .../chart-detail-dependency.component.spec.ts | 0 .../chart-detail-dependency.component.ts | 2 +- .../chart-detail-summary.component.html | 0 .../chart-detail-summary.component.scss | 0 .../chart-detail-summary.component.spec.ts | 7 +- .../chart-detail-summary.component.ts | 10 +- .../chart-detail-value.component.html | 0 .../chart-detail-value.component.scss | 0 .../chart-detail-value.component.spec.ts | 0 .../chart-detail-value.component.ts | 0 .../chart-detail/chart-detail.component.html | 0 .../chart-detail/chart-detail.component.scss | 2 +- .../chart-detail.component.spec.ts | 6 +- .../chart-detail/chart-detail.component.ts | 18 +- .../helm-chart-detail.module.ts | 54 +++ .../helm-chart.interface.service.ts | 2 +- .../helm-chart.service.spec.ts | 0 .../helm-chart-detail}/helm-chart.service.ts | 24 +- .../label-filter/label-filter.component.html | 0 .../label-filter/label-filter.component.scss | 0 .../label-filter.component.spec.ts | 0 .../label-filter/label-filter.component.ts | 6 +- .../label-marker/label-marker.component.html | 2 +- .../label-marker/label-marker.component.scss | 0 .../label-marker.component.spec.ts | 4 +- .../label-marker/label-marker.component.ts | 6 +- .../helm-chart-version.component.html | 0 .../helm-chart-version.component.scss | 2 +- .../helm-chart-version.component.spec.ts | 6 +- .../helm-chart-version.component.ts | 47 +- .../list-chart-versions.component.html | 0 .../list-chart-versions.component.scss | 0 .../list-chart-versions.component.spec.ts | 10 +- .../list-chart-versions.component.ts | 12 +- .../helm-chart-list/helm-chart-list.module.ts | 37 ++ .../helm-chart.component.html | 0 .../helm-chart.component.scss | 2 +- .../helm-chart.component.spec.ts | 8 +- .../helm-chart.component.ts | 54 +-- .../list-charts.component.html | 0 .../list-charts.component.scss | 0 .../list-charts.component.spec.ts | 18 +- .../helm-chart-list}/list-charts.component.ts | 12 +- .../member/add-group/add-group.component.html | 0 .../member/add-group/add-group.component.scss | 0 .../add-group/add-group.component.spec.ts | 6 +- .../member/add-group/add-group.component.ts | 16 +- .../add-http-auth-group.component.html | 0 .../add-http-auth-group.component.scss | 0 .../add-http-auth-group.component.spec.ts | 11 +- .../add-http-auth-group.component.ts | 14 +- .../add-member/add-member.component.html | 0 .../add-member/add-member.component.scss | 0 .../add-member/add-member.component.spec.ts | 28 +- .../member/add-member/add-member.component.ts | 37 +- .../project/member/member.component.html | 0 .../project/member/member.component.scss | 0 .../project/member/member.component.spec.ts | 35 +- .../project/member/member.component.ts | 51 ++- .../app/base/project/member/member.module.ts | 31 ++ .../project/member/member.service.spec.ts | 0 .../project/member/member.service.ts | 4 +- .../app/{ => base}/project/member/member.ts | 0 .../add-p2p-policy.component.html | 0 .../add-p2p-policy.component.scss | 0 .../add-p2p-policy.component.spec.ts | 12 +- .../add-p2p-policy.component.ts | 18 +- .../p2p-provider/p2p-provider.module.ts | 35 ++ .../p2p-provider/p2p-provider.service.spec.ts | 0 .../p2p-provider/p2p-provider.service.ts | 0 .../p2p-provider/policy/policy.component.html | 0 .../p2p-provider/policy/policy.component.scss | 0 .../policy/policy.component.spec.ts | 22 +- .../p2p-provider/policy/policy.component.ts | 24 +- .../task-list/task-list.component.html | 0 .../task-list/task-list.component.scss | 0 .../task-list/task-list.component.spec.ts | 12 +- .../task-list/task-list.component.ts | 14 +- .../project-config.component.html | 0 .../project-config.component.scss | 0 .../project-config.component.spec.ts | 23 +- .../project-config.component.ts | 8 +- .../project-config/project-config.module.ts | 23 + .../project-policy-config.component.html | 0 .../project-policy-config.component.scss | 0 .../project-policy-config.component.spec.ts | 24 +- .../project-policy-config.component.ts | 33 +- .../project-policy-config/project.ts | 0 .../project-detail.component.html | 0 .../project-detail.component.scss | 0 .../project-detail.component.spec.ts | 8 +- .../project-detail.component.ts | 8 +- .../project-detail/project-detail.const.ts | 0 .../project-label.component.html | 0 .../project-label.component.scss | 0 .../project-label.component.spec.ts | 16 +- .../project-label/project-label.component.ts | 10 +- .../project-label/project-label.module.ts | 19 + .../project-log}/audit-log.component.html | 0 .../project-log}/audit-log.component.scss | 0 .../project-log}/audit-log.component.spec.ts | 30 +- .../project-log}/audit-log.component.ts | 14 +- .../project/project-log/audit-log.module.ts | 20 + .../src/app/base/project/project.module.ts | 177 ++++++++ .../src/app/{ => base}/project/project.ts | 0 .../additions.service.spec.ts | 0 .../artifact-additions/additions.service.ts | 2 +- .../artifact-additions.component.html | 0 .../artifact-additions.component.scss | 0 .../artifact-additions.component.spec.ts | 22 +- .../artifact-additions.component.ts | 6 +- .../artifact-vulnerabilities.component.html | 0 .../artifact-vulnerabilities.component.scss | 0 ...artifact-vulnerabilities.component.spec.ts | 12 +- .../artifact-vulnerabilities.component.ts | 16 +- .../build-history.component.html | 0 .../build-history.component.scss | 0 .../build-history.component.spec.ts | 4 +- .../build-history/build-history.component.ts | 4 +- .../dependencies/dependencies.component.html | 0 .../dependencies/dependencies.component.scss | 0 .../dependencies.component.spec.ts | 12 +- .../dependencies/dependencies.component.ts | 5 +- .../artifact/artifact-additions/models.ts | 2 +- .../summary/summary.component.html | 0 .../summary/summary.component.scss | 0 .../summary/summary.component.spec.ts | 17 +- .../summary/summary.component.ts | 4 +- .../values/values.component.html | 0 .../values/values.component.scss | 0 .../values/values.component.spec.ts | 4 +- .../values/values.component.ts | 6 +- .../artifact-common-properties.component.html | 0 .../artifact-common-properties.component.scss | 0 ...tifact-common-properties.component.spec.ts | 2 +- .../artifact-common-properties.component.ts | 4 +- .../artifact-list-page.component.html | 0 .../artifact-list-page.component.scss | 0 .../artifact-list-page.component.spec.ts | 15 +- .../artifact-list-page.component.ts | 17 +- .../artifact-list-tab.component.html | 2 +- .../artifact-list-tab.component.scss | 0 .../artifact-list-tab.component.spec.ts | 36 +- .../artifact-list-tab.component.ts | 40 +- .../artifact-list.component.html | 0 .../artifact-list.component.scss | 0 .../artifact-list.component.spec.ts | 32 +- .../artifact-list/artifact-list.component.ts | 20 +- .../artifact/artifact-summary.component.html | 0 .../artifact/artifact-summary.component.scss | 0 .../artifact-summary.component.spec.ts | 28 +- .../artifact/artifact-summary.component.ts | 12 +- .../artifact-tag/artifact-tag.component.html | 0 .../artifact-tag/artifact-tag.component.scss | 0 .../artifact-tag.component.spec.ts | 25 +- .../artifact-tag/artifact-tag.component.ts | 30 +- .../repository/artifact/artifact.module.ts | 75 ++++ .../artifact/artifact.service.spec.ts | 12 +- .../repository/artifact/artifact.service.ts | 4 +- .../project/repository/artifact/artifact.ts | 4 +- .../histogram-chart.component.html | 0 .../histogram-chart.component.scss | 0 .../histogram-chart.component.spec.ts | 0 .../histogram-chart.component.ts | 0 .../result-bar-chart-component.html | 0 .../result-bar-chart.component.spec.ts | 27 +- .../result-bar-chart.component.ts | 16 +- .../result-tip-histogram.component.html | 0 .../result-tip-histogram.component.scss | 0 .../result-tip-histogram.component.spec.ts | 0 .../result-tip-histogram.component.ts | 4 +- .../result-tip.component.spec.ts | 14 +- .../result-tip.component.ts | 4 +- .../result-tip.componnent.html | 0 .../vulnerability-scanning/scanning.scss | 0 .../gridview/grid-view.component.html | 0 .../gridview/grid-view.component.scss | 0 .../gridview/grid-view.component.spec.ts | 12 +- .../gridview/grid-view.component.ts | 2 +- .../repository-gridview.component.html | 0 .../repository-gridview.component.scss | 0 .../repository-gridview.component.spec.ts | 36 +- .../repository-gridview.component.ts | 45 +- .../project/repository/repository.module.ts | 23 + .../add-robot/add-robot.component.html | 0 .../add-robot/add-robot.component.scss | 0 .../add-robot/add-robot.component.spec.ts | 10 +- .../add-robot/add-robot.component.ts | 20 +- .../project-robot-account.module.ts | 24 ++ .../robot-account.component.html | 0 .../robot-account.component.scss | 2 +- .../robot-account.component.spec.ts | 30 +- .../robot-account/robot-account.component.ts | 34 +- .../project/scanner/project-scanner.module.ts | 20 + .../project/scanner/scanner.component.html | 0 .../project/scanner/scanner.component.scss | 0 .../project/scanner/scanner.component.spec.ts | 22 +- .../project/scanner/scanner.component.ts | 14 +- .../project/summary/summary.component.html | 0 .../project/summary/summary.component.scss | 0 .../project/summary/summary.component.spec.ts | 36 +- .../project/summary/summary.component.ts | 15 +- .../base/project/summary/summary.module.ts | 19 + .../add-immutable-rule.component.html} | 0 .../add-immutable-rule.component.scss} | 0 .../add-immutable-rule.component.spec.ts} | 14 +- .../add-rule/add-immutable-rule.component.ts} | 12 +- .../immutable-tag.component.html | 2 +- .../immutable-tag.component.scss | 0 .../immutable-tag.component.spec.ts | 39 +- .../immutable-tag/immutable-tag.component.ts | 10 +- .../immutable-tag.service.spec.ts | 1 - .../immutable-tag/immutable-tag.service.ts | 2 +- .../tag-feature-integration.component.html | 0 .../tag-feature-integration.component.scss | 0 .../tag-feature-integration.component.spec.ts | 0 .../tag-feature-integration.component.ts | 0 .../tag-feature-integration.module.ts | 47 ++ .../add-rule/add-rule.component.html | 0 .../add-rule/add-rule.component.scss | 0 .../add-rule/add-rule.component.spec.ts | 6 +- .../add-rule/add-rule.component.ts | 5 +- .../tag-retention/retention.ts | 0 .../tag-retention.component.html | 0 .../tag-retention.component.scss | 0 .../tag-retention.component.spec.ts | 30 +- .../tag-retention/tag-retention.component.ts | 10 +- .../tag-retention.service.spec.ts | 0 .../tag-retention/tag-retention.service.ts | 2 +- .../add-webhook-form.component.html | 0 .../add-webhook-form.component.scss | 0 .../add-webhook-form.component.spec.ts | 6 +- .../add-webhook-form.component.ts | 4 +- .../add-webhook/add-webhook.component.html | 0 .../add-webhook/add-webhook.component.scss | 0 .../add-webhook/add-webhook.component.spec.ts | 0 .../add-webhook/add-webhook.component.ts | 0 .../last-trigger/last-trigger.component.html | 0 .../last-trigger/last-trigger.component.scss | 0 .../last-trigger.component.spec.ts | 5 +- .../last-trigger/last-trigger.component.ts | 0 .../project/webhook/webhook.component.html | 0 .../project/webhook/webhook.component.scss | 0 .../project/webhook/webhook.component.spec.ts | 41 +- .../project/webhook/webhook.component.ts | 19 +- .../base/project/webhook/webhook.module.ts | 32 ++ .../project/webhook/webhook.service.spec.ts | 0 .../project/webhook/webhook.service.ts | 2 +- .../app/{ => base}/project/webhook/webhook.ts | 0 src/portal/src/app/core/core.module.ts | 61 --- .../dev-center-other.component.spec.ts | 53 --- .../dev-center/dev-center-other.component.ts | 61 --- .../app/dev-center/dev-center.component.ts | 4 +- .../src/app/dev-center/dev-center.module.ts | 22 +- src/portal/src/app/group/group.module.ts | 27 -- src/portal/src/app/harbor-routing.module.ts | 408 +----------------- src/portal/src/app/license/license.module.ts | 17 +- .../src/app/log/log-page.component.html | 3 - .../src/app/log/log-page.component.spec.ts | 29 -- .../not-found/not-found.component.html | 0 .../not-found/not-found.component.scss | 0 .../not-found/not-found.component.spec.ts | 0 .../not-found/not-found.component.ts | 0 .../src/app/not-found/not-found.module.ts | 18 + .../oidc-onboard/oidc-onboard.component.ts | 4 +- .../app/oidc-onboard/oidc-onboard.module.ts | 14 +- .../project/helm-chart/helm-chart.module.ts | 60 --- .../p2p-provider/p2p-provider.component.html | 1 - .../p2p-provider/p2p-provider.component.scss | 0 .../p2p-provider.component.spec.ts | 28 -- .../p2p-provider/p2p-provider.component.ts | 15 - src/portal/src/app/project/project.module.ts | 134 ------ .../src/app/project/summary/summary.module.ts | 13 - .../immutable-tag/immutable-tag.module.ts | 25 -- .../tag-feature-integration.module.ts | 29 -- .../destination-page.component.html | 4 - .../destination-page.component.spec.ts | 44 -- .../destination/destination-page.component.ts | 22 - .../replication-management.component.html | 12 - .../replication-management.component.scss | 12 - .../replication-management.component.spec.ts | 45 -- .../replication-management.component.ts | 25 -- .../replication-page.component.html | 12 - .../replication-page.component.spec.ts | 95 ---- .../replication/replication-page.component.ts | 94 ---- .../src/app/replication/replication.module.ts | 41 -- .../app/services/app-config.service.spec.ts | 2 +- .../src/app/services/app-config.service.ts | 7 +- src/portal/src/app/services/app-config.ts | 2 +- .../config.service.spec.ts | 0 .../{config => services}/config.service.ts | 8 +- .../harbor-translate-loader.service.spec.ts | 18 + .../harbor-translate-loader.service.ts | 23 + ...ct-detail-routing-resolver.service.spec.ts | 2 +- ...rtifact-detail-routing-resolver.service.ts | 6 +- .../project-routing-resolver.service.spec.ts | 4 +- .../project-routing-resolver.service.ts | 11 +- src/portal/src/app/services/theme.service.ts | 3 +- .../shared}/_animations/fade-in.animation.ts | 2 +- .../_animations/slide-in-out.animation.ts | 0 .../src/{lib => app/shared}/_mixin.scss | 0 .../about-dialog/about-dialog.component.html | 0 .../about-dialog/about-dialog.component.scss | 0 .../about-dialog.component.spec.ts | 4 +- .../about-dialog/about-dialog.component.ts | 4 +- .../confirmation-dialog.component.html | 2 +- .../confirmation-dialog.component.scss | 0 .../confirmation-dialog.component.spec.ts | 17 +- .../confirmation-dialog.component.ts | 10 +- .../components/confirmation-dialog/index.ts | 6 - .../cron-schedule.component.html | 0 .../cron-schedule.component.scss | 0 .../cron-schedule/cron-schedule.component.ts | 4 +- .../cron-tooltip/cron-tooltip.component.html | 0 .../cron-tooltip/cron-tooltip.component.scss | 0 .../cron-tooltip/cron-tooltip.component.ts | 0 .../shared}/components/cron-schedule/index.ts | 0 .../date-validator.directive.ts | 0 .../datetime-picker.component.html | 0 .../datetime-picker.component.scss | 0 .../datetime-picker.component.ts | 0 .../components/filter/filter.component.html | 0 .../components/filter/filter.component.scss | 0 .../components/filter/filter.component.ts | 0 .../gauge/gauge.component.html | 0 .../gauge/gauge.component.scss | 0 .../gauge/gauge.component.spec.ts | 0 .../{ => components}/gauge/gauge.component.ts | 0 .../global-message/message.component.html | 0 .../global-message/message.component.scss | 0 .../global-message/message.component.spec.ts | 2 +- .../global-message/message.component.ts | 2 +- .../global-message/message.service.spec.ts | 0 .../global-message/message.service.ts | 6 +- .../components}/global-message/message.ts | 3 +- .../global-search.component.html | 0 .../global-search.component.spec.ts | 4 +- .../global-search/global-search.component.ts | 4 +- .../global-search.service.spec.ts | 2 +- .../global-search/global-search.service.ts | 2 +- .../search-result.component.html | 0 .../search-result.component.spec.ts | 8 +- .../global-search/search-result.component.ts | 4 +- .../global-search/search-results.ts | 6 +- .../search-trigger.service.spec.ts | 0 .../global-search/search-trigger.service.ts | 4 +- .../global-search/search.component.scss | 0 .../image-name-input.component.html | 0 .../image-name-input.component.scss | 0 .../image-name-input.component.spec.ts | 17 +- .../image-name-input.component.ts | 10 +- .../inline-alert/inline-alert.component.html | 0 .../inline-alert/inline-alert.component.scss | 0 .../inline-alert.component.spec.ts | 30 ++ .../inline-alert/inline-alert.component.ts | 23 +- .../create-edit-label.component.html | 0 .../create-edit-label.component.scss | 0 .../create-edit-label.component.spec.ts | 24 +- .../create-edit-label.component.ts | 10 +- .../label-piece/label-piece.component.html | 0 .../label-piece/label-piece.component.scss | 0 .../label-piece/label-piece.component.ts | 10 +- .../label-signpost.component.html | 0 .../label-signpost.component.scss | 0 .../label-signpost.component.ts | 0 .../components/label/label.component.html | 0 .../components/label/label.component.scss | 0 .../components/label/label.component.spec.ts | 19 +- .../components/label/label.component.ts | 47 +- .../list-chart-version-ro.component.html | 0 .../list-chart-version-ro.component.spec.ts | 4 +- .../list-chart-version-ro.component.ts | 6 +- .../list-project-ro.component.html | 0 .../list-project-ro.component.spec.ts | 2 +- .../list-project-ro.component.ts | 6 +- .../list-repository-ro.component.html | 0 .../list-repository-ro.component.spec.ts | 4 +- .../list-repository-ro.component.ts | 8 +- .../navigator/navigator.component.html | 0 .../navigator/navigator.component.scss | 0 .../navigator/navigator.component.spec.ts | 8 +- .../navigator/navigator.component.ts | 46 +- .../new-user-form.component.html | 0 .../new-user-form.component.scss | 0 .../new-user-form.component.spec.ts | 2 +- .../new-user-form/new-user-form.component.ts | 8 +- .../shared}/components/operation/operate.ts | 0 .../operation/operation.component.css | 0 .../operation/operation.component.html | 0 .../operation/operation.component.spec.ts | 12 +- .../operation/operation.component.ts | 0 .../operation/operation.service.spec.ts | 0 .../components/operation/operation.service.ts | 4 +- .../push-image/copy-input.component.ts | 0 .../push-image/copy-input.coponent.html | 0 .../push-image/push-image.component.html | 2 +- .../push-image/push-image.component.spec.ts | 14 +- .../push-image/push-image.component.ts | 0 .../components/push-image/push-image.scss | 0 .../ngx-clipboard/clipboard.directive.ts | 2 +- .../ngx-clipboard/clipboard.service.ts | 4 +- .../third-party/ngx-clipboard/index.ts | 5 +- .../ngx-window-token/window-token.ts | 0 .../view-token/view-token.component.html | 0 .../view-token/view-token.component.scss | 0 .../view-token/view-token.component.spec.ts | 15 +- .../view-token/view-token.component.ts | 17 +- .../confirmation-message.ts | 36 -- .../date-validator.directive.spec.ts | 0 .../date-validator.directive.ts | 0 .../max-length-ext.directive.spec.ts | 0 .../max-length-ext.directive.ts | 0 .../{ => directives}/port.directive.spec.ts | 0 .../shared/{ => directives}/port.directive.ts | 0 .../target-exists-directive.spec.ts | 0 .../target-exists-directive.ts | 6 +- .../app/shared/{ => entities}/session-user.ts | 0 .../shared}/entities/shared.const.ts | 85 +++- .../inline-alert/inline-alert.component.scss | 9 - .../inline-alert.component.spec.ts | 50 --- .../inline-alert/inline-alert.component.ts | 113 ----- .../auth-user-activate.service.spec.ts | 6 +- .../auth-user-activate.service.ts | 18 +- .../member-guard-activate.service.spec.ts | 4 +- .../member-guard-activate.service.ts | 10 +- ...-permission-guard-activate.service.spec.ts | 4 +- ...ember-permission-guard-activate.service.ts | 10 +- .../mode-guard-activate.service.spec.ts | 0 .../mode-guard-activate.service.ts | 6 +- .../oidc-guard-active.service.spec.ts | 2 +- .../oidc-guard-active.service.ts | 9 +- .../sign-in-guard-activate.service.spec.ts | 4 +- .../sign-in-guard-activate.service.ts | 8 +- .../system-admin-activate.service.spec.ts | 2 +- .../system-admin-activate.service.ts | 10 +- .../shared}/services/RequestQueryParams.ts | 0 .../shared}/services/channel.service.ts | 6 +- .../shared/services/endpoint.service.spec.ts | 24 ++ .../shared}/services/endpoint.service.ts | 15 +- .../src/{lib => app/shared}/services/index.ts | 3 - .../{lib => app/shared}/services/interface.ts | 1 - .../shared/services/job-log.service.spec.ts | 25 ++ .../shared}/services/job-log.service.ts | 14 +- .../shared}/services/label.service.ts | 16 +- .../message-handler.service.spec.ts | 6 +- .../message-handler.service.ts | 15 +- .../shared}/services/permission-static.ts | 0 .../shared}/services/permission.service.ts | 4 +- .../shared}/services/project.service.ts | 20 +- .../shared}/services/quota.service.ts | 13 +- .../services/replication.service.spec.ts | 25 ++ .../shared}/services/replication.service.ts | 18 +- .../shared/services/scanning.service.spec.ts | 25 ++ .../shared}/services/scanning.service.ts | 11 +- .../{ => services}/session.service.spec.ts | 0 .../shared/{ => services}/session.service.ts | 26 +- .../session.viewmodel.factory.spec.ts | 0 .../session.viewmodel.factory.ts | 4 +- .../services/system-info.service.spec.ts | 23 + .../shared}/services/system-info.service.ts | 10 +- .../shared}/services/tempCodeRunnerFile.ts | 0 src/portal/src/app/shared/shared.const.ts | 112 ----- src/portal/src/app/shared/shared.module.ts | 283 +++++++----- src/portal/src/app/shared/shared.utils.ts | 112 ----- .../utils => app/shared/units}/cache-util.ts | 0 .../units}/error-handler/error-handler.ts | 27 +- .../shared/units}/error-handler/index.ts | 0 .../shared/units}/shared.utils.ts | 103 ++++- .../{lib/utils => app/shared/units}/utils.ts | 21 +- src/portal/src/app/sign-in/sign-in.module.ts | 25 -- .../vulnerability-page.component.html | 14 - .../vulnerability-page.component.scss | 9 - .../vulnerability-page.component.spec.ts | 38 -- .../vulnerability-page.component.ts | 18 - src/portal/src/i18n/lang/zh-tw-lang.json | 3 +- .../edit-project-quotas.component.spec.ts | 60 --- .../config/registry-config.component.html | 24 -- .../config/registry-config.component.scss | 24 -- .../config/registry-config.component.spec.ts | 121 ------ .../config/registry-config.component.ts | 175 -------- .../replication-config.component.html | 20 - .../replication-config.component.scss | 3 - .../replication-config.component.spec.ts | 33 -- .../replication-config.component.ts | 36 -- .../confirmation-state-message.ts | 26 -- .../filter-label.component.html | 13 - .../filter-label.component.scss | 137 ------ .../filter-label.component.spec.ts | 109 ----- .../filter-label.component.ts | 162 ------- .../inline-alert/inline-alert.component.html | 11 - src/portal/src/lib/entities/service.config.ts | 239 ---------- src/portal/src/lib/harbor-library.module.ts | 325 -------------- src/portal/src/lib/i18n/i18n-config.ts | 33 -- src/portal/src/lib/i18n/index.ts | 2 - src/portal/src/lib/i18n/local-json.loader.ts | 27 -- .../src/lib/i18n/missing-trans.handler.ts | 24 -- .../src/lib/i18n/translate-init.service.ts | 48 --- src/portal/src/lib/i18n/translate.spec.ts | 74 ---- .../lib/services/access-log.service.spec.ts | 43 -- .../src/lib/services/access-log.service.ts | 115 ----- .../services/configuration.service.spec.ts | 43 -- .../src/lib/services/configuration.service.ts | 78 ---- .../src/lib/services/endpoint.service.spec.ts | 36 -- .../src/lib/services/job-log.service.spec.ts | 40 -- .../lib/services/replication.service.spec.ts | 44 -- .../lib/services/resource-label.service.ts | 146 ------- .../src/lib/services/scanning.service.spec.ts | 42 -- .../lib/services/system-info.service.spec.ts | 42 -- .../src/lib/utils/shared/shared.module.ts | 72 ---- src/portal/src/polyfills.ts | 87 ++-- src/portal/src/tsconfig.app.json | 37 -- src/portal/src/tsconfig.spec.json | 19 - src/portal/src/typings.d.ts | 15 - src/portal/tsconfig.app.json | 15 + src/portal/tsconfig.json | 50 +-- src/portal/tsconfig.spec.json | 18 + src/portal/typings.json | 5 - 796 files changed, 4041 insertions(+), 7447 deletions(-) create mode 100644 src/portal/.browserslistrc delete mode 100644 src/portal/browserslist delete mode 100644 src/portal/favicon.ico delete mode 100644 src/portal/src/app/account/password-setting/reset-password/reset-password.component.html delete mode 100644 src/portal/src/app/account/password-setting/reset-password/reset-password.component.scss delete mode 100644 src/portal/src/app/account/password-setting/reset-password/reset-password.component.spec.ts delete mode 100644 src/portal/src/app/account/password-setting/reset-password/reset-password.component.ts rename src/portal/src/app/{shared => account/sign-in}/sign-in-credential.ts (100%) rename src/portal/src/app/{ => account}/sign-in/sign-in.component.html (100%) rename src/portal/src/app/{ => account}/sign-in/sign-in.component.scss (100%) rename src/portal/src/app/{ => account}/sign-in/sign-in.component.spec.ts (93%) rename src/portal/src/app/{ => account}/sign-in/sign-in.component.ts (91%) rename src/portal/src/app/{ => account}/sign-in/sign-in.service.spec.ts (100%) rename src/portal/src/app/{ => account}/sign-in/sign-in.service.ts (93%) rename src/portal/src/app/{ => account}/sign-in/top-repo/top-repo.component.html (100%) rename src/portal/src/app/{ => account}/sign-in/top-repo/top-repo.component.scss (100%) rename src/portal/src/app/{ => account}/sign-in/top-repo/top-repo.component.spec.ts (95%) rename src/portal/src/app/{ => account}/sign-in/top-repo/top-repo.component.ts (86%) rename src/portal/src/app/{ => account}/sign-in/top-repo/top-repository.service.spec.ts (100%) rename src/portal/src/app/{ => account}/sign-in/top-repo/top-repository.service.ts (90%) rename src/portal/src/app/{ => account}/sign-in/top-repo/top-repository.ts (100%) delete mode 100644 src/portal/src/app/all-pipes/all-pipes.module.ts delete mode 100644 src/portal/src/app/all-pipes/select-artifact-icon/select-artifact-icon.pipe.spec.ts delete mode 100644 src/portal/src/app/all-pipes/select-artifact-icon/select-artifact-icon.pipe.ts rename src/portal/src/app/{account => base}/account-settings/account-settings-modal-service.service.spec.ts (100%) rename src/portal/src/app/{account => base}/account-settings/account-settings-modal-service.service.ts (84%) rename src/portal/src/app/{account => base}/account-settings/account-settings-modal.component.html (100%) rename src/portal/src/app/{account => base}/account-settings/account-settings-modal.component.scss (100%) rename src/portal/src/app/{account => base}/account-settings/account-settings-modal.component.spec.ts (93%) rename src/portal/src/app/{account => base}/account-settings/account-settings-modal.component.ts (92%) rename src/portal/src/app/{account => base}/account-settings/account.ts (100%) delete mode 100644 src/portal/src/app/base/footer/footer.component.html delete mode 100644 src/portal/src/app/base/footer/footer.component.spec.ts rename src/portal/src/{lib/components/confirmation-dialog => app/base/global-confirmation-dialog}/confirmation-batch-message.ts (100%) rename src/portal/src/app/{shared/confirmation-dialog => base/global-confirmation-dialog}/confirmation-dialog.service.spec.ts (100%) rename src/portal/src/app/{shared/confirmation-dialog => base/global-confirmation-dialog}/confirmation-dialog.service.ts (97%) rename src/portal/src/{lib/components/confirmation-dialog => app/base/global-confirmation-dialog}/confirmation-message.ts (96%) rename src/portal/src/app/{shared/confirmation-dialog => base/global-confirmation-dialog}/confirmation-state-message.ts (91%) rename src/portal/src/app/{shared/confirmation-dialog/confirmation-dialog.component.html => base/global-confirmation-dialog/global-confirmation-dialog.component.html} (100%) rename src/portal/src/app/{shared/confirmation-dialog/confirmation-dialog.component.scss => base/global-confirmation-dialog/global-confirmation-dialog.component.scss} (100%) rename src/portal/src/app/{shared/confirmation-dialog/confirmation-dialog.component.spec.ts => base/global-confirmation-dialog/global-confirmation-dialog.component.spec.ts} (80%) rename src/portal/src/app/{shared/confirmation-dialog/confirmation-dialog.component.ts => base/global-confirmation-dialog/global-confirmation-dialog.component.ts} (87%) rename src/portal/src/app/{ => base/left-side-nav}/config/auth/config-auth.component.html (100%) rename src/portal/src/app/{ => base/left-side-nav}/config/auth/config-auth.component.scss (100%) rename src/portal/src/app/{ => base/left-side-nav}/config/auth/config-auth.component.spec.ts (87%) rename src/portal/src/app/{ => base/left-side-nav}/config/auth/config-auth.component.ts (92%) rename src/portal/src/app/{ => base/left-side-nav}/config/config.component.html (100%) rename src/portal/src/app/{ => base/left-side-nav}/config/config.component.scss (100%) rename src/portal/src/app/{ => base/left-side-nav}/config/config.component.spec.ts (84%) rename src/portal/src/app/{ => base/left-side-nav}/config/config.component.ts (88%) rename src/portal/src/app/{ => base/left-side-nav}/config/config.module.ts (56%) rename src/portal/src/app/{ => base/left-side-nav}/config/config.msg.utils.ts (63%) rename src/portal/src/{lib/components => app/base/left-side-nav}/config/config.ts (100%) rename src/portal/src/app/{ => base/left-side-nav}/config/email/config-email.component.html (100%) rename src/portal/src/app/{ => base/left-side-nav}/config/email/config-email.component.scss (100%) rename src/portal/src/app/{ => base/left-side-nav}/config/email/config-email.component.spec.ts (92%) rename src/portal/src/app/{ => base/left-side-nav}/config/email/config-email.component.ts (93%) rename src/portal/src/{lib/components => app/base/left-side-nav}/config/system/system-settings.component.html (100%) rename src/portal/src/{lib/components => app/base/left-side-nav}/config/system/system-settings.component.scss (83%) rename src/portal/src/{lib/components => app/base/left-side-nav}/config/system/system-settings.component.spec.ts (81%) rename src/portal/src/{lib/components => app/base/left-side-nav}/config/system/system-settings.component.ts (91%) rename src/portal/src/app/{ => base/left-side-nav}/distribution/base.scss (100%) rename src/portal/src/app/{ => base/left-side-nav}/distribution/distribution-instances/distribution-instances.component.html (100%) rename src/portal/src/app/{ => base/left-side-nav}/distribution/distribution-instances/distribution-instances.component.scss (95%) rename src/portal/src/app/{ => base/left-side-nav}/distribution/distribution-instances/distribution-instances.component.spec.ts (92%) rename src/portal/src/app/{ => base/left-side-nav}/distribution/distribution-instances/distribution-instances.component.ts (92%) rename src/portal/src/app/{ => base/left-side-nav}/distribution/distribution-interface.ts (87%) rename src/portal/src/app/{ => base/left-side-nav}/distribution/distribution-setup-modal/distribution-setup-modal.component.html (100%) rename src/portal/src/app/{ => base/left-side-nav}/distribution/distribution-setup-modal/distribution-setup-modal.component.scss (100%) rename src/portal/src/app/{ => base/left-side-nav}/distribution/distribution-setup-modal/distribution-setup-modal.component.spec.ts (92%) rename src/portal/src/app/{ => base/left-side-nav}/distribution/distribution-setup-modal/distribution-setup-modal.component.ts (94%) rename src/portal/src/app/{ => base/left-side-nav}/distribution/distribution.module.ts (53%) rename src/portal/src/app/{ => base/left-side-nav}/gc-page/gc-page.component.html (100%) rename src/portal/src/app/{ => base/left-side-nav}/gc-page/gc-page.component.scss (100%) rename src/portal/src/app/{ => base/left-side-nav}/gc-page/gc-page.component.spec.ts (94%) rename src/portal/src/app/{ => base/left-side-nav}/gc-page/gc-page.component.ts (87%) create mode 100644 src/portal/src/app/base/left-side-nav/gc-page/gc.module.ts rename src/portal/src/{lib/components/config => app/base/left-side-nav/gc-page}/gc/gc-history/gc-history.component.html (100%) rename src/portal/src/{lib/components/config => app/base/left-side-nav/gc-page}/gc/gc-history/gc-history.component.scss (100%) rename src/portal/src/{lib/components/config => app/base/left-side-nav/gc-page}/gc/gc-history/gc-history.component.spec.ts (93%) rename src/portal/src/{lib/components/config => app/base/left-side-nav/gc-page}/gc/gc-history/gc-history.component.ts (93%) rename src/portal/src/{lib/components/config => app/base/left-side-nav/gc-page}/gc/gc.api.repository.ts (64%) rename src/portal/src/{lib/components/config => app/base/left-side-nav/gc-page}/gc/gc.component.html (100%) rename src/portal/src/{lib/components/config => app/base/left-side-nav/gc-page}/gc/gc.component.scss (100%) rename src/portal/src/{lib/components/config => app/base/left-side-nav/gc-page}/gc/gc.component.spec.ts (79%) rename src/portal/src/{lib/components/config => app/base/left-side-nav/gc-page}/gc/gc.component.ts (94%) rename src/portal/src/{lib/components/config => app/base/left-side-nav/gc-page}/gc/gc.const.ts (86%) rename src/portal/src/{lib/components/config => app/base/left-side-nav/gc-page}/gc/gc.service.ts (94%) rename src/portal/src/{lib/components/config => app/base/left-side-nav/gc-page}/gc/gc.viewmodel.factory.ts (100%) rename src/portal/src/{lib/components/config => app/base/left-side-nav/gc-page}/gc/gcLog.ts (100%) rename src/portal/src/app/{ => base/left-side-nav}/group/add-group-modal/add-group-modal.component.html (100%) rename src/portal/src/app/{ => base/left-side-nav}/group/add-group-modal/add-group-modal.component.scss (100%) rename src/portal/src/app/{ => base/left-side-nav}/group/add-group-modal/add-group-modal.component.spec.ts (84%) rename src/portal/src/app/{ => base/left-side-nav}/group/add-group-modal/add-group-modal.component.ts (89%) rename src/portal/src/app/{ => base/left-side-nav}/group/group.component.html (100%) rename src/portal/src/app/{ => base/left-side-nav}/group/group.component.scss (100%) rename src/portal/src/app/{ => base/left-side-nav}/group/group.component.spec.ts (82%) rename src/portal/src/app/{ => base/left-side-nav}/group/group.component.ts (87%) create mode 100644 src/portal/src/app/base/left-side-nav/group/group.module.ts rename src/portal/src/app/{ => base/left-side-nav}/group/group.service.spec.ts (100%) rename src/portal/src/app/{ => base/left-side-nav}/group/group.service.ts (96%) rename src/portal/src/app/{ => base/left-side-nav}/group/group.ts (100%) rename src/portal/src/app/{ => base/left-side-nav}/interrogation-services/interrogation-services.component.html (100%) rename src/portal/src/app/{ => base/left-side-nav}/interrogation-services/interrogation-services.component.scss (100%) rename src/portal/src/app/{ => base/left-side-nav}/interrogation-services/interrogation-services.component.spec.ts (92%) rename src/portal/src/app/{ => base/left-side-nav}/interrogation-services/interrogation-services.component.ts (100%) create mode 100644 src/portal/src/app/base/left-side-nav/interrogation-services/interrogation-services.module.ts rename src/portal/src/app/{config => base/left-side-nav/interrogation-services}/scanner/config-scanner.component.html (100%) rename src/portal/src/app/{config => base/left-side-nav/interrogation-services}/scanner/config-scanner.component.scss (100%) rename src/portal/src/app/{config => base/left-side-nav/interrogation-services}/scanner/config-scanner.component.spec.ts (89%) rename src/portal/src/app/{config => base/left-side-nav/interrogation-services}/scanner/config-scanner.component.ts (92%) rename src/portal/src/app/{config => base/left-side-nav/interrogation-services}/scanner/config-scanner.service.spec.ts (81%) rename src/portal/src/app/{config => base/left-side-nav/interrogation-services}/scanner/config-scanner.service.ts (97%) rename src/portal/src/app/{config => base/left-side-nav/interrogation-services}/scanner/new-scanner-form/new-scanner-form.component.html (100%) rename src/portal/src/app/{config => base/left-side-nav/interrogation-services}/scanner/new-scanner-form/new-scanner-form.component.scss (100%) rename src/portal/src/app/{config => base/left-side-nav/interrogation-services}/scanner/new-scanner-form/new-scanner-form.component.spec.ts (97%) rename src/portal/src/app/{config => base/left-side-nav/interrogation-services}/scanner/new-scanner-form/new-scanner-form.component.ts (100%) rename src/portal/src/app/{config => base/left-side-nav/interrogation-services}/scanner/new-scanner-modal/new-scanner-modal.component.html (100%) rename src/portal/src/app/{config => base/left-side-nav/interrogation-services}/scanner/new-scanner-modal/new-scanner-modal.component.spec.ts (95%) rename src/portal/src/app/{config => base/left-side-nav/interrogation-services}/scanner/new-scanner-modal/new-scanner-modal.component.ts (97%) rename src/portal/src/app/{config => base/left-side-nav/interrogation-services}/scanner/scanner-metadata.ts (100%) rename src/portal/src/app/{config => base/left-side-nav/interrogation-services}/scanner/scanner-metadata/scanner-metadata.component.spec.ts (90%) rename src/portal/src/app/{config => base/left-side-nav/interrogation-services}/scanner/scanner-metadata/scanner-metadata.component.ts (92%) rename src/portal/src/app/{config => base/left-side-nav/interrogation-services}/scanner/scanner-metadata/scanner-metadata.html (100%) rename src/portal/src/app/{config => base/left-side-nav/interrogation-services}/scanner/scanner-metadata/scanner-metadata.scss (100%) rename src/portal/src/app/{config => base/left-side-nav/interrogation-services}/scanner/scanner.ts (100%) rename src/portal/src/{lib/components/config => app/base/left-side-nav/interrogation-services}/vulnerability/scanAll.api.repository.ts (64%) rename src/portal/src/{lib/components/config => app/base/left-side-nav/interrogation-services}/vulnerability/scanAll.service.ts (87%) rename src/portal/src/{lib/components/config => app/base/left-side-nav/interrogation-services}/vulnerability/vulnerability-config.component.html (100%) rename src/portal/src/{lib/components/config => app/base/left-side-nav/interrogation-services}/vulnerability/vulnerability-config.component.scss (84%) rename src/portal/src/{lib/components/config => app/base/left-side-nav/interrogation-services}/vulnerability/vulnerability-config.component.spec.ts (80%) rename src/portal/src/{lib/components/config => app/base/left-side-nav/interrogation-services}/vulnerability/vulnerability-config.component.ts (90%) rename src/portal/src/app/{ => base/left-side-nav}/labels/labels.component.html (100%) rename src/portal/src/app/{ => base/left-side-nav}/labels/labels.component.spec.ts (91%) rename src/portal/src/app/{ => base/left-side-nav}/labels/labels.component.ts (100%) rename src/portal/src/app/{log/log-page.component.ts => base/left-side-nav/labels/labels.module.ts} (55%) rename src/portal/src/app/{ => base/left-side-nav}/log/log.module.ts (66%) rename src/portal/src/{lib/components => app/base/left-side-nav}/log/recent-log.component.html (100%) rename src/portal/src/{lib/components => app/base/left-side-nav}/log/recent-log.component.scss (100%) rename src/portal/src/{lib/components => app/base/left-side-nav}/log/recent-log.component.spec.ts (85%) rename src/portal/src/{lib/components => app/base/left-side-nav}/log/recent-log.component.ts (90%) rename src/portal/src/app/{project-quotas/project-quotas.component.html => base/left-side-nav/project-quotas/project-quotas-container.component.html} (100%) rename src/portal/src/app/{project-quotas/project-quotas.component.scss => base/left-side-nav/project-quotas/project-quotas-container.component.scss} (100%) rename src/portal/src/app/{project-quotas/project-quotas.component.spec.ts => base/left-side-nav/project-quotas/project-quotas-container.component.spec.ts} (63%) rename src/portal/src/app/{project-quotas/project-quotas.component.ts => base/left-side-nav/project-quotas/project-quotas-container.component.ts} (66%) create mode 100644 src/portal/src/app/base/left-side-nav/project-quotas/project-quotas.module.ts rename src/portal/src/{lib/components/config => app/base/left-side-nav/project-quotas}/project-quotas/edit-project-quotas/edit-project-quotas.component.html (98%) rename src/portal/src/{lib/components/config => app/base/left-side-nav/project-quotas}/project-quotas/edit-project-quotas/edit-project-quotas.component.scss (100%) create mode 100644 src/portal/src/app/base/left-side-nav/project-quotas/project-quotas/edit-project-quotas/edit-project-quotas.component.spec.ts rename src/portal/src/{lib/components/config => app/base/left-side-nav/project-quotas}/project-quotas/edit-project-quotas/edit-project-quotas.component.ts (93%) rename src/portal/src/{lib/components/config => app/base/left-side-nav/project-quotas}/project-quotas/project-quotas.component.html (99%) rename src/portal/src/{lib/components/config => app/base/left-side-nav/project-quotas}/project-quotas/project-quotas.component.scss (100%) rename src/portal/src/{lib/components/config => app/base/left-side-nav/project-quotas}/project-quotas/project-quotas.component.spec.ts (65%) rename src/portal/src/{lib/components/config => app/base/left-side-nav/project-quotas}/project-quotas/project-quotas.component.ts (94%) rename src/portal/src/app/{project => base/left-side-nav/projects}/create-project/create-project.component.html (100%) rename src/portal/src/app/{project => base/left-side-nav/projects}/create-project/create-project.component.spec.ts (87%) rename src/portal/src/app/{project => base/left-side-nav/projects}/create-project/create-project.component.ts (93%) rename src/portal/src/app/{project => base/left-side-nav/projects}/create-project/create-project.scss (100%) rename src/portal/src/app/{project => base/left-side-nav/projects}/list-project/list-project.component.html (100%) rename src/portal/src/app/{project => base/left-side-nav/projects}/list-project/list-project.component.spec.ts (84%) rename src/portal/src/app/{project => base/left-side-nav/projects}/list-project/list-project.component.ts (89%) rename src/portal/src/app/{project/project.component.html => base/left-side-nav/projects/projects.component.html} (100%) rename src/portal/src/app/{project/project.component.scss => base/left-side-nav/projects/projects.component.scss} (92%) rename src/portal/src/app/{project/project.component.spec.ts => base/left-side-nav/projects/projects.component.spec.ts} (92%) rename src/portal/src/app/{project/project.component.ts => base/left-side-nav/projects/projects.component.ts} (85%) create mode 100644 src/portal/src/app/base/left-side-nav/projects/projects.module.ts rename src/portal/src/app/{shared => base/left-side-nav/projects}/statictics/statistic-handler.service.spec.ts (100%) rename src/portal/src/app/{shared => base/left-side-nav/projects}/statictics/statistic-handler.service.ts (95%) rename src/portal/src/app/{shared => base/left-side-nav/projects}/statictics/statistics-panel.component.html (100%) rename src/portal/src/app/{shared => base/left-side-nav/projects}/statictics/statistics-panel.component.spec.ts (92%) rename src/portal/src/app/{shared => base/left-side-nav/projects}/statictics/statistics-panel.component.ts (94%) rename src/portal/src/app/{shared => base/left-side-nav/projects}/statictics/statistics.component.html (100%) rename src/portal/src/app/{shared => base/left-side-nav/projects}/statictics/statistics.component.scss (100%) rename src/portal/src/app/{shared => base/left-side-nav/projects}/statictics/statistics.component.spec.ts (100%) rename src/portal/src/app/{shared => base/left-side-nav/projects}/statictics/statistics.component.ts (100%) rename src/portal/src/app/{shared => base/left-side-nav/projects}/statictics/statistics.service.spec.ts (100%) rename src/portal/src/app/{shared => base/left-side-nav/projects}/statictics/statistics.service.ts (95%) rename src/portal/src/app/{shared => base/left-side-nav/projects}/statictics/statistics.ts (100%) rename src/portal/src/app/{shared => base/left-side-nav/projects}/statictics/volumes.ts (100%) rename src/portal/src/{lib/components => app/base/left-side-nav/registries}/create-edit-endpoint/create-edit-endpoint.component.html (98%) rename src/portal/src/{lib/components => app/base/left-side-nav/registries}/create-edit-endpoint/create-edit-endpoint.component.scss (100%) rename src/portal/src/{lib/components => app/base/left-side-nav/registries}/create-edit-endpoint/create-edit-endpoint.component.spec.ts (90%) rename src/portal/src/{lib/components => app/base/left-side-nav/registries}/create-edit-endpoint/create-edit-endpoint.component.ts (96%) rename src/portal/src/{lib/components/endpoint => app/base/left-side-nav/registries}/endpoint.component.html (98%) rename src/portal/src/{lib/components/endpoint => app/base/left-side-nav/registries}/endpoint.component.scss (91%) rename src/portal/src/{lib/components/endpoint => app/base/left-side-nav/registries}/endpoint.component.spec.ts (90%) rename src/portal/src/{lib/components/endpoint => app/base/left-side-nav/registries}/endpoint.component.ts (85%) rename src/portal/src/app/base/{footer/footer.component.ts => left-side-nav/registries/endpoint.module.ts} (50%) create mode 100644 src/portal/src/app/base/left-side-nav/replication/replication.module.ts rename src/portal/src/{lib/components => app/base/left-side-nav/replication/replication}/create-edit-rule/create-edit-rule.component.html (99%) rename src/portal/src/{lib/components => app/base/left-side-nav/replication/replication}/create-edit-rule/create-edit-rule.component.scss (100%) rename src/portal/src/{lib/components => app/base/left-side-nav/replication/replication}/create-edit-rule/create-edit-rule.component.spec.ts (78%) rename src/portal/src/{lib/components => app/base/left-side-nav/replication/replication}/create-edit-rule/create-edit-rule.component.ts (96%) rename src/portal/src/{lib/components => app/base/left-side-nav/replication/replication}/list-replication-rule/list-replication-rule.component.html (100%) rename src/portal/src/{lib/components => app/base/left-side-nav/replication/replication}/list-replication-rule/list-replication-rule.component.scss (100%) rename src/portal/src/{lib/components => app/base/left-side-nav/replication/replication}/list-replication-rule/list-replication-rule.component.spec.ts (85%) rename src/portal/src/{lib/components => app/base/left-side-nav/replication/replication}/list-replication-rule/list-replication-rule.component.ts (87%) rename src/portal/src/{lib/components => app/base/left-side-nav/replication}/replication/replication-tasks/replication-tasks.component.html (100%) rename src/portal/src/{lib/components => app/base/left-side-nav/replication}/replication/replication-tasks/replication-tasks.component.scss (100%) rename src/portal/src/{lib/components => app/base/left-side-nav/replication}/replication/replication-tasks/replication-tasks.component.spec.ts (90%) rename src/portal/src/{lib/components => app/base/left-side-nav/replication}/replication/replication-tasks/replication-tasks.component.ts (92%) rename src/portal/src/{lib/components => app/base/left-side-nav/replication}/replication/replication.component.html (100%) rename src/portal/src/{lib/components => app/base/left-side-nav/replication}/replication/replication.component.scss (100%) rename src/portal/src/{lib/components => app/base/left-side-nav/replication}/replication/replication.component.spec.ts (80%) rename src/portal/src/{lib/components => app/base/left-side-nav/replication}/replication/replication.component.ts (90%) rename src/portal/src/app/{replication/total-replication => base/left-side-nav/replication}/total-replication-page.component.html (100%) rename src/portal/src/app/{replication/total-replication/total-replication.component.scss => base/left-side-nav/replication/total-replication-page.component.scss} (100%) rename src/portal/src/app/{replication/total-replication => base/left-side-nav/replication}/total-replication-page.component.spec.ts (94%) rename src/portal/src/app/{replication/total-replication => base/left-side-nav/replication}/total-replication-page.component.ts (85%) rename src/portal/src/app/{ => base/left-side-nav}/system-robot-accounts/list-all-projects/list-all-projects.component.html (100%) rename src/portal/src/app/{ => base/left-side-nav}/system-robot-accounts/list-all-projects/list-all-projects.component.scss (100%) rename src/portal/src/app/{ => base/left-side-nav}/system-robot-accounts/list-all-projects/list-all-projects.component.spec.ts (92%) rename src/portal/src/app/{ => base/left-side-nav}/system-robot-accounts/list-all-projects/list-all-projects.component.ts (92%) rename src/portal/src/app/{ => base/left-side-nav}/system-robot-accounts/new-robot/new-robot.component.html (100%) rename src/portal/src/app/{ => base/left-side-nav}/system-robot-accounts/new-robot/new-robot.component.scss (100%) rename src/portal/src/app/{ => base/left-side-nav}/system-robot-accounts/new-robot/new-robot.component.spec.ts (88%) rename src/portal/src/app/{ => base/left-side-nav}/system-robot-accounts/new-robot/new-robot.component.ts (94%) rename src/portal/src/app/{ => base/left-side-nav}/system-robot-accounts/projects-modal/projects-modal.component.html (100%) rename src/portal/src/app/{ => base/left-side-nav}/system-robot-accounts/projects-modal/projects-modal.component.scss (100%) rename src/portal/src/app/{ => base/left-side-nav}/system-robot-accounts/projects-modal/projects-modal.component.spec.ts (92%) rename src/portal/src/app/{ => base/left-side-nav}/system-robot-accounts/projects-modal/projects-modal.component.ts (81%) rename src/portal/src/app/{ => base/left-side-nav}/system-robot-accounts/system-robot-accounts.component.html (100%) rename src/portal/src/app/{ => base/left-side-nav}/system-robot-accounts/system-robot-accounts.component.scss (100%) rename src/portal/src/app/{ => base/left-side-nav}/system-robot-accounts/system-robot-accounts.component.spec.ts (87%) rename src/portal/src/app/{ => base/left-side-nav}/system-robot-accounts/system-robot-accounts.component.ts (91%) rename src/portal/src/app/{ => base/left-side-nav}/system-robot-accounts/system-robot-accounts.module.ts (70%) rename src/portal/src/app/{ => base/left-side-nav}/system-robot-accounts/system-robot-util.ts (93%) rename src/portal/src/app/{ => base/left-side-nav}/user/change-password/change-password.component.html (100%) rename src/portal/src/app/{ => base/left-side-nav}/user/change-password/change-password.component.scss (100%) rename src/portal/src/app/{ => base/left-side-nav}/user/change-password/change-password.component.spec.ts (87%) rename src/portal/src/app/{ => base/left-side-nav}/user/change-password/change-password.component.ts (94%) rename src/portal/src/app/{ => base/left-side-nav}/user/new-user-madal.component.scss (100%) rename src/portal/src/app/{ => base/left-side-nav}/user/new-user-modal.component.html (100%) rename src/portal/src/app/{ => base/left-side-nav}/user/new-user-modal.component.spec.ts (85%) rename src/portal/src/app/{ => base/left-side-nav}/user/new-user-modal.component.ts (89%) rename src/portal/src/app/{ => base/left-side-nav}/user/user.component.html (100%) rename src/portal/src/app/{ => base/left-side-nav}/user/user.component.scss (100%) rename src/portal/src/app/{ => base/left-side-nav}/user/user.component.spec.ts (81%) rename src/portal/src/app/{ => base/left-side-nav}/user/user.component.ts (93%) rename src/portal/src/app/{ => base/left-side-nav}/user/user.module.ts (73%) rename src/portal/src/app/{ => base/left-side-nav}/user/user.service.spec.ts (100%) rename src/portal/src/app/{ => base/left-side-nav}/user/user.service.ts (98%) rename src/portal/src/app/{ => base/left-side-nav}/user/user.ts (100%) rename src/portal/src/app/{account => base}/password-setting/forgot-password/forgot-password.component.html (100%) rename src/portal/src/app/{account => base}/password-setting/forgot-password/forgot-password.component.scss (100%) rename src/portal/src/app/{account => base}/password-setting/forgot-password/forgot-password.component.spec.ts (95%) rename src/portal/src/app/{account => base}/password-setting/forgot-password/forgot-password.component.ts (96%) rename src/portal/src/app/{account => base}/password-setting/password-setting.component.html (100%) rename src/portal/src/app/{account => base}/password-setting/password-setting.component.scss (100%) rename src/portal/src/app/{account => base}/password-setting/password-setting.component.spec.ts (94%) rename src/portal/src/app/{account => base}/password-setting/password-setting.component.ts (94%) rename src/portal/src/app/{account => base}/password-setting/password-setting.service.spec.ts (96%) rename src/portal/src/app/{account => base}/password-setting/password-setting.service.ts (96%) rename src/portal/src/app/{account => base}/password-setting/password-setting.ts (100%) rename src/portal/src/app/{ => base}/project/helm-chart/helm-chart-detail/chart-detail.component.html (100%) rename src/portal/src/app/{ => base}/project/helm-chart/helm-chart-detail/chart-detail.component.scss (100%) rename src/portal/src/app/{ => base}/project/helm-chart/helm-chart-detail/chart-detail.component.spec.ts (73%) rename src/portal/src/app/{ => base}/project/helm-chart/helm-chart-detail/chart-detail.component.ts (82%) rename src/portal/src/app/{ => base}/project/helm-chart/helm-chart-detail/chart-detail/chart-detail-dependency.component.html (100%) rename src/portal/src/app/{ => base}/project/helm-chart/helm-chart-detail/chart-detail/chart-detail-dependency.component.scss (100%) rename src/portal/src/app/{ => base}/project/helm-chart/helm-chart-detail/chart-detail/chart-detail-dependency.component.spec.ts (100%) rename src/portal/src/app/{ => base}/project/helm-chart/helm-chart-detail/chart-detail/chart-detail-dependency.component.ts (86%) rename src/portal/src/app/{ => base}/project/helm-chart/helm-chart-detail/chart-detail/chart-detail-summary.component.html (100%) rename src/portal/src/app/{ => base}/project/helm-chart/helm-chart-detail/chart-detail/chart-detail-summary.component.scss (100%) rename src/portal/src/app/{ => base}/project/helm-chart/helm-chart-detail/chart-detail/chart-detail-summary.component.spec.ts (87%) rename src/portal/src/app/{ => base}/project/helm-chart/helm-chart-detail/chart-detail/chart-detail-summary.component.ts (85%) rename src/portal/src/app/{ => base}/project/helm-chart/helm-chart-detail/chart-detail/chart-detail-value.component.html (100%) rename src/portal/src/app/{ => base}/project/helm-chart/helm-chart-detail/chart-detail/chart-detail-value.component.scss (100%) rename src/portal/src/app/{ => base}/project/helm-chart/helm-chart-detail/chart-detail/chart-detail-value.component.spec.ts (100%) rename src/portal/src/app/{ => base}/project/helm-chart/helm-chart-detail/chart-detail/chart-detail-value.component.ts (100%) rename src/portal/src/app/{ => base}/project/helm-chart/helm-chart-detail/chart-detail/chart-detail.component.html (100%) rename src/portal/src/app/{ => base}/project/helm-chart/helm-chart-detail/chart-detail/chart-detail.component.scss (91%) rename src/portal/src/app/{ => base}/project/helm-chart/helm-chart-detail/chart-detail/chart-detail.component.spec.ts (96%) rename src/portal/src/app/{ => base}/project/helm-chart/helm-chart-detail/chart-detail/chart-detail.component.ts (78%) create mode 100644 src/portal/src/app/base/project/helm-chart/helm-chart-detail/helm-chart-detail.module.ts rename src/portal/src/app/{project/helm-chart => base/project/helm-chart/helm-chart-detail}/helm-chart.interface.service.ts (97%) rename src/portal/src/app/{project/helm-chart => base/project/helm-chart/helm-chart-detail}/helm-chart.service.spec.ts (100%) rename src/portal/src/app/{project/helm-chart => base/project/helm-chart/helm-chart-detail}/helm-chart.service.ts (82%) rename src/portal/src/app/{project/helm-chart => base/project/helm-chart/helm-chart-detail}/label-filter/label-filter.component.html (100%) rename src/portal/src/app/{project/helm-chart => base/project/helm-chart/helm-chart-detail}/label-filter/label-filter.component.scss (100%) rename src/portal/src/app/{project/helm-chart => base/project/helm-chart/helm-chart-detail}/label-filter/label-filter.component.spec.ts (100%) rename src/portal/src/app/{project/helm-chart => base/project/helm-chart/helm-chart-detail}/label-filter/label-filter.component.ts (91%) rename src/portal/src/app/{project/helm-chart => base/project/helm-chart/helm-chart-detail}/label-marker/label-marker.component.html (89%) rename src/portal/src/app/{project/helm-chart => base/project/helm-chart/helm-chart-detail}/label-marker/label-marker.component.scss (100%) rename src/portal/src/app/{project/helm-chart => base/project/helm-chart/helm-chart-detail}/label-marker/label-marker.component.spec.ts (93%) rename src/portal/src/app/{project/helm-chart => base/project/helm-chart/helm-chart-detail}/label-marker/label-marker.component.ts (95%) rename src/portal/src/app/{project/helm-chart => base/project/helm-chart/helm-chart-detail}/list-chart-versions/helm-chart-versions-detail/helm-chart-version.component.html (100%) rename src/portal/src/app/{project/helm-chart => base/project/helm-chart/helm-chart-detail}/list-chart-versions/helm-chart-versions-detail/helm-chart-version.component.scss (98%) rename src/portal/src/app/{project/helm-chart => base/project/helm-chart/helm-chart-detail}/list-chart-versions/helm-chart-versions-detail/helm-chart-version.component.spec.ts (94%) rename src/portal/src/app/{project/helm-chart => base/project/helm-chart/helm-chart-detail}/list-chart-versions/helm-chart-versions-detail/helm-chart-version.component.ts (89%) rename src/portal/src/app/{project/helm-chart => base/project/helm-chart/helm-chart-detail}/list-chart-versions/list-chart-versions.component.html (100%) rename src/portal/src/app/{project/helm-chart => base/project/helm-chart/helm-chart-detail}/list-chart-versions/list-chart-versions.component.scss (100%) rename src/portal/src/app/{project/helm-chart => base/project/helm-chart/helm-chart-detail}/list-chart-versions/list-chart-versions.component.spec.ts (87%) rename src/portal/src/app/{project/helm-chart => base/project/helm-chart/helm-chart-detail}/list-chart-versions/list-chart-versions.component.ts (77%) create mode 100644 src/portal/src/app/base/project/helm-chart/helm-chart-list/helm-chart-list.module.ts rename src/portal/src/app/{project/helm-chart => base/project/helm-chart/helm-chart-list}/list-charts-detail/helm-chart.component.html (100%) rename src/portal/src/app/{project/helm-chart => base/project/helm-chart/helm-chart-list}/list-charts-detail/helm-chart.component.scss (98%) rename src/portal/src/app/{project/helm-chart => base/project/helm-chart/helm-chart-list}/list-charts-detail/helm-chart.component.spec.ts (92%) rename src/portal/src/app/{project/helm-chart => base/project/helm-chart/helm-chart-list}/list-charts-detail/helm-chart.component.ts (85%) rename src/portal/src/app/{project/helm-chart => base/project/helm-chart/helm-chart-list}/list-charts.component.html (100%) rename src/portal/src/app/{project/helm-chart => base/project/helm-chart/helm-chart-list}/list-charts.component.scss (100%) rename src/portal/src/app/{project/helm-chart => base/project/helm-chart/helm-chart-list}/list-charts.component.spec.ts (75%) rename src/portal/src/app/{project/helm-chart => base/project/helm-chart/helm-chart-list}/list-charts.component.ts (72%) rename src/portal/src/app/{ => base}/project/member/add-group/add-group.component.html (100%) rename src/portal/src/app/{ => base}/project/member/add-group/add-group.component.scss (100%) rename src/portal/src/app/{ => base}/project/member/add-group/add-group.component.spec.ts (85%) rename src/portal/src/app/{ => base}/project/member/add-group/add-group.component.ts (89%) rename src/portal/src/app/{ => base}/project/member/add-http-auth-group/add-http-auth-group.component.html (100%) rename src/portal/src/app/{ => base}/project/member/add-http-auth-group/add-http-auth-group.component.scss (100%) rename src/portal/src/app/{ => base}/project/member/add-http-auth-group/add-http-auth-group.component.spec.ts (78%) rename src/portal/src/app/{ => base}/project/member/add-http-auth-group/add-http-auth-group.component.ts (85%) rename src/portal/src/app/{ => base}/project/member/add-member/add-member.component.html (100%) rename src/portal/src/app/{ => base}/project/member/add-member/add-member.component.scss (100%) rename src/portal/src/app/{ => base}/project/member/add-member/add-member.component.spec.ts (65%) rename src/portal/src/app/{ => base}/project/member/add-member/add-member.component.ts (83%) rename src/portal/src/app/{ => base}/project/member/member.component.html (100%) rename src/portal/src/app/{ => base}/project/member/member.component.scss (100%) rename src/portal/src/app/{ => base}/project/member/member.component.spec.ts (71%) rename src/portal/src/app/{ => base}/project/member/member.component.ts (85%) create mode 100644 src/portal/src/app/base/project/member/member.module.ts rename src/portal/src/app/{ => base}/project/member/member.service.spec.ts (100%) rename src/portal/src/app/{ => base}/project/member/member.service.ts (96%) rename src/portal/src/app/{ => base}/project/member/member.ts (100%) rename src/portal/src/app/{ => base}/project/p2p-provider/add-p2p-policy/add-p2p-policy.component.html (100%) rename src/portal/src/app/{ => base}/project/p2p-provider/add-p2p-policy/add-p2p-policy.component.scss (100%) rename src/portal/src/app/{ => base}/project/p2p-provider/add-p2p-policy/add-p2p-policy.component.spec.ts (92%) rename src/portal/src/app/{ => base}/project/p2p-provider/add-p2p-policy/add-p2p-policy.component.ts (93%) create mode 100644 src/portal/src/app/base/project/p2p-provider/p2p-provider.module.ts rename src/portal/src/app/{ => base}/project/p2p-provider/p2p-provider.service.spec.ts (100%) rename src/portal/src/app/{ => base}/project/p2p-provider/p2p-provider.service.ts (100%) rename src/portal/src/app/{ => base}/project/p2p-provider/policy/policy.component.html (100%) rename src/portal/src/app/{ => base}/project/p2p-provider/policy/policy.component.scss (100%) rename src/portal/src/app/{ => base}/project/p2p-provider/policy/policy.component.spec.ts (88%) rename src/portal/src/app/{ => base}/project/p2p-provider/policy/policy.component.ts (94%) rename src/portal/src/app/{ => base}/project/p2p-provider/task-list/task-list.component.html (100%) rename src/portal/src/app/{ => base}/project/p2p-provider/task-list/task-list.component.scss (100%) rename src/portal/src/app/{ => base}/project/p2p-provider/task-list/task-list.component.spec.ts (88%) rename src/portal/src/app/{ => base}/project/p2p-provider/task-list/task-list.component.ts (95%) rename src/portal/src/app/{ => base}/project/project-config/project-config.component.html (100%) rename src/portal/src/app/{ => base}/project/project-config/project-config.component.scss (100%) rename src/portal/src/app/{ => base}/project/project-config/project-config.component.spec.ts (76%) rename src/portal/src/app/{ => base}/project/project-config/project-config.component.ts (84%) create mode 100644 src/portal/src/app/base/project/project-config/project-config.module.ts rename src/portal/src/{lib/components => app/base/project/project-config}/project-policy-config/project-policy-config.component.html (100%) rename src/portal/src/{lib/components => app/base/project/project-config}/project-policy-config/project-policy-config.component.scss (100%) rename src/portal/src/{lib/components => app/base/project/project-config}/project-policy-config/project-policy-config.component.spec.ts (79%) rename src/portal/src/{lib/components => app/base/project/project-config}/project-policy-config/project-policy-config.component.ts (92%) rename src/portal/src/{lib/components => app/base/project/project-config}/project-policy-config/project.ts (100%) rename src/portal/src/app/{ => base}/project/project-detail/project-detail.component.html (100%) rename src/portal/src/app/{ => base}/project/project-detail/project-detail.component.scss (100%) rename src/portal/src/app/{ => base}/project/project-detail/project-detail.component.spec.ts (93%) rename src/portal/src/app/{ => base}/project/project-detail/project-detail.component.ts (97%) rename src/portal/src/app/{ => base}/project/project-detail/project-detail.const.ts (100%) rename src/portal/src/app/{ => base}/project/project-label/project-label.component.html (100%) rename src/portal/src/app/{ => base}/project/project-label/project-label.component.scss (100%) rename src/portal/src/app/{ => base}/project/project-label/project-label.component.spec.ts (79%) rename src/portal/src/app/{ => base}/project/project-label/project-label.component.ts (89%) create mode 100644 src/portal/src/app/base/project/project-label/project-label.module.ts rename src/portal/src/app/{log => base/project/project-log}/audit-log.component.html (100%) rename src/portal/src/app/{log => base/project/project-log}/audit-log.component.scss (100%) rename src/portal/src/app/{log => base/project/project-log}/audit-log.component.spec.ts (83%) rename src/portal/src/app/{log => base/project/project-log}/audit-log.component.ts (92%) create mode 100644 src/portal/src/app/base/project/project-log/audit-log.module.ts create mode 100644 src/portal/src/app/base/project/project.module.ts rename src/portal/src/app/{ => base}/project/project.ts (100%) rename src/portal/src/app/{ => base}/project/repository/artifact/artifact-additions/additions.service.spec.ts (100%) rename src/portal/src/app/{ => base}/project/repository/artifact/artifact-additions/additions.service.ts (88%) rename src/portal/src/app/{ => base}/project/repository/artifact/artifact-additions/artifact-additions.component.html (100%) rename src/portal/src/app/{ => base}/project/repository/artifact/artifact-additions/artifact-additions.component.scss (100%) rename src/portal/src/app/{ => base}/project/repository/artifact/artifact-additions/artifact-additions.component.spec.ts (69%) rename src/portal/src/app/{ => base}/project/repository/artifact/artifact-additions/artifact-additions.component.ts (85%) rename src/portal/src/app/{ => base}/project/repository/artifact/artifact-additions/artifact-vulnerabilities/artifact-vulnerabilities.component.html (100%) rename src/portal/src/app/{ => base}/project/repository/artifact/artifact-additions/artifact-vulnerabilities/artifact-vulnerabilities.component.scss (100%) rename src/portal/src/app/{ => base}/project/repository/artifact/artifact-additions/artifact-vulnerabilities/artifact-vulnerabilities.component.spec.ts (90%) rename src/portal/src/app/{ => base}/project/repository/artifact/artifact-additions/artifact-vulnerabilities/artifact-vulnerabilities.component.ts (93%) rename src/portal/src/app/{ => base}/project/repository/artifact/artifact-additions/build-history/build-history.component.html (100%) rename src/portal/src/app/{ => base}/project/repository/artifact/artifact-additions/build-history/build-history.component.scss (100%) rename src/portal/src/app/{ => base}/project/repository/artifact/artifact-additions/build-history/build-history.component.spec.ts (92%) rename src/portal/src/app/{ => base}/project/repository/artifact/artifact-additions/build-history/build-history.component.ts (91%) rename src/portal/src/app/{ => base}/project/repository/artifact/artifact-additions/dependencies/dependencies.component.html (100%) rename src/portal/src/app/{ => base}/project/repository/artifact/artifact-additions/dependencies/dependencies.component.scss (100%) rename src/portal/src/app/{ => base}/project/repository/artifact/artifact-additions/dependencies/dependencies.component.spec.ts (81%) rename src/portal/src/app/{ => base}/project/repository/artifact/artifact-additions/dependencies/dependencies.component.ts (86%) rename src/portal/src/app/{ => base}/project/repository/artifact/artifact-additions/models.ts (95%) rename src/portal/src/app/{ => base}/project/repository/artifact/artifact-additions/summary/summary.component.html (100%) rename src/portal/src/app/{ => base}/project/repository/artifact/artifact-additions/summary/summary.component.scss (100%) rename src/portal/src/app/{ => base}/project/repository/artifact/artifact-additions/summary/summary.component.spec.ts (96%) rename src/portal/src/app/{ => base}/project/repository/artifact/artifact-additions/summary/summary.component.ts (85%) rename src/portal/src/app/{ => base}/project/repository/artifact/artifact-additions/values/values.component.html (100%) rename src/portal/src/app/{ => base}/project/repository/artifact/artifact-additions/values/values.component.scss (100%) rename src/portal/src/app/{ => base}/project/repository/artifact/artifact-additions/values/values.component.spec.ts (92%) rename src/portal/src/app/{ => base}/project/repository/artifact/artifact-additions/values/values.component.ts (90%) rename src/portal/src/app/{ => base}/project/repository/artifact/artifact-common-properties/artifact-common-properties.component.html (100%) rename src/portal/src/app/{ => base}/project/repository/artifact/artifact-common-properties/artifact-common-properties.component.scss (100%) rename src/portal/src/app/{ => base}/project/repository/artifact/artifact-common-properties/artifact-common-properties.component.spec.ts (95%) rename src/portal/src/app/{ => base}/project/repository/artifact/artifact-common-properties/artifact-common-properties.component.ts (90%) rename src/portal/src/app/{project/repository => base/project/repository/artifact}/artifact-list-page/artifact-list-page.component.html (100%) rename src/portal/src/app/{project/repository => base/project/repository/artifact}/artifact-list-page/artifact-list-page.component.scss (100%) rename src/portal/src/app/{project/repository => base/project/repository/artifact}/artifact-list-page/artifact-list-page.component.spec.ts (83%) rename src/portal/src/app/{project/repository => base/project/repository/artifact}/artifact-list-page/artifact-list-page.component.ts (86%) rename src/portal/src/app/{project/repository => base/project/repository/artifact}/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.html (99%) rename src/portal/src/app/{project/repository => base/project/repository/artifact}/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.scss (100%) rename src/portal/src/app/{project/repository => base/project/repository/artifact}/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.spec.ts (89%) rename src/portal/src/app/{project/repository => base/project/repository/artifact}/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.ts (95%) rename src/portal/src/app/{project/repository => base/project/repository/artifact}/artifact-list-page/artifact-list/artifact-list.component.html (100%) rename src/portal/src/app/{project/repository => base/project/repository/artifact}/artifact-list-page/artifact-list/artifact-list.component.scss (100%) rename src/portal/src/app/{project/repository => base/project/repository/artifact}/artifact-list-page/artifact-list/artifact-list.component.spec.ts (76%) rename src/portal/src/app/{project/repository => base/project/repository/artifact}/artifact-list-page/artifact-list/artifact-list.component.ts (89%) rename src/portal/src/app/{ => base}/project/repository/artifact/artifact-summary.component.html (100%) rename src/portal/src/app/{ => base}/project/repository/artifact/artifact-summary.component.scss (100%) rename src/portal/src/app/{ => base}/project/repository/artifact/artifact-summary.component.spec.ts (75%) rename src/portal/src/app/{ => base}/project/repository/artifact/artifact-summary.component.ts (88%) rename src/portal/src/app/{ => base}/project/repository/artifact/artifact-tag/artifact-tag.component.html (100%) rename src/portal/src/app/{ => base}/project/repository/artifact/artifact-tag/artifact-tag.component.scss (100%) rename src/portal/src/app/{ => base}/project/repository/artifact/artifact-tag/artifact-tag.component.spec.ts (73%) rename src/portal/src/app/{ => base}/project/repository/artifact/artifact-tag/artifact-tag.component.ts (91%) create mode 100644 src/portal/src/app/base/project/repository/artifact/artifact.module.ts rename src/portal/src/app/{ => base}/project/repository/artifact/artifact.service.spec.ts (58%) rename src/portal/src/app/{ => base}/project/repository/artifact/artifact.service.ts (91%) rename src/portal/src/app/{ => base}/project/repository/artifact/artifact.ts (90%) rename src/portal/src/app/{project/repository => base/project/repository/artifact}/vulnerability-scanning/histogram-chart/histogram-chart.component.html (100%) rename src/portal/src/app/{project/repository => base/project/repository/artifact}/vulnerability-scanning/histogram-chart/histogram-chart.component.scss (100%) rename src/portal/src/app/{project/repository => base/project/repository/artifact}/vulnerability-scanning/histogram-chart/histogram-chart.component.spec.ts (100%) rename src/portal/src/app/{project/repository => base/project/repository/artifact}/vulnerability-scanning/histogram-chart/histogram-chart.component.ts (100%) rename src/portal/src/app/{project/repository => base/project/repository/artifact}/vulnerability-scanning/result-bar-chart-component.html (100%) rename src/portal/src/app/{project/repository => base/project/repository/artifact}/vulnerability-scanning/result-bar-chart.component.spec.ts (79%) rename src/portal/src/app/{project/repository => base/project/repository/artifact}/vulnerability-scanning/result-bar-chart.component.ts (91%) rename src/portal/src/app/{project/repository => base/project/repository/artifact}/vulnerability-scanning/result-tip-histogram/result-tip-histogram.component.html (100%) rename src/portal/src/app/{project/repository => base/project/repository/artifact}/vulnerability-scanning/result-tip-histogram/result-tip-histogram.component.scss (100%) rename src/portal/src/app/{project/repository => base/project/repository/artifact}/vulnerability-scanning/result-tip-histogram/result-tip-histogram.component.spec.ts (100%) rename src/portal/src/app/{project/repository => base/project/repository/artifact}/vulnerability-scanning/result-tip-histogram/result-tip-histogram.component.ts (99%) rename src/portal/src/app/{project/repository => base/project/repository/artifact}/vulnerability-scanning/result-tip.component.spec.ts (79%) rename src/portal/src/app/{project/repository => base/project/repository/artifact}/vulnerability-scanning/result-tip.component.ts (97%) rename src/portal/src/app/{project/repository => base/project/repository/artifact}/vulnerability-scanning/result-tip.componnent.html (100%) rename src/portal/src/app/{project/repository => base/project/repository/artifact}/vulnerability-scanning/scanning.scss (100%) rename src/portal/src/app/{ => base}/project/repository/gridview/grid-view.component.html (100%) rename src/portal/src/app/{ => base}/project/repository/gridview/grid-view.component.scss (100%) rename src/portal/src/app/{ => base}/project/repository/gridview/grid-view.component.spec.ts (79%) rename src/portal/src/app/{ => base}/project/repository/gridview/grid-view.component.ts (99%) rename src/portal/src/app/{ => base}/project/repository/repository-gridview.component.html (100%) rename src/portal/src/app/{ => base}/project/repository/repository-gridview.component.scss (100%) rename src/portal/src/app/{ => base}/project/repository/repository-gridview.component.spec.ts (74%) rename src/portal/src/app/{ => base}/project/repository/repository-gridview.component.ts (91%) create mode 100644 src/portal/src/app/base/project/repository/repository.module.ts rename src/portal/src/app/{ => base}/project/robot-account/add-robot/add-robot.component.html (100%) rename src/portal/src/app/{ => base}/project/robot-account/add-robot/add-robot.component.scss (100%) rename src/portal/src/app/{ => base}/project/robot-account/add-robot/add-robot.component.spec.ts (80%) rename src/portal/src/app/{ => base}/project/robot-account/add-robot/add-robot.component.ts (92%) create mode 100644 src/portal/src/app/base/project/robot-account/project-robot-account.module.ts rename src/portal/src/app/{ => base}/project/robot-account/robot-account.component.html (100%) rename src/portal/src/app/{ => base}/project/robot-account/robot-account.component.scss (93%) rename src/portal/src/app/{ => base}/project/robot-account/robot-account.component.spec.ts (78%) rename src/portal/src/app/{ => base}/project/robot-account/robot-account.component.ts (90%) create mode 100644 src/portal/src/app/base/project/scanner/project-scanner.module.ts rename src/portal/src/app/{ => base}/project/scanner/scanner.component.html (100%) rename src/portal/src/app/{ => base}/project/scanner/scanner.component.scss (100%) rename src/portal/src/app/{ => base}/project/scanner/scanner.component.spec.ts (81%) rename src/portal/src/app/{ => base}/project/scanner/scanner.component.ts (89%) rename src/portal/src/app/{ => base}/project/summary/summary.component.html (100%) rename src/portal/src/app/{ => base}/project/summary/summary.component.scss (100%) rename src/portal/src/app/{ => base}/project/summary/summary.component.spec.ts (73%) rename src/portal/src/app/{ => base}/project/summary/summary.component.ts (81%) create mode 100644 src/portal/src/app/base/project/summary/summary.module.ts rename src/portal/src/app/{project/tag-feature-integration/immutable-tag/add-rule/add-rule.component.html => base/project/tag-feature-integration/immutable-tag/add-rule/add-immutable-rule.component.html} (100%) rename src/portal/src/app/{project/tag-feature-integration/immutable-tag/add-rule/add-rule.component.scss => base/project/tag-feature-integration/immutable-tag/add-rule/add-immutable-rule.component.scss} (100%) rename src/portal/src/app/{project/tag-feature-integration/immutable-tag/add-rule/add-rule.component.spec.ts => base/project/tag-feature-integration/immutable-tag/add-rule/add-immutable-rule.component.spec.ts} (88%) rename src/portal/src/app/{project/tag-feature-integration/immutable-tag/add-rule/add-rule.component.ts => base/project/tag-feature-integration/immutable-tag/add-rule/add-immutable-rule.component.ts} (93%) rename src/portal/src/app/{ => base}/project/tag-feature-integration/immutable-tag/immutable-tag.component.html (96%) rename src/portal/src/app/{ => base}/project/tag-feature-integration/immutable-tag/immutable-tag.component.scss (100%) rename src/portal/src/app/{ => base}/project/tag-feature-integration/immutable-tag/immutable-tag.component.spec.ts (89%) rename src/portal/src/app/{ => base}/project/tag-feature-integration/immutable-tag/immutable-tag.component.ts (93%) rename src/portal/src/app/{ => base}/project/tag-feature-integration/immutable-tag/immutable-tag.service.spec.ts (99%) rename src/portal/src/app/{ => base}/project/tag-feature-integration/immutable-tag/immutable-tag.service.ts (99%) rename src/portal/src/app/{ => base}/project/tag-feature-integration/tag-feature-integration.component.html (100%) rename src/portal/src/app/{ => base}/project/tag-feature-integration/tag-feature-integration.component.scss (100%) rename src/portal/src/app/{ => base}/project/tag-feature-integration/tag-feature-integration.component.spec.ts (100%) rename src/portal/src/app/{ => base}/project/tag-feature-integration/tag-feature-integration.component.ts (100%) create mode 100644 src/portal/src/app/base/project/tag-feature-integration/tag-feature-integration.module.ts rename src/portal/src/app/{ => base}/project/tag-feature-integration/tag-retention/add-rule/add-rule.component.html (100%) rename src/portal/src/app/{ => base}/project/tag-feature-integration/tag-retention/add-rule/add-rule.component.scss (100%) rename src/portal/src/app/{ => base}/project/tag-feature-integration/tag-retention/add-rule/add-rule.component.spec.ts (88%) rename src/portal/src/app/{ => base}/project/tag-feature-integration/tag-retention/add-rule/add-rule.component.ts (97%) rename src/portal/src/app/{ => base}/project/tag-feature-integration/tag-retention/retention.ts (100%) rename src/portal/src/app/{ => base}/project/tag-feature-integration/tag-retention/tag-retention.component.html (100%) rename src/portal/src/app/{ => base}/project/tag-feature-integration/tag-retention/tag-retention.component.scss (100%) rename src/portal/src/app/{ => base}/project/tag-feature-integration/tag-retention/tag-retention.component.spec.ts (74%) rename src/portal/src/app/{ => base}/project/tag-feature-integration/tag-retention/tag-retention.component.ts (97%) rename src/portal/src/app/{ => base}/project/tag-feature-integration/tag-retention/tag-retention.service.spec.ts (100%) rename src/portal/src/app/{ => base}/project/tag-feature-integration/tag-retention/tag-retention.service.ts (99%) rename src/portal/src/app/{ => base}/project/webhook/add-webhook-form/add-webhook-form.component.html (100%) rename src/portal/src/app/{ => base}/project/webhook/add-webhook-form/add-webhook-form.component.scss (100%) rename src/portal/src/app/{ => base}/project/webhook/add-webhook-form/add-webhook-form.component.spec.ts (94%) rename src/portal/src/app/{ => base}/project/webhook/add-webhook-form/add-webhook-form.component.ts (94%) rename src/portal/src/app/{ => base}/project/webhook/add-webhook/add-webhook.component.html (100%) rename src/portal/src/app/{ => base}/project/webhook/add-webhook/add-webhook.component.scss (100%) rename src/portal/src/app/{ => base}/project/webhook/add-webhook/add-webhook.component.spec.ts (100%) rename src/portal/src/app/{ => base}/project/webhook/add-webhook/add-webhook.component.ts (100%) rename src/portal/src/app/{ => base}/project/webhook/last-trigger/last-trigger.component.html (100%) rename src/portal/src/app/{ => base}/project/webhook/last-trigger/last-trigger.component.scss (100%) rename src/portal/src/app/{ => base}/project/webhook/last-trigger/last-trigger.component.spec.ts (94%) rename src/portal/src/app/{ => base}/project/webhook/last-trigger/last-trigger.component.ts (100%) rename src/portal/src/app/{ => base}/project/webhook/webhook.component.html (100%) rename src/portal/src/app/{ => base}/project/webhook/webhook.component.scss (100%) rename src/portal/src/app/{ => base}/project/webhook/webhook.component.spec.ts (81%) rename src/portal/src/app/{ => base}/project/webhook/webhook.component.ts (93%) create mode 100644 src/portal/src/app/base/project/webhook/webhook.module.ts rename src/portal/src/app/{ => base}/project/webhook/webhook.service.spec.ts (100%) rename src/portal/src/app/{ => base}/project/webhook/webhook.service.ts (98%) rename src/portal/src/app/{ => base}/project/webhook/webhook.ts (100%) delete mode 100644 src/portal/src/app/core/core.module.ts delete mode 100644 src/portal/src/app/dev-center/dev-center-other.component.spec.ts delete mode 100644 src/portal/src/app/dev-center/dev-center-other.component.ts delete mode 100644 src/portal/src/app/group/group.module.ts delete mode 100644 src/portal/src/app/log/log-page.component.html delete mode 100644 src/portal/src/app/log/log-page.component.spec.ts rename src/portal/src/app/{shared => }/not-found/not-found.component.html (100%) rename src/portal/src/app/{shared => }/not-found/not-found.component.scss (100%) rename src/portal/src/app/{shared => }/not-found/not-found.component.spec.ts (100%) rename src/portal/src/app/{shared => }/not-found/not-found.component.ts (100%) create mode 100644 src/portal/src/app/not-found/not-found.module.ts delete mode 100644 src/portal/src/app/project/helm-chart/helm-chart.module.ts delete mode 100644 src/portal/src/app/project/p2p-provider/p2p-provider.component.html delete mode 100644 src/portal/src/app/project/p2p-provider/p2p-provider.component.scss delete mode 100644 src/portal/src/app/project/p2p-provider/p2p-provider.component.spec.ts delete mode 100644 src/portal/src/app/project/p2p-provider/p2p-provider.component.ts delete mode 100644 src/portal/src/app/project/project.module.ts delete mode 100644 src/portal/src/app/project/summary/summary.module.ts delete mode 100644 src/portal/src/app/project/tag-feature-integration/immutable-tag/immutable-tag.module.ts delete mode 100644 src/portal/src/app/project/tag-feature-integration/tag-feature-integration.module.ts delete mode 100644 src/portal/src/app/replication/destination/destination-page.component.html delete mode 100644 src/portal/src/app/replication/destination/destination-page.component.spec.ts delete mode 100644 src/portal/src/app/replication/destination/destination-page.component.ts delete mode 100644 src/portal/src/app/replication/replication-management/replication-management.component.html delete mode 100644 src/portal/src/app/replication/replication-management/replication-management.component.scss delete mode 100644 src/portal/src/app/replication/replication-management/replication-management.component.spec.ts delete mode 100644 src/portal/src/app/replication/replication-management/replication-management.component.ts delete mode 100644 src/portal/src/app/replication/replication-page.component.html delete mode 100644 src/portal/src/app/replication/replication-page.component.spec.ts delete mode 100644 src/portal/src/app/replication/replication-page.component.ts delete mode 100644 src/portal/src/app/replication/replication.module.ts rename src/portal/src/app/{config => services}/config.service.spec.ts (100%) rename src/portal/src/app/{config => services}/config.service.ts (94%) create mode 100644 src/portal/src/app/services/harbor-translate-loader.service.spec.ts create mode 100644 src/portal/src/app/services/harbor-translate-loader.service.ts rename src/portal/src/{lib => app/shared}/_animations/fade-in.animation.ts (93%) rename src/portal/src/{lib => app/shared}/_animations/slide-in-out.animation.ts (100%) rename src/portal/src/{lib => app/shared}/_mixin.scss (100%) rename src/portal/src/app/shared/{ => components}/about-dialog/about-dialog.component.html (100%) rename src/portal/src/app/shared/{ => components}/about-dialog/about-dialog.component.scss (100%) rename src/portal/src/app/shared/{ => components}/about-dialog/about-dialog.component.spec.ts (90%) rename src/portal/src/app/shared/{ => components}/about-dialog/about-dialog.component.ts (92%) rename src/portal/src/{lib => app/shared}/components/confirmation-dialog/confirmation-dialog.component.html (97%) rename src/portal/src/{lib => app/shared}/components/confirmation-dialog/confirmation-dialog.component.scss (100%) rename src/portal/src/{lib => app/shared}/components/confirmation-dialog/confirmation-dialog.component.spec.ts (86%) rename src/portal/src/{lib => app/shared}/components/confirmation-dialog/confirmation-dialog.component.ts (89%) rename src/portal/src/{lib => app/shared}/components/confirmation-dialog/index.ts (65%) rename src/portal/src/{lib => app/shared}/components/cron-schedule/cron-schedule.component.html (100%) rename src/portal/src/{lib => app/shared}/components/cron-schedule/cron-schedule.component.scss (100%) rename src/portal/src/{lib => app/shared}/components/cron-schedule/cron-schedule.component.ts (96%) rename src/portal/src/{lib => app/shared}/components/cron-schedule/cron-tooltip/cron-tooltip.component.html (100%) rename src/portal/src/{lib => app/shared}/components/cron-schedule/cron-tooltip/cron-tooltip.component.scss (100%) rename src/portal/src/{lib => app/shared}/components/cron-schedule/cron-tooltip/cron-tooltip.component.ts (100%) rename src/portal/src/{lib => app/shared}/components/cron-schedule/index.ts (100%) rename src/portal/src/{lib => app/shared}/components/datetime-picker/date-validator.directive.ts (100%) rename src/portal/src/{lib => app/shared}/components/datetime-picker/datetime-picker.component.html (100%) rename src/portal/src/{lib => app/shared}/components/datetime-picker/datetime-picker.component.scss (100%) rename src/portal/src/{lib => app/shared}/components/datetime-picker/datetime-picker.component.ts (100%) rename src/portal/src/{lib => app/shared}/components/filter/filter.component.html (100%) rename src/portal/src/{lib => app/shared}/components/filter/filter.component.scss (100%) rename src/portal/src/{lib => app/shared}/components/filter/filter.component.ts (100%) rename src/portal/src/app/shared/{ => components}/gauge/gauge.component.html (100%) rename src/portal/src/app/shared/{ => components}/gauge/gauge.component.scss (100%) rename src/portal/src/app/shared/{ => components}/gauge/gauge.component.spec.ts (100%) rename src/portal/src/app/shared/{ => components}/gauge/gauge.component.ts (100%) rename src/portal/src/app/{ => shared/components}/global-message/message.component.html (100%) rename src/portal/src/app/{ => shared/components}/global-message/message.component.scss (100%) rename src/portal/src/app/{ => shared/components}/global-message/message.component.spec.ts (97%) rename src/portal/src/app/{ => shared/components}/global-message/message.component.ts (99%) rename src/portal/src/app/{ => shared/components}/global-message/message.service.spec.ts (100%) rename src/portal/src/app/{ => shared/components}/global-message/message.service.ts (93%) rename src/portal/src/app/{ => shared/components}/global-message/message.ts (96%) rename src/portal/src/app/{base => shared/components}/global-search/global-search.component.html (100%) rename src/portal/src/app/{base => shared/components}/global-search/global-search.component.spec.ts (94%) rename src/portal/src/app/{base => shared/components}/global-search/global-search.component.ts (95%) rename src/portal/src/app/{base => shared/components}/global-search/global-search.service.spec.ts (95%) rename src/portal/src/app/{base => shared/components}/global-search/global-search.service.ts (95%) rename src/portal/src/app/{base => shared/components}/global-search/search-result.component.html (100%) rename src/portal/src/app/{base => shared/components}/global-search/search-result.component.spec.ts (91%) rename src/portal/src/app/{base => shared/components}/global-search/search-result.component.ts (97%) rename src/portal/src/app/{base => shared/components}/global-search/search-results.ts (76%) rename src/portal/src/app/{base => shared/components}/global-search/search-trigger.service.spec.ts (100%) rename src/portal/src/app/{base => shared/components}/global-search/search-trigger.service.ts (96%) rename src/portal/src/app/{base => shared/components}/global-search/search.component.scss (100%) rename src/portal/src/{lib => app/shared}/components/image-name-input/image-name-input.component.html (100%) rename src/portal/src/{lib => app/shared}/components/image-name-input/image-name-input.component.scss (100%) rename src/portal/src/{lib => app/shared}/components/image-name-input/image-name-input.component.spec.ts (76%) rename src/portal/src/{lib => app/shared}/components/image-name-input/image-name-input.component.ts (91%) rename src/portal/src/app/shared/{ => components}/inline-alert/inline-alert.component.html (100%) rename src/portal/src/{lib => app/shared}/components/inline-alert/inline-alert.component.scss (100%) create mode 100644 src/portal/src/app/shared/components/inline-alert/inline-alert.component.spec.ts rename src/portal/src/{lib => app/shared}/components/inline-alert/inline-alert.component.ts (82%) rename src/portal/src/{lib/components => app/shared/components/label}/create-edit-label/create-edit-label.component.html (100%) rename src/portal/src/{lib/components => app/shared/components/label}/create-edit-label/create-edit-label.component.scss (100%) rename src/portal/src/{lib/components => app/shared/components/label}/create-edit-label/create-edit-label.component.spec.ts (70%) rename src/portal/src/{lib/components => app/shared/components/label}/create-edit-label/create-edit-label.component.ts (93%) rename src/portal/src/{lib/components => app/shared/components/label}/label-piece/label-piece.component.html (100%) rename src/portal/src/{lib/components => app/shared/components/label}/label-piece/label-piece.component.scss (100%) rename src/portal/src/{lib/components => app/shared/components/label}/label-piece/label-piece.component.ts (87%) rename src/portal/src/{lib => app/shared}/components/label/label-signpost/label-signpost.component.html (100%) rename src/portal/src/{lib => app/shared}/components/label/label-signpost/label-signpost.component.scss (100%) rename src/portal/src/{lib => app/shared}/components/label/label-signpost/label-signpost.component.ts (100%) rename src/portal/src/{lib => app/shared}/components/label/label.component.html (100%) rename src/portal/src/{lib => app/shared}/components/label/label.component.scss (100%) rename src/portal/src/{lib => app/shared}/components/label/label.component.spec.ts (83%) rename src/portal/src/{lib => app/shared}/components/label/label.component.ts (78%) rename src/portal/src/app/shared/{ => components}/list-chart-version-ro/list-chart-version-ro.component.html (100%) rename src/portal/src/app/shared/{ => components}/list-chart-version-ro/list-chart-version-ro.component.spec.ts (93%) rename src/portal/src/app/shared/{ => components}/list-chart-version-ro/list-chart-version-ro.component.ts (89%) rename src/portal/src/app/shared/{ => components}/list-project-ro/list-project-ro.component.html (100%) rename src/portal/src/app/shared/{ => components}/list-project-ro/list-project-ro.component.spec.ts (95%) rename src/portal/src/app/shared/{ => components}/list-project-ro/list-project-ro.component.ts (87%) rename src/portal/src/app/shared/{ => components}/list-repository-ro/list-repository-ro.component.html (100%) rename src/portal/src/app/shared/{ => components}/list-repository-ro/list-repository-ro.component.spec.ts (92%) rename src/portal/src/app/shared/{ => components}/list-repository-ro/list-repository-ro.component.ts (91%) rename src/portal/src/app/{base => shared/components}/navigator/navigator.component.html (100%) rename src/portal/src/app/{base => shared/components}/navigator/navigator.component.scss (100%) rename src/portal/src/app/{base => shared/components}/navigator/navigator.component.spec.ts (89%) rename src/portal/src/app/{base => shared/components}/navigator/navigator.component.ts (77%) rename src/portal/src/app/shared/{ => components}/new-user-form/new-user-form.component.html (100%) rename src/portal/src/app/shared/{ => components}/new-user-form/new-user-form.component.scss (100%) rename src/portal/src/app/shared/{ => components}/new-user-form/new-user-form.component.spec.ts (96%) rename src/portal/src/app/shared/{ => components}/new-user-form/new-user-form.component.ts (97%) rename src/portal/src/{lib => app/shared}/components/operation/operate.ts (100%) rename src/portal/src/{lib => app/shared}/components/operation/operation.component.css (100%) rename src/portal/src/{lib => app/shared}/components/operation/operation.component.html (100%) rename src/portal/src/{lib => app/shared}/components/operation/operation.component.spec.ts (88%) rename src/portal/src/{lib => app/shared}/components/operation/operation.component.ts (100%) rename src/portal/src/{lib => app/shared}/components/operation/operation.service.spec.ts (100%) rename src/portal/src/{lib => app/shared}/components/operation/operation.service.ts (90%) rename src/portal/src/{lib => app/shared}/components/push-image/copy-input.component.ts (100%) rename src/portal/src/{lib => app/shared}/components/push-image/copy-input.coponent.html (100%) rename src/portal/src/{lib => app/shared}/components/push-image/push-image.component.html (97%) rename src/portal/src/{lib => app/shared}/components/push-image/push-image.component.spec.ts (83%) rename src/portal/src/{lib => app/shared}/components/push-image/push-image.component.ts (100%) rename src/portal/src/{lib => app/shared}/components/push-image/push-image.scss (100%) rename src/portal/src/{lib => app/shared}/components/third-party/ngx-clipboard/clipboard.directive.ts (98%) rename src/portal/src/{lib => app/shared}/components/third-party/ngx-clipboard/clipboard.service.ts (96%) rename src/portal/src/{lib => app/shared}/components/third-party/ngx-clipboard/index.ts (87%) rename src/portal/src/{lib => app/shared}/components/third-party/ngx-window-token/window-token.ts (100%) rename src/portal/src/app/{system-robot-accounts => shared/components}/view-token/view-token.component.html (100%) rename src/portal/src/app/{system-robot-accounts => shared/components}/view-token/view-token.component.scss (100%) rename src/portal/src/app/{system-robot-accounts => shared/components}/view-token/view-token.component.spec.ts (86%) rename src/portal/src/app/{system-robot-accounts => shared/components}/view-token/view-token.component.ts (87%) delete mode 100644 src/portal/src/app/shared/confirmation-dialog/confirmation-message.ts rename src/portal/src/app/shared/{ => directives}/date-validator.directive.spec.ts (100%) rename src/portal/src/app/shared/{ => directives}/date-validator.directive.ts (100%) rename src/portal/src/app/shared/{ => directives}/max-length-ext.directive.spec.ts (100%) rename src/portal/src/app/shared/{ => directives}/max-length-ext.directive.ts (100%) rename src/portal/src/app/shared/{ => directives}/port.directive.spec.ts (100%) rename src/portal/src/app/shared/{ => directives}/port.directive.ts (100%) rename src/portal/src/app/shared/{ => directives}/target-exists-directive.spec.ts (100%) rename src/portal/src/app/shared/{ => directives}/target-exists-directive.ts (93%) rename src/portal/src/app/shared/{ => entities}/session-user.ts (100%) rename src/portal/src/{lib => app/shared}/entities/shared.const.ts (68%) delete mode 100644 src/portal/src/app/shared/inline-alert/inline-alert.component.scss delete mode 100644 src/portal/src/app/shared/inline-alert/inline-alert.component.spec.ts delete mode 100644 src/portal/src/app/shared/inline-alert/inline-alert.component.ts rename src/portal/src/app/shared/{route => router-guard}/auth-user-activate.service.spec.ts (81%) rename src/portal/src/app/shared/{route => router-guard}/auth-user-activate.service.ts (86%) rename src/portal/src/app/shared/{route => router-guard}/member-guard-activate.service.spec.ts (85%) rename src/portal/src/app/shared/{route => router-guard}/member-guard-activate.service.ts (91%) rename src/portal/src/app/shared/{route => router-guard}/member-permission-guard-activate.service.spec.ts (86%) rename src/portal/src/app/shared/{route => router-guard}/member-permission-guard-activate.service.ts (89%) rename src/portal/src/app/shared/{route => router-guard}/mode-guard-activate.service.spec.ts (100%) rename src/portal/src/app/shared/{route => router-guard}/mode-guard-activate.service.ts (95%) rename src/portal/src/app/shared/{route => router-guard}/oidc-guard-active.service.spec.ts (93%) rename src/portal/src/app/shared/{route => router-guard}/oidc-guard-active.service.ts (90%) rename src/portal/src/app/shared/{route => router-guard}/sign-in-guard-activate.service.spec.ts (86%) rename src/portal/src/app/shared/{route => router-guard}/sign-in-guard-activate.service.ts (93%) rename src/portal/src/app/shared/{route => router-guard}/system-admin-activate.service.spec.ts (92%) rename src/portal/src/app/shared/{route => router-guard}/system-admin-activate.service.ts (91%) rename src/portal/src/{lib => app/shared}/services/RequestQueryParams.ts (100%) rename src/portal/src/{lib => app/shared}/services/channel.service.ts (88%) create mode 100644 src/portal/src/app/shared/services/endpoint.service.spec.ts rename src/portal/src/{lib => app/shared}/services/endpoint.service.ts (93%) rename src/portal/src/{lib => app/shared}/services/index.ts (77%) rename src/portal/src/{lib => app/shared}/services/interface.ts (99%) create mode 100644 src/portal/src/app/shared/services/job-log.service.spec.ts rename src/portal/src/{lib => app/shared}/services/job-log.service.ts (79%) rename src/portal/src/{lib => app/shared}/services/label.service.ts (90%) rename src/portal/src/app/shared/{message-handler => services}/message-handler.service.spec.ts (79%) rename src/portal/src/app/shared/{message-handler => services}/message-handler.service.ts (90%) rename src/portal/src/{lib => app/shared}/services/permission-static.ts (100%) rename src/portal/src/{lib => app/shared}/services/permission.service.ts (97%) rename src/portal/src/{lib => app/shared}/services/project.service.ts (89%) rename src/portal/src/{lib => app/shared}/services/quota.service.ts (84%) create mode 100644 src/portal/src/app/shared/services/replication.service.spec.ts rename src/portal/src/{lib => app/shared}/services/replication.service.ts (95%) create mode 100644 src/portal/src/app/shared/services/scanning.service.spec.ts rename src/portal/src/{lib => app/shared}/services/scanning.service.ts (90%) rename src/portal/src/app/shared/{ => services}/session.service.spec.ts (100%) rename src/portal/src/app/shared/{ => services}/session.service.ts (92%) rename src/portal/src/app/shared/{ => services}/session.viewmodel.factory.spec.ts (100%) rename src/portal/src/app/shared/{ => services}/session.viewmodel.factory.ts (84%) create mode 100644 src/portal/src/app/shared/services/system-info.service.spec.ts rename src/portal/src/{lib => app/shared}/services/system-info.service.ts (83%) rename src/portal/src/{lib => app/shared}/services/tempCodeRunnerFile.ts (100%) delete mode 100644 src/portal/src/app/shared/shared.const.ts delete mode 100644 src/portal/src/app/shared/shared.utils.ts rename src/portal/src/{lib/utils => app/shared/units}/cache-util.ts (100%) rename src/portal/src/{lib/utils => app/shared/units}/error-handler/error-handler.ts (57%) rename src/portal/src/{lib/utils => app/shared/units}/error-handler/index.ts (100%) rename src/portal/src/{lib/utils/shared => app/shared/units}/shared.utils.ts (53%) rename src/portal/src/{lib/utils => app/shared/units}/utils.ts (97%) delete mode 100644 src/portal/src/app/sign-in/sign-in.module.ts delete mode 100644 src/portal/src/app/vulnerability-page/vulnerability-page.component.html delete mode 100644 src/portal/src/app/vulnerability-page/vulnerability-page.component.scss delete mode 100644 src/portal/src/app/vulnerability-page/vulnerability-page.component.spec.ts delete mode 100644 src/portal/src/app/vulnerability-page/vulnerability-page.component.ts delete mode 100644 src/portal/src/lib/components/config/project-quotas/edit-project-quotas/edit-project-quotas.component.spec.ts delete mode 100644 src/portal/src/lib/components/config/registry-config.component.html delete mode 100644 src/portal/src/lib/components/config/registry-config.component.scss delete mode 100644 src/portal/src/lib/components/config/registry-config.component.spec.ts delete mode 100644 src/portal/src/lib/components/config/registry-config.component.ts delete mode 100644 src/portal/src/lib/components/config/replication/replication-config.component.html delete mode 100644 src/portal/src/lib/components/config/replication/replication-config.component.scss delete mode 100644 src/portal/src/lib/components/config/replication/replication-config.component.spec.ts delete mode 100644 src/portal/src/lib/components/config/replication/replication-config.component.ts delete mode 100644 src/portal/src/lib/components/confirmation-dialog/confirmation-state-message.ts delete mode 100644 src/portal/src/lib/components/create-edit-rule/filter-label.component.html delete mode 100644 src/portal/src/lib/components/create-edit-rule/filter-label.component.scss delete mode 100644 src/portal/src/lib/components/create-edit-rule/filter-label.component.spec.ts delete mode 100644 src/portal/src/lib/components/create-edit-rule/filter-label.component.ts delete mode 100644 src/portal/src/lib/components/inline-alert/inline-alert.component.html delete mode 100644 src/portal/src/lib/entities/service.config.ts delete mode 100644 src/portal/src/lib/harbor-library.module.ts delete mode 100644 src/portal/src/lib/i18n/i18n-config.ts delete mode 100644 src/portal/src/lib/i18n/index.ts delete mode 100644 src/portal/src/lib/i18n/local-json.loader.ts delete mode 100644 src/portal/src/lib/i18n/missing-trans.handler.ts delete mode 100644 src/portal/src/lib/i18n/translate-init.service.ts delete mode 100644 src/portal/src/lib/i18n/translate.spec.ts delete mode 100644 src/portal/src/lib/services/access-log.service.spec.ts delete mode 100644 src/portal/src/lib/services/access-log.service.ts delete mode 100644 src/portal/src/lib/services/configuration.service.spec.ts delete mode 100644 src/portal/src/lib/services/configuration.service.ts delete mode 100644 src/portal/src/lib/services/endpoint.service.spec.ts delete mode 100644 src/portal/src/lib/services/job-log.service.spec.ts delete mode 100644 src/portal/src/lib/services/replication.service.spec.ts delete mode 100644 src/portal/src/lib/services/resource-label.service.ts delete mode 100644 src/portal/src/lib/services/scanning.service.spec.ts delete mode 100644 src/portal/src/lib/services/system-info.service.spec.ts delete mode 100644 src/portal/src/lib/utils/shared/shared.module.ts delete mode 100644 src/portal/src/tsconfig.app.json delete mode 100644 src/portal/src/tsconfig.spec.json delete mode 100644 src/portal/src/typings.d.ts create mode 100644 src/portal/tsconfig.app.json create mode 100644 src/portal/tsconfig.spec.json delete mode 100644 src/portal/typings.json diff --git a/src/portal/.browserslistrc b/src/portal/.browserslistrc new file mode 100644 index 000000000..427441dc9 --- /dev/null +++ b/src/portal/.browserslistrc @@ -0,0 +1,17 @@ +# This file is used by the build system to adjust CSS and JS output to support the specified browsers below. +# For additional information regarding the format and rule options, please see: +# https://github.com/browserslist/browserslist#queries + +# For the full list of supported browsers by the Angular framework, please see: +# https://angular.io/guide/browser-support + +# You can see what browsers were selected by your queries by running: +# npx browserslist + +last 1 Chrome version +last 1 Firefox version +last 2 Edge major versions +last 2 Safari major versions +last 2 iOS major versions +Firefox ESR +not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line. diff --git a/src/portal/README.md b/src/portal/README.md index ceec0b813..1ee23b69c 100644 --- a/src/portal/README.md +++ b/src/portal/README.md @@ -2,4 +2,100 @@ Harbor UI ============ -This is the project based on Clarity and Angular to build Harbor UI. \ No newline at end of file +This is the project based on Clarity and Angular to build Harbor UI. + + + +Start +============ +1. npm install (should trigger 'npm postinstall') +2. npm run postinstall (if not triggered, manually run this step) +3. create "proxy.config.json" file with below content under "portal" directory, and replace "hostname" with an available Harbor hostname +4. npm run start +5. open your browser on https://localhost:4200 +```json +{ + "/api/*": { + "target": "https://hostname", + "secure": false, + "changeOrigin": true, + "logLevel": "debug" + }, + "/service/*": { + "target": "https://hostname", + "secure": false, + "logLevel": "debug" + }, + "/c/login": { + "target": "https://hostname", + "secure": false, + "logLevel": "debug" + }, + "/c/oidc/login": { + "target": "https://hostname", + "secure": false, + "logLevel": "debug" + }, + "/sign_in": { + "target": "https://hostname", + "secure": false, + "logLevel": "debug" + }, + "/c/log_out": { + "target": "https://hostname", + "secure": false, + "logLevel": "debug" + }, + "/sendEmail": { + "target": "https://hostname", + "secure": false, + "logLevel": "debug" + }, + "/language": { + "target": "https://hostname", + "secure": false, + "logLevel": "debug" + }, + "/reset": { + "target": "https://hostname", + "secure": false, + "logLevel": "debug" + }, + "/c/userExists": { + "target": "https://hostname", + "secure": false, + "logLevel": "debug" + }, + "/reset_password": { + "target": "https://hostname", + "secure": false, + "logLevel": "debug" + }, + "/i18n/lang/*.json": { + "target": "https://hostname", + "secure": false, + "logLevel": "debug", + "pathRewrite": { "^/src$": "" } + }, + "/swagger.json": { + "target": "https://hostname", + "secure": false, + "logLevel": "debug" + }, + "/swagger2.json": { + "target": "https://hostname", + "secure": false, + "logLevel": "debug" + }, + "/chartrepo/*": { + "target": "https://hostname", + "secure": false, + "logLevel": "debug" + }, + "/LICENSE": { + "target": "https://hostname", + "secure": false, + "logLevel": "debug" + } +} +``` diff --git a/src/portal/angular.json b/src/portal/angular.json index 9e6cff76a..3c99cbd69 100644 --- a/src/portal/angular.json +++ b/src/portal/angular.json @@ -11,10 +11,15 @@ "build": { "builder": "@angular-devkit/build-angular:browser", "options": { + "allowedCommonJsDependencies": [ + "swagger-ui", + "js-yaml" + ], "outputPath": "dist", "index": "src/index.html", "main": "src/main.ts", - "tsConfig": "src/tsconfig.app.json", + "polyfills": "src/polyfills.ts", + "tsConfig": "tsconfig.app.json", "extractCss": true, "assets": [ "src/images", @@ -31,12 +36,12 @@ { "input": "src/css/dark-theme.scss", "bundleName": "dark-theme", - "lazy": true + "inject": false }, { "input": "src/css/light-theme.scss", "bundleName": "light-theme", - "lazy": true + "inject": false } ], "scripts": [ @@ -92,9 +97,10 @@ "test": { "builder": "@angular-devkit/build-angular:karma", "options": { - "tsConfig": "src/tsconfig.spec.json", + "tsConfig": "tsconfig.spec.json", "main": "src/test.ts", - "karmaConfig": "./karma.conf.js", + "polyfills": "src/polyfills.ts", + "karmaConfig": "karma.conf.js", "scripts": [ "node_modules/core-js/client/shim.min.js", "node_modules/mutationobserver-shim/dist/mutationobserver.min.js", diff --git a/src/portal/browserslist b/src/portal/browserslist deleted file mode 100644 index 37371cb04..000000000 --- a/src/portal/browserslist +++ /dev/null @@ -1,11 +0,0 @@ -# This file is currently used by autoprefixer to adjust CSS to support the below specified browsers -# For additional information regarding the format and rule options, please see: -# https://github.com/browserslist/browserslist#queries -# -# For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed - -> 0.5% -last 2 versions -Firefox ESR -not dead -not IE 9-11 \ No newline at end of file diff --git a/src/portal/favicon.ico b/src/portal/favicon.ico deleted file mode 100644 index 8b3d01243989c615ec42a99e5aaff4abd0887800..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7455 zcmY*;1ymf(w)Nl+!w?A0;4tXm&fxBz;O;IHLV~-yhXl7E!6m^pNC<9026u-*Adm0f z```b)UaPvRPw(2h_E}YHb)SybR9C>mCdUQ<0C-A@vf9sA*gp*u{rOz!;PDFpKq7OH zkrETNY1P(_O%1-H0Z*uNvOp}%&Bp*=(!Z-< z!;YxIuNhb=#!La0FOjG)t=*97r)iIf%=v*gRCPH?U_0;wO44{Hsx5Eu(WXjd9U9EJ z{3{r|mz7eGRtdQH8u6*5B%CSwJs4A2n@t(k==EO8M$6V;K01V+yI7l8>@wxr`$Zfs z?l>taYy)5GQ5Z=1AYLHVm2mX$+`5*j3d z()Uexq(sg}(~2}Zj*JxZ97&s3*<<^DYwbB#Sni5OUH|}r#Xk+HT(ZpJIdeu1x`y6{ zYN{euZZ4b_)^3(IoNyQSXEXpH1{Znmy4ZMIfZ;CAu3jQ=ak_sYM4tQqgt_Rz|AKfs ziPIUXX@X_kJZ-@IoP39{QNlmcsboX z?YN-A!opnKJX}0H9M1?2uQ#sV7H|$%FZzFz{68L98!szQ2X}7=H&^gKycU*jKHlPV zbpHtb_xSfby&Y`-zmluhe{4M)%ZL3L&g4yifDK`*gPx$!!H39`xo;6 z#Qvir#`TZ*|C-Fdo&GEOY*hkVjO)K?lfYK(Wi|o;$Q6`irF7v)UteRv^=6x%PV;h; zaTyp;6?@rb0BDk$Kwz>+(0!WrRg-RIfXn9$$FBRvcT@qjeGU39Q~3CDETLw^Y})1E z(T`&?$QDVgL|EC8xm!%PJNRyo57uU`((?VTLbs|9M_=c=BEHToiI#qR@h3OtM7f~j zV9uHc>7eURz{tS8O>-?KF+B7lQI@s0SmxbH#VHK@u`(=hd0Oz@JGT@mQynaGFR^xV zZ!a(2oSd8=OH0^YYqbZSKS*NH^s9)Ilar%jV%m|5KP(-yZL~k}qXkhOD#Be{IFwaX zw2Y18VqbC$yr(DfS;jr zYghUySAO~VwOD|jAWTA^jCQt?`g+3M$pRVI6X@19l|g??V$R<+a6SQq79m=!?XGVO7^0Tv9YFR-e?~?BXDO9MC2xtf?VUNT3`z zS?%!na|dPItgo++igL$>?)aiopp=?$N9`*Hp@(U2dbXhgY2*_qqjTLpB#fjoTXhE^ z9T3goV0^I>6<;;u2OMRE=cjgH;8S*IaO8SiY$?eqDA03qs(VEGPl$-|X>IWpTvlU& zqr_Oq#18KRYLQ&+?O`S+R6IO9?hnT;R`*wA;O-5p{pj_C(^_l*zA*tr@-MQ0^Fq+1 z#Di{}K_fX(ly=B|#?bz5#Z^#@I?-H-pWWMt)mbRyx<-_E>yy~cpZbe)SrSBT6 z`Fsu_*UoeKI8tcg=MN3@C`Gi@&x^v!pE?qsN*gjL@SqY%y}#z#V)0a1LMmd(7ZR-B zub=>C70?b6jGUZ;z%gv|r2MQi~aSByK8kCNE!KU&rhTd+nHC?M>13 zYFQvYmXsZHA1N%v`evd|S+_f{el;cFG;R&jkoYZ|kT|7r^?pKp4K{eD#ob3x)`uQB z9Aw9W86_VJr$1Mr>Ce4RIa!0|m=_!PygU|4>bo}R9#q}20xyOzkRQ(7*Z ze;Ojy_v3sCTy6JzMqcf(5uF}*Hp1?O`UdSQ77!;WZYZk(J)Tya#VJ{|X_&Sn@IeO(czKv>`**%pFLH2t} zOj6$HMQ6EyB^KE>whh-CmXPrs0J|-@;=aN+C!VHJKbU16JoRS;x)%S!h(-(G%u4(& zo?>liXFL~bJq(l+E4UQLo7)_Sg$6za2vHKoAdVD5r?W!f?+?>_1D>=*i6 zhdK26-IW+^*d?$jIfM1-eX63hn)qfv=fZJEofYeKT;K42M^=C>7{0K-7YfWb- zE`emHZd8{}lOlBcGGSnEK@+J`&P|FNMz5hJWTY7$c*F)Wd0CMfXe!qUaK$fNJXENX zWcm3crt%A2-soat>Ja`&+QC4D&Jfgjfjf>uuttS-Pgi(RST1kw-E^s1D+BmP2f|p* zDRBQMBh;6m(SsT}W~10!y>o0;0$uzYkXdBz5bg$aQykmxg;cNlNFiwmb$&)l2866D zxTN;uArIDFp~|8ioVQ3m(s&Y_2Gi4Nmwrd8dsPj;UG@6`9?ZQ;dPAj>38>qww;G!9 z7KG)!d==2KT2uWvQ=wCD-h)gV74Iu2);7MQw$NxtH9=CKJ&%+ea-y8uT<$jcLJu*1 zY!|NB1+;3WpybZZ;9e z%et9MuHmpt4vz7=vpxdiq2EZ7r6{sAfg8Qyj_*%%;0HBRS5v%i&rX8v>MiDT z%PVSuu^b{RSj-ENQl00=ZL$3DYqPQ`I=YiI;cttFGCrv<$3MT1BcqIbTWVwOe*ba@*h4VOO+YZ3Nx67 z7MQ(?%@oYnHBN}FD{TBGN7ltEL&WWK1+Xq2#NyD60{?N*DQ2O&zdnqt<+z8K-alen z$CHNA8udX9OOLj;p3cyg;T(B0n)z1o<+(IjVR(_j-4@p_Q#w0f@U9KS)rp8a!L@1SFh$LHjG3 zB>L=+CF(Sy6kO(x^S)&;aog;{t(c*tqIp;ir1NSvXm?FCBD5r4F|pa|=eproJ|D0s zf}yvDPDQ;eA|@%>6gryT z=Vw65L1EaroYW{%F65bbKn;?RC`&y$IuBS?vhZX06_$t7QEz)nuwI9G-lGUr=D0{R zPDz^Im49U{fKS{Rx@&-TUc}f1`y2LR*7S`F{rfLB+;f?HoBJLkS)v}`K>`gD{H2+< zh{!x=IU^sU3$9s2fDy{5tav|XOpGEsn9w2(FbhFnW@<*?1V$@Hd@DnWPwF_UXr%%K z^lYJD7i>Uqgmui!B0EmMQJkNvDv$|Ce|3KN^mMTd`w>}$w!Cqj8NERsaxf@%*AEeF z$_wwB<(yZ-ytm{oU(@YOx_r4}cIATxb4bUTtPw}9f?d}RAUqz+k)pg8WK8&CmS01R zCA{iMn6VF&%vNy=;4)B4ntQCNDNkQzO7mo>J39}#&y5NdwFK=7b6hd%9V?-9Dkm-A zDl{j@F;CP_ef(idf-#hpV`tm&F79I^8@BZn*VJDlE0V&_8sK9QZ~fhl-Nwt+#@F=L zkjn};llW^mqJV2NUDUL@H5s94iWqFCvOAxpz}T3h;OVy|6*=~Nt7&}FyT3`kwKKnI z{f20TXO|hfJ~~+-JKXtajnM&xDJxb4@uT$L2 zxLvoDr{(d1nXN{EpI@1dUWJk8PQo|~Ald5lxBI3jRlYVjgRMhd0 zISwA9q_8ZzbLx)Wp`NjhS|=AUOYeTn`dEd29D99!^D6gTXrL@b46>sgf zdFe0{s=Vw%Ke0skJB*9tqi$Lg@GlTt{VXBJifn+Io>dHaJUb0m0ebePzIlt#T-f4kgXEz}E*)6;xFbp3ilsgIZz$YHd<;9kIBvag4xOiOh~mJXGiU$x`zVoz zjZ|kQmqt9Y-iRn!+#i(EZ}q&DhjrQW_Ipz4@DwHuEZ2myksvu!#Yyh9&0x?O0)9`8*U|NS+6Aft73_3!x1v z`Hxu;OBYL&gkZR!GY&9KhFB(%1!Me?jtx3Z-RC7Oek3%Lzjwd@2#;qK^q}Kl42S`| zo>qzHbUsHnK>2(+XKoRxI$Yo-k(x(4?b_K>EtG8G-vZlc5oJ?xzPO??!=Z&C?5Olw ze^9AYtoCnZXitK-53U6Q%tgRxs0Qyf2NCP z6hlZjh&Hv#z8Z?Y1AwcNCx<|giZsOrdoR#+`4zvxE-wZgX zwJ+#e@XN$KKTNiogyW=pN56$cgelrGi4exxi3i)Ayd}6*^*0e|E~;~- zH|DSz1-=@0pfzYM6XMKwIj^WucobXK6*A~4g|qX@2qMJSkmhMnz-FrEj2};q|+gG-exNWsf@&=XxeBjcq?h{_gA}>*rEqDn*D=#Il)#X zPG<`_8;0kJG)2Wsw(;7!=bW8e|xee1e(Zs*mG%L1`p085Xq|92Q(yRGvWpvz1#(*k;T5 zkLMJU81E_lOuNe2a3#h0*rC}_Pp3F(x-fdz(+LeUa3?UT@rPuqZ@87s4|)D|I!MDD zdm6TF6O+aV(5sG_t7eoSVx!h-Dk35d$8|k`yH=PHT|_23xwy~tO;Oiphw|=%mM6@i zO9IP)xffy`dp@1@Tfm=0@|KHBqG#*1gBH^Xc*-VmVLRz$rDwhmo}Y*0CQg@IG`6{Z zix0`0MJQ2K@*kQY!QcvHWZBwpsz*_E@NgA+L#RZ3%UM%coI+&QnxX-z)Fe8n@0*SV z{=kn-7P1@29F#)O`g;qk4hbgLzp-jqP317&^_+Gs3J{UrFwacrnUbyu-i^cw_~q=C zXJ~O==B7E5;Jv7o0ey50GXxDrxhyq0NLMT9?eOlbL__4N8Z3pxrLbfR&pt1|Psn`v zq4(}e^!y+Jd4Z0>W@@;ZXG50 zMGaO&RmcYF)a>Kgl@;9a5!l&u-7<>kINXuDyR@=9KPXfit`!PCD)<$|Y-SwsrBbCg zKr6U;K_bTlN@XgnH;*-*7zwZEetJsU#PBTuzxp4 z7**`Kw5DHe_zBlURW(jq&$hm`K2+3TXVMI)ojh^>T;Gt>%KC-36;b4!)O5 zUx(cUG-D_|rlyq>t{5AUJK0w%6j?|320l@GPUI;##gZAJC~RaL?pkbI6VOjdpsVO} z^`*^3x4M>3kX_-1q(~rrKclhU9UdXN>!W%4sGBAb3sK&z_`xRr@R_6)VBslowif!lT4_Fxo)8MFAkRb^vL^hK*)WS zJ*}~A3l|wES5ho;* zoB~YWtJXV`@5XL%He{(-WvXB`zpu0NINa(8d$1ZHkyRluh*-$6zi~5sBjd+q%C5ic z+w8JjIR_c>;7DfpfOvCIK?5m^bgA=Zx<5c$Qz~J5JMY#vL5}(~)yGy_t@!|NJIx%P z&dO$7-2(A%1QlW^DdzkHG&IPOFxdzzlPIEm2Ep%-Hy`d2A5$SgN>7+{ zEVOm(vn7Lx-EljJQCjU!by56YzEmn+4X?=>^71IJ1u?_J!$;Az(DpOkRU73P8DB!Z z_uScEH>+|WZZqIF^G*Q6Yx5&DRF>Y*J9={9&~d{!&6j!9t$IyH{lG?d|?euk%1< zZR*UCZOY19E-m8&g>tcJ1V3JG602QE)#?VN`%E2lYY9L@le`CV& zW|Z{J5Z>zsyEXEI+b{QfQ@(*GO?Z0?ap=L5`>w8Q-%MO8yxOc|9gVx1$A3m7REmph zCpJqji<(Y{Iy*aJk{OY6duE_s=7c{cv4GTzzK@d!2wDwtWC@ Wqh9(8p#1Z9PDxH(wno}K { @@ -10,10 +11,29 @@ data.forEach((item,index) => { buildTimestampIndex = index; } }); +// modify buildTimestamp value in src/environments/environment.prod.ts file if (buildTimestampIndex > 0) { - const timestamp = new Date().getTime(); data[buildTimestampIndex] = ` buildTimestamp: ${timestamp},`; fs.writeFileSync('src/environments/environment.prod.ts', data.join('\n'), 'utf8'); } +// modify below lines in src/index.html to add buildTimestamp query string, in case of css cache in different builds +// +// +const indexHtmlData = fs.readFileSync('src/index.html', 'utf8').split('\n'); +let lightIndex = 0; +let darkIndex =0; +indexHtmlData.forEach((item,index) => { + if(item.indexOf('light-theme.css') !== -1) { + lightIndex = index; + } + if(item.indexOf('dark-theme.css') !== -1) { + darkIndex = index; + } +}); +if (lightIndex > 0 && darkIndex > 0) { + indexHtmlData[lightIndex] = ` `; + indexHtmlData[darkIndex] = ` `; + fs.writeFileSync('src/index.html', indexHtmlData.join('\n'), 'utf8'); +} \ No newline at end of file diff --git a/src/portal/server/controllers/scanners.ts b/src/portal/server/controllers/scanners.ts index 694ed1c17..80c68e3e1 100644 --- a/src/portal/server/controllers/scanners.ts +++ b/src/portal/server/controllers/scanners.ts @@ -1,4 +1,4 @@ -import { Scanner } from '../../src/app/config/scanner/scanner'; +import { Scanner } from '../../src/app/base/left-side-nav/interrogation-services/scanner/scanner'; import { Request, Response } from "express"; diff --git a/src/portal/server/src/mock-api.ts b/src/portal/server/src/mock-api.ts index ef39f5655..dabd14041 100644 --- a/src/portal/server/src/mock-api.ts +++ b/src/portal/server/src/mock-api.ts @@ -1,7 +1,7 @@ import express from "express"; import { Express } from 'express'; import * as Controllers from '../controllers'; -import { CURRENT_BASE_HREF } from "../../src/lib/utils/utils"; +import { CURRENT_BASE_HREF } from "../../src/app/shared/units/utils"; const mockApi: Express = express(); diff --git a/src/portal/src/app/account/account.module.ts b/src/portal/src/app/account/account.module.ts index 630226b5b..f641fdf80 100644 --- a/src/portal/src/app/account/account.module.ts +++ b/src/portal/src/app/account/account.module.ts @@ -12,40 +12,35 @@ // See the License for the specific language governing permissions and // limitations under the License. import { NgModule } from '@angular/core'; -import { RouterModule } from '@angular/router'; -import { CoreModule } from '../core/core.module'; +import { RouterModule, Routes } from '@angular/router'; import { SharedModule } from '../shared/shared.module'; -import { PasswordSettingComponent } from './password-setting/password-setting.component'; -import { AccountSettingsModalComponent } from './account-settings/account-settings-modal.component'; import { SignUpComponent } from './sign-up/sign-up.component'; -import { ForgotPasswordComponent } from './password-setting/forgot-password/forgot-password.component'; -import { ResetPasswordComponent } from './password-setting/reset-password/reset-password.component'; import { SignUpPageComponent } from './sign-up/sign-up-page.component'; -import { PasswordSettingService } from './password-setting/password-setting.service'; -import { AccountSettingsModalService } from './account-settings/account-settings-modal-service.service'; - +import { SignInComponent } from "./sign-in/sign-in.component"; +import { SignInGuard } from "../shared/router-guard/sign-in-guard-activate.service"; +import { TopRepoService } from "./sign-in/top-repo/top-repository.service"; +import { TopRepoComponent } from "./sign-in/top-repo/top-repo.component"; +const routes: Routes = [ + { + path: 'sign-in', + canActivate: [SignInGuard], + component: SignInComponent + } +]; @NgModule({ imports: [ - CoreModule, - RouterModule, + RouterModule.forChild(routes), SharedModule, ], declarations: [ - PasswordSettingComponent, - AccountSettingsModalComponent, SignUpComponent, - ForgotPasswordComponent, - ResetPasswordComponent, - SignUpPageComponent], - exports: [ - PasswordSettingComponent, - AccountSettingsModalComponent, - ForgotPasswordComponent, - ResetPasswordComponent, - SignUpComponent, - SignUpPageComponent], - - providers: [PasswordSettingService, AccountSettingsModalService] + SignUpPageComponent, + SignInComponent, + TopRepoComponent, + ], + providers: [ + TopRepoService + ] }) export class AccountModule { } diff --git a/src/portal/src/app/account/password-setting/reset-password/reset-password.component.html b/src/portal/src/app/account/password-setting/reset-password/reset-password.component.html deleted file mode 100644 index 5ad506b80..000000000 --- a/src/portal/src/app/account/password-setting/reset-password/reset-password.component.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - diff --git a/src/portal/src/app/account/password-setting/reset-password/reset-password.component.scss b/src/portal/src/app/account/password-setting/reset-password/reset-password.component.scss deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/portal/src/app/account/password-setting/reset-password/reset-password.component.spec.ts b/src/portal/src/app/account/password-setting/reset-password/reset-password.component.spec.ts deleted file mode 100644 index 48a2efba1..000000000 --- a/src/portal/src/app/account/password-setting/reset-password/reset-password.component.spec.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; -import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { ResetPasswordComponent } from './reset-password.component'; -import { FormsModule } from '@angular/forms'; -import { PasswordSettingService } from '../password-setting.service'; -import { RouterTestingModule } from '@angular/router/testing'; -import { MessageHandlerService } from '../../../shared/message-handler/message-handler.service'; -import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { ClarityModule } from '@clr/angular'; -import { InlineAlertComponent } from '../../../shared/inline-alert/inline-alert.component'; -import { ErrorHandler } from '../../../../lib/utils/error-handler'; - -describe('ResetPasswordComponent', () => { - let component: ResetPasswordComponent; - let fixture: ComponentFixture; - let fakePasswordSettingService = null; - let fakeMessageHandlerService = null; - - beforeEach(waitForAsync(() => { - TestBed.configureTestingModule({ - imports: [ - TranslateModule.forRoot(), - FormsModule, - RouterTestingModule, - BrowserAnimationsModule, - ClarityModule - ], - declarations: [ResetPasswordComponent, InlineAlertComponent], - providers: [ - TranslateService, - { provide: PasswordSettingService, useValue: fakePasswordSettingService }, - { provide: MessageHandlerService, useValue: fakeMessageHandlerService }, - ErrorHandler - ], - schemas: [CUSTOM_ELEMENTS_SCHEMA] - }).compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(ResetPasswordComponent); - component = fixture.componentInstance; - component.inlineAlert = TestBed.createComponent(InlineAlertComponent).componentInstance; - component.open(); - fixture.autoDetectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/portal/src/app/account/password-setting/reset-password/reset-password.component.ts b/src/portal/src/app/account/password-setting/reset-password/reset-password.component.ts deleted file mode 100644 index b51e77730..000000000 --- a/src/portal/src/app/account/password-setting/reset-password/reset-password.component.ts +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright Project Harbor Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -import { Component, ViewChild, OnInit } from '@angular/core'; -import { Router, ActivatedRoute } from '@angular/router'; -import { NgForm } from '@angular/forms'; - -import { PasswordSettingService } from '../password-setting.service'; -import { InlineAlertComponent } from '../../../shared/inline-alert/inline-alert.component'; -import { MessageHandlerService } from '../../../shared/message-handler/message-handler.service'; -import { CommonRoutes } from "../../../../lib/entities/shared.const"; - -@Component({ - selector: 'reset-password', - templateUrl: "reset-password.component.html", - styleUrls: ['./reset-password.component.scss', '../password-setting.component.scss', '../../../common.scss'] -}) -export class ResetPasswordComponent implements OnInit { - opened: boolean = true; - onGoing: boolean = false; - password: string = ""; - private validationState: any = { - "newPassword": true, - "reNewPassword": true - }; - resetUuid: string = ""; - resetOk: boolean = false; - confirmPwd: string = ""; - - @ViewChild("resetPwdForm", {static: true}) resetPwdForm: NgForm; - @ViewChild(InlineAlertComponent) - inlineAlert: InlineAlertComponent; - - constructor( - private pwdService: PasswordSettingService, - private route: ActivatedRoute, - private msgHandler: MessageHandlerService, - private router: Router) { } - - ngOnInit(): void { - this.route.queryParams.subscribe(params => this.resetUuid = params["reset_uuid"] || ""); - } - - public get showProgress(): boolean { - return this.onGoing; - } - - public get isValid(): boolean { - return this.resetPwdForm && this.resetPwdForm.valid && this.samePassword(); - } - - public get btnCancelCaption(): string { - if (!this.resetOk) { - return 'BUTTON.CANCEL'; - } else { - return 'BUTTON.CLOSE'; - } - } - - public getValidationState(key: string): boolean { - return this.validationState && - this.validationState[key]; - } - - public open(): void { - this.resetOk = false; - this.onGoing = false; - this.validationState = { - "newPassword": true, - "reNewPassword": true - }; - this.resetPwdForm.resetForm(); - this.inlineAlert.close(); - - this.opened = true; - } - - public close(): void { - // If already reset password ok, navigator to sign-in - if (this.resetOk) { - this.router.navigateByUrl(CommonRoutes.EMBEDDED_SIGN_IN); - } - this.opened = false; - } - - public send(): void { - // Double confirm to avoid improper situations - if (!this.password) { - return; - } - - if (!this.isValid) { - return; - } - - this.onGoing = true; - this.pwdService.resetPassword(this.resetUuid, this.password) - .subscribe(() => { - this.onGoing = false; - this.resetOk = true; - this.inlineAlert.showInlineSuccess({ message: 'RESET_PWD.RESET_OK' }); - }, error => { - this.onGoing = false; - if (this.msgHandler.isAppLevel(error)) { - this.close(); - } else { - this.inlineAlert.showInlineError(error); - } - }); - } - - public handleValidation(key: string, flag: boolean): void { - if (!flag) { - this.validationState[key] = true; - } else { - this.validationState[key] = this.getControlValidationState(key); - if (this.validationState[key]) { - this.validationState["reNewPassword"] = this.samePassword(); - } - } - } - - getControlValidationState(key: string): boolean { - if (this.resetPwdForm) { - let control = this.resetPwdForm.controls[key]; - if (control) { - return control.valid; - } - } - - return false; - } - - samePassword(): boolean { - if (this.resetPwdForm) { - let control1 = this.resetPwdForm.controls["newPassword"]; - let control2 = this.resetPwdForm.controls["reNewPassword"]; - if (control1 && control2) { - return control1.value === control2.value; - } - } - - return false; - } -} diff --git a/src/portal/src/app/shared/sign-in-credential.ts b/src/portal/src/app/account/sign-in/sign-in-credential.ts similarity index 100% rename from src/portal/src/app/shared/sign-in-credential.ts rename to src/portal/src/app/account/sign-in/sign-in-credential.ts diff --git a/src/portal/src/app/sign-in/sign-in.component.html b/src/portal/src/app/account/sign-in/sign-in.component.html similarity index 100% rename from src/portal/src/app/sign-in/sign-in.component.html rename to src/portal/src/app/account/sign-in/sign-in.component.html diff --git a/src/portal/src/app/sign-in/sign-in.component.scss b/src/portal/src/app/account/sign-in/sign-in.component.scss similarity index 100% rename from src/portal/src/app/sign-in/sign-in.component.scss rename to src/portal/src/app/account/sign-in/sign-in.component.scss diff --git a/src/portal/src/app/sign-in/sign-in.component.spec.ts b/src/portal/src/app/account/sign-in/sign-in.component.spec.ts similarity index 93% rename from src/portal/src/app/sign-in/sign-in.component.spec.ts rename to src/portal/src/app/account/sign-in/sign-in.component.spec.ts index ee75f23af..333657683 100644 --- a/src/portal/src/app/sign-in/sign-in.component.spec.ts +++ b/src/portal/src/app/account/sign-in/sign-in.component.spec.ts @@ -1,11 +1,11 @@ -import { waitForAsync, ComponentFixture, getTestBed, inject, TestBed } from '@angular/core/testing'; +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; import { SignInComponent } from './sign-in.component'; import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { RouterTestingModule } from '@angular/router/testing'; -import { AppConfigService } from '../services/app-config.service'; -import { SessionService } from '../shared/session.service'; +import { AppConfigService } from '../../services/app-config.service'; +import { SessionService } from '../../shared/services/session.service'; import { CookieService } from 'ngx-cookie'; -import { SkinableConfig } from "../services/skinable-config.service"; +import { SkinableConfig } from "../../services/skinable-config.service"; import { CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA } from '@angular/core'; import { ClarityModule } from "@clr/angular"; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; diff --git a/src/portal/src/app/sign-in/sign-in.component.ts b/src/portal/src/app/account/sign-in/sign-in.component.ts similarity index 91% rename from src/portal/src/app/sign-in/sign-in.component.ts rename to src/portal/src/app/account/sign-in/sign-in.component.ts index facdd0536..151eaabc0 100644 --- a/src/portal/src/app/sign-in/sign-in.component.ts +++ b/src/portal/src/app/account/sign-in/sign-in.component.ts @@ -15,19 +15,19 @@ import { Component, OnInit } from '@angular/core'; import { Router, ActivatedRoute } from '@angular/router'; import { Input, ViewChild, AfterViewChecked } from '@angular/core'; import { NgForm } from '@angular/forms'; -import { SessionService } from '../shared/session.service'; -import { SignInCredential } from '../shared/sign-in-credential'; -import { SignUpComponent } from '../account/sign-up/sign-up.component'; -import { ForgotPasswordComponent } from '../account/password-setting/forgot-password/forgot-password.component'; -import { AppConfigService } from '../services/app-config.service'; -import { AppConfig } from '../services/app-config'; -import { User } from '../user/user'; +import { SessionService } from '../../shared/services/session.service'; +import { SignUpComponent } from '../sign-up/sign-up.component'; +import { ForgotPasswordComponent } from '../../base/password-setting/forgot-password/forgot-password.component'; +import { AppConfigService } from '../../services/app-config.service'; +import { AppConfig } from '../../services/app-config'; +import { User } from '../../base/left-side-nav/user/user'; import { CookieService, CookieOptions } from 'ngx-cookie'; -import { SkinableConfig } from "../services/skinable-config.service"; -import {ModalEvent} from "../base/modal-event"; -import {modalEvents} from "../base/modal-events.const"; -import {AboutDialogComponent} from "../shared/about-dialog/about-dialog.component"; -import { CommonRoutes, CONFIG_AUTH_MODE } from "../../lib/entities/shared.const"; +import { SkinableConfig } from "../../services/skinable-config.service"; +import {ModalEvent} from "../../base/modal-event"; +import {modalEvents} from "../../base/modal-events.const"; +import {AboutDialogComponent} from "../../shared/components/about-dialog/about-dialog.component"; +import { CommonRoutes, CONFIG_AUTH_MODE } from "../../shared/entities/shared.const"; +import { SignInCredential } from "./sign-in-credential"; // Define status flags for signing in states export const signInStatusNormal = 0; @@ -247,7 +247,7 @@ export class SignInComponent implements AfterViewChecked, OnInit { // Remeber me this.remeberMe(); - // Redirect to the right route + // Redirect to the right router-guard if (this.redirectUrl === "") { // Routing to the default location this.router.navigateByUrl(CommonRoutes.HARBOR_DEFAULT); diff --git a/src/portal/src/app/sign-in/sign-in.service.spec.ts b/src/portal/src/app/account/sign-in/sign-in.service.spec.ts similarity index 100% rename from src/portal/src/app/sign-in/sign-in.service.spec.ts rename to src/portal/src/app/account/sign-in/sign-in.service.spec.ts diff --git a/src/portal/src/app/sign-in/sign-in.service.ts b/src/portal/src/app/account/sign-in/sign-in.service.ts similarity index 93% rename from src/portal/src/app/sign-in/sign-in.service.ts rename to src/portal/src/app/account/sign-in/sign-in.service.ts index 7c805ef70..109c3248b 100644 --- a/src/portal/src/app/sign-in/sign-in.service.ts +++ b/src/portal/src/app/account/sign-in/sign-in.service.ts @@ -13,10 +13,10 @@ // limitations under the License. import { Injectable } from '@angular/core'; import { HttpClient, HttpParams } from '@angular/common/http'; -import { SignInCredential } from '../shared/sign-in-credential'; import { map, catchError } from "rxjs/operators"; import { Observable, throwError as observableThrowError } from "rxjs"; -import { HTTP_FORM_OPTIONS } from "../../lib/utils/utils"; +import { HTTP_FORM_OPTIONS } from "../../shared/units/utils"; +import { SignInCredential } from "./sign-in-credential"; const signInUrl = '/c/login'; /** * diff --git a/src/portal/src/app/sign-in/top-repo/top-repo.component.html b/src/portal/src/app/account/sign-in/top-repo/top-repo.component.html similarity index 100% rename from src/portal/src/app/sign-in/top-repo/top-repo.component.html rename to src/portal/src/app/account/sign-in/top-repo/top-repo.component.html diff --git a/src/portal/src/app/sign-in/top-repo/top-repo.component.scss b/src/portal/src/app/account/sign-in/top-repo/top-repo.component.scss similarity index 100% rename from src/portal/src/app/sign-in/top-repo/top-repo.component.scss rename to src/portal/src/app/account/sign-in/top-repo/top-repo.component.scss diff --git a/src/portal/src/app/sign-in/top-repo/top-repo.component.spec.ts b/src/portal/src/app/account/sign-in/top-repo/top-repo.component.spec.ts similarity index 95% rename from src/portal/src/app/sign-in/top-repo/top-repo.component.spec.ts rename to src/portal/src/app/account/sign-in/top-repo/top-repo.component.spec.ts index e2f44d7d8..286382d12 100644 --- a/src/portal/src/app/sign-in/top-repo/top-repo.component.spec.ts +++ b/src/portal/src/app/account/sign-in/top-repo/top-repo.component.spec.ts @@ -8,7 +8,7 @@ import { FormsModule } from '@angular/forms'; import { RouterTestingModule } from '@angular/router/testing'; import { of } from 'rxjs'; import { HttpClientTestingModule } from '@angular/common/http/testing'; -import { MessageHandlerService } from '../../shared/message-handler/message-handler.service'; +import { MessageHandlerService } from '../../../shared/services/message-handler.service'; import { TopRepoService } from './top-repository.service'; describe('TopRepoComponent', () => { let component: TopRepoComponent; diff --git a/src/portal/src/app/sign-in/top-repo/top-repo.component.ts b/src/portal/src/app/account/sign-in/top-repo/top-repo.component.ts similarity index 86% rename from src/portal/src/app/sign-in/top-repo/top-repo.component.ts rename to src/portal/src/app/account/sign-in/top-repo/top-repo.component.ts index d3a3e598b..12fa89098 100644 --- a/src/portal/src/app/sign-in/top-repo/top-repo.component.ts +++ b/src/portal/src/app/account/sign-in/top-repo/top-repo.component.ts @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. import { Component, OnInit } from '@angular/core'; -import { MessageHandlerService } from '../../shared/message-handler/message-handler.service'; +import { MessageHandlerService } from '../../../shared/services/message-handler.service'; import { TopRepoService } from './top-repository.service'; -import { Repository } from "../../../../ng-swagger-gen/models/repository"; -import { ListMode } from "../../../lib/entities/shared.const"; +import { Repository } from "../../../../../ng-swagger-gen/models/repository"; +import { ListMode } from "../../../shared/entities/shared.const"; @Component({ diff --git a/src/portal/src/app/sign-in/top-repo/top-repository.service.spec.ts b/src/portal/src/app/account/sign-in/top-repo/top-repository.service.spec.ts similarity index 100% rename from src/portal/src/app/sign-in/top-repo/top-repository.service.spec.ts rename to src/portal/src/app/account/sign-in/top-repo/top-repository.service.spec.ts diff --git a/src/portal/src/app/sign-in/top-repo/top-repository.service.ts b/src/portal/src/app/account/sign-in/top-repo/top-repository.service.ts similarity index 90% rename from src/portal/src/app/sign-in/top-repo/top-repository.service.ts rename to src/portal/src/app/account/sign-in/top-repo/top-repository.service.ts index a98da0d0d..79e2fd365 100644 --- a/src/portal/src/app/sign-in/top-repo/top-repository.service.ts +++ b/src/portal/src/app/account/sign-in/top-repo/top-repository.service.ts @@ -15,8 +15,8 @@ import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { map, catchError } from "rxjs/operators"; import { Observable, throwError as observableThrowError } from "rxjs"; -import { Repository } from "../../../../ng-swagger-gen/models/repository"; -import { CURRENT_BASE_HREF, HTTP_GET_OPTIONS } from "../../../lib/utils/utils"; +import { Repository } from "../../../../../ng-swagger-gen/models/repository"; +import { CURRENT_BASE_HREF, HTTP_GET_OPTIONS } from "../../../shared/units/utils"; export const topRepoEndpoint = CURRENT_BASE_HREF + "/repositories/top"; /** diff --git a/src/portal/src/app/sign-in/top-repo/top-repository.ts b/src/portal/src/app/account/sign-in/top-repo/top-repository.ts similarity index 100% rename from src/portal/src/app/sign-in/top-repo/top-repository.ts rename to src/portal/src/app/account/sign-in/top-repo/top-repository.ts diff --git a/src/portal/src/app/account/sign-up/sign-up-page.component.spec.ts b/src/portal/src/app/account/sign-up/sign-up-page.component.spec.ts index c03b3031e..b0ba97398 100644 --- a/src/portal/src/app/account/sign-up/sign-up-page.component.spec.ts +++ b/src/portal/src/app/account/sign-up/sign-up-page.component.spec.ts @@ -1,13 +1,13 @@ import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; -import { UserService } from '../../user/user.service'; +import { UserService } from '../../base/left-side-nav/user/user.service'; import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { MessageService } from '../../global-message/message.service'; +import { MessageService } from '../../shared/components/global-message/message.service'; import { RouterTestingModule } from '@angular/router/testing'; import { SignUpPageComponent } from './sign-up-page.component'; import { FormsModule } from '@angular/forms'; -import { NewUserFormComponent } from '../../shared/new-user-form/new-user-form.component'; -import { SessionService } from '../../shared/session.service'; +import { NewUserFormComponent } from '../../shared/components/new-user-form/new-user-form.component'; +import { SessionService } from '../../shared/services/session.service'; describe('SignUpPageComponent', () => { let component: SignUpPageComponent; diff --git a/src/portal/src/app/account/sign-up/sign-up-page.component.ts b/src/portal/src/app/account/sign-up/sign-up-page.component.ts index 2cd751a61..2c793e07a 100644 --- a/src/portal/src/app/account/sign-up/sign-up-page.component.ts +++ b/src/portal/src/app/account/sign-up/sign-up-page.component.ts @@ -14,11 +14,11 @@ import { Component, ViewChild, OnInit } from '@angular/core'; import { Router } from '@angular/router'; -import { NewUserFormComponent } from '../../shared/new-user-form/new-user-form.component'; -import { User } from '../../user/user'; -import { UserService } from '../../user/user.service'; -import { AlertType } from '../../shared/shared.const'; -import { MessageService } from '../../global-message/message.service'; +import { NewUserFormComponent } from '../../shared/components/new-user-form/new-user-form.component'; +import { User } from '../../base/left-side-nav/user/user'; +import { UserService } from '../../base/left-side-nav/user/user.service'; +import { MessageService } from '../../shared/components/global-message/message.service'; +import { AlertType } from "../../shared/entities/shared.const"; @Component({ selector: 'sign-up-page', diff --git a/src/portal/src/app/account/sign-up/sign-up.component.spec.ts b/src/portal/src/app/account/sign-up/sign-up.component.spec.ts index a40fc9f4a..91ba40bd5 100644 --- a/src/portal/src/app/account/sign-up/sign-up.component.spec.ts +++ b/src/portal/src/app/account/sign-up/sign-up.component.spec.ts @@ -1,16 +1,16 @@ import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; import { ClarityModule } from "@clr/angular"; import { SignUpComponent } from './sign-up.component'; -import { SessionService } from '../../shared/session.service'; -import { UserService } from '../../user/user.service'; +import { SessionService } from '../../shared/services/session.service'; +import { UserService } from '../../base/left-side-nav/user/user.service'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { NewUserFormComponent } from '../../shared/new-user-form/new-user-form.component'; +import { NewUserFormComponent } from '../../shared/components/new-user-form/new-user-form.component'; import { FormsModule } from '@angular/forms'; -import { InlineAlertComponent } from '../../shared/inline-alert/inline-alert.component'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { of } from 'rxjs'; -import { ErrorHandler } from '../../../lib/utils/error-handler'; +import { ErrorHandler } from '../../shared/units/error-handler'; +import { InlineAlertComponent } from "../../shared/components/inline-alert/inline-alert.component"; describe('SignUpComponent', () => { let component: SignUpComponent; diff --git a/src/portal/src/app/account/sign-up/sign-up.component.ts b/src/portal/src/app/account/sign-up/sign-up.component.ts index d42a9b283..92ab61efb 100644 --- a/src/portal/src/app/account/sign-up/sign-up.component.ts +++ b/src/portal/src/app/account/sign-up/sign-up.component.ts @@ -12,14 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. import { Component, Output, ViewChild, EventEmitter } from '@angular/core'; -import { Modal } from '../../../lib/services/interface'; - -import { NewUserFormComponent } from '../../shared/new-user-form/new-user-form.component'; -import { User } from '../../user/user'; -import { SessionService } from '../../shared/session.service'; -import { UserService } from '../../user/user.service'; -import { InlineAlertComponent } from '../../shared/inline-alert/inline-alert.component'; - +import { Modal } from '../../shared/services/interface'; +import { NewUserFormComponent } from '../../shared/components/new-user-form/new-user-form.component'; +import { User } from '../../base/left-side-nav/user/user'; +import { SessionService } from '../../shared/services/session.service'; +import { UserService } from '../../base/left-side-nav/user/user.service'; +import { InlineAlertComponent } from "../../shared/components/inline-alert/inline-alert.component"; @Component({ selector: 'sign-up', diff --git a/src/portal/src/app/all-pipes/all-pipes.module.ts b/src/portal/src/app/all-pipes/all-pipes.module.ts deleted file mode 100644 index 80f69f7df..000000000 --- a/src/portal/src/app/all-pipes/all-pipes.module.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { SelectArtifactIconPipe } from './select-artifact-icon/select-artifact-icon.pipe'; - - - -@NgModule({ - declarations: [SelectArtifactIconPipe], - imports: [ - CommonModule - ], - exports: [ - SelectArtifactIconPipe - ] -}) -export class AllPipesModule { } diff --git a/src/portal/src/app/all-pipes/select-artifact-icon/select-artifact-icon.pipe.spec.ts b/src/portal/src/app/all-pipes/select-artifact-icon/select-artifact-icon.pipe.spec.ts deleted file mode 100644 index 6928752ee..000000000 --- a/src/portal/src/app/all-pipes/select-artifact-icon/select-artifact-icon.pipe.spec.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { SelectArtifactIconPipe } from './select-artifact-icon.pipe'; - -describe('SelectArtifactIconPipe', () => { - let mockTypeImage = "IMAGE"; - let mockTypeChart = "CHART"; - let mockTypecnab = "CNAB"; - it('create an instance', () => { - const pipe = new SelectArtifactIconPipe(); - expect(pipe).toBeTruthy(); - }); - it('it should success get adress of icon', () => { - const pipe = new SelectArtifactIconPipe(); - expect(pipe.transform(mockTypeImage, '')).toBe('images/artifact-image.svg'); - expect(pipe.transform(mockTypeChart, '')).toBe('images/artifact-chart.svg'); - expect(pipe.transform(mockTypecnab, '')).toBe('images/artifact-cnab.svg'); - expect(pipe.transform("", '')).toBe('images/artifact-default.svg'); - - }); -}); diff --git a/src/portal/src/app/all-pipes/select-artifact-icon/select-artifact-icon.pipe.ts b/src/portal/src/app/all-pipes/select-artifact-icon/select-artifact-icon.pipe.ts deleted file mode 100644 index 876007cfa..000000000 --- a/src/portal/src/app/all-pipes/select-artifact-icon/select-artifact-icon.pipe.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { Pipe, PipeTransform } from '@angular/core'; -import { artifactImages, artifactDefault } from '../../project/repository/artifact/artifact'; - -@Pipe({ - name: 'selectArtifactIcon' -}) -export class SelectArtifactIconPipe implements PipeTransform { - - transform(value: string, ...args: any[]): any { - - if (artifactImages.some(image => image === value)) { - return 'images/artifact-' + value.toLowerCase() + '.svg'; - } else { - return artifactDefault; - } - } - -} diff --git a/src/portal/src/app/app.component.spec.ts b/src/portal/src/app/app.component.spec.ts index a79509a58..37873fffe 100644 --- a/src/portal/src/app/app.component.spec.ts +++ b/src/portal/src/app/app.component.spec.ts @@ -18,7 +18,7 @@ import { Title } from '@angular/platform-browser'; import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { CookieService } from 'ngx-cookie'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; -import { SessionService } from './shared/session.service'; +import { SessionService } from './shared/services/session.service'; import { AppConfigService } from './services/app-config.service'; import { AppComponent } from './app.component'; import { ClarityModule } from "@clr/angular"; diff --git a/src/portal/src/app/app.component.ts b/src/portal/src/app/app.component.ts index a8dba24ae..5cd7507a4 100644 --- a/src/portal/src/app/app.component.ts +++ b/src/portal/src/app/app.component.ts @@ -13,15 +13,13 @@ // limitations under the License. import { Component } from '@angular/core'; import { Title } from '@angular/platform-browser'; - import { TranslateService } from '@ngx-translate/core'; -import { CookieService } from 'ngx-cookie'; - -import { SessionService } from './shared/session.service'; import { AppConfigService } from './services/app-config.service'; import { ThemeService } from './services/theme.service'; import { THEME_ARRAY, ThemeInterface } from './services/theme'; -import { clone } from '../lib/utils/utils'; +import { clone } from './shared/units/utils'; +import { DEFAULT_LANG_LOCALSTORAGE_KEY, DeFaultLang, supportedLangs } from "./shared/entities/shared.const"; +import { forkJoin, Observable } from "rxjs"; const HAS_STYLE_MODE: string = 'styleModeLocal'; @@ -31,17 +29,16 @@ const HAS_STYLE_MODE: string = 'styleModeLocal'; }) export class AppComponent { themeArray: ThemeInterface[] = clone(THEME_ARRAY); - styleMode: string = this.themeArray[0].showStyle; constructor( private translate: TranslateService, - private cookie: CookieService, - private session: SessionService, private appConfigService: AppConfigService, private titleService: Title, public theme: ThemeService ) { + // init language + this.initLanguage(); // Override page title let key: string = "APP_TITLE.HARBOR"; if (this.appConfigService.isIntegrationMode()) { @@ -67,4 +64,37 @@ export class AppComponent { } }); } + initLanguage() { + /** + * due to the bug(https://github.com/ngx-translate/core/issues/1258) of translate module + * we have to call use method for all supported languages + * use method will load related language json from backend server + */ + const usedLangs: Array> = []; + supportedLangs.forEach(lang => { + usedLangs.push(this.translate.use(lang)); + }); + forkJoin(usedLangs).subscribe(() => { // use target lang after all langs json loaded + this.translate.addLangs(supportedLangs); + this.translate.setDefaultLang(DeFaultLang); + let selectedLang: string = DeFaultLang; + if (localStorage && localStorage.getItem(DEFAULT_LANG_LOCALSTORAGE_KEY)) {// If user has selected lang, then directly use it + selectedLang = localStorage.getItem(DEFAULT_LANG_LOCALSTORAGE_KEY); + } else {// If user has not selected lang, then use browser language(if contained in supportedLangs) + const browserCultureLang: string = this.translate + .getBrowserCultureLang() + .toLowerCase(); + if (browserCultureLang && browserCultureLang.trim() !== "") { + if (supportedLangs && supportedLangs.length > 0) { + if (supportedLangs.find(lang => lang === browserCultureLang)) { + selectedLang = browserCultureLang; + } + } + } + } + localStorage.setItem(DEFAULT_LANG_LOCALSTORAGE_KEY, selectedLang); + this.translate.use(selectedLang); + } + ); + } } diff --git a/src/portal/src/app/app.module.ts b/src/portal/src/app/app.module.ts index ab9ae9641..3652f25fe 100644 --- a/src/portal/src/app/app.module.ts +++ b/src/portal/src/app/app.module.ts @@ -12,86 +12,68 @@ // See the License for the specific language governing permissions and // limitations under the License. import { BrowserModule } from '@angular/platform-browser'; -import { NgModule, APP_INITIALIZER, LOCALE_ID, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { NgModule, APP_INITIALIZER, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { AppComponent } from './app.component'; import { InterceptHttpService } from './services/intercept-http.service'; - -import { BaseModule } from './base/base.module'; import { HarborRoutingModule } from './harbor-routing.module'; -import { SharedModule } from './shared/shared.module'; -import { AccountModule } from './account/account.module'; -import { SignInModule } from './sign-in/sign-in.module'; -import { ConfigurationModule } from './config/config.module'; -import { DeveloperCenterModule } from './dev-center/dev-center.module'; -import { registerLocaleData } from '@angular/common'; - -import { TranslateService } from "@ngx-translate/core"; import { AppConfigService } from './services/app-config.service'; import { SkinableConfig } from "./services/skinable-config.service"; -import { ProjectConfigComponent } from './project/project-config/project-config.component'; +import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http'; +import { BrowserAnimationsModule } from "@angular/platform-browser/animations"; +import { CookieModule } from "ngx-cookie"; +import { + MissingTranslationHandler, + MissingTranslationHandlerParams, + TranslateLoader, + TranslateModule +} from "@ngx-translate/core"; +import { + ProjectDefaultService, + ProjectService, + UserPermissionDefaultService, + UserPermissionService +} from "./shared/services"; +import { ErrorHandler } from "./shared/units/error-handler"; +import { MessageHandlerService } from "./shared/services/message-handler.service"; +import { HarborTranslateLoaderService } from "./services/harbor-translate-loader.service"; -import zh from '@angular/common/locales/zh-Hans'; -import es from '@angular/common/locales/es'; -import localeFr from '@angular/common/locales/fr'; -import localePt from '@angular/common/locales/pt-PT'; -import localeTr from '@angular/common/locales/tr'; -import { DevCenterComponent } from './dev-center/dev-center.component'; -import { VulnerabilityPageComponent } from './vulnerability-page/vulnerability-page.component'; -import { GcPageComponent } from './gc-page/gc-page.component'; -import { OidcOnboardModule } from './oidc-onboard/oidc-onboard.module'; -import { LicenseModule } from './license/license.module'; -import { InterrogationServicesComponent } from "./interrogation-services/interrogation-services.component"; -import { LabelsComponent } from './labels/labels.component'; -import { ProjectQuotasComponent } from './project-quotas/project-quotas.component'; -import { HarborLibraryModule } from "../lib/harbor-library.module"; -import { HTTP_INTERCEPTORS } from '@angular/common/http'; -import { AllPipesModule } from './all-pipes/all-pipes.module'; -import { DistributionModule } from './distribution/distribution.module'; -import { SystemRobotAccountsModule } from './system-robot-accounts/system-robot-accounts.module'; -registerLocaleData(zh, 'zh-cn'); -registerLocaleData(es, 'es-es'); -registerLocaleData(localeFr, 'fr-fr'); -registerLocaleData(localePt, 'pt-br'); -registerLocaleData(localeTr, 'tr-tr'); - -export function initConfig(configService: AppConfigService, skinableService: SkinableConfig) { +function initConfig(configService: AppConfigService, skinableService: SkinableConfig) { return () => { skinableService.getCustomFile().subscribe(); configService.load().subscribe(); }; } -export function getCurrentLanguage(translateService: TranslateService) { - return translateService.currentLang; +class MyMissingTranslationHandler implements MissingTranslationHandler { + handle(params: MissingTranslationHandlerParams) { + const missingText: string = "{Harbor}"; + return params.key || missingText; + } } + + + @NgModule({ declarations: [ AppComponent, - ProjectConfigComponent, - VulnerabilityPageComponent, - GcPageComponent, - InterrogationServicesComponent, - LabelsComponent, - ProjectQuotasComponent ], imports: [ + TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useClass: HarborTranslateLoaderService + }, + missingTranslationHandler: { + provide: MissingTranslationHandler, + useClass: MyMissingTranslationHandler + } + }), BrowserModule, - SharedModule, - BaseModule, - AccountModule, - SignInModule, + BrowserAnimationsModule, + HttpClientModule, HarborRoutingModule, - ConfigurationModule, - DeveloperCenterModule, - OidcOnboardModule, - LicenseModule, - HarborLibraryModule, - AllPipesModule, - DistributionModule, - SystemRobotAccountsModule - ], - exports: [ + CookieModule.forRoot(), ], providers: [ AppConfigService, @@ -102,9 +84,10 @@ export function getCurrentLanguage(translateService: TranslateService) { deps: [AppConfigService, SkinableConfig], multi: true }, - { provide: LOCALE_ID, useValue: "en-US" }, - { provide: HTTP_INTERCEPTORS, useClass: InterceptHttpService, multi: true } - + { provide: HTTP_INTERCEPTORS, useClass: InterceptHttpService, multi: true }, + { provide: ProjectService, useClass: ProjectDefaultService }, + { provide: ErrorHandler, useClass: MessageHandlerService }, + { provide: UserPermissionService, useClass: UserPermissionDefaultService }, ], schemas: [ CUSTOM_ELEMENTS_SCHEMA diff --git a/src/portal/src/app/account/account-settings/account-settings-modal-service.service.spec.ts b/src/portal/src/app/base/account-settings/account-settings-modal-service.service.spec.ts similarity index 100% rename from src/portal/src/app/account/account-settings/account-settings-modal-service.service.spec.ts rename to src/portal/src/app/base/account-settings/account-settings-modal-service.service.spec.ts diff --git a/src/portal/src/app/account/account-settings/account-settings-modal-service.service.ts b/src/portal/src/app/base/account-settings/account-settings-modal-service.service.ts similarity index 84% rename from src/portal/src/app/account/account-settings/account-settings-modal-service.service.ts rename to src/portal/src/app/base/account-settings/account-settings-modal-service.service.ts index bf290ff6f..3c8cf11ba 100644 --- a/src/portal/src/app/account/account-settings/account-settings-modal-service.service.ts +++ b/src/portal/src/app/base/account-settings/account-settings-modal-service.service.ts @@ -2,12 +2,14 @@ import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { catchError, map } from 'rxjs/operators'; import { throwError as observableThrowError, Observable } from 'rxjs'; -import { CURRENT_BASE_HREF } from "../../../lib/utils/utils"; +import { CURRENT_BASE_HREF } from "../../shared/units/utils"; -@Injectable() +@Injectable({ + providedIn: 'root' +}) export class AccountSettingsModalService { constructor(private http: HttpClient) { } diff --git a/src/portal/src/app/account/account-settings/account-settings-modal.component.html b/src/portal/src/app/base/account-settings/account-settings-modal.component.html similarity index 100% rename from src/portal/src/app/account/account-settings/account-settings-modal.component.html rename to src/portal/src/app/base/account-settings/account-settings-modal.component.html diff --git a/src/portal/src/app/account/account-settings/account-settings-modal.component.scss b/src/portal/src/app/base/account-settings/account-settings-modal.component.scss similarity index 100% rename from src/portal/src/app/account/account-settings/account-settings-modal.component.scss rename to src/portal/src/app/base/account-settings/account-settings-modal.component.scss diff --git a/src/portal/src/app/account/account-settings/account-settings-modal.component.spec.ts b/src/portal/src/app/base/account-settings/account-settings-modal.component.spec.ts similarity index 93% rename from src/portal/src/app/account/account-settings/account-settings-modal.component.spec.ts rename to src/portal/src/app/base/account-settings/account-settings-modal.component.spec.ts index eebf34f4e..b475a1c1a 100644 --- a/src/portal/src/app/account/account-settings/account-settings-modal.component.spec.ts +++ b/src/portal/src/app/base/account-settings/account-settings-modal.component.spec.ts @@ -1,23 +1,23 @@ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; import { AccountSettingsModalComponent } from './account-settings-modal.component'; -import { SessionService } from "../../shared/session.service"; -import { MessageHandlerService } from "../../shared/message-handler/message-handler.service"; -import { SearchTriggerService } from "../../base/global-search/search-trigger.service"; +import { SessionService } from "../../shared/services/session.service"; +import { MessageHandlerService } from "../../shared/services/message-handler.service"; +import { SearchTriggerService } from "../../shared/components/global-search/search-trigger.service"; import { AccountSettingsModalService } from './account-settings-modal-service.service'; import { CUSTOM_ELEMENTS_SCHEMA, ChangeDetectorRef } from '@angular/core'; import { ClarityModule } from "@clr/angular"; import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { FormsModule } from '@angular/forms'; -import { InlineAlertComponent } from '../../shared/inline-alert/inline-alert.component'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { of } from 'rxjs'; import { Router } from '@angular/router'; -import { clone } from '../../../lib/utils/utils'; -import { ConfirmationDialogComponent } from '../../shared/confirmation-dialog/confirmation-dialog.component'; -import { ConfirmationDialogService } from '../../shared/confirmation-dialog/confirmation-dialog.service'; -import { ConfirmationMessage } from '../../shared/confirmation-dialog/confirmation-message'; -import { ErrorHandler } from '../../../lib/utils/error-handler'; +import { clone } from '../../shared/units/utils'; +import { ErrorHandler } from '../../shared/units/error-handler'; +import { ConfirmationDialogComponent } from "../../shared/components/confirmation-dialog"; +import { InlineAlertComponent } from "../../shared/components/inline-alert/inline-alert.component"; +import { ConfirmationDialogService } from "../global-confirmation-dialog/confirmation-dialog.service"; +import { ConfirmationMessage } from "../global-confirmation-dialog/confirmation-message"; describe('AccountSettingsModalComponent', () => { let component: AccountSettingsModalComponent; diff --git a/src/portal/src/app/account/account-settings/account-settings-modal.component.ts b/src/portal/src/app/base/account-settings/account-settings-modal.component.ts similarity index 92% rename from src/portal/src/app/account/account-settings/account-settings-modal.component.ts rename to src/portal/src/app/base/account-settings/account-settings-modal.component.ts index 433a4e3f3..bc59983e5 100644 --- a/src/portal/src/app/account/account-settings/account-settings-modal.component.ts +++ b/src/portal/src/app/base/account-settings/account-settings-modal.component.ts @@ -1,4 +1,3 @@ -import { ChangeDetectorRef } from '@angular/core'; // Copyright Project Harbor Authors // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,26 +11,24 @@ import { ChangeDetectorRef } from '@angular/core'; // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. + +import { ChangeDetectorRef } from '@angular/core'; import { Component, OnInit, ViewChild, AfterViewChecked } from "@angular/core"; import { NgForm } from "@angular/forms"; import { Router, NavigationExtras } from "@angular/router"; -import { ConfirmationMessage } from '../../shared/confirmation-dialog/confirmation-message'; - -import { SessionUser } from "../../shared/session-user"; -import { SessionService } from "../../shared/session.service"; -import { InlineAlertComponent } from "../../shared/inline-alert/inline-alert.component"; -import { MessageHandlerService } from "../../shared/message-handler/message-handler.service"; -import { SearchTriggerService } from "../../base/global-search/search-trigger.service"; +import { SessionUser } from "../../shared/entities/session-user"; +import { SessionService } from "../../shared/services/session.service"; +import { MessageHandlerService } from "../../shared/services/message-handler.service"; +import { SearchTriggerService } from "../../shared/components/global-search/search-trigger.service"; import { AccountSettingsModalService } from './account-settings-modal-service.service'; -import { ConfirmationDialogComponent } from "../../shared/confirmation-dialog/confirmation-dialog.component"; -import { - ConfirmationTargets, - ConfirmationButtons -} from "../../shared/shared.const"; -import { randomWord } from '../../shared/shared.utils'; +import { randomWord } from '../../shared/units/shared.utils'; import { ResetSecret } from './account'; -import { CopyInputComponent } from "../../../lib/components/push-image/copy-input.component"; -import { CommonRoutes } from "../../../lib/entities/shared.const"; +import { CopyInputComponent } from "../../shared/components/push-image/copy-input.component"; +import { CommonRoutes, ConfirmationButtons, ConfirmationTargets } from "../../shared/entities/shared.const"; +import { ConfirmationDialogComponent } from "../../shared/components/confirmation-dialog"; +import { InlineAlertComponent } from "../../shared/components/inline-alert/inline-alert.component"; +import { ConfirmationMessage } from "../global-confirmation-dialog/confirmation-message"; + @Component({ selector: "account-settings-modal", templateUrl: "account-settings-modal.component.html", @@ -224,7 +221,7 @@ export class AccountSettingsModalComponent implements OnInit, AfterViewChecked { // Log out system logOut(): void { - // Naviagte to the sign in route + // Naviagte to the sign in router-guard // Appending 'signout' means destroy session cache let navigatorExtra: NavigationExtras = { queryParams: { signout: true } diff --git a/src/portal/src/app/account/account-settings/account.ts b/src/portal/src/app/base/account-settings/account.ts similarity index 100% rename from src/portal/src/app/account/account-settings/account.ts rename to src/portal/src/app/base/account-settings/account.ts diff --git a/src/portal/src/app/base/base.module.ts b/src/portal/src/app/base/base.module.ts index 4f5ffd6be..dfeeb6717 100644 --- a/src/portal/src/app/base/base.module.ts +++ b/src/portal/src/app/base/base.module.ts @@ -13,37 +13,127 @@ // limitations under the License. import { NgModule } from '@angular/core'; import { SharedModule } from '../shared/shared.module'; -import { RouterModule } from '@angular/router'; -import { ProjectModule } from '../project/project.module'; -import { UserModule } from '../user/user.module'; -import { AccountModule } from '../account/account.module'; -import { GroupModule } from '../group/group.module'; -import { NavigatorComponent } from './navigator/navigator.component'; -import { GlobalSearchComponent } from './global-search/global-search.component'; -import { FooterComponent } from './footer/footer.component'; +import { RouterModule, Routes } from '@angular/router'; import { HarborShellComponent } from './harbor-shell/harbor-shell.component'; -import { SearchResultComponent } from './global-search/search-result.component'; - -import { SearchTriggerService } from './global-search/search-trigger.service'; +import { SystemAdminGuard } from "../shared/router-guard/system-admin-activate.service"; +import { MemberGuard } from "../shared/router-guard/member-guard-activate.service"; +import { ProjectRoutingResolver } from "../services/routing-resolvers/project-routing-resolver.service"; +import { PasswordSettingComponent } from "./password-setting/password-setting.component"; +import { AccountSettingsModalComponent } from "./account-settings/account-settings-modal.component"; +import { ForgotPasswordComponent } from "./password-setting/forgot-password/forgot-password.component"; +import { GlobalConfirmationDialogComponent } from "./global-confirmation-dialog/global-confirmation-dialog.component"; +const routes: Routes = [ + { + path: '', + component: HarborShellComponent, + children: [ + { path: '', redirectTo: 'projects', pathMatch: 'full' }, + { + path: 'projects', + loadChildren: () => import('./left-side-nav/projects/projects.module').then(m => m.ProjectsModule) + }, + { + path: 'logs', + loadChildren: () => import('./left-side-nav/log/log.module').then(m => m.LogModule) + }, + { + path: 'users', + canActivate: [SystemAdminGuard], + loadChildren: () => import('./left-side-nav/user/user.module').then(m => m.UserModule) + }, + { + path: 'robot-accounts', + canActivate: [SystemAdminGuard], + loadChildren: () => import('./left-side-nav/system-robot-accounts/system-robot-accounts.module') + .then(m => m.SystemRobotAccountsModule) + }, + { + path: 'groups', + canActivate: [SystemAdminGuard], + loadChildren: () => import('./left-side-nav/group/group.module').then(m => m.GroupModule) + }, + { + path: 'registries', + canActivate: [SystemAdminGuard], + loadChildren: () => import('./left-side-nav/registries/endpoint.module').then(m => m.EndpointModule) + }, + { + path: 'replications', + canActivate: [SystemAdminGuard], + loadChildren: () => import('./left-side-nav/replication/replication.module').then(m => m.ReplicationModule) + }, + { + path: 'distribution', + canActivate: [SystemAdminGuard], + loadChildren: () => import('./left-side-nav/distribution/distribution.module').then(m => m.DistributionModule) + }, + { + path: 'interrogation-services', + canActivate: [SystemAdminGuard], + loadChildren: () => + import('./left-side-nav/interrogation-services/interrogation-services.module') + .then(m => m.InterrogationServicesModule) + }, + { + path: 'labels', + canActivate: [SystemAdminGuard], + loadChildren: () => import('./left-side-nav/labels/labels.module').then(m => m.LabelsModule) + }, + { + path: 'project-quotas', + canActivate: [SystemAdminGuard], + loadChildren: () => import('./left-side-nav/project-quotas/project-quotas.module').then(m => m.ProjectQuotasModule) + }, + { + path: 'gc', + canActivate: [SystemAdminGuard], + loadChildren: () => import('./left-side-nav/gc-page/gc.module').then(m => m.GcModule) + }, + { + path: 'configs', + canActivate: [SystemAdminGuard], + loadChildren: () => import('./left-side-nav/config/config.module').then(m => m.ConfigurationModule) + }, + { + path: 'projects/:id', + loadChildren: () => import('./project/project.module').then(m => m.ProjectModule), + canActivate: [MemberGuard], + resolve: { + projectResolver: ProjectRoutingResolver + } + }, + { + path: 'projects/:id/repositories', + loadChildren: () => import('./project/repository/artifact/artifact.module').then(m => m.ArtifactModule), + canActivate: [MemberGuard], + resolve: { + projectResolver: ProjectRoutingResolver + } + }, + { + path: 'projects/:id/helm-charts', + canActivate: [MemberGuard], + resolve: { + projectResolver: ProjectRoutingResolver + }, + loadChildren: () => import('./project/helm-chart/helm-chart-detail/helm-chart-detail.module').then(m => m.HelmChartListModule), + }, + ] + } +]; @NgModule({ imports: [ SharedModule, - ProjectModule, - UserModule, - AccountModule, - RouterModule, - GroupModule + RouterModule.forChild(routes), ], declarations: [ - NavigatorComponent, - GlobalSearchComponent, - FooterComponent, HarborShellComponent, - SearchResultComponent, - ], - exports: [ HarborShellComponent, NavigatorComponent, SearchResultComponent ], - providers: [SearchTriggerService] + PasswordSettingComponent, + AccountSettingsModalComponent, + ForgotPasswordComponent, + GlobalConfirmationDialogComponent + ] }) export class BaseModule { diff --git a/src/portal/src/app/base/footer/footer.component.html b/src/portal/src/app/base/footer/footer.component.html deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/portal/src/app/base/footer/footer.component.spec.ts b/src/portal/src/app/base/footer/footer.component.spec.ts deleted file mode 100644 index 30acbc4f6..000000000 --- a/src/portal/src/app/base/footer/footer.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { FooterComponent } from './footer.component'; - -describe('FooterComponent', () => { - let component: FooterComponent; - let fixture: ComponentFixture; - - beforeEach(waitForAsync(() => { - TestBed.configureTestingModule({ - declarations: [FooterComponent] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(FooterComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/portal/src/lib/components/confirmation-dialog/confirmation-batch-message.ts b/src/portal/src/app/base/global-confirmation-dialog/confirmation-batch-message.ts similarity index 100% rename from src/portal/src/lib/components/confirmation-dialog/confirmation-batch-message.ts rename to src/portal/src/app/base/global-confirmation-dialog/confirmation-batch-message.ts diff --git a/src/portal/src/app/shared/confirmation-dialog/confirmation-dialog.service.spec.ts b/src/portal/src/app/base/global-confirmation-dialog/confirmation-dialog.service.spec.ts similarity index 100% rename from src/portal/src/app/shared/confirmation-dialog/confirmation-dialog.service.spec.ts rename to src/portal/src/app/base/global-confirmation-dialog/confirmation-dialog.service.spec.ts diff --git a/src/portal/src/app/shared/confirmation-dialog/confirmation-dialog.service.ts b/src/portal/src/app/base/global-confirmation-dialog/confirmation-dialog.service.ts similarity index 97% rename from src/portal/src/app/shared/confirmation-dialog/confirmation-dialog.service.ts rename to src/portal/src/app/base/global-confirmation-dialog/confirmation-dialog.service.ts index d1d5f6b85..187e0bc03 100644 --- a/src/portal/src/app/shared/confirmation-dialog/confirmation-dialog.service.ts +++ b/src/portal/src/app/base/global-confirmation-dialog/confirmation-dialog.service.ts @@ -17,7 +17,9 @@ import { Subject } from "rxjs"; import { ConfirmationMessage } from './confirmation-message'; import { ConfirmationAcknowledgement } from './confirmation-state-message'; -@Injectable() +@Injectable({ + providedIn: 'root', +}) export class ConfirmationDialogService { confirmationAnnoucedSource = new Subject(); confirmationConfirmSource = new Subject(); diff --git a/src/portal/src/lib/components/confirmation-dialog/confirmation-message.ts b/src/portal/src/app/base/global-confirmation-dialog/confirmation-message.ts similarity index 96% rename from src/portal/src/lib/components/confirmation-dialog/confirmation-message.ts rename to src/portal/src/app/base/global-confirmation-dialog/confirmation-message.ts index 501cc6ec5..bed0718ef 100644 --- a/src/portal/src/lib/components/confirmation-dialog/confirmation-message.ts +++ b/src/portal/src/app/base/global-confirmation-dialog/confirmation-message.ts @@ -14,7 +14,7 @@ import { ConfirmationTargets, ConfirmationButtons -} from "../../entities/shared.const"; +} from "../../shared/entities/shared.const"; export class ConfirmationMessage { public constructor( diff --git a/src/portal/src/app/shared/confirmation-dialog/confirmation-state-message.ts b/src/portal/src/app/base/global-confirmation-dialog/confirmation-state-message.ts similarity index 91% rename from src/portal/src/app/shared/confirmation-dialog/confirmation-state-message.ts rename to src/portal/src/app/base/global-confirmation-dialog/confirmation-state-message.ts index 275ce396e..ac2767d62 100644 --- a/src/portal/src/app/shared/confirmation-dialog/confirmation-state-message.ts +++ b/src/portal/src/app/base/global-confirmation-dialog/confirmation-state-message.ts @@ -11,7 +11,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -import { ConfirmationState, ConfirmationTargets } from '../shared.const'; +import { ConfirmationState, ConfirmationTargets } from '../../shared/entities/shared.const'; export class ConfirmationAcknowledgement { constructor(state: ConfirmationState, data: any, source: ConfirmationTargets) { diff --git a/src/portal/src/app/shared/confirmation-dialog/confirmation-dialog.component.html b/src/portal/src/app/base/global-confirmation-dialog/global-confirmation-dialog.component.html similarity index 100% rename from src/portal/src/app/shared/confirmation-dialog/confirmation-dialog.component.html rename to src/portal/src/app/base/global-confirmation-dialog/global-confirmation-dialog.component.html diff --git a/src/portal/src/app/shared/confirmation-dialog/confirmation-dialog.component.scss b/src/portal/src/app/base/global-confirmation-dialog/global-confirmation-dialog.component.scss similarity index 100% rename from src/portal/src/app/shared/confirmation-dialog/confirmation-dialog.component.scss rename to src/portal/src/app/base/global-confirmation-dialog/global-confirmation-dialog.component.scss diff --git a/src/portal/src/app/shared/confirmation-dialog/confirmation-dialog.component.spec.ts b/src/portal/src/app/base/global-confirmation-dialog/global-confirmation-dialog.component.spec.ts similarity index 80% rename from src/portal/src/app/shared/confirmation-dialog/confirmation-dialog.component.spec.ts rename to src/portal/src/app/base/global-confirmation-dialog/global-confirmation-dialog.component.spec.ts index fa34f3f7d..b42e5ea26 100644 --- a/src/portal/src/app/shared/confirmation-dialog/confirmation-dialog.component.spec.ts +++ b/src/portal/src/app/base/global-confirmation-dialog/global-confirmation-dialog.component.spec.ts @@ -1,6 +1,5 @@ -import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { ConfirmationDialogComponent } from './confirmation-dialog.component'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { BrowserAnimationsModule, NoopAnimationsModule } from '@angular/platform-browser/animations'; import { ClarityModule } from '@clr/angular'; @@ -9,10 +8,11 @@ import { RouterTestingModule } from '@angular/router/testing'; import { of } from 'rxjs'; import { HttpClientTestingModule } from '@angular/common/http/testing'; import { ConfirmationDialogService } from './confirmation-dialog.service'; +import { GlobalConfirmationDialogComponent } from "./global-confirmation-dialog.component"; describe('ConfirmationDialogComponent', () => { - let component: ConfirmationDialogComponent; - let fixture: ComponentFixture; + let component: GlobalConfirmationDialogComponent; + let fixture: ComponentFixture; const mockConfirmationDialogService = { confirmationAnnouced$: of({ title: "title", @@ -36,7 +36,7 @@ describe('ConfirmationDialogComponent', () => { NoopAnimationsModule, HttpClientTestingModule ], - declarations: [ConfirmationDialogComponent], + declarations: [GlobalConfirmationDialogComponent], providers: [ TranslateService, { provide: ConfirmationDialogService, useValue: mockConfirmationDialogService }, @@ -46,7 +46,7 @@ describe('ConfirmationDialogComponent', () => { })); beforeEach(() => { - fixture = TestBed.createComponent(ConfirmationDialogComponent); + fixture = TestBed.createComponent(GlobalConfirmationDialogComponent); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/src/portal/src/app/shared/confirmation-dialog/confirmation-dialog.component.ts b/src/portal/src/app/base/global-confirmation-dialog/global-confirmation-dialog.component.ts similarity index 87% rename from src/portal/src/app/shared/confirmation-dialog/confirmation-dialog.component.ts rename to src/portal/src/app/base/global-confirmation-dialog/global-confirmation-dialog.component.ts index ecb1c7540..b8b43e1fd 100644 --- a/src/portal/src/app/shared/confirmation-dialog/confirmation-dialog.component.ts +++ b/src/portal/src/app/base/global-confirmation-dialog/global-confirmation-dialog.component.ts @@ -14,19 +14,19 @@ import { Component, OnDestroy } from '@angular/core'; import { Subscription } from "rxjs"; import { TranslateService } from '@ngx-translate/core'; - -import { ConfirmationDialogService } from './confirmation-dialog.service'; import { ConfirmationMessage } from './confirmation-message'; -import { ConfirmationAcknowledgement } from './confirmation-state-message'; -import { ConfirmationState, ConfirmationTargets, ConfirmationButtons } from '../shared.const'; +import { ConfirmationButtons, ConfirmationState, ConfirmationTargets } from "../../shared/entities/shared.const"; +import { ConfirmationDialogService } from "./confirmation-dialog.service"; +import { ConfirmationAcknowledgement } from "./confirmation-state-message"; + @Component({ - selector: 'confiramtion-dialog', - templateUrl: 'confirmation-dialog.component.html', - styleUrls: ['confirmation-dialog.component.scss'] + selector: 'global-confirmation-dialog', + templateUrl: 'global-confirmation-dialog.component.html', + styleUrls: ['global-confirmation-dialog.component.scss'] }) -export class ConfirmationDialogComponent implements OnDestroy { +export class GlobalConfirmationDialogComponent implements OnDestroy { opened: boolean = false; dialogTitle: string = ""; dialogContent: string = ""; diff --git a/src/portal/src/app/base/harbor-shell/harbor-shell.component.html b/src/portal/src/app/base/harbor-shell/harbor-shell.component.html index ab320db0d..233d71c1f 100644 --- a/src/portal/src/app/base/harbor-shell/harbor-shell.component.html +++ b/src/portal/src/app/base/harbor-shell/harbor-shell.component.html @@ -111,5 +111,5 @@ - + diff --git a/src/portal/src/app/base/harbor-shell/harbor-shell.component.spec.ts b/src/portal/src/app/base/harbor-shell/harbor-shell.component.spec.ts index f1d61f3af..0ffc74411 100644 --- a/src/portal/src/app/base/harbor-shell/harbor-shell.component.spec.ts +++ b/src/portal/src/app/base/harbor-shell/harbor-shell.component.spec.ts @@ -1,26 +1,26 @@ import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { SessionService } from '../../shared/session.service'; +import { SessionService } from '../../shared/services/session.service'; import { CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA } from '@angular/core'; import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { SearchTriggerService } from '../global-search/search-trigger.service'; +import { SearchTriggerService } from '../../shared/components/global-search/search-trigger.service'; import { HarborShellComponent } from './harbor-shell.component'; import { ClarityModule } from "@clr/angular"; import { of } from 'rxjs'; -import { ConfigScannerService } from "../../config/scanner/config-scanner.service"; +import { ConfigScannerService } from "../left-side-nav/interrogation-services/scanner/config-scanner.service"; import { modalEvents } from '../modal-events.const'; -import { AccountSettingsModalComponent } from '../../account/account-settings/account-settings-modal.component'; -import { PasswordSettingComponent } from '../../account/password-setting/password-setting.component'; -import { AboutDialogComponent } from '../../shared/about-dialog/about-dialog.component'; +import { PasswordSettingComponent } from '../password-setting/password-setting.component'; +import { AboutDialogComponent } from '../../shared/components/about-dialog/about-dialog.component'; import { FormsModule } from '@angular/forms'; -import { MessageHandlerService } from '../../shared/message-handler/message-handler.service'; -import { AccountSettingsModalService } from '../../account/account-settings/account-settings-modal-service.service'; -import { PasswordSettingService } from '../../account/password-setting/password-setting.service'; +import { MessageHandlerService } from '../../shared/services/message-handler.service'; +import { PasswordSettingService } from '../password-setting/password-setting.service'; import { SkinableConfig } from '../../services/skinable-config.service'; -import { InlineAlertComponent } from '../../shared/inline-alert/inline-alert.component'; import { AppConfigService } from "../../services/app-config.service"; -import { ErrorHandler } from '../../../lib/utils/error-handler'; +import { ErrorHandler } from '../../shared/units/error-handler'; +import { AccountSettingsModalComponent } from "../account-settings/account-settings-modal.component"; +import { InlineAlertComponent } from "../../shared/components/inline-alert/inline-alert.component"; +import { AccountSettingsModalService } from "../account-settings/account-settings-modal-service.service"; describe('HarborShellComponent', () => { let component: HarborShellComponent; diff --git a/src/portal/src/app/base/harbor-shell/harbor-shell.component.ts b/src/portal/src/app/base/harbor-shell/harbor-shell.component.ts index 6a8ee6fe5..0c135fa44 100644 --- a/src/portal/src/app/base/harbor-shell/harbor-shell.component.ts +++ b/src/portal/src/app/base/harbor-shell/harbor-shell.component.ts @@ -15,21 +15,19 @@ import { Component, OnInit, ViewChild, OnDestroy } from '@angular/core'; import { Router, ActivatedRoute } from '@angular/router'; import { Subscription } from "rxjs"; import { AppConfigService } from '../../services/app-config.service'; - import { ModalEvent } from '../modal-event'; import { modalEvents } from '../modal-events.const'; - -import { AccountSettingsModalComponent } from '../../account/account-settings/account-settings-modal.component'; -import { PasswordSettingComponent } from '../../account/password-setting/password-setting.component'; -import { NavigatorComponent } from '../navigator/navigator.component'; -import { SessionService } from '../../shared/session.service'; -import { AboutDialogComponent } from '../../shared/about-dialog/about-dialog.component'; -import { SearchTriggerService } from '../global-search/search-trigger.service'; -import { CommonRoutes } from "../../../lib/entities/shared.const"; -import { ConfigScannerService, SCANNERS_DOC } from "../../config/scanner/config-scanner.service"; +import { PasswordSettingComponent } from '../password-setting/password-setting.component'; +import { NavigatorComponent } from '../../shared/components/navigator/navigator.component'; +import { SessionService } from '../../shared/services/session.service'; +import { AboutDialogComponent } from '../../shared/components/about-dialog/about-dialog.component'; +import { SearchTriggerService } from '../../shared/components/global-search/search-trigger.service'; +import { CommonRoutes } from "../../shared/entities/shared.const"; +import { ConfigScannerService, SCANNERS_DOC } from "../left-side-nav/interrogation-services/scanner/config-scanner.service"; import { THEME_ARRAY, ThemeInterface } from "../../services/theme"; -import { clone } from "../../../lib/utils/utils"; +import { clone } from "../../shared/units/utils"; import { ThemeService } from "../../services/theme.service"; +import { AccountSettingsModalComponent } from "../account-settings/account-settings-modal.component"; const HAS_SHOWED_SCANNER_INFO: string = 'hasShowScannerInfo'; const YES: string = 'yes'; diff --git a/src/portal/src/app/config/auth/config-auth.component.html b/src/portal/src/app/base/left-side-nav/config/auth/config-auth.component.html similarity index 100% rename from src/portal/src/app/config/auth/config-auth.component.html rename to src/portal/src/app/base/left-side-nav/config/auth/config-auth.component.html diff --git a/src/portal/src/app/config/auth/config-auth.component.scss b/src/portal/src/app/base/left-side-nav/config/auth/config-auth.component.scss similarity index 100% rename from src/portal/src/app/config/auth/config-auth.component.scss rename to src/portal/src/app/base/left-side-nav/config/auth/config-auth.component.scss diff --git a/src/portal/src/app/config/auth/config-auth.component.spec.ts b/src/portal/src/app/base/left-side-nav/config/auth/config-auth.component.spec.ts similarity index 87% rename from src/portal/src/app/config/auth/config-auth.component.spec.ts rename to src/portal/src/app/base/left-side-nav/config/auth/config-auth.component.spec.ts index 8c993916c..715979873 100644 --- a/src/portal/src/app/config/auth/config-auth.component.spec.ts +++ b/src/portal/src/app/base/left-side-nav/config/auth/config-auth.component.spec.ts @@ -1,17 +1,17 @@ import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; -import { MessageHandlerService } from '../../shared/message-handler/message-handler.service'; +import { MessageHandlerService } from '../../../../shared/services/message-handler.service'; import { ConfirmMessageHandler } from '../config.msg.utils'; -import { AppConfigService } from '../../services/app-config.service'; -import { ConfigurationService } from '../config.service'; +import { AppConfigService } from '../../../../services/app-config.service'; +import { ConfigurationService } from '../../../../services/config.service'; import { ConfigurationAuthComponent } from './config-auth.component'; import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { CUSTOM_ELEMENTS_SCHEMA, SimpleChange } from '@angular/core'; +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { of } from 'rxjs'; -import { ErrorHandler } from "../../../lib/utils/error-handler"; -import { SystemInfoService } from "../../../lib/services"; -import { clone } from '../../../lib/utils/utils'; -import { CONFIG_AUTH_MODE } from '../../../lib/entities/shared.const'; +import { ErrorHandler } from "../../../../shared/units/error-handler"; +import { SystemInfoService } from "../../../../shared/services"; +import { clone } from '../../../../shared/units/utils'; +import { CONFIG_AUTH_MODE } from '../../../../shared/entities/shared.const'; describe('ConfigurationAuthComponent', () => { let component: ConfigurationAuthComponent; diff --git a/src/portal/src/app/config/auth/config-auth.component.ts b/src/portal/src/app/base/left-side-nav/config/auth/config-auth.component.ts similarity index 92% rename from src/portal/src/app/config/auth/config-auth.component.ts rename to src/portal/src/app/base/left-side-nav/config/auth/config-auth.component.ts index b28ae023b..00d14e5d3 100644 --- a/src/portal/src/app/config/auth/config-auth.component.ts +++ b/src/portal/src/app/base/left-side-nav/config/auth/config-auth.component.ts @@ -14,17 +14,16 @@ import { Component, Input, ViewChild, SimpleChanges, OnChanges, OnInit, Output, EventEmitter } from '@angular/core'; import { NgForm } from '@angular/forms'; import { Subscription } from "rxjs"; -import { MessageHandlerService } from '../../shared/message-handler/message-handler.service'; +import { MessageHandlerService } from '../../../../shared/services/message-handler.service'; import { ConfirmMessageHandler } from '../config.msg.utils'; -import { AppConfigService } from '../../services/app-config.service'; -import { ConfigurationService } from '../config.service'; -import { Configuration } from "../../../lib/components/config/config"; -import { ErrorHandler } from "../../../lib/utils/error-handler"; -import { errorHandler as errorHandlerFn } from "../../../lib/utils/shared/shared.utils"; - -import { SystemInfoService } from "../../../lib/services"; -import { clone, isEmpty, getChanges as getChangesFunc } from "../../../lib/utils/utils"; -import { CONFIG_AUTH_MODE } from "../../../lib/entities/shared.const"; +import { AppConfigService } from '../../../../services/app-config.service'; +import { ConfigurationService } from '../../../../services/config.service'; +import { ErrorHandler } from "../../../../shared/units/error-handler"; +import { SystemInfoService } from "../../../../shared/services"; +import { clone, isEmpty, getChanges as getChangesFunc } from "../../../../shared/units/utils"; +import { CONFIG_AUTH_MODE } from "../../../../shared/entities/shared.const"; +import { errorHandler } from "../../../../shared/units/shared.utils"; +import { Configuration } from "../config"; const fakePass = 'aWpLOSYkIzJTTU4wMDkx'; @Component({ @@ -49,7 +48,7 @@ export class ConfigurationAuthComponent implements OnChanges, OnInit { private appConfigService: AppConfigService, private confirmMessageHandler: ConfirmMessageHandler, private systemInfo: SystemInfoService, - private errorHandler: ErrorHandler, + private errorHandlerEntity: ErrorHandler, ) { } ngOnInit() { @@ -58,7 +57,7 @@ export class ConfigurationAuthComponent implements OnChanges, OnInit { getSystemInfo(): void { this.systemInfo.getSystemInfo() .subscribe(systemInfo => (this.redirectUrl = systemInfo.external_url) - , error => this.errorHandler.error(error)); + , error => this.errorHandlerEntity.error(error)); } get checkable() { return this.currentConfig && @@ -144,7 +143,7 @@ export class ConfigurationAuthComponent implements OnChanges, OnInit { this.msgHandler.showSuccess('CONFIG.TEST_LDAP_SUCCESS'); }, error => { this.testingOnGoing = false; - let err = errorHandlerFn(error); + let err = errorHandler(error); if (!err || !err.trim()) { err = 'UNKNOWN'; } @@ -165,10 +164,9 @@ export class ConfigurationAuthComponent implements OnChanges, OnInit { this.msgHandler.showSuccess('CONFIG.TEST_OIDC_SUCCESS'); }, error => { this.testingOnGoing = false; - this.errorHandler.error(error); + this.errorHandlerEntity.error(error); }); } - } public get showTestingServerBtn(): boolean { diff --git a/src/portal/src/app/config/config.component.html b/src/portal/src/app/base/left-side-nav/config/config.component.html similarity index 100% rename from src/portal/src/app/config/config.component.html rename to src/portal/src/app/base/left-side-nav/config/config.component.html diff --git a/src/portal/src/app/config/config.component.scss b/src/portal/src/app/base/left-side-nav/config/config.component.scss similarity index 100% rename from src/portal/src/app/config/config.component.scss rename to src/portal/src/app/base/left-side-nav/config/config.component.scss diff --git a/src/portal/src/app/config/config.component.spec.ts b/src/portal/src/app/base/left-side-nav/config/config.component.spec.ts similarity index 84% rename from src/portal/src/app/config/config.component.spec.ts rename to src/portal/src/app/base/left-side-nav/config/config.component.spec.ts index e92e6606f..4cdac61ae 100644 --- a/src/portal/src/app/config/config.component.spec.ts +++ b/src/portal/src/app/base/left-side-nav/config/config.component.spec.ts @@ -1,17 +1,17 @@ import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; -import { SessionService } from '../shared/session.service'; -import { ConfirmationDialogService } from '../shared/confirmation-dialog/confirmation-dialog.service'; -import { MessageHandlerService } from '../shared/message-handler/message-handler.service'; +import { SessionService } from '../../../shared/services/session.service'; +import { MessageHandlerService } from '../../../shared/services/message-handler.service'; import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { ClarityModule } from "@clr/angular"; -import { AppConfigService } from '../services/app-config.service'; -import { ConfigurationService } from './config.service'; +import { AppConfigService } from '../../../services/app-config.service'; +import { ConfigurationService } from '../../../services/config.service'; import { ConfigurationComponent } from './config.component'; import { of } from 'rxjs'; -import { ConfirmationAcknowledgement } from '../shared/confirmation-dialog/confirmation-state-message'; -import { ConfirmationState, ConfirmationTargets } from '../shared/shared.const'; -import { Configuration } from '../../lib/components/config/config'; +import { Configuration } from './config'; +import { ConfirmationState, ConfirmationTargets } from "../../../shared/entities/shared.const"; +import { ConfirmationDialogService } from "../../global-confirmation-dialog/confirmation-dialog.service"; +import { ConfirmationAcknowledgement } from "../../global-confirmation-dialog/confirmation-state-message"; describe('ConfigurationComponent', () => { let component: ConfigurationComponent; diff --git a/src/portal/src/app/config/config.component.ts b/src/portal/src/app/base/left-side-nav/config/config.component.ts similarity index 88% rename from src/portal/src/app/config/config.component.ts rename to src/portal/src/app/base/left-side-nav/config/config.component.ts index 284d696e5..0e0e25322 100644 --- a/src/portal/src/app/config/config.component.ts +++ b/src/portal/src/app/base/left-side-nav/config/config.component.ts @@ -13,17 +13,17 @@ // limitations under the License. import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core'; import { Subscription } from "rxjs"; -import { ConfirmationTargets, ConfirmationState } from '../shared/shared.const'; -import { SessionService } from '../shared/session.service'; -import { ConfirmationDialogService } from '../shared/confirmation-dialog/confirmation-dialog.service'; -import { MessageHandlerService } from '../shared/message-handler/message-handler.service'; -import { AppConfigService } from '../services/app-config.service'; +import { SessionService } from '../../../shared/services/session.service'; +import { MessageHandlerService } from '../../../shared/services/message-handler.service'; +import { AppConfigService } from '../../../services/app-config.service'; import { ConfigurationAuthComponent } from './auth/config-auth.component'; import { ConfigurationEmailComponent } from './email/config-email.component'; -import { ConfigurationService } from './config.service'; -import { Configuration, StringValueItem } from "../../lib/components/config/config"; -import { SystemSettingsComponent } from "../../lib/components/config/system/system-settings.component"; -import { clone, isEmpty } from "../../lib/utils/utils"; +import { ConfigurationService } from '../../../services/config.service'; +import { Configuration, StringValueItem } from "./config"; +import { SystemSettingsComponent } from "./system/system-settings.component"; +import { clone, isEmpty } from "../../../shared/units/utils"; +import { ConfirmationDialogService } from "../../global-confirmation-dialog/confirmation-dialog.service"; +import { ConfirmationState, ConfirmationTargets } from "../../../shared/entities/shared.const"; const fakePass = 'aWpLOSYkIzJTTU4wMDkx'; const TabLinkContentMap = { diff --git a/src/portal/src/app/config/config.module.ts b/src/portal/src/app/base/left-side-nav/config/config.module.ts similarity index 56% rename from src/portal/src/app/config/config.module.ts rename to src/portal/src/app/base/left-side-nav/config/config.module.ts index 1934c4fd7..d1f80dad2 100644 --- a/src/portal/src/app/config/config.module.ts +++ b/src/portal/src/app/base/left-side-nav/config/config.module.ts @@ -13,37 +13,33 @@ // limitations under the License. import { NgModule } from "@angular/core"; -import { CoreModule } from "../core/core.module"; -import { SharedModule } from "../shared/shared.module"; - +import { SharedModule } from "../../../shared/shared.module"; import { ConfigurationComponent } from "./config.component"; -import { ConfigurationService } from "./config.service"; import { ConfirmMessageHandler } from "./config.msg.utils"; import { ConfigurationAuthComponent } from "./auth/config-auth.component"; import { ConfigurationEmailComponent } from "./email/config-email.component"; -import { ConfigurationScannerComponent } from "./scanner/config-scanner.component"; -import { NewScannerModalComponent } from "./scanner/new-scanner-modal/new-scanner-modal.component"; -import { NewScannerFormComponent } from "./scanner/new-scanner-form/new-scanner-form.component"; -import { ConfigScannerService } from "./scanner/config-scanner.service"; -import { ScannerMetadataComponent } from "./scanner/scanner-metadata/scanner-metadata.component"; - +import { SystemSettingsComponent } from "./system/system-settings.component"; +import { RouterModule, Routes } from "@angular/router"; +const routes: Routes = [ + { + path: '', + component: ConfigurationComponent + } +]; @NgModule({ - imports: [CoreModule, SharedModule], + imports: [ + SharedModule, + RouterModule.forChild(routes) + ], declarations: [ ConfigurationComponent, ConfigurationAuthComponent, ConfigurationEmailComponent, - ConfigurationScannerComponent, - NewScannerModalComponent, - NewScannerFormComponent, - ScannerMetadataComponent + SystemSettingsComponent ], - exports: [ConfigurationComponent], providers: [ - ConfigurationService, ConfirmMessageHandler, - ConfigScannerService, ] }) export class ConfigurationModule { diff --git a/src/portal/src/app/config/config.msg.utils.ts b/src/portal/src/app/base/left-side-nav/config/config.msg.utils.ts similarity index 63% rename from src/portal/src/app/config/config.msg.utils.ts rename to src/portal/src/app/base/left-side-nav/config/config.msg.utils.ts index 58e555388..6a6a87240 100644 --- a/src/portal/src/app/config/config.msg.utils.ts +++ b/src/portal/src/app/base/left-side-nav/config/config.msg.utils.ts @@ -1,7 +1,7 @@ -import { ConfirmationDialogService } from '../shared/confirmation-dialog/confirmation-dialog.service'; -import { ConfirmationMessage } from '../shared/confirmation-dialog/confirmation-message'; -import { ConfirmationTargets } from '../shared/shared.const'; import { Injectable } from '@angular/core'; +import { ConfirmationDialogService } from "../../global-confirmation-dialog/confirmation-dialog.service"; +import { ConfirmationTargets } from "../../../shared/entities/shared.const"; +import { ConfirmationMessage } from "../../global-confirmation-dialog/confirmation-message"; @Injectable() export class ConfirmMessageHandler { diff --git a/src/portal/src/lib/components/config/config.ts b/src/portal/src/app/base/left-side-nav/config/config.ts similarity index 100% rename from src/portal/src/lib/components/config/config.ts rename to src/portal/src/app/base/left-side-nav/config/config.ts diff --git a/src/portal/src/app/config/email/config-email.component.html b/src/portal/src/app/base/left-side-nav/config/email/config-email.component.html similarity index 100% rename from src/portal/src/app/config/email/config-email.component.html rename to src/portal/src/app/base/left-side-nav/config/email/config-email.component.html diff --git a/src/portal/src/app/config/email/config-email.component.scss b/src/portal/src/app/base/left-side-nav/config/email/config-email.component.scss similarity index 100% rename from src/portal/src/app/config/email/config-email.component.scss rename to src/portal/src/app/base/left-side-nav/config/email/config-email.component.scss diff --git a/src/portal/src/app/config/email/config-email.component.spec.ts b/src/portal/src/app/base/left-side-nav/config/email/config-email.component.spec.ts similarity index 92% rename from src/portal/src/app/config/email/config-email.component.spec.ts rename to src/portal/src/app/base/left-side-nav/config/email/config-email.component.spec.ts index 66d831773..e7da3538d 100644 --- a/src/portal/src/app/config/email/config-email.component.spec.ts +++ b/src/portal/src/app/base/left-side-nav/config/email/config-email.component.spec.ts @@ -1,12 +1,12 @@ import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; -import { MessageHandlerService } from '../../shared/message-handler/message-handler.service'; +import { MessageHandlerService } from '../../../../shared/services/message-handler.service'; import { ConfirmMessageHandler } from '../config.msg.utils'; -import { ConfigurationService } from '../config.service'; +import { ConfigurationService } from '../../../../services/config.service'; import { ConfigurationEmailComponent } from './config-email.component'; import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { FormsModule } from '@angular/forms'; -import { clone } from '../../../lib/utils/utils'; +import { clone } from '../../../../shared/units/utils'; import { of } from 'rxjs'; describe('ConfigurationEmailComponent', () => { diff --git a/src/portal/src/app/config/email/config-email.component.ts b/src/portal/src/app/base/left-side-nav/config/email/config-email.component.ts similarity index 93% rename from src/portal/src/app/config/email/config-email.component.ts rename to src/portal/src/app/base/left-side-nav/config/email/config-email.component.ts index 170b8db3a..c180cbfda 100644 --- a/src/portal/src/app/config/email/config-email.component.ts +++ b/src/portal/src/app/base/left-side-nav/config/email/config-email.component.ts @@ -13,13 +13,13 @@ // limitations under the License. import { Component, Input, ViewChild, SimpleChanges, OnChanges, Output, EventEmitter } from '@angular/core'; import { NgForm } from '@angular/forms'; -import { MessageHandlerService } from '../../shared/message-handler/message-handler.service'; +import { MessageHandlerService } from '../../../../shared/services/message-handler.service'; import { ConfirmMessageHandler } from '../config.msg.utils'; -import { ConfigurationService } from '../config.service'; -import { Configuration } from "../../../lib/components/config/config"; -import { isEmpty, getChanges as getChangesFunc, clone } from "../../../lib/utils/utils"; -import { errorHandler } from "../../../lib/utils/shared/shared.utils"; -const fakePass = 'aWpLOSYkIzJTTU4wMDkx'; +import { ConfigurationService } from '../../../../services/config.service'; +import { Configuration } from "../config"; +import { isEmpty, getChanges as getChangesFunc, clone } from "../../../../shared/units/utils"; +import { errorHandler } from "../../../../shared/units/shared.utils"; + @Component({ selector: 'config-email', templateUrl: "config-email.component.html", diff --git a/src/portal/src/lib/components/config/system/system-settings.component.html b/src/portal/src/app/base/left-side-nav/config/system/system-settings.component.html similarity index 100% rename from src/portal/src/lib/components/config/system/system-settings.component.html rename to src/portal/src/app/base/left-side-nav/config/system/system-settings.component.html diff --git a/src/portal/src/lib/components/config/system/system-settings.component.scss b/src/portal/src/app/base/left-side-nav/config/system/system-settings.component.scss similarity index 83% rename from src/portal/src/lib/components/config/system/system-settings.component.scss rename to src/portal/src/app/base/left-side-nav/config/system/system-settings.component.scss index d9bafdb5e..7338f1c77 100644 --- a/src/portal/src/lib/components/config/system/system-settings.component.scss +++ b/src/portal/src/app/base/left-side-nav/config/system/system-settings.component.scss @@ -112,3 +112,27 @@ transform: translateY(-50%); } } +.info-tips-icon { + color: grey; +} + +.info-tips-icon:hover { + color: #007CBB; +} + +.replication-config { + margin-top: 0; + margin-bottom: 0; +} + +.replication-text { + font-size: 14px; + font-weight: 600; +} + +.replication-tooltip { + top: -8px; +} +.margin-top-3px { + margin-top: 3px; +} diff --git a/src/portal/src/lib/components/config/system/system-settings.component.spec.ts b/src/portal/src/app/base/left-side-nav/config/system/system-settings.component.spec.ts similarity index 81% rename from src/portal/src/lib/components/config/system/system-settings.component.spec.ts rename to src/portal/src/app/base/left-side-nav/config/system/system-settings.component.spec.ts index 2bfee9bc8..2cd8931da 100644 --- a/src/portal/src/lib/components/config/system/system-settings.component.spec.ts +++ b/src/portal/src/app/base/left-side-nav/config/system/system-settings.component.spec.ts @@ -1,19 +1,14 @@ import { ComponentFixture, ComponentFixtureAutoDetect, TestBed } from '@angular/core/testing'; -import { HarborLibraryModule } from "../../../harbor-library.module"; -import { IServiceConfig, SERVICE_CONFIG } from "../../../entities/service.config"; import { SystemSettingsComponent } from "./system-settings.component"; -import { ConfigurationService, SystemInfoService } from "../../../services"; -import { ErrorHandler } from "../../../utils/error-handler"; +import { SystemInfoService } from "../../../../shared/services"; +import { ErrorHandler } from "../../../../shared/units/error-handler"; import { of } from "rxjs"; import { StringValueItem } from "../config"; import { BrowserAnimationsModule } from "@angular/platform-browser/animations"; -import { CURRENT_BASE_HREF } from "../../../utils/utils"; +import { SharedTestingModule } from "../../../../shared/shared.module"; describe('SystemSettingsComponent', () => { let component: SystemSettingsComponent; let fixture: ComponentFixture; - const config: IServiceConfig = { - baseEndpoint: CURRENT_BASE_HREF + "/testing" - }; const mockedAllowlist = { id: 1, project_id: 1, @@ -41,17 +36,18 @@ describe('SystemSettingsComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ imports: [ - HarborLibraryModule, + SharedTestingModule, BrowserAnimationsModule ], providers: [ - ConfigurationService, { provide: ErrorHandler, useValue: fakedErrorHandler }, { provide: SystemInfoService, useValue: fakedSystemInfoService }, - { provide: SERVICE_CONFIG, useValue: config }, // open auto detect { provide: ComponentFixtureAutoDetect, useValue: true } - ] + ], + declarations: [ + SystemSettingsComponent + ] }); }); beforeEach(() => { diff --git a/src/portal/src/lib/components/config/system/system-settings.component.ts b/src/portal/src/app/base/left-side-nav/config/system/system-settings.component.ts similarity index 91% rename from src/portal/src/lib/components/config/system/system-settings.component.ts rename to src/portal/src/app/base/left-side-nav/config/system/system-settings.component.ts index 1b8163d30..f8ad46e5f 100644 --- a/src/portal/src/lib/components/config/system/system-settings.component.ts +++ b/src/portal/src/app/base/left-side-nav/config/system/system-settings.component.ts @@ -5,24 +5,22 @@ import { Output, EventEmitter, ViewChild, - Inject, OnChanges, SimpleChanges, ElementRef } from '@angular/core'; import {NgForm} from '@angular/forms'; import {Configuration, StringValueItem} from '../config'; -import {SERVICE_CONFIG, IServiceConfig} from '../../../entities/service.config'; -import {clone, isEmpty, getChanges, compareValue} from '../../../utils/utils'; -import {ErrorHandler} from '../../../utils/error-handler'; -import {ConfirmationMessage} from '../../confirmation-dialog/confirmation-message'; -import {ConfirmationDialogComponent} from '../../confirmation-dialog/confirmation-dialog.component'; -import {ConfirmationState, ConfirmationTargets} from '../../../entities/shared.const'; -import {ConfirmationAcknowledgement} from '../../confirmation-dialog/confirmation-state-message'; -import { - ConfigurationService, SystemCVEAllowlist, SystemInfo, SystemInfoService, VulnerabilityItem -} from '../../../services'; +import { clone, isEmpty, getChanges, compareValue, CURRENT_BASE_HREF } from '../../../../shared/units/utils'; +import {ErrorHandler} from '../../../../shared/units/error-handler'; +import {ConfirmationMessage} from '../../../global-confirmation-dialog/confirmation-message'; +import {ConfirmationDialogComponent} from '../../../../shared/components/confirmation-dialog'; +import {ConfirmationState, ConfirmationTargets} from '../../../../shared/entities/shared.const'; +import {ConfirmationAcknowledgement} from '../../../global-confirmation-dialog/confirmation-state-message'; +import { SystemCVEAllowlist, SystemInfo, SystemInfoService, +} from '../../../../shared/services'; import {forkJoin} from "rxjs"; +import { ConfigurationService } from "../../../../services/config.service"; const fakePass = 'aWpLOSYkIzJTTU4wMDkx'; const ONE_THOUSAND: number = 1000; @@ -32,7 +30,7 @@ const TARGET_BLANK = "_blank"; @Component({ selector: 'system-settings', templateUrl: './system-settings.component.html', - styleUrls: ['./system-settings.component.scss', '../registry-config.component.scss'] + styleUrls: ['./system-settings.component.scss'] }) export class SystemSettingsComponent implements OnChanges, OnInit { config: Configuration = new Configuration(); @@ -161,7 +159,7 @@ export class SystemSettingsComponent implements OnChanges, OnInit { this.onGoing = true; let observables = []; if (!isEmpty(changes)) { - observables.push(this.configService.saveConfigurations(changes)); + observables.push(this.configService.saveConfiguration(changes)); } if (!compareValue(this.systemAllowlistOrigin, this.systemAllowlist)) { observables.push(this.systemInfoService.updateSystemAllowlist(this.systemAllowlist)); @@ -197,7 +195,7 @@ export class SystemSettingsComponent implements OnChanges, OnInit { retrieveConfig(): void { this.onGoing = true; - this.configService.getConfigurations() + this.configService.getConfiguration() .subscribe((configurations: Configuration) => { this.onGoing = false; // Add two password fields @@ -263,13 +261,11 @@ export class SystemSettingsComponent implements OnChanges, OnInit { } } - constructor(@Inject(SERVICE_CONFIG) private configInfo: IServiceConfig, + constructor( private configService: ConfigurationService, private errorHandler: ErrorHandler, private systemInfoService: SystemInfoService) { - if (this.configInfo && this.configInfo.systemInfoEndpoint) { - this.downloadLink = this.configInfo.systemInfoEndpoint + "/getcert"; - } + this.downloadLink = CURRENT_BASE_HREF + "/systeminfo/getcert"; } ngOnInit() { diff --git a/src/portal/src/app/distribution/base.scss b/src/portal/src/app/base/left-side-nav/distribution/base.scss similarity index 100% rename from src/portal/src/app/distribution/base.scss rename to src/portal/src/app/base/left-side-nav/distribution/base.scss diff --git a/src/portal/src/app/distribution/distribution-instances/distribution-instances.component.html b/src/portal/src/app/base/left-side-nav/distribution/distribution-instances/distribution-instances.component.html similarity index 100% rename from src/portal/src/app/distribution/distribution-instances/distribution-instances.component.html rename to src/portal/src/app/base/left-side-nav/distribution/distribution-instances/distribution-instances.component.html diff --git a/src/portal/src/app/distribution/distribution-instances/distribution-instances.component.scss b/src/portal/src/app/base/left-side-nav/distribution/distribution-instances/distribution-instances.component.scss similarity index 95% rename from src/portal/src/app/distribution/distribution-instances/distribution-instances.component.scss rename to src/portal/src/app/base/left-side-nav/distribution/distribution-instances/distribution-instances.component.scss index 63b765348..11ceadcd9 100644 --- a/src/portal/src/app/distribution/distribution-instances/distribution-instances.component.scss +++ b/src/portal/src/app/base/left-side-nav/distribution/distribution-instances/distribution-instances.component.scss @@ -1,4 +1,4 @@ -@import "../base.scss"; +@import "../base"; $refrsh-btn-color: #007CBB; .refresh-btn { @include refresh-button diff --git a/src/portal/src/app/distribution/distribution-instances/distribution-instances.component.spec.ts b/src/portal/src/app/base/left-side-nav/distribution/distribution-instances/distribution-instances.component.spec.ts similarity index 92% rename from src/portal/src/app/distribution/distribution-instances/distribution-instances.component.spec.ts rename to src/portal/src/app/base/left-side-nav/distribution/distribution-instances/distribution-instances.component.spec.ts index 16b3397e4..1a76f46a0 100644 --- a/src/portal/src/app/distribution/distribution-instances/distribution-instances.component.spec.ts +++ b/src/portal/src/app/base/left-side-nav/distribution/distribution-instances/distribution-instances.component.spec.ts @@ -1,16 +1,16 @@ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { ClarityModule } from '@clr/angular'; -import { SharedModule } from '../../shared/shared.module'; +import { SharedTestingModule } from '../../../../shared/shared.module'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { HttpClientTestingModule } from '@angular/common/http/testing'; import { DistributionInstancesComponent } from './distribution-instances.component'; -import { PreheatService } from "../../../../ng-swagger-gen/services/preheat.service"; -import { Instance } from '../../../../ng-swagger-gen/models/instance'; +import { PreheatService } from "../../../../../../ng-swagger-gen/services/preheat.service"; +import { Instance } from '../../../../../../ng-swagger-gen/models/instance'; import { HttpHeaders, HttpResponse } from '@angular/common/http'; import { of } from 'rxjs'; import { delay } from 'rxjs/operators'; -import { Metadata } from '../../../../ng-swagger-gen/models/metadata'; +import { Metadata } from '../../../../../../ng-swagger-gen/models/metadata'; import { DistributionSetupModalComponent } from '../distribution-setup-modal/distribution-setup-modal.component'; describe('DistributionInstanceComponent', () => { @@ -101,7 +101,7 @@ describe('DistributionInstanceComponent', () => { imports: [ ClarityModule, TranslateModule, - SharedModule, + SharedTestingModule, HttpClientTestingModule ], schemas: [CUSTOM_ELEMENTS_SCHEMA], diff --git a/src/portal/src/app/distribution/distribution-instances/distribution-instances.component.ts b/src/portal/src/app/base/left-side-nav/distribution/distribution-instances/distribution-instances.component.ts similarity index 92% rename from src/portal/src/app/distribution/distribution-instances/distribution-instances.component.ts rename to src/portal/src/app/base/left-side-nav/distribution/distribution-instances/distribution-instances.component.ts index 0c3e1c940..60924e6b1 100644 --- a/src/portal/src/app/distribution/distribution-instances/distribution-instances.component.ts +++ b/src/portal/src/app/base/left-side-nav/distribution/distribution-instances/distribution-instances.component.ts @@ -1,4 +1,4 @@ -import { MessageHandlerService } from '../../shared/message-handler/message-handler.service'; +import { MessageHandlerService } from '../../../../shared/services/message-handler.service'; import { Component, OnInit, ViewChild, OnDestroy } from '@angular/core'; import { Subscription, @@ -7,28 +7,24 @@ import { throwError as observableThrowError } from 'rxjs'; import { DistributionSetupModalComponent } from '../distribution-setup-modal/distribution-setup-modal.component'; -import { OperationService } from '../../../lib/components/operation/operation.service'; -import { - ConfirmationState, - ConfirmationTargets, - ConfirmationButtons -} from '../../shared/shared.const'; -import { ConfirmationDialogService } from '../../shared/confirmation-dialog/confirmation-dialog.service'; -import { ConfirmationMessage } from '../../shared/confirmation-dialog/confirmation-message'; +import { OperationService } from '../../../../shared/components/operation/operation.service'; import { operateChanges, OperateInfo, OperationState -} from '../../../lib/components/operation/operate'; +} from '../../../../shared/components/operation/operate'; import { TranslateService } from '@ngx-translate/core'; import { map, catchError, finalize } from 'rxjs/operators'; -import { errorHandler } from '../../../lib/utils/shared/shared.utils'; -import { clone, DEFAULT_PAGE_SIZE } from '../../../lib/utils/utils'; -import { Instance } from "../../../../ng-swagger-gen/models/instance"; -import { PreheatService } from "../../../../ng-swagger-gen/services/preheat.service"; -import { Metadata } from '../../../../ng-swagger-gen/models/metadata'; +import { clone, DEFAULT_PAGE_SIZE } from '../../../../shared/units/utils'; +import { Instance } from "../../../../../../ng-swagger-gen/models/instance"; +import { PreheatService } from "../../../../../../ng-swagger-gen/services/preheat.service"; +import { Metadata } from '../../../../../../ng-swagger-gen/models/metadata'; import { FrontInstance, HEALTHY, UNHEALTHY } from '../distribution-interface'; import { ClrDatagridStateInterface } from '@clr/angular'; +import { ConfirmationDialogService } from "../../../global-confirmation-dialog/confirmation-dialog.service"; +import { ConfirmationButtons, ConfirmationState, ConfirmationTargets } from "../../../../shared/entities/shared.const"; +import { errorHandler } from "../../../../shared/units/shared.utils"; +import { ConfirmationMessage } from "../../../global-confirmation-dialog/confirmation-message"; interface MultiOperateData { operation: string; diff --git a/src/portal/src/app/distribution/distribution-interface.ts b/src/portal/src/app/base/left-side-nav/distribution/distribution-interface.ts similarity index 87% rename from src/portal/src/app/distribution/distribution-interface.ts rename to src/portal/src/app/base/left-side-nav/distribution/distribution-interface.ts index c555ceca4..6e6adcf17 100644 --- a/src/portal/src/app/distribution/distribution-interface.ts +++ b/src/portal/src/app/base/left-side-nav/distribution/distribution-interface.ts @@ -1,4 +1,4 @@ -import { Instance } from '../../../ng-swagger-gen/models/instance'; +import { Instance } from '../../../../../ng-swagger-gen/models/instance'; export class AuthMode { static NONE = 'NONE'; diff --git a/src/portal/src/app/distribution/distribution-setup-modal/distribution-setup-modal.component.html b/src/portal/src/app/base/left-side-nav/distribution/distribution-setup-modal/distribution-setup-modal.component.html similarity index 100% rename from src/portal/src/app/distribution/distribution-setup-modal/distribution-setup-modal.component.html rename to src/portal/src/app/base/left-side-nav/distribution/distribution-setup-modal/distribution-setup-modal.component.html diff --git a/src/portal/src/app/distribution/distribution-setup-modal/distribution-setup-modal.component.scss b/src/portal/src/app/base/left-side-nav/distribution/distribution-setup-modal/distribution-setup-modal.component.scss similarity index 100% rename from src/portal/src/app/distribution/distribution-setup-modal/distribution-setup-modal.component.scss rename to src/portal/src/app/base/left-side-nav/distribution/distribution-setup-modal/distribution-setup-modal.component.scss diff --git a/src/portal/src/app/distribution/distribution-setup-modal/distribution-setup-modal.component.spec.ts b/src/portal/src/app/base/left-side-nav/distribution/distribution-setup-modal/distribution-setup-modal.component.spec.ts similarity index 92% rename from src/portal/src/app/distribution/distribution-setup-modal/distribution-setup-modal.component.spec.ts rename to src/portal/src/app/base/left-side-nav/distribution/distribution-setup-modal/distribution-setup-modal.component.spec.ts index 9fa751520..5161a4feb 100644 --- a/src/portal/src/app/distribution/distribution-setup-modal/distribution-setup-modal.component.spec.ts +++ b/src/portal/src/app/base/left-side-nav/distribution/distribution-setup-modal/distribution-setup-modal.component.spec.ts @@ -1,12 +1,12 @@ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { TranslateModule } from '@ngx-translate/core'; import { ClarityModule } from '@clr/angular'; -import { SharedModule } from '../../shared/shared.module'; +import { SharedTestingModule } from '../../../../shared/shared.module'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { HttpClientTestingModule } from '@angular/common/http/testing'; import { DistributionSetupModalComponent } from './distribution-setup-modal.component'; -import { PreheatService } from "../../../../ng-swagger-gen/services/preheat.service"; -import { Instance } from '../../../../ng-swagger-gen/models/instance'; +import { PreheatService } from "../../../../../../ng-swagger-gen/services/preheat.service"; +import { Instance } from '../../../../../../ng-swagger-gen/models/instance'; import { of } from 'rxjs'; import { delay } from 'rxjs/operators'; @@ -37,7 +37,7 @@ describe('DistributionSetupModalComponent', () => { imports: [ ClarityModule, TranslateModule, - SharedModule, + SharedTestingModule, HttpClientTestingModule ], schemas: [CUSTOM_ELEMENTS_SCHEMA], diff --git a/src/portal/src/app/distribution/distribution-setup-modal/distribution-setup-modal.component.ts b/src/portal/src/app/base/left-side-nav/distribution/distribution-setup-modal/distribution-setup-modal.component.ts similarity index 94% rename from src/portal/src/app/distribution/distribution-setup-modal/distribution-setup-modal.component.ts rename to src/portal/src/app/base/left-side-nav/distribution/distribution-setup-modal/distribution-setup-modal.component.ts index 81004ccd0..18aa2c186 100644 --- a/src/portal/src/app/distribution/distribution-setup-modal/distribution-setup-modal.component.ts +++ b/src/portal/src/app/base/left-side-nav/distribution/distribution-setup-modal/distribution-setup-modal.component.ts @@ -1,4 +1,4 @@ -import { MessageHandlerService } from '../../shared/message-handler/message-handler.service'; +import { MessageHandlerService } from '../../../../shared/services/message-handler.service'; import { Component, EventEmitter, @@ -10,18 +10,18 @@ import { } from '@angular/core'; import { NgForm } from '@angular/forms'; import { TranslateService } from '@ngx-translate/core'; -import { errorHandler } from '../../../lib/utils/shared/shared.utils'; -import { PreheatService } from '../../../../ng-swagger-gen/services/preheat.service'; -import { Instance } from '../../../../ng-swagger-gen/models/instance'; +import { PreheatService } from '../../../../../../ng-swagger-gen/services/preheat.service'; +import { Instance } from '../../../../../../ng-swagger-gen/models/instance'; import { AuthMode, FrontInstance } from '../distribution-interface'; -import { clone } from '../../../lib/utils/utils'; -import { InlineAlertComponent } from '../../shared/inline-alert/inline-alert.component'; +import { clone } from '../../../../shared/units/utils'; import { ClrLoadingState } from '@clr/angular'; -import { Metadata } from '../../../../ng-swagger-gen/models/metadata'; -import { operateChanges, OperateInfo, OperationState } from '../../../lib/components/operation/operate'; -import { OperationService } from '../../../lib/components/operation/operation.service'; +import { Metadata } from '../../../../../../ng-swagger-gen/models/metadata'; +import { operateChanges, OperateInfo, OperationState } from '../../../../shared/components/operation/operate'; +import { OperationService } from '../../../../shared/components/operation/operation.service'; import { debounceTime, distinctUntilChanged, filter, finalize, switchMap } from 'rxjs/operators'; import { Subject, Subscription } from 'rxjs'; +import { InlineAlertComponent } from "../../../../shared/components/inline-alert/inline-alert.component"; +import { errorHandler } from "../../../../shared/units/shared.utils"; const DEFAULT_PROVIDER: string = 'dragonfly'; diff --git a/src/portal/src/app/distribution/distribution.module.ts b/src/portal/src/app/base/left-side-nav/distribution/distribution.module.ts similarity index 53% rename from src/portal/src/app/distribution/distribution.module.ts rename to src/portal/src/app/base/left-side-nav/distribution/distribution.module.ts index 2a850b8d8..fcd10fe0c 100644 --- a/src/portal/src/app/distribution/distribution.module.ts +++ b/src/portal/src/app/base/left-side-nav/distribution/distribution.module.ts @@ -1,11 +1,21 @@ import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; import { DistributionInstancesComponent } from './distribution-instances/distribution-instances.component'; import { DistributionSetupModalComponent } from './distribution-setup-modal/distribution-setup-modal.component'; -import { SharedModule } from '../shared/shared.module'; +import { SharedModule } from '../../../shared/shared.module'; +import { RouterModule, Routes } from "@angular/router"; +const routes: Routes = [ + { + path: 'instances', + component: DistributionInstancesComponent + }, + { path: '', redirectTo: 'instances', pathMatch: 'full' }, +]; @NgModule({ - imports: [CommonModule, SharedModule], + imports: [ + SharedModule, + RouterModule.forChild(routes) + ], declarations: [ DistributionSetupModalComponent, DistributionInstancesComponent diff --git a/src/portal/src/app/gc-page/gc-page.component.html b/src/portal/src/app/base/left-side-nav/gc-page/gc-page.component.html similarity index 100% rename from src/portal/src/app/gc-page/gc-page.component.html rename to src/portal/src/app/base/left-side-nav/gc-page/gc-page.component.html diff --git a/src/portal/src/app/gc-page/gc-page.component.scss b/src/portal/src/app/base/left-side-nav/gc-page/gc-page.component.scss similarity index 100% rename from src/portal/src/app/gc-page/gc-page.component.scss rename to src/portal/src/app/base/left-side-nav/gc-page/gc-page.component.scss diff --git a/src/portal/src/app/gc-page/gc-page.component.spec.ts b/src/portal/src/app/base/left-side-nav/gc-page/gc-page.component.spec.ts similarity index 94% rename from src/portal/src/app/gc-page/gc-page.component.spec.ts rename to src/portal/src/app/base/left-side-nav/gc-page/gc-page.component.spec.ts index 41ef3be18..01857ee1d 100644 --- a/src/portal/src/app/gc-page/gc-page.component.spec.ts +++ b/src/portal/src/app/base/left-side-nav/gc-page/gc-page.component.spec.ts @@ -2,7 +2,7 @@ import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; import { ClarityModule } from '@clr/angular'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { SessionService } from "../shared/session.service"; +import { SessionService } from "../../../shared/services/session.service"; import { GcPageComponent } from './gc-page.component'; describe('GcPageComponent', () => { diff --git a/src/portal/src/app/gc-page/gc-page.component.ts b/src/portal/src/app/base/left-side-nav/gc-page/gc-page.component.ts similarity index 87% rename from src/portal/src/app/gc-page/gc-page.component.ts rename to src/portal/src/app/base/left-side-nav/gc-page/gc-page.component.ts index 00bf2a3dc..90cef9fb5 100644 --- a/src/portal/src/app/gc-page/gc-page.component.ts +++ b/src/portal/src/app/base/left-side-nav/gc-page/gc-page.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit } from "@angular/core"; -import { SessionService } from "../shared/session.service"; +import { SessionService } from "../../../shared/services/session.service"; @Component({ selector: "app-gc-page", diff --git a/src/portal/src/app/base/left-side-nav/gc-page/gc.module.ts b/src/portal/src/app/base/left-side-nav/gc-page/gc.module.ts new file mode 100644 index 000000000..447fbadf8 --- /dev/null +++ b/src/portal/src/app/base/left-side-nav/gc-page/gc.module.ts @@ -0,0 +1,33 @@ +import { NgModule } from "@angular/core"; +import { RouterModule, Routes } from "@angular/router"; +import { GcPageComponent } from "./gc-page.component"; +import { GcComponent } from "./gc/gc.component"; +import { GcHistoryComponent } from "./gc/gc-history/gc-history.component"; +import { GcRepoService } from "./gc/gc.service"; +import { SharedModule } from "../../../shared/shared.module"; +import { GcApiDefaultRepository, GcApiRepository } from "./gc/gc.api.repository"; +import { GcViewModelFactory } from "./gc/gc.viewmodel.factory"; + +const routes: Routes = [ + { + path: '', + component: GcPageComponent + } +]; +@NgModule({ + imports: [ + SharedModule, + RouterModule.forChild(routes) + ], + declarations: [ + GcPageComponent, + GcComponent, + GcHistoryComponent + ], + providers: [ + GcRepoService, + {provide: GcApiRepository, useClass: GcApiDefaultRepository }, + GcViewModelFactory + ] +}) +export class GcModule {} diff --git a/src/portal/src/lib/components/config/gc/gc-history/gc-history.component.html b/src/portal/src/app/base/left-side-nav/gc-page/gc/gc-history/gc-history.component.html similarity index 100% rename from src/portal/src/lib/components/config/gc/gc-history/gc-history.component.html rename to src/portal/src/app/base/left-side-nav/gc-page/gc/gc-history/gc-history.component.html diff --git a/src/portal/src/lib/components/config/gc/gc-history/gc-history.component.scss b/src/portal/src/app/base/left-side-nav/gc-page/gc/gc-history/gc-history.component.scss similarity index 100% rename from src/portal/src/lib/components/config/gc/gc-history/gc-history.component.scss rename to src/portal/src/app/base/left-side-nav/gc-page/gc/gc-history/gc-history.component.scss diff --git a/src/portal/src/lib/components/config/gc/gc-history/gc-history.component.spec.ts b/src/portal/src/app/base/left-side-nav/gc-page/gc/gc-history/gc-history.component.spec.ts similarity index 93% rename from src/portal/src/lib/components/config/gc/gc-history/gc-history.component.spec.ts rename to src/portal/src/app/base/left-side-nav/gc-page/gc/gc-history/gc-history.component.spec.ts index c3cd1d3af..565a2c225 100644 --- a/src/portal/src/lib/components/config/gc/gc-history/gc-history.component.spec.ts +++ b/src/portal/src/app/base/left-side-nav/gc-page/gc/gc-history/gc-history.component.spec.ts @@ -1,19 +1,17 @@ import { ComponentFixture, ComponentFixtureAutoDetect, - fakeAsync, TestBed, - tick, waitForAsync } from '@angular/core/testing'; -import { SharedModule } from '../../../../utils/shared/shared.module'; import { GcRepoService } from "../gc.service"; import { of } from 'rxjs'; import { GcViewModelFactory } from "../gc.viewmodel.factory"; import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { ErrorHandler } from '../../../../utils/error-handler'; +import { ErrorHandler } from '../../../../../shared/units/error-handler'; import { GcHistoryComponent } from './gc-history.component'; import { GcJobData } from "../gcLog"; +import { SharedTestingModule } from "../../../../../shared/shared.module"; describe('GcHistoryComponent', () => { let component: GcHistoryComponent; @@ -64,7 +62,7 @@ describe('GcHistoryComponent', () => { TestBed.configureTestingModule({ declarations: [GcHistoryComponent], imports: [ - SharedModule, + SharedTestingModule, TranslateModule.forRoot() ], providers: [ diff --git a/src/portal/src/lib/components/config/gc/gc-history/gc-history.component.ts b/src/portal/src/app/base/left-side-nav/gc-page/gc/gc-history/gc-history.component.ts similarity index 93% rename from src/portal/src/lib/components/config/gc/gc-history/gc-history.component.ts rename to src/portal/src/app/base/left-side-nav/gc-page/gc/gc-history/gc-history.component.ts index 1ecb868ca..1bc51754f 100644 --- a/src/portal/src/lib/components/config/gc/gc-history/gc-history.component.ts +++ b/src/portal/src/app/base/left-side-nav/gc-page/gc/gc-history/gc-history.component.ts @@ -2,9 +2,9 @@ import { Component, OnInit, OnDestroy } from '@angular/core'; import { GcRepoService } from "../gc.service"; import { GcJobViewModel } from "../gcLog"; import { GcViewModelFactory } from "../gc.viewmodel.factory"; -import { ErrorHandler } from "../../../../utils/error-handler"; +import { ErrorHandler } from "../../../../../shared/units/error-handler"; import { Subscription, timer } from "rxjs"; -import { REFRESH_TIME_DIFFERENCE } from '../../../../entities/shared.const'; +import { REFRESH_TIME_DIFFERENCE } from '../../../../../shared/entities/shared.const'; const JOB_STATUS = { PENDING: "pending", RUNNING: "running" diff --git a/src/portal/src/lib/components/config/gc/gc.api.repository.ts b/src/portal/src/app/base/left-side-nav/gc-page/gc/gc.api.repository.ts similarity index 64% rename from src/portal/src/lib/components/config/gc/gc.api.repository.ts rename to src/portal/src/app/base/left-side-nav/gc-page/gc/gc.api.repository.ts index 9c9f754de..f5c8699df 100644 --- a/src/portal/src/lib/components/config/gc/gc.api.repository.ts +++ b/src/portal/src/app/base/left-side-nav/gc-page/gc/gc.api.repository.ts @@ -1,9 +1,8 @@ - -import { Injectable, Inject } from '@angular/core'; +import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { throwError as observableThrowError, Observable } from 'rxjs'; -import { catchError, map } from 'rxjs/operators'; -import { SERVICE_CONFIG, IServiceConfig } from "../../../entities/service.config"; +import { catchError } from 'rxjs/operators'; +import { CURRENT_BASE_HREF } from "../../../../shared/units/utils"; export abstract class GcApiRepository { abstract postSchedule(param): Observable; @@ -24,44 +23,43 @@ export abstract class GcApiRepository { @Injectable() export class GcApiDefaultRepository extends GcApiRepository { constructor( - private http: HttpClient, - @Inject(SERVICE_CONFIG) private config: IServiceConfig + private http: HttpClient ) { super(); } public postSchedule(param): Observable { - return this.http.post(`${this.config.gcEndpoint}/schedule`, param) + return this.http.post(`${CURRENT_BASE_HREF}/system/gc/schedule`, param) .pipe(catchError(error => observableThrowError(error))); } public putSchedule(param): Observable { - return this.http.put(`${this.config.gcEndpoint}/schedule`, param) + return this.http.put(`${CURRENT_BASE_HREF}/system/gc/schedule`, param) .pipe(catchError(error => observableThrowError(error))); } public getSchedule(): Observable { - return this.http.get(`${this.config.gcEndpoint}/schedule`) + return this.http.get(`${CURRENT_BASE_HREF}/system/gc/schedule`) .pipe(catchError(error => observableThrowError(error))); } public getLog(id): Observable { - return this.http.get(`${this.config.gcEndpoint}/${id}/log`) + return this.http.get(`${CURRENT_BASE_HREF}/system/gc/${id}/log`) .pipe(catchError(error => observableThrowError(error))); } public getStatus(id): Observable { - return this.http.get(`${this.config.gcEndpoint}/id`) + return this.http.get(`${CURRENT_BASE_HREF}/system/gc/${id}`) .pipe(catchError(error => observableThrowError(error))); } public getJobs(): Observable { - return this.http.get(`${this.config.gcEndpoint}`) + return this.http.get(`${CURRENT_BASE_HREF}/system/gc`) .pipe(catchError(error => observableThrowError(error))); } public getLogLink(id) { - return `${this.config.gcEndpoint}/${id}/log`; + return `${CURRENT_BASE_HREF}/system/gc/${id}/log`; } } diff --git a/src/portal/src/lib/components/config/gc/gc.component.html b/src/portal/src/app/base/left-side-nav/gc-page/gc/gc.component.html similarity index 100% rename from src/portal/src/lib/components/config/gc/gc.component.html rename to src/portal/src/app/base/left-side-nav/gc-page/gc/gc.component.html diff --git a/src/portal/src/lib/components/config/gc/gc.component.scss b/src/portal/src/app/base/left-side-nav/gc-page/gc/gc.component.scss similarity index 100% rename from src/portal/src/lib/components/config/gc/gc.component.scss rename to src/portal/src/app/base/left-side-nav/gc-page/gc/gc.component.scss diff --git a/src/portal/src/lib/components/config/gc/gc.component.spec.ts b/src/portal/src/app/base/left-side-nav/gc-page/gc/gc.component.spec.ts similarity index 79% rename from src/portal/src/lib/components/config/gc/gc.component.spec.ts rename to src/portal/src/app/base/left-side-nav/gc-page/gc/gc.component.spec.ts index 08ea2b5c9..12e112bda 100644 --- a/src/portal/src/lib/components/config/gc/gc.component.spec.ts +++ b/src/portal/src/app/base/left-side-nav/gc-page/gc/gc.component.spec.ts @@ -1,24 +1,20 @@ import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; import { GcComponent } from './gc.component'; -import { SERVICE_CONFIG, IServiceConfig } from '../../../entities/service.config'; import { GcApiRepository, GcApiDefaultRepository} from './gc.api.repository'; import { GcRepoService } from './gc.service'; -import { SharedModule } from "../../../utils/shared/shared.module"; -import { ErrorHandler } from '../../../utils/error-handler/error-handler'; +import { ErrorHandler } from '../../../../shared/units/error-handler'; import { GcViewModelFactory } from './gc.viewmodel.factory'; -import { CronScheduleComponent } from '../../cron-schedule/cron-schedule.component'; -import { CronTooltipComponent } from "../../cron-schedule/cron-tooltip/cron-tooltip.component"; +import { CronScheduleComponent } from '../../../../shared/components/cron-schedule'; +import { CronTooltipComponent } from "../../../../shared/components/cron-schedule"; import { of } from 'rxjs'; import { GcJobData } from './gcLog'; -import { CURRENT_BASE_HREF } from "../../../utils/utils"; +import { CURRENT_BASE_HREF } from "../../../../shared/units/utils"; +import { SharedTestingModule } from "../../../../shared/shared.module"; describe('GcComponent', () => { let component: GcComponent; let fixture: ComponentFixture; let gcRepoService: GcRepoService; - let config: IServiceConfig = { - systemInfoEndpoint: CURRENT_BASE_HREF + "/system/gc" - }; let mockSchedule = []; let mockJobs: GcJobData[] = [ { @@ -48,12 +44,11 @@ describe('GcComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ imports: [ - SharedModule + SharedTestingModule ], declarations: [ GcComponent, CronScheduleComponent, CronTooltipComponent], providers: [ { provide: GcApiRepository, useClass: GcApiDefaultRepository }, - { provide: SERVICE_CONFIG, useValue: config }, { provide: ErrorHandler, useValue: fakedErrorHandler }, GcRepoService, GcViewModelFactory diff --git a/src/portal/src/lib/components/config/gc/gc.component.ts b/src/portal/src/app/base/left-side-nav/gc-page/gc/gc.component.ts similarity index 94% rename from src/portal/src/lib/components/config/gc/gc.component.ts rename to src/portal/src/app/base/left-side-nav/gc-page/gc/gc.component.ts index b6b311d39..6d17e5033 100644 --- a/src/portal/src/lib/components/config/gc/gc.component.ts +++ b/src/portal/src/app/base/left-side-nav/gc-page/gc/gc.component.ts @@ -15,9 +15,9 @@ import { ONE_MINITUE, THREE_SECONDS, GCSchedule } from "./gc.const"; -import { ErrorHandler } from "../../../utils/error-handler"; -import { CronScheduleComponent } from "../../cron-schedule/cron-schedule.component"; -import { OriginCron } from '../../../services/interface'; +import { ErrorHandler } from "../../../../shared/units/error-handler"; +import { CronScheduleComponent } from "../../../../shared/components/cron-schedule/cron-schedule.component"; +import { OriginCron } from '../../../../shared/services/interface'; import { finalize } from "rxjs/operators"; @Component({ selector: "gc-config", diff --git a/src/portal/src/lib/components/config/gc/gc.const.ts b/src/portal/src/app/base/left-side-nav/gc-page/gc/gc.const.ts similarity index 86% rename from src/portal/src/lib/components/config/gc/gc.const.ts rename to src/portal/src/app/base/left-side-nav/gc-page/gc/gc.const.ts index 121d40b4c..d16beb88e 100644 --- a/src/portal/src/lib/components/config/gc/gc.const.ts +++ b/src/portal/src/app/base/left-side-nav/gc-page/gc/gc.const.ts @@ -1,4 +1,4 @@ -import { OriginCron } from "../../../services"; +import { OriginCron } from "../../../../shared/services"; export const SCHEDULE_TYPE_NONE = "None"; diff --git a/src/portal/src/lib/components/config/gc/gc.service.ts b/src/portal/src/app/base/left-side-nav/gc-page/gc/gc.service.ts similarity index 94% rename from src/portal/src/lib/components/config/gc/gc.service.ts rename to src/portal/src/app/base/left-side-nav/gc-page/gc/gc.service.ts index 7d3f1c875..ee5ab69ea 100644 --- a/src/portal/src/lib/components/config/gc/gc.service.ts +++ b/src/portal/src/app/base/left-side-nav/gc-page/gc/gc.service.ts @@ -2,7 +2,7 @@ import { Injectable } from '@angular/core'; import { Observable, Subscription, Subject, of } from 'rxjs'; import { catchError, map } from 'rxjs/operators'; import { GcApiRepository } from './gc.api.repository'; -import { ErrorHandler } from '../../../utils/error-handler'; +import { ErrorHandler } from '../../../../shared/units/error-handler'; import { GcJobData } from './gcLog'; @@ -11,8 +11,7 @@ export class GcRepoService { constructor( private gcApiRepository: GcApiRepository, - private errorHandler: ErrorHandler) { - } + ) {} public manualGc(shouldDeleteUntagged: boolean, isDryRun: boolean): Observable { const param = { diff --git a/src/portal/src/lib/components/config/gc/gc.viewmodel.factory.ts b/src/portal/src/app/base/left-side-nav/gc-page/gc/gc.viewmodel.factory.ts similarity index 100% rename from src/portal/src/lib/components/config/gc/gc.viewmodel.factory.ts rename to src/portal/src/app/base/left-side-nav/gc-page/gc/gc.viewmodel.factory.ts diff --git a/src/portal/src/lib/components/config/gc/gcLog.ts b/src/portal/src/app/base/left-side-nav/gc-page/gc/gcLog.ts similarity index 100% rename from src/portal/src/lib/components/config/gc/gcLog.ts rename to src/portal/src/app/base/left-side-nav/gc-page/gc/gcLog.ts diff --git a/src/portal/src/app/group/add-group-modal/add-group-modal.component.html b/src/portal/src/app/base/left-side-nav/group/add-group-modal/add-group-modal.component.html similarity index 100% rename from src/portal/src/app/group/add-group-modal/add-group-modal.component.html rename to src/portal/src/app/base/left-side-nav/group/add-group-modal/add-group-modal.component.html diff --git a/src/portal/src/app/group/add-group-modal/add-group-modal.component.scss b/src/portal/src/app/base/left-side-nav/group/add-group-modal/add-group-modal.component.scss similarity index 100% rename from src/portal/src/app/group/add-group-modal/add-group-modal.component.scss rename to src/portal/src/app/base/left-side-nav/group/add-group-modal/add-group-modal.component.scss diff --git a/src/portal/src/app/group/add-group-modal/add-group-modal.component.spec.ts b/src/portal/src/app/base/left-side-nav/group/add-group-modal/add-group-modal.component.spec.ts similarity index 84% rename from src/portal/src/app/group/add-group-modal/add-group-modal.component.spec.ts rename to src/portal/src/app/base/left-side-nav/group/add-group-modal/add-group-modal.component.spec.ts index f5556590b..1c50479f2 100644 --- a/src/portal/src/app/group/add-group-modal/add-group-modal.component.spec.ts +++ b/src/portal/src/app/base/left-side-nav/group/add-group-modal/add-group-modal.component.spec.ts @@ -1,13 +1,12 @@ import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; import { ClarityModule } from '@clr/angular'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; +import { TranslateModule } from '@ngx-translate/core'; import { CUSTOM_ELEMENTS_SCHEMA, ChangeDetectorRef } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { GroupService } from "../group.service"; -import { MessageHandlerService } from "./../../shared/message-handler/message-handler.service"; -import { SessionService } from "./../../shared/session.service"; -import { UserGroup } from "./../group"; -import { AppConfigService } from "../../services/app-config.service"; +import { MessageHandlerService } from "../../../../shared/services/message-handler.service"; +import { SessionService } from "../../../../shared/services/session.service"; +import { AppConfigService } from "../../../../services/app-config.service"; import { AddGroupModalComponent } from './add-group-modal.component'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; diff --git a/src/portal/src/app/group/add-group-modal/add-group-modal.component.ts b/src/portal/src/app/base/left-side-nav/group/add-group-modal/add-group-modal.component.ts similarity index 89% rename from src/portal/src/app/group/add-group-modal/add-group-modal.component.ts rename to src/portal/src/app/base/left-side-nav/group/add-group-modal/add-group-modal.component.ts index 5ebd2eb9e..8f4d4188a 100644 --- a/src/portal/src/app/group/add-group-modal/add-group-modal.component.ts +++ b/src/portal/src/app/base/left-side-nav/group/add-group-modal/add-group-modal.component.ts @@ -4,11 +4,11 @@ import { Subscription } from "rxjs"; import { Component, OnInit, EventEmitter, Output, ChangeDetectorRef, OnDestroy, ViewChild } from "@angular/core"; import { NgForm } from "@angular/forms"; import { GroupService } from "../group.service"; -import { MessageHandlerService } from "./../../shared/message-handler/message-handler.service"; -import { SessionService } from "./../../shared/session.service"; -import { UserGroup } from "./../group"; -import { AppConfigService } from "../../services/app-config.service"; -import { GroupType } from "../../../lib/entities/shared.const"; +import { MessageHandlerService } from "../../../../shared/services/message-handler.service"; +import { SessionService } from "../../../../shared/services/session.service"; +import { UserGroup } from "../group"; +import { AppConfigService } from "../../../../services/app-config.service"; +import { GroupType } from "../../../../shared/entities/shared.const"; @Component({ selector: "hbr-add-group-modal", diff --git a/src/portal/src/app/group/group.component.html b/src/portal/src/app/base/left-side-nav/group/group.component.html similarity index 100% rename from src/portal/src/app/group/group.component.html rename to src/portal/src/app/base/left-side-nav/group/group.component.html diff --git a/src/portal/src/app/group/group.component.scss b/src/portal/src/app/base/left-side-nav/group/group.component.scss similarity index 100% rename from src/portal/src/app/group/group.component.scss rename to src/portal/src/app/base/left-side-nav/group/group.component.scss diff --git a/src/portal/src/app/group/group.component.spec.ts b/src/portal/src/app/base/left-side-nav/group/group.component.spec.ts similarity index 82% rename from src/portal/src/app/group/group.component.spec.ts rename to src/portal/src/app/base/left-side-nav/group/group.component.spec.ts index fb832c463..dc907d3ca 100644 --- a/src/portal/src/app/group/group.component.spec.ts +++ b/src/portal/src/app/base/left-side-nav/group/group.component.spec.ts @@ -4,13 +4,13 @@ import { ClarityModule } from '@clr/angular'; import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { FormsModule } from '@angular/forms'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; -import { SessionService } from "./../shared/session.service"; +import { SessionService } from "../../../shared/services/session.service"; import { GroupService } from "./group.service"; import { of } from "rxjs"; -import { ConfirmationDialogService } from "./../shared/confirmation-dialog/confirmation-dialog.service"; -import { MessageHandlerService } from '../shared/message-handler/message-handler.service'; -import { AppConfigService } from '../services/app-config.service'; -import { OperationService } from "../../lib/components/operation/operation.service"; +import { MessageHandlerService } from '../../../shared/services/message-handler.service'; +import { AppConfigService } from '../../../services/app-config.service'; +import { OperationService } from "../../../shared/components/operation/operation.service"; +import { ConfirmationDialogService } from "../../global-confirmation-dialog/confirmation-dialog.service"; describe('GroupComponent', () => { let component: GroupComponent; diff --git a/src/portal/src/app/group/group.component.ts b/src/portal/src/app/base/left-side-nav/group/group.component.ts similarity index 87% rename from src/portal/src/app/group/group.component.ts rename to src/portal/src/app/base/left-side-nav/group/group.component.ts index d0067e0c5..fbfdbd5bb 100644 --- a/src/portal/src/app/group/group.component.ts +++ b/src/portal/src/app/base/left-side-nav/group/group.component.ts @@ -1,26 +1,25 @@ import { of, Subscription, forkJoin } from "rxjs"; import { flatMap, catchError } from "rxjs/operators"; -import { SessionService } from "./../shared/session.service"; +import { SessionService } from "../../../shared/services/session.service"; import { TranslateService } from "@ngx-translate/core"; import { Component, OnInit, ViewChild, OnDestroy } from "@angular/core"; -import { - ConfirmationTargets, - ConfirmationState, - ConfirmationButtons -} from "../shared/shared.const"; - -import { ConfirmationMessage } from "../shared/confirmation-dialog/confirmation-message"; -import { ConfirmationDialogService } from "./../shared/confirmation-dialog/confirmation-dialog.service"; import { AddGroupModalComponent } from "./add-group-modal/add-group-modal.component"; import { UserGroup } from "./group"; import { GroupService } from "./group.service"; -import { MessageHandlerService } from "../shared/message-handler/message-handler.service"; +import { MessageHandlerService } from "../../../shared/services/message-handler.service"; import { throwError as observableThrowError } from "rxjs"; -import { AppConfigService } from '../services/app-config.service'; -import { OperationService } from "../../lib/components/operation/operation.service"; -import { operateChanges, OperateInfo, OperationState } from "../../lib/components/operation/operate"; -import { errorHandler } from "../../lib/utils/shared/shared.utils"; -import { GroupType } from "../../lib/entities/shared.const"; +import { AppConfigService } from '../../../services/app-config.service'; +import { OperationService } from "../../../shared/components/operation/operation.service"; +import { operateChanges, OperateInfo, OperationState } from "../../../shared/components/operation/operate"; +import { + ConfirmationButtons, + ConfirmationState, + ConfirmationTargets, + GroupType +} from "../../../shared/entities/shared.const"; +import { ConfirmationDialogService } from "../../global-confirmation-dialog/confirmation-dialog.service"; +import { errorHandler } from "../../../shared/units/shared.utils"; +import { ConfirmationMessage } from "../../global-confirmation-dialog/confirmation-message"; @Component({ selector: "app-group", diff --git a/src/portal/src/app/base/left-side-nav/group/group.module.ts b/src/portal/src/app/base/left-side-nav/group/group.module.ts new file mode 100644 index 000000000..baf073647 --- /dev/null +++ b/src/portal/src/app/base/left-side-nav/group/group.module.ts @@ -0,0 +1,23 @@ +import { NgModule } from '@angular/core'; +import { SharedModule } from '../../../shared/shared.module'; +import { GroupComponent } from './group.component'; +import { AddGroupModalComponent } from './add-group-modal/add-group-modal.component'; +import { RouterModule, Routes } from "@angular/router"; + +const routes: Routes = [ + { + path: '', + component: GroupComponent, + } +]; +@NgModule({ + imports: [ + SharedModule, + RouterModule.forChild(routes), + ], + declarations: [ + GroupComponent, + AddGroupModalComponent + ] +}) +export class GroupModule { } diff --git a/src/portal/src/app/group/group.service.spec.ts b/src/portal/src/app/base/left-side-nav/group/group.service.spec.ts similarity index 100% rename from src/portal/src/app/group/group.service.spec.ts rename to src/portal/src/app/base/left-side-nav/group/group.service.spec.ts diff --git a/src/portal/src/app/group/group.service.ts b/src/portal/src/app/base/left-side-nav/group/group.service.ts similarity index 96% rename from src/portal/src/app/group/group.service.ts rename to src/portal/src/app/base/left-side-nav/group/group.service.ts index 9876b4ec6..4d042473a 100644 --- a/src/portal/src/app/group/group.service.ts +++ b/src/portal/src/app/base/left-side-nav/group/group.service.ts @@ -3,12 +3,14 @@ import {catchError, map} from 'rxjs/operators'; import { Injectable } from "@angular/core"; import { HttpClient } from "@angular/common/http"; import { UserGroup } from "./group"; -import { CURRENT_BASE_HREF, HTTP_GET_OPTIONS, HTTP_JSON_OPTIONS } from "../../lib/utils/utils"; +import { CURRENT_BASE_HREF, HTTP_GET_OPTIONS, HTTP_JSON_OPTIONS } from "../../../shared/units/utils"; const userGroupEndpoint = CURRENT_BASE_HREF + "/usergroups"; const ldapGroupSearchEndpoint = CURRENT_BASE_HREF + "/ldap/groups/search?groupname="; -@Injectable() +@Injectable({ + providedIn: 'root', +}) export class GroupService { constructor(private http: HttpClient) {} diff --git a/src/portal/src/app/group/group.ts b/src/portal/src/app/base/left-side-nav/group/group.ts similarity index 100% rename from src/portal/src/app/group/group.ts rename to src/portal/src/app/base/left-side-nav/group/group.ts diff --git a/src/portal/src/app/interrogation-services/interrogation-services.component.html b/src/portal/src/app/base/left-side-nav/interrogation-services/interrogation-services.component.html similarity index 100% rename from src/portal/src/app/interrogation-services/interrogation-services.component.html rename to src/portal/src/app/base/left-side-nav/interrogation-services/interrogation-services.component.html diff --git a/src/portal/src/app/interrogation-services/interrogation-services.component.scss b/src/portal/src/app/base/left-side-nav/interrogation-services/interrogation-services.component.scss similarity index 100% rename from src/portal/src/app/interrogation-services/interrogation-services.component.scss rename to src/portal/src/app/base/left-side-nav/interrogation-services/interrogation-services.component.scss diff --git a/src/portal/src/app/interrogation-services/interrogation-services.component.spec.ts b/src/portal/src/app/base/left-side-nav/interrogation-services/interrogation-services.component.spec.ts similarity index 92% rename from src/portal/src/app/interrogation-services/interrogation-services.component.spec.ts rename to src/portal/src/app/base/left-side-nav/interrogation-services/interrogation-services.component.spec.ts index c087ce061..82bd9f416 100644 --- a/src/portal/src/app/interrogation-services/interrogation-services.component.spec.ts +++ b/src/portal/src/app/base/left-side-nav/interrogation-services/interrogation-services.component.spec.ts @@ -1,6 +1,6 @@ import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; import { InterrogationServicesComponent } from './interrogation-services.component'; -import { SharedModule } from "../shared/shared.module"; +import { SharedTestingModule } from "../../../shared/shared.module"; import { BrowserAnimationsModule } from "@angular/platform-browser/animations"; import { ClarityModule } from "@clr/angular"; import { TranslateService } from "@ngx-translate/core"; @@ -12,7 +12,7 @@ describe('InterrogationServicesComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ imports: [ - SharedModule, + SharedTestingModule, BrowserAnimationsModule, ClarityModule, ], diff --git a/src/portal/src/app/interrogation-services/interrogation-services.component.ts b/src/portal/src/app/base/left-side-nav/interrogation-services/interrogation-services.component.ts similarity index 100% rename from src/portal/src/app/interrogation-services/interrogation-services.component.ts rename to src/portal/src/app/base/left-side-nav/interrogation-services/interrogation-services.component.ts diff --git a/src/portal/src/app/base/left-side-nav/interrogation-services/interrogation-services.module.ts b/src/portal/src/app/base/left-side-nav/interrogation-services/interrogation-services.module.ts new file mode 100644 index 000000000..254e6d335 --- /dev/null +++ b/src/portal/src/app/base/left-side-nav/interrogation-services/interrogation-services.module.ts @@ -0,0 +1,70 @@ +// Copyright Project Harbor Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import { NgModule } from "@angular/core"; +import { SharedModule } from "../../../shared/shared.module"; +import { NewScannerModalComponent } from "./scanner/new-scanner-modal/new-scanner-modal.component"; +import { ScannerMetadataComponent } from "./scanner/scanner-metadata/scanner-metadata.component"; +import { NewScannerFormComponent } from "./scanner/new-scanner-form/new-scanner-form.component"; +import { ConfigScannerService } from "./scanner/config-scanner.service"; +import { RouterModule, Routes } from "@angular/router"; +import { ConfigurationScannerComponent } from "./scanner/config-scanner.component"; +import { VulnerabilityConfigComponent } from "./vulnerability/vulnerability-config.component"; +import { InterrogationServicesComponent } from "./interrogation-services.component"; +import { ScanAllRepoService } from "./vulnerability/scanAll.service"; +import { ScanApiDefaultRepository, ScanApiRepository } from "./vulnerability/scanAll.api.repository"; + + +const routes: Routes = [ + { + path: '', + component: InterrogationServicesComponent, + children: [ + { + path: 'scanners', + component: ConfigurationScannerComponent + }, + { + path: 'vulnerability', + component: VulnerabilityConfigComponent + }, + { + path: '', + redirectTo: 'scanners', + pathMatch: 'full' + }, + ] + } +]; +@NgModule({ + imports: [ + SharedModule, + RouterModule.forChild(routes), + ], + declarations: [ + NewScannerModalComponent, + NewScannerFormComponent, + ScannerMetadataComponent, + ConfigurationScannerComponent, + InterrogationServicesComponent, + VulnerabilityConfigComponent + ], + providers: [ + ConfigScannerService, + ScanAllRepoService, + {provide: ScanApiRepository, useClass: ScanApiDefaultRepository }, + ] +}) +export class InterrogationServicesModule { +} diff --git a/src/portal/src/app/config/scanner/config-scanner.component.html b/src/portal/src/app/base/left-side-nav/interrogation-services/scanner/config-scanner.component.html similarity index 100% rename from src/portal/src/app/config/scanner/config-scanner.component.html rename to src/portal/src/app/base/left-side-nav/interrogation-services/scanner/config-scanner.component.html diff --git a/src/portal/src/app/config/scanner/config-scanner.component.scss b/src/portal/src/app/base/left-side-nav/interrogation-services/scanner/config-scanner.component.scss similarity index 100% rename from src/portal/src/app/config/scanner/config-scanner.component.scss rename to src/portal/src/app/base/left-side-nav/interrogation-services/scanner/config-scanner.component.scss diff --git a/src/portal/src/app/config/scanner/config-scanner.component.spec.ts b/src/portal/src/app/base/left-side-nav/interrogation-services/scanner/config-scanner.component.spec.ts similarity index 89% rename from src/portal/src/app/config/scanner/config-scanner.component.spec.ts rename to src/portal/src/app/base/left-side-nav/interrogation-services/scanner/config-scanner.component.spec.ts index 36200f1d8..b28e225dc 100644 --- a/src/portal/src/app/config/scanner/config-scanner.component.spec.ts +++ b/src/portal/src/app/base/left-side-nav/interrogation-services/scanner/config-scanner.component.spec.ts @@ -4,14 +4,14 @@ import { ClarityModule } from "@clr/angular"; import { of } from "rxjs"; import { ConfigurationScannerComponent } from "./config-scanner.component"; import { ConfigScannerService } from "./config-scanner.service"; -import { MessageHandlerService } from "../../shared/message-handler/message-handler.service"; -import { ConfirmationDialogService } from "../../shared/confirmation-dialog/confirmation-dialog.service"; -import { SharedModule } from "../../shared/shared.module"; +import { MessageHandlerService } from "../../../../shared/services/message-handler.service"; +import { SharedTestingModule } from "../../../../shared/shared.module"; import { ScannerMetadataComponent } from "./scanner-metadata/scanner-metadata.component"; import { NewScannerModalComponent } from "./new-scanner-modal/new-scanner-modal.component"; import { NewScannerFormComponent } from "./new-scanner-form/new-scanner-form.component"; import { TranslateService } from "@ngx-translate/core"; -import { ErrorHandler } from "../../../lib/utils/error-handler"; +import { ErrorHandler } from "../../../../shared/units/error-handler"; +import { ConfirmationDialogService } from "../../../global-confirmation-dialog/confirmation-dialog.service"; describe('ConfigurationScannerComponent', () => { let mockScannerMetadata = { @@ -47,7 +47,7 @@ describe('ConfigurationScannerComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ imports: [ - SharedModule, + SharedTestingModule, BrowserAnimationsModule, ClarityModule, ], diff --git a/src/portal/src/app/config/scanner/config-scanner.component.ts b/src/portal/src/app/base/left-side-nav/interrogation-services/scanner/config-scanner.component.ts similarity index 92% rename from src/portal/src/app/config/scanner/config-scanner.component.ts rename to src/portal/src/app/base/left-side-nav/interrogation-services/scanner/config-scanner.component.ts index bc077e910..1311a61e7 100644 --- a/src/portal/src/app/config/scanner/config-scanner.component.ts +++ b/src/portal/src/app/base/left-side-nav/interrogation-services/scanner/config-scanner.component.ts @@ -3,17 +3,17 @@ import { Scanner } from "./scanner"; import { NewScannerModalComponent } from "./new-scanner-modal/new-scanner-modal.component"; import { ConfigScannerService, SCANNERS_DOC } from "./config-scanner.service"; import { finalize } from "rxjs/operators"; -import { MessageHandlerService } from "../../shared/message-handler/message-handler.service"; -import { ConfirmationButtons, ConfirmationState, ConfirmationTargets } from "../../shared/shared.const"; -import { ConfirmationDialogService } from "../../shared/confirmation-dialog/confirmation-dialog.service"; -import { ConfirmationMessage } from '../../shared/confirmation-dialog/confirmation-message'; -import { ErrorHandler } from "../../../lib/utils/error-handler"; -import { clone } from "../../../lib/utils/utils"; +import { MessageHandlerService } from "../../../../shared/services/message-handler.service"; +import { ErrorHandler } from "../../../../shared/units/error-handler"; +import { clone } from "../../../../shared/units/utils"; +import { ConfirmationDialogService } from "../../../global-confirmation-dialog/confirmation-dialog.service"; +import { ConfirmationButtons, ConfirmationState, ConfirmationTargets } from "../../../../shared/entities/shared.const"; +import { ConfirmationMessage } from "../../../global-confirmation-dialog/confirmation-message"; @Component({ selector: 'config-scanner', templateUrl: "config-scanner.component.html", - styleUrls: ['./config-scanner.component.scss', '../config.component.scss'] + styleUrls: ['./config-scanner.component.scss', '../../config/config.component.scss'] }) export class ConfigurationScannerComponent implements OnInit, OnDestroy { scanners: Scanner[] = []; diff --git a/src/portal/src/app/config/scanner/config-scanner.service.spec.ts b/src/portal/src/app/base/left-side-nav/interrogation-services/scanner/config-scanner.service.spec.ts similarity index 81% rename from src/portal/src/app/config/scanner/config-scanner.service.spec.ts rename to src/portal/src/app/base/left-side-nav/interrogation-services/scanner/config-scanner.service.spec.ts index 2c50aab4e..05af33fde 100644 --- a/src/portal/src/app/config/scanner/config-scanner.service.spec.ts +++ b/src/portal/src/app/base/left-side-nav/interrogation-services/scanner/config-scanner.service.spec.ts @@ -1,12 +1,12 @@ import { TestBed, inject } from '@angular/core/testing'; -import { SharedModule } from "../../shared/shared.module"; +import { SharedTestingModule } from "../../../../shared/shared.module"; import { ConfigScannerService } from "./config-scanner.service"; describe('TagService', () => { beforeEach(() => { TestBed.configureTestingModule({ imports: [ - SharedModule + SharedTestingModule ], providers: [ ConfigScannerService diff --git a/src/portal/src/app/config/scanner/config-scanner.service.ts b/src/portal/src/app/base/left-side-nav/interrogation-services/scanner/config-scanner.service.ts similarity index 97% rename from src/portal/src/app/config/scanner/config-scanner.service.ts rename to src/portal/src/app/base/left-side-nav/interrogation-services/scanner/config-scanner.service.ts index 582cbe308..bac505dbf 100644 --- a/src/portal/src/app/config/scanner/config-scanner.service.ts +++ b/src/portal/src/app/base/left-side-nav/interrogation-services/scanner/config-scanner.service.ts @@ -4,11 +4,13 @@ import { forkJoin, Observable, throwError as observableThrowError } from "rxjs"; import { catchError, map } from "rxjs/operators"; import { HttpClient } from "@angular/common/http"; import { ScannerMetadata } from "./scanner-metadata"; -import { CURRENT_BASE_HREF } from "../../../lib/utils/utils"; +import { CURRENT_BASE_HREF } from "../../../../shared/units/utils"; export const SCANNERS_DOC: string = "https://goharbor.io/blog/harbor-1.10-release/#vulnerability-scanning-with-pluggable-scanners"; -@Injectable() +@Injectable({ + providedIn: 'root', +}) export class ConfigScannerService { constructor( private http: HttpClient) {} diff --git a/src/portal/src/app/config/scanner/new-scanner-form/new-scanner-form.component.html b/src/portal/src/app/base/left-side-nav/interrogation-services/scanner/new-scanner-form/new-scanner-form.component.html similarity index 100% rename from src/portal/src/app/config/scanner/new-scanner-form/new-scanner-form.component.html rename to src/portal/src/app/base/left-side-nav/interrogation-services/scanner/new-scanner-form/new-scanner-form.component.html diff --git a/src/portal/src/app/config/scanner/new-scanner-form/new-scanner-form.component.scss b/src/portal/src/app/base/left-side-nav/interrogation-services/scanner/new-scanner-form/new-scanner-form.component.scss similarity index 100% rename from src/portal/src/app/config/scanner/new-scanner-form/new-scanner-form.component.scss rename to src/portal/src/app/base/left-side-nav/interrogation-services/scanner/new-scanner-form/new-scanner-form.component.scss diff --git a/src/portal/src/app/config/scanner/new-scanner-form/new-scanner-form.component.spec.ts b/src/portal/src/app/base/left-side-nav/interrogation-services/scanner/new-scanner-form/new-scanner-form.component.spec.ts similarity index 97% rename from src/portal/src/app/config/scanner/new-scanner-form/new-scanner-form.component.spec.ts rename to src/portal/src/app/base/left-side-nav/interrogation-services/scanner/new-scanner-form/new-scanner-form.component.spec.ts index cbc24883f..963785150 100644 --- a/src/portal/src/app/config/scanner/new-scanner-form/new-scanner-form.component.spec.ts +++ b/src/portal/src/app/base/left-side-nav/interrogation-services/scanner/new-scanner-form/new-scanner-form.component.spec.ts @@ -3,7 +3,7 @@ import { NewScannerFormComponent } from "./new-scanner-form.component"; import { FormBuilder } from "@angular/forms"; import { BrowserAnimationsModule } from "@angular/platform-browser/animations"; import { ClarityModule } from "@clr/angular"; -import { SharedModule } from "../../../shared/shared.module"; +import { SharedTestingModule } from "../../../../../shared/shared.module"; import { ConfigScannerService } from "../config-scanner.service"; import { of } from "rxjs"; import { TranslateService } from "@ngx-translate/core"; @@ -29,7 +29,7 @@ describe('NewScannerFormComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ imports: [ - SharedModule, + SharedTestingModule, BrowserAnimationsModule, ClarityModule, ], diff --git a/src/portal/src/app/config/scanner/new-scanner-form/new-scanner-form.component.ts b/src/portal/src/app/base/left-side-nav/interrogation-services/scanner/new-scanner-form/new-scanner-form.component.ts similarity index 100% rename from src/portal/src/app/config/scanner/new-scanner-form/new-scanner-form.component.ts rename to src/portal/src/app/base/left-side-nav/interrogation-services/scanner/new-scanner-form/new-scanner-form.component.ts diff --git a/src/portal/src/app/config/scanner/new-scanner-modal/new-scanner-modal.component.html b/src/portal/src/app/base/left-side-nav/interrogation-services/scanner/new-scanner-modal/new-scanner-modal.component.html similarity index 100% rename from src/portal/src/app/config/scanner/new-scanner-modal/new-scanner-modal.component.html rename to src/portal/src/app/base/left-side-nav/interrogation-services/scanner/new-scanner-modal/new-scanner-modal.component.html diff --git a/src/portal/src/app/config/scanner/new-scanner-modal/new-scanner-modal.component.spec.ts b/src/portal/src/app/base/left-side-nav/interrogation-services/scanner/new-scanner-modal/new-scanner-modal.component.spec.ts similarity index 95% rename from src/portal/src/app/config/scanner/new-scanner-modal/new-scanner-modal.component.spec.ts rename to src/portal/src/app/base/left-side-nav/interrogation-services/scanner/new-scanner-modal/new-scanner-modal.component.spec.ts index 72dee4a92..bf5352e1f 100644 --- a/src/portal/src/app/config/scanner/new-scanner-modal/new-scanner-modal.component.spec.ts +++ b/src/portal/src/app/base/left-side-nav/interrogation-services/scanner/new-scanner-modal/new-scanner-modal.component.spec.ts @@ -2,14 +2,13 @@ import { ComponentFixture, ComponentFixtureAutoDetect, fakeAsync, TestBed, tick import { ClrLoadingState } from "@clr/angular"; import { ConfigScannerService } from "../config-scanner.service"; import { NewScannerModalComponent } from "./new-scanner-modal.component"; -import { MessageHandlerService } from "../../../shared/message-handler/message-handler.service"; +import { MessageHandlerService } from "../../../../../shared/services/message-handler.service"; import { NewScannerFormComponent } from "../new-scanner-form/new-scanner-form.component"; import { FormBuilder } from "@angular/forms"; import { of, Subscription } from "rxjs"; import { delay } from "rxjs/operators"; -import { SharedModule as AppSharedModule } from "../../../shared/shared.module"; +import { SharedTestingModule } from "../../../../../shared/shared.module"; import { Scanner } from "../scanner"; -import { SharedModule } from "../../../../lib/utils/shared/shared.module"; describe('NewScannerModalComponent', () => { let component: NewScannerModalComponent; @@ -38,8 +37,7 @@ describe('NewScannerModalComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ imports: [ - SharedModule, - AppSharedModule + SharedTestingModule, ], declarations: [ NewScannerFormComponent, diff --git a/src/portal/src/app/config/scanner/new-scanner-modal/new-scanner-modal.component.ts b/src/portal/src/app/base/left-side-nav/interrogation-services/scanner/new-scanner-modal/new-scanner-modal.component.ts similarity index 97% rename from src/portal/src/app/config/scanner/new-scanner-modal/new-scanner-modal.component.ts rename to src/portal/src/app/base/left-side-nav/interrogation-services/scanner/new-scanner-modal/new-scanner-modal.component.ts index e768b6cc8..287932b7c 100644 --- a/src/portal/src/app/config/scanner/new-scanner-modal/new-scanner-modal.component.ts +++ b/src/portal/src/app/base/left-side-nav/interrogation-services/scanner/new-scanner-modal/new-scanner-modal.component.ts @@ -4,14 +4,14 @@ import { NewScannerFormComponent } from "../new-scanner-form/new-scanner-form.co import { ConfigScannerService } from "../config-scanner.service"; import { ClrLoadingState } from "@clr/angular"; import { finalize } from "rxjs/operators"; -import { InlineAlertComponent } from "../../../shared/inline-alert/inline-alert.component"; -import { MessageHandlerService } from "../../../shared/message-handler/message-handler.service"; +import { MessageHandlerService } from "../../../../../shared/services/message-handler.service"; import { TranslateService } from "@ngx-translate/core"; +import { InlineAlertComponent } from "../../../../../shared/components/inline-alert/inline-alert.component"; @Component({ selector: "new-scanner-modal", templateUrl: "new-scanner-modal.component.html", - styleUrls: ['../../../common.scss'] + styleUrls: ['../../../../../common.scss'] }) export class NewScannerModalComponent { testMap: any = {}; diff --git a/src/portal/src/app/config/scanner/scanner-metadata.ts b/src/portal/src/app/base/left-side-nav/interrogation-services/scanner/scanner-metadata.ts similarity index 100% rename from src/portal/src/app/config/scanner/scanner-metadata.ts rename to src/portal/src/app/base/left-side-nav/interrogation-services/scanner/scanner-metadata.ts diff --git a/src/portal/src/app/config/scanner/scanner-metadata/scanner-metadata.component.spec.ts b/src/portal/src/app/base/left-side-nav/interrogation-services/scanner/scanner-metadata/scanner-metadata.component.spec.ts similarity index 90% rename from src/portal/src/app/config/scanner/scanner-metadata/scanner-metadata.component.spec.ts rename to src/portal/src/app/base/left-side-nav/interrogation-services/scanner/scanner-metadata/scanner-metadata.component.spec.ts index ee9130904..cf956bfc3 100644 --- a/src/portal/src/app/config/scanner/scanner-metadata/scanner-metadata.component.spec.ts +++ b/src/portal/src/app/base/left-side-nav/interrogation-services/scanner/scanner-metadata/scanner-metadata.component.spec.ts @@ -1,11 +1,11 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { BrowserAnimationsModule } from "@angular/platform-browser/animations"; import { ClarityModule } from "@clr/angular"; -import { SharedModule } from "../../../shared/shared.module"; +import { SharedTestingModule } from "../../../../../shared/shared.module"; import { ConfigScannerService } from "../config-scanner.service"; import { of } from "rxjs"; import { ScannerMetadataComponent } from "./scanner-metadata.component"; -import { ErrorHandler } from "../../../../lib/utils/error-handler"; +import { ErrorHandler } from "../../../../../shared/units/error-handler"; describe('ScannerMetadataComponent', () => { let mockScannerMetadata = { @@ -29,7 +29,7 @@ describe('ScannerMetadataComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ imports: [ - SharedModule, + SharedTestingModule, BrowserAnimationsModule, ClarityModule, ], diff --git a/src/portal/src/app/config/scanner/scanner-metadata/scanner-metadata.component.ts b/src/portal/src/app/base/left-side-nav/interrogation-services/scanner/scanner-metadata/scanner-metadata.component.ts similarity index 92% rename from src/portal/src/app/config/scanner/scanner-metadata/scanner-metadata.component.ts rename to src/portal/src/app/base/left-side-nav/interrogation-services/scanner/scanner-metadata/scanner-metadata.component.ts index 9ae523656..c24385088 100644 --- a/src/portal/src/app/config/scanner/scanner-metadata/scanner-metadata.component.ts +++ b/src/portal/src/app/base/left-side-nav/interrogation-services/scanner/scanner-metadata/scanner-metadata.component.ts @@ -6,9 +6,8 @@ import { ConfigScannerService } from "../config-scanner.service"; import { finalize } from "rxjs/operators"; import { ScannerMetadata } from "../scanner-metadata"; import { DatePipe } from "@angular/common"; -import { TranslateService } from "@ngx-translate/core"; -import { ErrorHandler } from "../../../../lib/utils/error-handler"; -import {DATABASE_NEXT_UPDATE_PROPERTY, DATABASE_UPDATED_PROPERTY} from "../../../../lib/utils/utils"; +import { ErrorHandler } from "../../../../../shared/units/error-handler"; +import {DATABASE_NEXT_UPDATE_PROPERTY, DATABASE_UPDATED_PROPERTY} from "../../../../../shared/units/utils"; @Component({ selector: 'scanner-metadata', diff --git a/src/portal/src/app/config/scanner/scanner-metadata/scanner-metadata.html b/src/portal/src/app/base/left-side-nav/interrogation-services/scanner/scanner-metadata/scanner-metadata.html similarity index 100% rename from src/portal/src/app/config/scanner/scanner-metadata/scanner-metadata.html rename to src/portal/src/app/base/left-side-nav/interrogation-services/scanner/scanner-metadata/scanner-metadata.html diff --git a/src/portal/src/app/config/scanner/scanner-metadata/scanner-metadata.scss b/src/portal/src/app/base/left-side-nav/interrogation-services/scanner/scanner-metadata/scanner-metadata.scss similarity index 100% rename from src/portal/src/app/config/scanner/scanner-metadata/scanner-metadata.scss rename to src/portal/src/app/base/left-side-nav/interrogation-services/scanner/scanner-metadata/scanner-metadata.scss diff --git a/src/portal/src/app/config/scanner/scanner.ts b/src/portal/src/app/base/left-side-nav/interrogation-services/scanner/scanner.ts similarity index 100% rename from src/portal/src/app/config/scanner/scanner.ts rename to src/portal/src/app/base/left-side-nav/interrogation-services/scanner/scanner.ts diff --git a/src/portal/src/lib/components/config/vulnerability/scanAll.api.repository.ts b/src/portal/src/app/base/left-side-nav/interrogation-services/vulnerability/scanAll.api.repository.ts similarity index 64% rename from src/portal/src/lib/components/config/vulnerability/scanAll.api.repository.ts rename to src/portal/src/app/base/left-side-nav/interrogation-services/vulnerability/scanAll.api.repository.ts index a1b3115dd..0c009f274 100644 --- a/src/portal/src/lib/components/config/vulnerability/scanAll.api.repository.ts +++ b/src/portal/src/app/base/left-side-nav/interrogation-services/vulnerability/scanAll.api.repository.ts @@ -1,9 +1,9 @@ - -import { Injectable, Inject } from '@angular/core'; +import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { throwError as observableThrowError, Observable } from 'rxjs'; -import { catchError, map } from 'rxjs/operators'; -import { SERVICE_CONFIG, IServiceConfig } from "../../../entities/service.config"; +import { catchError } from 'rxjs/operators'; +import { CURRENT_BASE_HREF } from "../../../../shared/units/utils"; + export abstract class ScanApiRepository { abstract postSchedule(param): Observable; @@ -18,23 +18,22 @@ export abstract class ScanApiRepository { export class ScanApiDefaultRepository extends ScanApiRepository { constructor( private http: HttpClient, - @Inject(SERVICE_CONFIG) private config: IServiceConfig ) { super(); } public postSchedule(param): Observable { - return this.http.post(`${this.config.ScanAllEndpoint}/schedule`, param) + return this.http.post(`${CURRENT_BASE_HREF}/system/scanAll/schedule`, param) .pipe(catchError(error => observableThrowError(error))); } public putSchedule(param): Observable { - return this.http.put(`${this.config.ScanAllEndpoint}/schedule`, param) + return this.http.put(`${CURRENT_BASE_HREF}/system/scanAll/schedule`, param) .pipe(catchError(error => observableThrowError(error))); } public getSchedule(): Observable { - return this.http.get(`${this.config.ScanAllEndpoint}/schedule`) + return this.http.get(`${CURRENT_BASE_HREF}/system/scanAll/schedule`) .pipe(catchError(error => observableThrowError(error))); } diff --git a/src/portal/src/lib/components/config/vulnerability/scanAll.service.ts b/src/portal/src/app/base/left-side-nav/interrogation-services/vulnerability/scanAll.service.ts similarity index 87% rename from src/portal/src/lib/components/config/vulnerability/scanAll.service.ts rename to src/portal/src/app/base/left-side-nav/interrogation-services/vulnerability/scanAll.service.ts index 1baf7ee15..c3cde3482 100644 --- a/src/portal/src/lib/components/config/vulnerability/scanAll.service.ts +++ b/src/portal/src/app/base/left-side-nav/interrogation-services/vulnerability/scanAll.service.ts @@ -1,11 +1,11 @@ import { Injectable } from '@angular/core'; import {Observable, throwError as observableThrowError} from 'rxjs'; import { ScanApiRepository } from './scanAll.api.repository'; -import { ErrorHandler } from '../../../utils/error-handler'; +import { ErrorHandler } from '../../../../shared/units/error-handler'; import {HttpClient} from "@angular/common/http"; -import {ScanningMetrics} from "../config"; +import {ScanningMetrics} from "../../config/config"; import {catchError, map} from "rxjs/operators"; -import { CURRENT_BASE_HREF } from "../../../utils/utils"; +import { CURRENT_BASE_HREF } from "../../../../shared/units/utils"; @Injectable() @@ -13,8 +13,7 @@ export class ScanAllRepoService { constructor( private http: HttpClient, - private scanApiRepository: ScanApiRepository, - private errorHandler: ErrorHandler) { + private scanApiRepository: ScanApiRepository) { } public manualScan(): Observable { diff --git a/src/portal/src/lib/components/config/vulnerability/vulnerability-config.component.html b/src/portal/src/app/base/left-side-nav/interrogation-services/vulnerability/vulnerability-config.component.html similarity index 100% rename from src/portal/src/lib/components/config/vulnerability/vulnerability-config.component.html rename to src/portal/src/app/base/left-side-nav/interrogation-services/vulnerability/vulnerability-config.component.html diff --git a/src/portal/src/lib/components/config/vulnerability/vulnerability-config.component.scss b/src/portal/src/app/base/left-side-nav/interrogation-services/vulnerability/vulnerability-config.component.scss similarity index 84% rename from src/portal/src/lib/components/config/vulnerability/vulnerability-config.component.scss rename to src/portal/src/app/base/left-side-nav/interrogation-services/vulnerability/vulnerability-config.component.scss index c41c45d90..c77f407d4 100644 --- a/src/portal/src/lib/components/config/vulnerability/vulnerability-config.component.scss +++ b/src/portal/src/app/base/left-side-nav/interrogation-services/vulnerability/vulnerability-config.component.scss @@ -109,3 +109,27 @@ .badge { min-width: 30px; } +.info-tips-icon { + color: grey; +} + +.info-tips-icon:hover { + color: #007CBB; +} + +.replication-config { + margin-top: 0; + margin-bottom: 0; +} + +.replication-text { + font-size: 14px; + font-weight: 600; +} + +.replication-tooltip { + top: -8px; +} +.margin-top-3px { + margin-top: 3px; +} diff --git a/src/portal/src/lib/components/config/vulnerability/vulnerability-config.component.spec.ts b/src/portal/src/app/base/left-side-nav/interrogation-services/vulnerability/vulnerability-config.component.spec.ts similarity index 80% rename from src/portal/src/lib/components/config/vulnerability/vulnerability-config.component.spec.ts rename to src/portal/src/app/base/left-side-nav/interrogation-services/vulnerability/vulnerability-config.component.spec.ts index 837ad5fbd..401b7e547 100644 --- a/src/portal/src/lib/components/config/vulnerability/vulnerability-config.component.spec.ts +++ b/src/portal/src/app/base/left-side-nav/interrogation-services/vulnerability/vulnerability-config.component.spec.ts @@ -1,20 +1,15 @@ -import { ComponentFixture, TestBed, waitForAsync, fakeAsync, tick, ComponentFixtureAutoDetect } from '@angular/core/testing'; +import { ComponentFixture, TestBed, waitForAsync, ComponentFixtureAutoDetect } from '@angular/core/testing'; import { VulnerabilityConfigComponent } from "./vulnerability-config.component"; import { ScanAllRepoService } from "./scanAll.service"; import { of } from "rxjs"; import { CUSTOM_ELEMENTS_SCHEMA } from "@angular/core"; -import { IServiceConfig, SERVICE_CONFIG } from "../../../entities/service.config"; -import { ScanningMetrics, Triggers } from "../config"; -import { SharedModule } from "../../../utils/shared/shared.module"; -import { ErrorHandler } from "../../../utils/error-handler"; -import { CURRENT_BASE_HREF } from "../../../utils/utils"; -import { Scanner } from "../../../../app/config/scanner/scanner"; +import { ScanningMetrics, Triggers } from "../../config/config"; +import { ErrorHandler } from "../../../../shared/units/error-handler"; +import { Scanner } from "../scanner/scanner"; +import { SharedTestingModule } from "../../../../shared/shared.module"; let component: VulnerabilityConfigComponent; let fixture: ComponentFixture; -let config: IServiceConfig = { - configurationEndpoint: CURRENT_BASE_HREF + '/configurations/testing' -}; let mockedSchedule = {"schedule": null}; let mockedScheduledMetrics: ScanningMetrics = { total: 50, @@ -66,7 +61,7 @@ describe('VulnerabilityConfigComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ imports: [ - SharedModule, + SharedTestingModule, ], schemas: [ CUSTOM_ELEMENTS_SCHEMA @@ -77,7 +72,6 @@ describe('VulnerabilityConfigComponent', () => { providers: [ {provide: ErrorHandler, useValue: fakedErrorHandler}, {provide: ScanAllRepoService, useValue: fakedScanAllRepoService}, - { provide: SERVICE_CONFIG, useValue: config }, // open auto detect { provide: ComponentFixtureAutoDetect, useValue: true } ] diff --git a/src/portal/src/lib/components/config/vulnerability/vulnerability-config.component.ts b/src/portal/src/app/base/left-side-nav/interrogation-services/vulnerability/vulnerability-config.component.ts similarity index 90% rename from src/portal/src/lib/components/config/vulnerability/vulnerability-config.component.ts rename to src/portal/src/app/base/left-side-nav/interrogation-services/vulnerability/vulnerability-config.component.ts index 8d8c011d8..523430217 100644 --- a/src/portal/src/lib/components/config/vulnerability/vulnerability-config.component.ts +++ b/src/portal/src/app/base/left-side-nav/interrogation-services/vulnerability/vulnerability-config.component.ts @@ -1,20 +1,20 @@ import { Component, ViewChild, OnInit, OnDestroy } from '@angular/core'; import { finalize } from "rxjs/operators"; -import { ScanningMetrics, Triggers } from '../config'; -import { ErrorHandler } from '../../../utils/error-handler'; +import { ScanningMetrics, Triggers } from '../../config/config'; +import { ErrorHandler } from '../../../../shared/units/error-handler'; import { TranslateService } from '@ngx-translate/core'; import { ScanAllRepoService } from './scanAll.service'; -import { OriginCron } from '../../../services'; -import { CronScheduleComponent } from "../../cron-schedule"; -import { DATABASE_UPDATED_PROPERTY, VULNERABILITY_SCAN_STATUS } from "../../../utils/utils"; -import { errorHandler as errorHandFn} from "../../../utils/shared/shared.utils"; +import { OriginCron } from '../../../../shared/services'; +import { CronScheduleComponent } from "../../../../shared/components/cron-schedule"; +import { DATABASE_UPDATED_PROPERTY, VULNERABILITY_SCAN_STATUS } from "../../../../shared/units/utils"; import { DatePipe } from "@angular/common"; +import { errorHandler } from "../../../../shared/units/shared.utils"; const SCHEDULE_TYPE_NONE = "None"; @Component({ selector: 'vulnerability-config', templateUrl: './vulnerability-config.component.html', - styleUrls: ['./vulnerability-config.component.scss', '../registry-config.component.scss'] + styleUrls: ['./vulnerability-config.component.scss'] }) export class VulnerabilityConfigComponent implements OnInit, OnDestroy { onGoing: boolean; @@ -43,7 +43,7 @@ export class VulnerabilityConfigComponent implements OnInit, OnDestroy { hasDefaultScanner: boolean = false; constructor( private scanningService: ScanAllRepoService, - private errorHandler: ErrorHandler, + private errorHandlerEntity: ErrorHandler, private translate: TranslateService, ) { } @@ -89,7 +89,7 @@ export class VulnerabilityConfigComponent implements OnInit, OnDestroy { .subscribe(schedule => { this.initSchedule(schedule); }, error => { - this.errorHandler.error(error); + this.errorHandlerEntity.error(error); }); } getScanners() { @@ -114,7 +114,7 @@ export class VulnerabilityConfigComponent implements OnInit, OnDestroy { this.onGettingUpdatedTimeStr = false; this.translate.get("SCANNER.NO_DEFAULT_SCANNER") .subscribe(res => { - this.errorHandler.warning(res); + this.errorHandlerEntity.warning(res); } ); } @@ -232,7 +232,7 @@ export class VulnerabilityConfigComponent implements OnInit, OnDestroy { .pipe(finalize(() => this.onSubmitting = false)) .subscribe(() => { this.translate.get("CONFIG.SCANNING.TRIGGER_SCAN_ALL_SUCCESS").subscribe((res: string) => { - this.errorHandler.info(res); + this.errorHandlerEntity.info(res); }); // reset metrics and then get new metrics this.scanningMetrics = null; @@ -241,11 +241,11 @@ export class VulnerabilityConfigComponent implements OnInit, OnDestroy { , error => { if (error && error.status && error.status === 412) { this.translate.get("CONFIG.SCANNING.TRIGGER_SCAN_ALL_FAIL", - { error: '' + errorHandFn(error) }).subscribe((res: string) => { - this.errorHandler.error(res); + { error: '' + errorHandler(error) }).subscribe((res: string) => { + this.errorHandlerEntity.error(res); }); } else { - this.errorHandler.error(error); + this.errorHandlerEntity.error(error); } }); } @@ -267,26 +267,26 @@ export class VulnerabilityConfigComponent implements OnInit, OnDestroy { this.translate .get("CONFIG.SAVE_SUCCESS") .subscribe((res) => { - this.errorHandler.info(res); + this.errorHandlerEntity.info(res); this.CronScheduleComponent.resetSchedule(); }); this.reset(cron); }, error => { - this.errorHandler.error(error); + this.errorHandlerEntity.error(error); } ); } else { this.scanningService.postSchedule(this.CronScheduleComponent.scheduleType, cron) .subscribe(response => { this.translate.get("CONFIG.SAVE_SUCCESS").subscribe((res) => { - this.errorHandler.info(res); + this.errorHandlerEntity.info(res); this.CronScheduleComponent.resetSchedule(); }); this.reset(cron); }, error => { - this.errorHandler.error(error); + this.errorHandlerEntity.error(error); } ); } diff --git a/src/portal/src/app/labels/labels.component.html b/src/portal/src/app/base/left-side-nav/labels/labels.component.html similarity index 100% rename from src/portal/src/app/labels/labels.component.html rename to src/portal/src/app/base/left-side-nav/labels/labels.component.html diff --git a/src/portal/src/app/labels/labels.component.spec.ts b/src/portal/src/app/base/left-side-nav/labels/labels.component.spec.ts similarity index 91% rename from src/portal/src/app/labels/labels.component.spec.ts rename to src/portal/src/app/base/left-side-nav/labels/labels.component.spec.ts index 3f9915d17..a54c9159f 100644 --- a/src/portal/src/app/labels/labels.component.spec.ts +++ b/src/portal/src/app/base/left-side-nav/labels/labels.component.spec.ts @@ -5,7 +5,7 @@ import { CUSTOM_ELEMENTS_SCHEMA } from "@angular/core"; import { TranslateService } from "@ngx-translate/core"; import { ClarityModule } from "@clr/angular"; import { BrowserAnimationsModule } from "@angular/platform-browser/animations"; -import { SharedModule } from "../shared/shared.module"; +import { SharedTestingModule } from "../../../shared/shared.module"; describe('LabelsComponent', () => { let component: LabelsComponent; @@ -14,7 +14,7 @@ describe('LabelsComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ imports: [ - SharedModule, + SharedTestingModule, BrowserAnimationsModule, ClarityModule, ], diff --git a/src/portal/src/app/labels/labels.component.ts b/src/portal/src/app/base/left-side-nav/labels/labels.component.ts similarity index 100% rename from src/portal/src/app/labels/labels.component.ts rename to src/portal/src/app/base/left-side-nav/labels/labels.component.ts diff --git a/src/portal/src/app/log/log-page.component.ts b/src/portal/src/app/base/left-side-nav/labels/labels.module.ts similarity index 55% rename from src/portal/src/app/log/log-page.component.ts rename to src/portal/src/app/base/left-side-nav/labels/labels.module.ts index a688f3880..3465b9be9 100644 --- a/src/portal/src/app/log/log-page.component.ts +++ b/src/portal/src/app/base/left-side-nav/labels/labels.module.ts @@ -11,12 +11,27 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -import { Component } from '@angular/core'; -@Component({ - selector: 'log-page', - templateUrl: './log-page.component.html' +import { NgModule } from "@angular/core"; +import { SharedModule } from "../../../shared/shared.module";; +import { RouterModule, Routes } from "@angular/router"; +import { LabelsComponent } from "./labels.component"; + + +const routes: Routes = [ + { + path: '', + component: LabelsComponent + }, +]; +@NgModule({ + imports: [ + SharedModule, + RouterModule.forChild(routes), + ], + declarations: [ + LabelsComponent, + ], }) - -export class LogPageComponent { +export class LabelsModule { } diff --git a/src/portal/src/app/log/log.module.ts b/src/portal/src/app/base/left-side-nav/log/log.module.ts similarity index 66% rename from src/portal/src/app/log/log.module.ts rename to src/portal/src/app/base/left-side-nav/log/log.module.ts index 3712d7e45..2c62127b3 100644 --- a/src/portal/src/app/log/log.module.ts +++ b/src/portal/src/app/base/left-side-nav/log/log.module.ts @@ -12,18 +12,23 @@ // See the License for the specific language governing permissions and // limitations under the License. import { NgModule } from '@angular/core'; -import { AuditLogComponent } from './audit-log.component'; -import { SharedModule } from '../shared/shared.module'; -import { LogPageComponent } from './log-page.component'; +import { SharedModule } from '../../../shared/shared.module'; +import { RecentLogComponent } from "./recent-log.component"; +import { RouterModule, Routes } from "@angular/router"; +const routes: Routes = [ + { + path: '', + component: RecentLogComponent + }, +]; @NgModule({ - imports: [SharedModule], - declarations: [ - AuditLogComponent, - LogPageComponent + imports: [ + SharedModule, + RouterModule.forChild(routes), ], - exports: [ - AuditLogComponent, - LogPageComponent] + declarations: [ + RecentLogComponent, + ] }) export class LogModule { } diff --git a/src/portal/src/lib/components/log/recent-log.component.html b/src/portal/src/app/base/left-side-nav/log/recent-log.component.html similarity index 100% rename from src/portal/src/lib/components/log/recent-log.component.html rename to src/portal/src/app/base/left-side-nav/log/recent-log.component.html diff --git a/src/portal/src/lib/components/log/recent-log.component.scss b/src/portal/src/app/base/left-side-nav/log/recent-log.component.scss similarity index 100% rename from src/portal/src/lib/components/log/recent-log.component.scss rename to src/portal/src/app/base/left-side-nav/log/recent-log.component.scss diff --git a/src/portal/src/lib/components/log/recent-log.component.spec.ts b/src/portal/src/app/base/left-side-nav/log/recent-log.component.spec.ts similarity index 85% rename from src/portal/src/lib/components/log/recent-log.component.spec.ts rename to src/portal/src/app/base/left-side-nav/log/recent-log.component.spec.ts index 9bc35b46c..75eaae60b 100644 --- a/src/portal/src/lib/components/log/recent-log.component.spec.ts +++ b/src/portal/src/app/base/left-side-nav/log/recent-log.component.spec.ts @@ -1,25 +1,20 @@ import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; import { DebugElement } from '@angular/core'; import { RecentLogComponent } from './recent-log.component'; -import { SERVICE_CONFIG, IServiceConfig } from '../../entities/service.config'; -import { ErrorHandler } from '../../utils/error-handler'; -import { SharedModule } from '../../utils/shared/shared.module'; -import { FilterComponent } from '../filter/filter.component'; -import { click, CURRENT_BASE_HREF } from '../../utils/utils'; +import { ErrorHandler } from '../../../shared/units/error-handler'; +import { FilterComponent } from '../../../shared/components/filter/filter.component'; +import { click } from '../../../shared/units/utils'; import { of } from 'rxjs'; -import { AuditLog } from "../../../../ng-swagger-gen/models/audit-log"; -import { AuditlogService } from "../../../../ng-swagger-gen/services/auditlog.service"; +import { AuditLog } from "../../../../../ng-swagger-gen/models/audit-log"; +import { AuditlogService } from "../../../../../ng-swagger-gen/services/auditlog.service"; import { HttpHeaders, HttpResponse } from "@angular/common/http"; import { delay } from "rxjs/operators"; +import { SharedTestingModule } from "../../../shared/shared.module"; describe('RecentLogComponent (inline template)', () => { let component: RecentLogComponent; let fixture: ComponentFixture; - let serviceConfig: IServiceConfig; let auditlogService: AuditlogService; - let testConfig: IServiceConfig = { - logBaseEndpoint: CURRENT_BASE_HREF + "/logs/testing" - }; const fakedErrorHandler = { error() { return undefined; @@ -76,13 +71,12 @@ describe('RecentLogComponent (inline template)', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ imports: [ - SharedModule + SharedTestingModule ], declarations: [FilterComponent, RecentLogComponent], providers: [ { provide: ErrorHandler, useValue: fakedErrorHandler }, { provide: AuditlogService, useValue: fakedAuditlogService }, - { provide: SERVICE_CONFIG, useValue: testConfig }, ] }); @@ -91,7 +85,6 @@ describe('RecentLogComponent (inline template)', () => { beforeEach(() => { fixture = TestBed.createComponent(RecentLogComponent); component = fixture.componentInstance; - serviceConfig = TestBed.get(SERVICE_CONFIG); auditlogService = fixture.debugElement.injector.get(AuditlogService); fixture.detectChanges(); }); @@ -99,12 +92,6 @@ describe('RecentLogComponent (inline template)', () => { it('should be created', () => { expect(component).toBeTruthy(); }); - - it('should inject the SERVICE_CONFIG', () => { - expect(serviceConfig).toBeTruthy(); - expect(serviceConfig.logBaseEndpoint).toEqual(CURRENT_BASE_HREF + "/logs/testing"); - }); - it('should get data from AccessLogService', waitForAsync(() => { expect(auditlogService).toBeTruthy(); fixture.detectChanges(); diff --git a/src/portal/src/lib/components/log/recent-log.component.ts b/src/portal/src/app/base/left-side-nav/log/recent-log.component.ts similarity index 90% rename from src/portal/src/lib/components/log/recent-log.component.ts rename to src/portal/src/app/base/left-side-nav/log/recent-log.component.ts index b6440e310..a00b7767b 100644 --- a/src/portal/src/lib/components/log/recent-log.component.ts +++ b/src/portal/src/app/base/left-side-nav/log/recent-log.component.ts @@ -11,11 +11,11 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -import { Component, OnInit, Input } from '@angular/core'; -import { ErrorHandler } from '../../utils/error-handler'; +import { Component, OnInit } from '@angular/core'; +import { ErrorHandler } from '../../../shared/units/error-handler'; import { finalize } from "rxjs/operators"; -import { AuditlogService } from "../../../../ng-swagger-gen/services/auditlog.service"; -import { AuditLog } from "../../../../ng-swagger-gen/models/audit-log"; +import { AuditlogService } from "../../../../../ng-swagger-gen/services/auditlog.service"; +import { AuditLog } from "../../../../../ng-swagger-gen/models/audit-log"; import ListAuditLogsParams = AuditlogService.ListAuditLogsParams; import { ClrDatagridStateInterface } from '@clr/angular'; @@ -31,7 +31,6 @@ export class RecentLogComponent implements OnInit { currentTerm: string; defaultFilter = "username"; isOpenFilterTag: boolean; - @Input() withTitle: boolean = false; pageSize: number = 15; currentPage: number = 1; // Double bound to pagination component totalCount: number = 0; diff --git a/src/portal/src/app/project-quotas/project-quotas.component.html b/src/portal/src/app/base/left-side-nav/project-quotas/project-quotas-container.component.html similarity index 100% rename from src/portal/src/app/project-quotas/project-quotas.component.html rename to src/portal/src/app/base/left-side-nav/project-quotas/project-quotas-container.component.html diff --git a/src/portal/src/app/project-quotas/project-quotas.component.scss b/src/portal/src/app/base/left-side-nav/project-quotas/project-quotas-container.component.scss similarity index 100% rename from src/portal/src/app/project-quotas/project-quotas.component.scss rename to src/portal/src/app/base/left-side-nav/project-quotas/project-quotas-container.component.scss diff --git a/src/portal/src/app/project-quotas/project-quotas.component.spec.ts b/src/portal/src/app/base/left-side-nav/project-quotas/project-quotas-container.component.spec.ts similarity index 63% rename from src/portal/src/app/project-quotas/project-quotas.component.spec.ts rename to src/portal/src/app/base/left-side-nav/project-quotas/project-quotas-container.component.spec.ts index 477442e56..00d708090 100644 --- a/src/portal/src/app/project-quotas/project-quotas.component.spec.ts +++ b/src/portal/src/app/base/left-side-nav/project-quotas/project-quotas-container.component.spec.ts @@ -1,17 +1,17 @@ import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; -import { ProjectQuotasComponent } from './project-quotas.component'; -import { TranslateModule } from "@ngx-translate/core"; +import { ProjectQuotasContainerComponent } from './project-quotas-container.component'; import { CUSTOM_ELEMENTS_SCHEMA } from "@angular/core"; -import { MessageHandlerService } from "../shared/message-handler/message-handler.service"; -import { SessionService } from "../shared/session.service"; -import { SessionUser } from "../shared/session-user"; -import { ConfigurationService } from "../config/config.service"; +import { MessageHandlerService } from "../../../shared/services/message-handler.service"; +import { SessionService } from "../../../shared/services/session.service"; +import { SessionUser } from "../../../shared/entities/session-user"; +import { ConfigurationService } from "../../../services/config.service"; import { of } from "rxjs"; -import { Configuration } from "../../lib/components/config/config"; +import { Configuration } from "../config/config"; +import { SharedTestingModule } from "../../../shared/shared.module"; -describe('ProjectQuotasComponent', () => { - let component: ProjectQuotasComponent; - let fixture: ComponentFixture; +describe('ProjectQuotasContainerComponent', () => { + let component: ProjectQuotasContainerComponent; + let fixture: ComponentFixture; const mockedUser: SessionUser = { user_id: 1, username: 'admin', @@ -41,11 +41,10 @@ describe('ProjectQuotasComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ imports: [ - TranslateModule.forRoot() + SharedTestingModule ], - declarations: [ ProjectQuotasComponent ], + declarations: [ ProjectQuotasContainerComponent ], providers: [ - MessageHandlerService, {provide: MessageHandlerService, useValue: fakedMessageHandlerService}, {provide: SessionService, useValue: fakedSessionService}, {provide: ConfigurationService, useValue: fakedConfigurationService} @@ -58,7 +57,7 @@ describe('ProjectQuotasComponent', () => { })); beforeEach(() => { - fixture = TestBed.createComponent(ProjectQuotasComponent); + fixture = TestBed.createComponent(ProjectQuotasContainerComponent); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/src/portal/src/app/project-quotas/project-quotas.component.ts b/src/portal/src/app/base/left-side-nav/project-quotas/project-quotas-container.component.ts similarity index 66% rename from src/portal/src/app/project-quotas/project-quotas.component.ts rename to src/portal/src/app/base/left-side-nav/project-quotas/project-quotas-container.component.ts index 81aee065b..2c4b9ccf1 100644 --- a/src/portal/src/app/project-quotas/project-quotas.component.ts +++ b/src/portal/src/app/base/left-side-nav/project-quotas/project-quotas-container.component.ts @@ -1,16 +1,16 @@ import { Component, OnInit } from '@angular/core'; -import { SessionService } from "../shared/session.service"; -import { ConfigurationService } from "../config/config.service"; -import { MessageHandlerService } from "../shared/message-handler/message-handler.service"; +import { SessionService } from "../../../shared/services/session.service"; +import { ConfigurationService } from "../../../services/config.service"; +import { MessageHandlerService } from "../../../shared/services/message-handler.service"; import { finalize } from "rxjs/operators"; -import { Configuration } from "../../lib/components/config/config"; +import { Configuration } from "../config/config"; @Component({ selector: 'app-project-quotas', - templateUrl: './project-quotas.component.html', - styleUrls: ['./project-quotas.component.scss'] + templateUrl: './project-quotas-container.component.html', + styleUrls: ['./project-quotas-container.component.scss'] }) -export class ProjectQuotasComponent implements OnInit { +export class ProjectQuotasContainerComponent implements OnInit { allConfig: Configuration = new Configuration(); loading: boolean = false; constructor(private session: SessionService, diff --git a/src/portal/src/app/base/left-side-nav/project-quotas/project-quotas.module.ts b/src/portal/src/app/base/left-side-nav/project-quotas/project-quotas.module.ts new file mode 100644 index 000000000..7f317552a --- /dev/null +++ b/src/portal/src/app/base/left-side-nav/project-quotas/project-quotas.module.ts @@ -0,0 +1,42 @@ +// Copyright Project Harbor Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import { NgModule } from "@angular/core"; +import { SharedModule } from "../../../shared/shared.module"; +import { RouterModule, Routes } from "@angular/router"; +import { ProjectQuotasContainerComponent } from "./project-quotas-container.component"; +import { ProjectQuotasComponent } from "./project-quotas/project-quotas.component"; +import { EditProjectQuotasComponent } from "./project-quotas/edit-project-quotas/edit-project-quotas.component"; +import { QuotaService } from "../../../shared/services"; + + +const routes: Routes = [ + { + path: '', + component: ProjectQuotasContainerComponent + }, +]; +@NgModule({ + imports: [ + SharedModule, + RouterModule.forChild(routes), + ], + declarations: [ + ProjectQuotasContainerComponent, + ProjectQuotasComponent, + EditProjectQuotasComponent + ], +}) +export class ProjectQuotasModule { +} diff --git a/src/portal/src/lib/components/config/project-quotas/edit-project-quotas/edit-project-quotas.component.html b/src/portal/src/app/base/left-side-nav/project-quotas/project-quotas/edit-project-quotas/edit-project-quotas.component.html similarity index 98% rename from src/portal/src/lib/components/config/project-quotas/edit-project-quotas/edit-project-quotas.component.html rename to src/portal/src/app/base/left-side-nav/project-quotas/project-quotas/edit-project-quotas/edit-project-quotas.component.html index 98f3365a8..8aedc8980 100644 --- a/src/portal/src/lib/components/config/project-quotas/edit-project-quotas/edit-project-quotas.component.html +++ b/src/portal/src/app/base/left-side-nav/project-quotas/project-quotas/edit-project-quotas/edit-project-quotas.component.html @@ -1,6 +1,6 @@ - +