From 8cf7d4f8225e1f706821d773a25d50742473e6d8 Mon Sep 17 00:00:00 2001 From: Qian Deng Date: Thu, 16 Aug 2018 20:32:59 +0800 Subject: [PATCH] Fix item number and i18n issues Fix item number presentation on Group, charts, chart versions, member group add Signed-off-by: Qian Deng --- src/ui_ng/lib/src/helm-chart/helm-chart.component.html | 5 ++++- src/ui_ng/lib/src/helm-chart/helm-chart.component.ts | 1 + .../helm-chart/versions/helm-chart-version.component.html | 7 +++++-- .../helm-chart/versions/helm-chart-version.component.ts | 1 + src/ui_ng/src/app/group/group.component.html | 5 ++++- .../app/project/member/add-group/add-group.component.html | 5 ++++- .../app/project/member/add-group/add-group.component.ts | 2 ++ src/ui_ng/src/i18n/lang/en-us-lang.json | 4 +++- src/ui_ng/src/i18n/lang/es-es-lang.json | 4 +++- src/ui_ng/src/i18n/lang/fr-fr-lang.json | 4 +++- src/ui_ng/src/i18n/lang/zh-cn-lang.json | 8 +++++--- 11 files changed, 35 insertions(+), 11 deletions(-) diff --git a/src/ui_ng/lib/src/helm-chart/helm-chart.component.html b/src/ui_ng/lib/src/helm-chart/helm-chart.component.html index 27c74cab2..22158f8c8 100644 --- a/src/ui_ng/lib/src/helm-chart/helm-chart.component.html +++ b/src/ui_ng/lib/src/helm-chart/helm-chart.component.html @@ -45,7 +45,10 @@ {{ chart.created | date }} - + + + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} {{'HELM_CHART.OF' | translate}} + {{pagination.totalItems}} {{'HELM_CHART.ITEMS'| translate}} diff --git a/src/ui_ng/lib/src/helm-chart/helm-chart.component.ts b/src/ui_ng/lib/src/helm-chart/helm-chart.component.ts index beb32a7f8..2ebd20e6a 100644 --- a/src/ui_ng/lib/src/helm-chart/helm-chart.component.ts +++ b/src/ui_ng/lib/src/helm-chart/helm-chart.component.ts @@ -105,6 +105,7 @@ export class HelmChartComponent implements OnInit { charts => { this.charts = charts.filter(x => x.name.includes(this.lastFilteredChartName)); this.chartsCopy = charts.map(x => Object.assign({}, x)); + this.totalCount = charts.length; }, err => { this.errorHandler.error(err); diff --git a/src/ui_ng/lib/src/helm-chart/versions/helm-chart-version.component.html b/src/ui_ng/lib/src/helm-chart/versions/helm-chart-version.component.html index 9c6a8a7f9..998161544 100644 --- a/src/ui_ng/lib/src/helm-chart/versions/helm-chart-version.component.html +++ b/src/ui_ng/lib/src/helm-chart/versions/helm-chart-version.component.html @@ -66,8 +66,11 @@ {{ v.created | date}} - - {{pagination.totalItems}} {{'HELM_CHART.ITEMS' | translate}} + + + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} {{'HELM_CHART.OF' | translate}} + + {{pagination.totalItems}} {{'HELM_CHART.ITEMS'| translate}} diff --git a/src/ui_ng/lib/src/helm-chart/versions/helm-chart-version.component.ts b/src/ui_ng/lib/src/helm-chart/versions/helm-chart-version.component.ts index 710379503..e4a9fca98 100644 --- a/src/ui_ng/lib/src/helm-chart/versions/helm-chart-version.component.ts +++ b/src/ui_ng/lib/src/helm-chart/versions/helm-chart-version.component.ts @@ -117,6 +117,7 @@ export class ChartVersionComponent implements OnInit { versions => { this.chartVersions = versions.filter(x => x.version.includes(this.lastFilteredVersionName)); this.versionsCopy = versions.map(x => Object.assign({}, x)); + this.totalCount = versions.length; }, err => { this.errorHandler.error(err); diff --git a/src/ui_ng/src/app/group/group.component.html b/src/ui_ng/src/app/group/group.component.html index a2d3b313c..9f99ac52d 100644 --- a/src/ui_ng/src/app/group/group.component.html +++ b/src/ui_ng/src/app/group/group.component.html @@ -30,7 +30,10 @@ - {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} {{'USER.OF' | translate }} {{pagination.totalItems}} {{'GROUP.GROUPS' | translate}} + + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} {{'GROUP.OF' | translate}} + + {{pagination.totalItems}} {{'GROUP.ITEMS' | translate}} diff --git a/src/ui_ng/src/app/project/member/add-group/add-group.component.html b/src/ui_ng/src/app/project/member/add-group/add-group.component.html index d723dd837..fa7be3b61 100644 --- a/src/ui_ng/src/app/project/member/add-group/add-group.component.html +++ b/src/ui_ng/src/app/project/member/add-group/add-group.component.html @@ -75,7 +75,10 @@ - + + + {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} {{'MEMBER.OF' | translate}} + {{pagination.totalItems}} {{'MEMBER.ITEMS' | translate}} diff --git a/src/ui_ng/src/app/project/member/add-group/add-group.component.ts b/src/ui_ng/src/app/project/member/add-group/add-group.component.ts index b5ea17a16..8e0327eca 100644 --- a/src/ui_ng/src/app/project/member/add-group/add-group.component.ts +++ b/src/ui_ng/src/app/project/member/add-group/add-group.component.ts @@ -34,6 +34,7 @@ export class AddGroupComponent implements OnInit { group = new UserGroup(); selectedGroups: UserGroup[] = []; groups: UserGroup[] = []; + totalCount = 0; dnTooltip = 'TOOLTIP.ITEM_REQUIRED'; @@ -76,6 +77,7 @@ export class AddGroupComponent implements OnInit { return group.group_name.includes(this.currentTerm) && !this.memberList.some(member => member.entity_type === 'g' && member.entity_id === group.id); }); + this.totalCount = groups.length; this.onLoading = false; this.ref.detectChanges(); }); 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 337cf00b1..b6c306bba 100644 --- a/src/ui_ng/src/i18n/lang/en-us-lang.json +++ b/src/ui_ng/src/i18n/lang/en-us-lang.json @@ -265,7 +265,9 @@ "REG_TIME": "Registration Time", "ADD_GROUP_SUCCESS": "Add group success", "EDIT_GROUP_SUCCESS": "Edit group success", - "LDAP_TYPE": "LDAP" + "LDAP_TYPE": "LDAP", + "OF": "of", + "ITEMS": "items" }, "AUDIT_LOG": { "USERNAME": "Username", 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 617cb86a1..6bbcff786 100644 --- a/src/ui_ng/src/i18n/lang/es-es-lang.json +++ b/src/ui_ng/src/i18n/lang/es-es-lang.json @@ -264,7 +264,9 @@ "REG_TIME": "Registration Time", "ADD_GROUP_SUCCESS": "Add group success", "EDIT_GROUP_SUCCESS": "Edit group success", - "LDAP_TYPE": "LDAP" + "LDAP_TYPE": "LDAP", + "OF": "of", + "ITEMS": "items" }, "AUDIT_LOG": { "USERNAME": "Nombre de usuario", diff --git a/src/ui_ng/src/i18n/lang/fr-fr-lang.json b/src/ui_ng/src/i18n/lang/fr-fr-lang.json index de8361bb9..25a76ca03 100644 --- a/src/ui_ng/src/i18n/lang/fr-fr-lang.json +++ b/src/ui_ng/src/i18n/lang/fr-fr-lang.json @@ -248,7 +248,9 @@ "REG_TIME": "Registration Time", "ADD_GROUP_SUCCESS": "Add group success", "EDIT_GROUP_SUCCESS": "Edit group success", - "LDAP_TYPE": "LDAP" + "LDAP_TYPE": "LDAP", + "OF": "of", + "ITEMS": "items" }, "AUDIT_LOG": { "USERNAME": "Nom d'utilisateur", 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 3eaff8e3c..88686fd82 100644 --- a/src/ui_ng/src/i18n/lang/zh-cn-lang.json +++ b/src/ui_ng/src/i18n/lang/zh-cn-lang.json @@ -264,7 +264,9 @@ "REG_TIME": "注册时间", "ADD_GROUP_SUCCESS": "添加组成功", "EDIT_GROUP_SUCCESS": "修改组成功", - "LDAP_TYPE": "LDAP" + "LDAP_TYPE": "LDAP", + "OF": "共计", + "ITEMS": "条记录" }, "AUDIT_LOG": { "USERNAME": "用户名", @@ -492,7 +494,7 @@ "REPO": "仓库", "FILTER_FOR_CHARTS": "过滤Chart", "DELETE": "删除", - "OF": "的", + "OF": "共计", "VERSIONS": "版本", "APP_VERSION": "应用版本", "IMAGES": "镜像", @@ -512,7 +514,7 @@ "SIGN": "签名", "SIGNED": "已签名", "UNSIGNED": "未签名", - "ITEMS": "项", + "ITEMS": "条记录", "NO_README": "此Chart未提供README文件", "SECURITY": "安全", "ACTIVE": "正常",