From 3c6192f9e4fcb3889bfcb1d31893da10642c4615 Mon Sep 17 00:00:00 2001 From: nscuro Date: Wed, 8 Nov 2023 15:08:03 +0100 Subject: [PATCH] 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 9c9b606e3..1936589cc 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,