From 2122503599b9adf463caaa53fa7046635f2ecfb3 Mon Sep 17 00:00:00 2001 From: "Deng, Qian" Date: Thu, 4 Jan 2018 11:31:25 +0800 Subject: [PATCH] Replace Navigation bar from Sidenav to Vertical Nav 1. Replace Sidenav to VerticalNav 2. Update related test case 3. Move Endpoint and Repliction to two different label --- src/ui_ng/package.json | 2 +- .../harbor-shell/harbor-shell.component.html | 56 ++++++++++++++----- src/ui_ng/src/app/harbor-routing.module.ts | 22 ++------ .../destination-page.component.html | 3 +- .../replication-management.component.ts | 4 ++ .../total-replication-page.component.html | 3 +- src/ui_ng/src/i18n/lang/en-us-lang.json | 3 +- src/ui_ng/src/i18n/lang/es-es-lang.json | 3 +- src/ui_ng/src/i18n/lang/zh-cn-lang.json | 1 + .../Administration-Users_Elements.robot | 4 +- .../Harbor-Pages/Configuration.robot | 30 +++++----- .../Harbor-Pages/Configuration_Elements.robot | 2 + tests/resources/Harbor-Pages/Project.robot | 2 +- .../Harbor-Pages/Project_Elements.robot | 6 +- .../Harbor-Pages/Replication_Elements.robot | 1 + .../resources/Harbor-Pages/UserProfile.robot | 2 +- 16 files changed, 86 insertions(+), 58 deletions(-) diff --git a/src/ui_ng/package.json b/src/ui_ng/package.json index aa3936f82..ce01b4a9d 100644 --- a/src/ui_ng/package.json +++ b/src/ui_ng/package.json @@ -31,7 +31,7 @@ "clarity-icons": "^0.10.17", "clarity-ui": "^0.10.17", "core-js": "^2.4.1", - "harbor-ui": "0.6.6-dev.0", + "harbor-ui": "0.6.6", "intl": "^1.2.5", "mutationobserver-shim": "^0.3.2", "ngx-cookie": "^1.0.0", diff --git a/src/ui_ng/src/app/base/harbor-shell/harbor-shell.component.html b/src/ui_ng/src/app/base/harbor-shell/harbor-shell.component.html index efe767bf4..b47b68883 100644 --- a/src/ui_ng/src/app/base/harbor-shell/harbor-shell.component.html +++ b/src/ui_ng/src/app/base/harbor-shell/harbor-shell.component.html @@ -8,21 +8,47 @@ - + + + + {{'SIDE_NAV.PROJECTS' | translate}} + + + + {{'SIDE_NAV.LOGS' | translate}} + + + + {{'SIDE_NAV.SYSTEM_MGMT.NAME' | translate}} + + + + + {{'SIDE_NAV.SYSTEM_MGMT.USER' | translate}} + + + + {{'SIDE_NAV.SYSTEM_MGMT.REGISTRY' | translate}} + + + + {{'SIDE_NAV.SYSTEM_MGMT.REPLICATION' | translate}} + + + + {{'SIDE_NAV.SYSTEM_MGMT.CONFIG' | translate}} + + + + diff --git a/src/ui_ng/src/app/harbor-routing.module.ts b/src/ui_ng/src/app/harbor-routing.module.ts index fa01bf976..934e914ca 100644 --- a/src/ui_ng/src/app/harbor-routing.module.ts +++ b/src/ui_ng/src/app/harbor-routing.module.ts @@ -78,25 +78,15 @@ const harborRoutes: Routes = [ component: UserComponent, canActivate: [SystemAdminGuard] }, + { + path: 'registries', + component: DestinationPageComponent, + canActivate: [SystemAdminGuard] + }, { path: 'replications', - component: ReplicationManagementComponent, + component: TotalReplicationPageComponent, canActivate: [SystemAdminGuard], - canActivateChild: [SystemAdminGuard], - children: [ - { - path: 'rules', - component: TotalReplicationPageComponent - }, - { - path: 'endpoints', - component: DestinationPageComponent - }, - { - path: '**', - redirectTo: 'endpoints' - } - ] }, { path: 'tags/:id/:repo', diff --git a/src/ui_ng/src/app/replication/destination/destination-page.component.html b/src/ui_ng/src/app/replication/destination/destination-page.component.html index 3d0c138d2..612bae5f8 100644 --- a/src/ui_ng/src/app/replication/destination/destination-page.component.html +++ b/src/ui_ng/src/app/replication/destination/destination-page.component.html @@ -1,3 +1,4 @@ -
+

{{'SIDE_NAV.SYSTEM_MGMT.REGISTRY' | translate}}

+
\ No newline at end of file diff --git a/src/ui_ng/src/app/replication/replication-management/replication-management.component.ts b/src/ui_ng/src/app/replication/replication-management/replication-management.component.ts index a81236c8b..1996213d7 100644 --- a/src/ui_ng/src/app/replication/replication-management/replication-management.component.ts +++ b/src/ui_ng/src/app/replication/replication-management/replication-management.component.ts @@ -11,6 +11,10 @@ // 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. + +// This Module is used as Container For Endpoint and Replication Rules +// Will deprecated on Harbor 1.4.0 + import { Component } from '@angular/core'; @Component({ diff --git a/src/ui_ng/src/app/replication/total-replication/total-replication-page.component.html b/src/ui_ng/src/app/replication/total-replication/total-replication-page.component.html index b93ec2ca3..9b0e1fb7f 100644 --- a/src/ui_ng/src/app/replication/total-replication/total-replication-page.component.html +++ b/src/ui_ng/src/app/replication/total-replication/total-replication-page.component.html @@ -1,3 +1,4 @@ -
+

{{'SIDE_NAV.SYSTEM_MGMT.REPLICATION' | translate}}

+
\ No newline at end of file diff --git a/src/ui_ng/src/i18n/lang/en-us-lang.json b/src/ui_ng/src/i18n/lang/en-us-lang.json index 071639669..a3a4de2b4 100644 --- a/src/ui_ng/src/i18n/lang/en-us-lang.json +++ b/src/ui_ng/src/i18n/lang/en-us-lang.json @@ -100,7 +100,8 @@ "SYSTEM_MGMT": { "NAME": "Administration", "USER": "Users", - "REPLICATION": "Replication", + "REGISTRY": "Registries", + "REPLICATION": "Replications", "CONFIG": "Configuration" }, "LOGS": "Logs" diff --git a/src/ui_ng/src/i18n/lang/es-es-lang.json b/src/ui_ng/src/i18n/lang/es-es-lang.json index 1c0a4b161..d74968509 100644 --- a/src/ui_ng/src/i18n/lang/es-es-lang.json +++ b/src/ui_ng/src/i18n/lang/es-es-lang.json @@ -96,7 +96,8 @@ "SYSTEM_MGMT": { "NAME": "Administración", "USER": "Usuarios", - "REPLICATION": "Replicación", + "REGISTRY": "Registries", + "REPLICATION": "Replicacións", "CONFIG": "Configuración" }, "LOGS": "Logs" diff --git a/src/ui_ng/src/i18n/lang/zh-cn-lang.json b/src/ui_ng/src/i18n/lang/zh-cn-lang.json index f498730c5..483d94e75 100644 --- a/src/ui_ng/src/i18n/lang/zh-cn-lang.json +++ b/src/ui_ng/src/i18n/lang/zh-cn-lang.json @@ -96,6 +96,7 @@ "SYSTEM_MGMT": { "NAME": "系统管理", "USER": "用户管理", + "REGISTRY": "仓库管理", "REPLICATION": "复制管理", "CONFIG": "配置管理" }, diff --git a/tests/resources/Harbor-Pages/Administration-Users_Elements.robot b/tests/resources/Harbor-Pages/Administration-Users_Elements.robot index b1aad665f..b278ae6b6 100644 --- a/tests/resources/Harbor-Pages/Administration-Users_Elements.robot +++ b/tests/resources/Harbor-Pages/Administration-Users_Elements.robot @@ -16,5 +16,5 @@ Documentation This resource provides any keywords related to the Harbor private registry appliance *** Variables *** -${administration_user_tag_xpath} /html/body/harbor-app/harbor-shell/clr-main-container/div/nav/section/section/ul/li[1]/a -${administration_tag_xpath} /html/body/harbor-app/harbor-shell/clr-main-container/div/nav/section/section/label \ No newline at end of file +${administration_user_tag_xpath} //clr-vertical-nav-group-children/a[contains(.,'Users')] +${administration_tag_xpath} //clr-vertical-nav-group[contains(.,'Admin')] \ No newline at end of file diff --git a/tests/resources/Harbor-Pages/Configuration.robot b/tests/resources/Harbor-Pages/Configuration.robot index 14a6a928d..e4c1cec4c 100644 --- a/tests/resources/Harbor-Pages/Configuration.robot +++ b/tests/resources/Harbor-Pages/Configuration.robot @@ -38,14 +38,14 @@ Init LDAP Sleep 1 Capture Page Screenshot Disable Ldap Verify Cert Checkbox - Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/config/div/div/div/button[1] + Click Element xpath=${config_save_button_xpath} Sleep 2 Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/config/div/div/div/button[3] Sleep 1 Capture Page Screenshot Switch To Configure - Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/nav/section/section/ul/li[3]/a + Click Element xpath=${configuration_xpath} Sleep 2 Test Ldap Connection @@ -89,32 +89,32 @@ Ldap Verify Cert Checkbox Should Be Disabled Set Pro Create Admin Only #set limit to admin only Sleep 2 - Click Element xpath=//clr-main-container//nav//ul/li[3] + Click Element xpath=${configuration_xpath} Sleep 1 Click Element xpath=//select[@id="proCreation"] Click Element xpath=//select[@id="proCreation"]//option[@value="adminonly"] Sleep 1 - Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/config/div/div/div/button[1] + Click Element xpath=${config_save_button_xpath} Capture Page Screenshot AdminCreateOnly.png Set Pro Create Every One #set limit to Every One - Click Element xpath=//clr-main-container//nav//ul/li[3] + Click Element xpath=${configuration_xpath} Sleep 1 Click Element xpath=//select[@id="proCreation"] Click Element xpath=//select[@id="proCreation"]//option[@value="everyone"] Sleep 1 - Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/config/div/div/div/button[1] + Click Element xpath=${config_save_button_xpath} Sleep 2 Capture Page Screenshot EveryoneCreate.png Disable Self Reg - Click Element xpath=//clr-main-container//nav//ul/li[3] + Click Element xpath=${configuration_xpath} Mouse Down xpath=${self_reg_xpath} Mouse Up xpath=${self_reg_xpath} Sleep 1 Self Reg Should Be Disabled - Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/config/div/div/div/button[1] + Click Element xpath=${config_save_button_xpath} Capture Page Screenshot DisableSelfReg.png Sleep 1 @@ -123,7 +123,7 @@ Enable Self Reg Mouse Up xpath=${self_reg_xpath} Sleep 1 Self Reg Should Be Enabled - Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/config/div/div/div/button[1] + Click Element xpath=${config_save_button_xpath} Capture Page Screenshot EnableSelfReg.png Sleep 1 @@ -142,13 +142,13 @@ Project Creation Should Not Display ## System settings Switch To System Settings Sleep 1 - Click Element xpath=//clr-main-container//nav//ul/li[3] + Click Element xpath=${configuration_xpath} Click Element xpath=//*[@id="config-system"] Modify Token Expiration [Arguments] ${minutes} Input Text xpath=//*[@id="tokenExpiration"] ${minutes} - Click Button xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/config/div/div/div/button[1] + Click Button xpath=${config_save_button_xpath} Sleep 1 Token Must Be Match @@ -159,7 +159,7 @@ Token Must Be Match Check Verify Remote Cert Mouse Down xpath=//*[@id="clr-checkbox-verifyRemoteCert"] Mouse Up xpath=//*[@id="clr-checkbox-verifyRemoteCert"] - Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/config/div/div/div/button[1] + Click Element xpath=${config_save_button_xpath} Capture Page Screenshot RemoteCert.png Sleep 1 @@ -191,7 +191,7 @@ Config Email Mouse Down xpath=//*[@id="clr-checkbox-emailInsecure"] Mouse Up xpath=//*[@id="clr-checkbox-emailInsecure"] Sleep 1 - Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/div/config/div/div/div/button[1] + Click Element xpath=${config_save_button_xpath} Sleep 6 Verify Email @@ -206,11 +206,11 @@ Set Scan All To None click element //vulnerability-config//select click element //vulnerability-config//select/option[@value='none'] sleep 1 - click element //config//div/button[contains(.,'SAVE')] + click element ${config_save_button_xpath} Set Scan All To Daily click element //vulnerability-config//select click element //vulnerability-config//select/option[@value='daily'] sleep 1 - click element //config//div/button[contains(.,'SAVE')] + click element ${config_save_button_xpath} Click Scan Now click element //vulnerability-config//button[contains(.,'SCAN')] \ No newline at end of file diff --git a/tests/resources/Harbor-Pages/Configuration_Elements.robot b/tests/resources/Harbor-Pages/Configuration_Elements.robot index 04bd2ffa2..8cb6649b5 100644 --- a/tests/resources/Harbor-Pages/Configuration_Elements.robot +++ b/tests/resources/Harbor-Pages/Configuration_Elements.robot @@ -19,3 +19,5 @@ Documentation This resource provides any keywords related to the Harbor private ${project_create_xpath} //clr-dg-action-bar//button[contains(.,'New')] ${self_reg_xpath} //input[@id="clr-checkbox-selfReg"] ${test_ldap_xpath} /html/body/harbor-app/harbor-shell/clr-main-container/div/div/config/div/div/div/button[3] +${config_save_button_xpath} //config//div/button[contains(.,'SAVE')] +${configuration_xpath} //clr-vertical-nav-group-children/a[contains(.,'Configuration')] \ No newline at end of file diff --git a/tests/resources/Harbor-Pages/Project.robot b/tests/resources/Harbor-Pages/Project.robot index 196a493c4..0ee7c2e5a 100644 --- a/tests/resources/Harbor-Pages/Project.robot +++ b/tests/resources/Harbor-Pages/Project.robot @@ -56,7 +56,7 @@ Switch To Log Sleep 1 Switch To Replication - Click Element xpath=${replication_xpath} + Click Element xpath=${project_replication_xpath} Sleep 1 Back To projects diff --git a/tests/resources/Harbor-Pages/Project_Elements.robot b/tests/resources/Harbor-Pages/Project_Elements.robot index 0902c3ecf..57175ee05 100644 --- a/tests/resources/Harbor-Pages/Project_Elements.robot +++ b/tests/resources/Harbor-Pages/Project_Elements.robot @@ -20,6 +20,6 @@ ${create_project_button_css} .btn ${project_name_xpath} //*[@id="create_project_name"] ${project_public_xpath} //input[@name='public']/..//label ${project_save_css} html body.no-scrolling harbor-app harbor-shell clr-main-container.main-container div.content-container div.content-area.content-area-override project div.row div.col-lg-12.col-md-12.col-sm-12.col-xs-12 div.row.flex-items-xs-between div.option-left create-project clr-modal div.modal div.modal-dialog div.modal-content div.modal-footer button.btn.btn-primary -${log_xpath} /html/body/harbor-app/harbor-shell/clr-main-container/div/nav/section/a[2] -${projects_xpath} /html/body/harbor-app/harbor-shell/clr-main-container/div/nav/section/a[1] -${replication_xpath} /html/body/harbor-app/harbor-shell/clr-main-container/div/div/project-detail/nav/ul/li[4]/a +${log_xpath} //clr-main-container/div/clr-vertical-nav/div/a[contains(.,'Logs')] +${projects_xpath} //clr-main-container/div/clr-vertical-nav/div/a[contains(.,'Projects')] +${project_replication_xpath} //project-detail//a[contains(.,'Replication')] \ No newline at end of file diff --git a/tests/resources/Harbor-Pages/Replication_Elements.robot b/tests/resources/Harbor-Pages/Replication_Elements.robot index 3265678a2..0976ddf1c 100644 --- a/tests/resources/Harbor-Pages/Replication_Elements.robot +++ b/tests/resources/Harbor-Pages/Replication_Elements.robot @@ -26,3 +26,4 @@ ${destination_url_xpath} //*[@id='destination_url'] ${destination_username_xpath} //*[@id='destination_username'] ${destination_password_xpath} //*[@id='destination_password'] ${replicaton_save_xpath} //button[contains(.,'OK')] +${replication_xpath} //clr-vertical-nav-group-children/a[contains(.,'Replication')] \ No newline at end of file diff --git a/tests/resources/Harbor-Pages/UserProfile.robot b/tests/resources/Harbor-Pages/UserProfile.robot index b8d0990f4..6e20cf16f 100644 --- a/tests/resources/Harbor-Pages/UserProfile.robot +++ b/tests/resources/Harbor-Pages/UserProfile.robot @@ -31,7 +31,7 @@ Change Password Sleep 1 Click Element xpath=//password-setting/clr-modal//button[2] Sleep 2 - Click Element xpath=/html/body/harbor-app/harbor-shell/clr-main-container/div/nav/section/a[2] + Click Element xpath=${log_xpath} Sleep 1 Update User Comment