From 9eda6eff59cea2470b11374a7b760d38890c7810 Mon Sep 17 00:00:00 2001 From: nscuro Date: Wed, 8 Nov 2023 15:08:03 +0100 Subject: [PATCH 1/4] Add support for project and component suppliers Signed-off-by: nscuro --- src/i18n/locales/en.json | 4 + .../projects/ComponentDetailsModal.vue | 99 +++++++++++++++++++ .../projects/ProjectDetailsModal.vue | 99 +++++++++++++++++++ 3 files changed, 202 insertions(+) diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index 0c208edde..53526d860 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -394,6 +394,10 @@ "service_details": "Service Details", "provider": "Provider", "provider_name": "Provider name", + "supplier": "Supplier", + "supplier_name": "Supplier name", + "component_supplier_name_desc": "The organization that supplied the component", + "project_supplier_name_desc": "The organization that supplied the project that the BOM describes", "endpoints": "Endpoints", "data": "Data", "url": "URL", diff --git a/src/views/portfolio/projects/ComponentDetailsModal.vue b/src/views/portfolio/projects/ComponentDetailsModal.vue index 0f001160d..bad34887b 100644 --- a/src/views/portfolio/projects/ComponentDetailsModal.vue +++ b/src/views/portfolio/projects/ComponentDetailsModal.vue @@ -104,6 +104,32 @@ :readonly="this.isNotPermitted(PERMISSIONS.PORTFOLIO_MANAGEMENT)" /> + + + + + + + + + + + + + + @@ -167,6 +193,78 @@ ], selectableLicenses: [], selectedLicense: '', + supplierUrlsTableColumns: [ + { + title: this.$t('message.urls'), + sortable: false, + formatter(value, row, index) { + return xssFilters.inHTMLData(common.valueWithDefault(row, "")); + } + } + ], + supplierUrlsTableOptions: { + search: false, + showHeader: false, + showColumns: false, + showRefresh: false, + pagination: true, + silentSort: false, + sidePagination: 'client', + queryParamsType: 'pageSize', + pageList: '[5, 10, 25]', + pageSize: 5, + icons: { + refresh: 'fa-refresh' + }, + responseHandler: function (res, xhr) { + res.total = xhr.getResponseHeader("X-Total-Count"); + return res; + } + }, + supplierContactsTableColumns: [ + { + title: this.$t('message.name'), + field: "name", + sortable: false, + formatter(value, row, index) { + return xssFilters.inHTMLData(common.valueWithDefault(value, "")); + } + }, + { + title: this.$t('message.email'), + field: "email", + sortable: false, + formatter(value, row, index) { + return xssFilters.inHTMLData(common.valueWithDefault(value, "")); + } + }, + { + title: this.$t('message.phone'), + field: "phone", + sortable: false, + formatter(value, row, index) { + return xssFilters.inHTMLData(common.valueWithDefault(value, "")); + } + } + ], + supplierContactsTableOptions: { + search: false, + showColumns: false, + showRefresh: false, + pagination: true, + silentSort: false, + sidePagination: 'client', + queryParamsType: 'pageSize', + pageList: '[5, 10, 25]', + pageSize: 5, + icons: { + refresh: 'fa-refresh' + }, + responseHandler: function (res, xhr) { + res.total = xhr.getResponseHeader("X-Total-Count"); + return res; + } + }, referencesTableColumns: [ { title: this.$t('message.url'), @@ -218,6 +316,7 @@ let url = `${this.$api.BASE_URL}/${this.$api.URL_COMPONENT}`; this.axios.post(url, { uuid: this.component.uuid, + supplier: this.component.supplier, name: this.component.name, version: this.component.version, group: this.component.group, diff --git a/src/views/portfolio/projects/ProjectDetailsModal.vue b/src/views/portfolio/projects/ProjectDetailsModal.vue index 0ac486b1c..021e7ee2f 100644 --- a/src/views/portfolio/projects/ProjectDetailsModal.vue +++ b/src/views/portfolio/projects/ProjectDetailsModal.vue @@ -78,6 +78,32 @@ :readonly="this.isNotPermitted(PERMISSIONS.PORTFOLIO_MANAGEMENT)" /> + + + + + + + + + + + + + + @@ -149,6 +175,78 @@ dataOff: '\u2715' }, isLoading: false, + supplierUrlsTableColumns: [ + { + title: this.$t('message.urls'), + sortable: false, + formatter(value, row, index) { + return xssFilters.inHTMLData(common.valueWithDefault(row, "")); + } + } + ], + supplierUrlsTableOptions: { + search: false, + showHeader: false, + showColumns: false, + showRefresh: false, + pagination: true, + silentSort: false, + sidePagination: 'client', + queryParamsType: 'pageSize', + pageList: '[5, 10, 25]', + pageSize: 5, + icons: { + refresh: 'fa-refresh' + }, + responseHandler: function (res, xhr) { + res.total = xhr.getResponseHeader("X-Total-Count"); + return res; + } + }, + supplierContactsTableColumns: [ + { + title: this.$t('message.name'), + field: "name", + sortable: false, + formatter(value, row, index) { + return xssFilters.inHTMLData(common.valueWithDefault(value, "")); + } + }, + { + title: this.$t('message.email'), + field: "email", + sortable: false, + formatter(value, row, index) { + return xssFilters.inHTMLData(common.valueWithDefault(value, "")); + } + }, + { + title: this.$t('message.phone'), + field: "phone", + sortable: false, + formatter(value, row, index) { + return xssFilters.inHTMLData(common.valueWithDefault(value, "")); + } + } + ], + supplierContactsTableOptions: { + search: false, + showColumns: false, + showRefresh: false, + pagination: true, + silentSort: false, + sidePagination: 'client', + queryParamsType: 'pageSize', + pageList: '[5, 10, 25]', + pageSize: 5, + icons: { + refresh: 'fa-refresh' + }, + responseHandler: function (res, xhr) { + res.total = xhr.getResponseHeader("X-Total-Count"); + return res; + } + }, referencesTableColumns: [ { title: this.$t('message.url'), @@ -225,6 +323,7 @@ uuid: this.project.uuid, author: this.project.author, publisher: this.project.publisher, + supplier: this.project.supplier, group: this.project.group, name: this.project.name, version: this.project.version, From f227f7f9d13eb022256061d57e1c9686595fdd99 Mon Sep 17 00:00:00 2001 From: nscuro Date: Mon, 27 Nov 2023 21:16:32 +0100 Subject: [PATCH 2/4] Add manufacturer tab to project details modal Signed-off-by: nscuro --- src/i18n/locales/en.json | 5 ++- .../projects/ProjectDetailsModal.vue | 42 +++++++++++++++---- 2 files changed, 38 insertions(+), 9 deletions(-) diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index 53526d860..8c74c0866 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -397,7 +397,10 @@ "supplier": "Supplier", "supplier_name": "Supplier name", "component_supplier_name_desc": "The organization that supplied the component", - "project_supplier_name_desc": "The organization that supplied the project that the BOM describes", + "project_supplier_name_desc": "The organization that supplied the project", + "manufacturer": "Manufacturer", + "manufacturer_name": "Manufacturer name", + "manufacturer_name_desc": "The organization that manufactured the project", "endpoints": "Endpoints", "data": "Data", "url": "URL", diff --git a/src/views/portfolio/projects/ProjectDetailsModal.vue b/src/views/portfolio/projects/ProjectDetailsModal.vue index 021e7ee2f..4747b9f16 100644 --- a/src/views/portfolio/projects/ProjectDetailsModal.vue +++ b/src/views/portfolio/projects/ProjectDetailsModal.vue @@ -78,6 +78,32 @@ :readonly="this.isNotPermitted(PERMISSIONS.PORTFOLIO_MANAGEMENT)" /> + + + + + + + + + + + + + + @@ -88,18 +114,18 @@ + :options="urlsTableOptions"> + :options="contactsTableOptions"> @@ -175,7 +201,7 @@ dataOff: '\u2715' }, isLoading: false, - supplierUrlsTableColumns: [ + urlsTableColumns: [ { title: this.$t('message.urls'), sortable: false, @@ -184,7 +210,7 @@ } } ], - supplierUrlsTableOptions: { + urlsTableOptions: { search: false, showHeader: false, showColumns: false, @@ -203,7 +229,7 @@ return res; } }, - supplierContactsTableColumns: [ + contactsTableColumns: [ { title: this.$t('message.name'), field: "name", @@ -229,7 +255,7 @@ } } ], - supplierContactsTableOptions: { + contactsTableOptions: { search: false, showColumns: false, showRefresh: false, From bc787b846ef39247db01aac6ed71bb3699316f9e Mon Sep 17 00:00:00 2001 From: nscuro Date: Mon, 27 Nov 2023 21:48:04 +0100 Subject: [PATCH 3/4] `project.metadata.manufacturer` -> `project.manufacturer` Signed-off-by: nscuro --- src/views/portfolio/projects/ProjectDetailsModal.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/views/portfolio/projects/ProjectDetailsModal.vue b/src/views/portfolio/projects/ProjectDetailsModal.vue index 4747b9f16..6c0d92194 100644 --- a/src/views/portfolio/projects/ProjectDetailsModal.vue +++ b/src/views/portfolio/projects/ProjectDetailsModal.vue @@ -78,10 +78,10 @@ :readonly="this.isNotPermitted(PERMISSIONS.PORTFOLIO_MANAGEMENT)" /> - + - @@ -89,7 +89,7 @@ id="manufacturerUrlsTable" ref="manufacturerUrlsTable" :columns="urlsTableColumns" - :data="project.metadata.manufacturer.urls" + :data="project.manufacturer.urls" :options="urlsTableOptions"> @@ -98,7 +98,7 @@ id="manufacturerContactsTable" ref="manufacturerContactsTable" :columns="contactsTableColumns" - :data="project.metadata.manufacturer.contacts" + :data="project.manufacturer.contacts" :options="contactsTableOptions"> From 4425c9d793a920e51317e60019ea22ed9f75c4a4 Mon Sep 17 00:00:00 2001 From: nscuro Date: Mon, 27 Nov 2023 22:27:46 +0100 Subject: [PATCH 4/4] Add vertical tabs for BOM metadata Signed-off-by: nscuro --- src/i18n/locales/en.json | 6 ++- .../projects/ProjectDetailsModal.vue | 50 ++++++++++++++++++- 2 files changed, 52 insertions(+), 4 deletions(-) diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index 8c74c0866..44ef19822 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -397,10 +397,12 @@ "supplier": "Supplier", "supplier_name": "Supplier name", "component_supplier_name_desc": "The organization that supplied the component", - "project_supplier_name_desc": "The organization that supplied the project", + "project_supplier_name_desc": "The organization that supplied the component that the project describes", + "project_metadata_supplier_name_desc": "The organization that supplied the BOM", "manufacturer": "Manufacturer", "manufacturer_name": "Manufacturer name", - "manufacturer_name_desc": "The organization that manufactured the project", + "manufacturer_name_desc": "The organization that manufactured the component that the project describes", + "authors": "Authors", "endpoints": "Endpoints", "data": "Data", "url": "URL", diff --git a/src/views/portfolio/projects/ProjectDetailsModal.vue b/src/views/portfolio/projects/ProjectDetailsModal.vue index 6c0d92194..0989f6142 100644 --- a/src/views/portfolio/projects/ProjectDetailsModal.vue +++ b/src/views/portfolio/projects/ProjectDetailsModal.vue @@ -83,7 +83,7 @@ + disabled="true" :tooltip="this.$t('message.manufacturer_name_desc')"/> + disabled="true" :tooltip="this.$t('message.project_supplier_name_desc')"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + +