diff --git a/src/centralserver/admin-ui/src/components/managementRequests/ManagementRequests.vue b/src/centralserver/admin-ui/src/components/managementRequests/ManagementRequests.vue index 4f2077248f..373838a327 100644 --- a/src/centralserver/admin-ui/src/components/managementRequests/ManagementRequests.vue +++ b/src/centralserver/admin-ui/src/components/managementRequests/ManagementRequests.vue @@ -55,6 +55,10 @@
{{ item.id }}
+ + @@ -124,7 +128,7 @@ export default Vue.extend({ { text: this.$t('global.created') as string, align: 'start', - value: 'created', + value: 'created_at', class: 'xrd-table-header mr-table-header-created', }, { diff --git a/src/centralserver/admin-ui/src/components/managementRequests/TypeCell.vue b/src/centralserver/admin-ui/src/components/managementRequests/TypeCell.vue index bbc6cd3a26..b1e71f643f 100644 --- a/src/centralserver/admin-ui/src/components/managementRequests/TypeCell.vue +++ b/src/centralserver/admin-ui/src/components/managementRequests/TypeCell.vue @@ -29,18 +29,23 @@ {{ getStatusText() }} + {{ getStatusText() }} @@ -54,21 +59,22 @@ export default Vue.extend({ default: undefined, }, }, + methods: { getStatusText() { if (!this.status) { return ''; } switch (this.status) { - case 'change_owner': + case 'OWNER_CHANGE_REQUEST': return this.$t('managementRequests.changeOwner') as string; - case 'delete_certificate': + case 'AUTH_CERT_DELETION_REQUEST': return this.$t('managementRequests.removeCertificate') as string; - case 'delete_client': + case 'CLIENT_DELETION_REQUEST': return this.$t('managementRequests.removeClient') as string; - case 'register_certificate': + case 'AUTH_CERT_REGISTRATION_REQUEST': return this.$t('managementRequests.addCertificate') as string; - case 'register_client': + case 'CLIENT_REGISTRATION_REQUEST': return this.$t('managementRequests.addClient') as string; default: return ''; @@ -86,4 +92,10 @@ export default Vue.extend({ flex-direction: row; align-items: center; } + +@media (max-width: 1200px) { + .status-text { + display: none; + } +} diff --git a/src/centralserver/admin-ui/src/locales/en.json b/src/centralserver/admin-ui/src/locales/en.json index faae8f4105..fc85b1d990 100644 --- a/src/centralserver/admin-ui/src/locales/en.json +++ b/src/centralserver/admin-ui/src/locales/en.json @@ -274,14 +274,12 @@ "rejected": "Rejected", "removeCertificate": "Remove Certificate", "removeClient": "Remove Client", - "serverCode": "Server Code", - "serverOnwerId": "Server Owner ID", + "serverIdentifier": "Server Identifier", "serverOwnerName": "Server Owner Name", "showOnlyPending": "Show only pending requests" }, "members": { "addMember": "Add member", - "deleteMember": "Delete member", "header": "Members", "member": { "details": { @@ -292,7 +290,12 @@ "globalGroups": "Global Groups", "group": "Group", "ownedServers": "Owned Servers", - "server": "Server" + "server": "Server", + "enterCode": "Enter Member Code", + "deleteMember": "Delete member", + "deleteMemberFromGroup": "Delete memmer from Global group", + "areYouSure1": "Are you sure you want to delete the Member {member} from the system configuration? Enter the member code to confirm.", + "areYouSure2": "Are you sure you want to delete the member {member} from the {group}?" }, "managementRequests": { "created": "Created", @@ -339,6 +342,9 @@ "expires": "Expires", "serialNumber": "Serial Number", "subject": "Subject", + "deleteSecurityServer": "Delete Security Server", + "enterCode": "Enter Security Server Code", + "areYouSure": "Are you sure you want to delete the Security Server {securityServer} from the system configuration? Enter the server code to confirm.", "tabs": { "authCertificates": "Authentication Certificates", "clients": "Clients", diff --git a/src/centralserver/admin-ui/src/plugins/vee-validate.ts b/src/centralserver/admin-ui/src/plugins/vee-validate.ts index d892d456a7..1de7bc6795 100644 --- a/src/centralserver/admin-ui/src/plugins/vee-validate.ts +++ b/src/centralserver/admin-ui/src/plugins/vee-validate.ts @@ -25,7 +25,7 @@ * THE SOFTWARE. */ import { extend, configure } from 'vee-validate'; -import { required, min, between } from 'vee-validate/dist/rules'; +import { required, min, between, is } from 'vee-validate/dist/rules'; import i18n from '../i18n'; configure({ @@ -47,3 +47,6 @@ extend('min', min); // Install between rule and message. extend('between', between); + +// Install is rule and message. +extend('is', is); diff --git a/src/centralserver/admin-ui/src/store/modules/managementRequests.ts b/src/centralserver/admin-ui/src/store/modules/managementRequests.ts new file mode 100644 index 0000000000..126597eb55 --- /dev/null +++ b/src/centralserver/admin-ui/src/store/modules/managementRequests.ts @@ -0,0 +1,131 @@ +/* + * The MIT License + * + * Copyright (c) 2019- Nordic Institute for Interoperability Solutions (NIIS) + * Copyright (c) 2018 Estonian Information System Authority (RIA), + * Nordic Institute for Interoperability Solutions (NIIS), Population Register Centre (VRK) + * Copyright (c) 2015-2017 Estonian Information System Authority (RIA), Population Register Centre (VRK) + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +import { defineStore } from 'pinia'; + +export const useManagementRequests = defineStore('managementRequests', { + state: () => { + return { + // Mock data. This will be replaced with data from server. + managementRequestsMockData: [ + { + id: 13, + type: 'AUTH_CERT_REGISTRATION_REQUEST', + origin: 'CENTER', + server_owner_name: 'Tartu Kesklinna Perearstikeskus OÜ', + security_server_id: { + instance_id: 'DEV7X', + type: 'SERVER', + member_class: 'TST', + member_code: 'MEMBER1', + server_code: 'RH1', + }, + status: 'APPROVED', + created_at: '2021-07-07T10:09:42.10186Z', + }, + { + id: 736287, + type: 'CLIENT_REGISTRATION_REQUEST', + origin: 'CENTER', + server_owner_name: 'Eesti Põllumajandusloomade Jõudluskontrolli ASi', + security_server_id: { + instance_id: 'DEV9X', + type: 'SERVER', + member_class: 'TST', + member_code: 'MEMBER22', + server_code: 'RH3', + }, + status: 'REJECTED', + created_at: '2021-02-08T10:09:40.10186Z', + }, + { + id: 64, + type: 'OWNER_CHANGE_REQUEST', + origin: 'CENTER', + server_owner_name: 'Helsingin kristillisen koulun kannatusyhdistys', + security_server_id: { + instance_id: 'OPP', + type: 'SERVER', + member_class: 'RAA', + member_code: 'MEMBER7', + server_code: 'X1', + }, + status: 'PENDING', + created_at: '2021-03-11T10:09:40.10186Z', + }, + { + id: 112283, + type: 'CLIENT_DELETION_REQUEST', + origin: 'CENTER', + server_owner_name: 'Siseministeerium', + security_server_id: { + instance_id: 'WAP', + type: 'SERVER', + member_class: 'MOP', + member_code: 'MEM227', + server_code: 'K8', + }, + status: 'APPROVED', + created_at: '2020-12-13T10:09:40.10186Z', + }, + { + id: 947283, + type: 'AUTH_CERT_DELETION_REQUEST', + origin: 'CENTER', + server_owner_name: 'Turvallisuus- ja kemikaalivirasto', + security_server_id: { + instance_id: 'NEO', + type: 'SERVER', + member_class: 'AUS', + member_code: 'MEMBER9', + server_code: 'SR2', + }, + status: 'PENDING', + created_at: '2020-12-13T10:09:40.10186Z', + }, + ], + }; + }, + getters: { + getManagementRequests(state) { + // Server id shown in data table is combined from instance id + member class + member code + // Any should be replaced with proper interface + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return state.managementRequestsMockData.map((item: any) => { + item.displayedServerId = + item.security_server_id.instance_id + + ':' + + item.security_server_id.member_class + + ':' + + item.security_server_id.member_code; + return item; + }); + }, + }, + + actions: {}, +}); diff --git a/src/centralserver/admin-ui/src/views/ManagementRequests/ManagementRequests.vue b/src/centralserver/admin-ui/src/views/ManagementRequests/ManagementRequests.vue index 5c0bcd16e1..47a9f6dcb9 100644 --- a/src/centralserver/admin-ui/src/views/ManagementRequests/ManagementRequests.vue +++ b/src/centralserver/admin-ui/src/views/ManagementRequests/ManagementRequests.vue @@ -48,7 +48,7 @@ {{ item.id }} + + @@ -97,6 +101,8 @@ import StatusCell from '../../components/managementRequests/StatusCell.vue'; import TypeCell from '../../components/managementRequests/TypeCell.vue'; import XrdFilter from '../../components/ui/XrdFilter.vue'; import { DataTableHeader } from 'vuetify'; +import { mapState } from 'pinia'; +import { useManagementRequests } from '@/store/modules/managementRequests'; export default Vue.extend({ components: { @@ -109,56 +115,87 @@ export default Vue.extend({ search: '' as string, loading: false, showOnlyPending: false, - managementRequests: [ + managementRequestsMockData: [ { - id: '938726', - created: '2021-02-01', - type: 'change_owner', - serverOwnerName: 'Tartu Kesklinna Perearstikeskus OÜ', - serverOnwerId: 'DEV-333', - serverCode: 'sidecar', + id: 13, + type: 'AUTH_CERT_REGISTRATION_REQUEST', + origin: 'CENTER', + server_owner_name: 'Tartu Kesklinna Perearstikeskus OÜ', + security_server_id: { + instance_id: 'DEV7X', + type: 'SERVER', + member_class: 'TST', + member_code: 'MEMBER1', + server_code: 'RH1', + }, status: 'APPROVED', + created_at: '2021-07-07T10:09:42.10186Z', }, { - id: '736287', - created: '2021-05-05', - type: 'delete_certificate', - serverOwnerName: 'Eesti Põllumajandusloomade Jõudluskontrolli ASi', - serverOnwerId: 'COM-777', - serverCode: 'SS1', + id: 736287, + type: 'CLIENT_REGISTRATION_REQUEST', + origin: 'CENTER', + server_owner_name: 'Eesti Põllumajandusloomade Jõudluskontrolli ASi', + security_server_id: { + instance_id: 'DEV9X', + type: 'SERVER', + member_class: 'TST', + member_code: 'MEMBER22', + server_code: 'RH3', + }, status: 'REJECTED', + created_at: '2021-02-08T10:09:40.10186Z', }, { - id: '234234', - created: '2021-03-12', - type: 'delete_client', - serverOwnerName: 'Helsingin kristillisen koulun kannatusyhdistys', - serverOnwerId: 'COM-666', - serverCode: 'SS2', + id: 64, + type: 'OWNER_CHANGE_REQUEST', + origin: 'CENTER', + server_owner_name: 'Helsingin kristillisen koulun kannatusyhdistys', + security_server_id: { + instance_id: 'OPP', + type: 'SERVER', + member_class: 'RAA', + member_code: 'MEMBER7', + server_code: 'X1', + }, status: 'PENDING', + created_at: '2021-03-11T10:09:40.10186Z', }, { - id: '987283', - created: '2021-04-22', - type: 'register_certificate', - serverOwnerName: 'Siseministeerium', - serverOnwerId: 'DEV-444', - serverCode: 'SS2', + id: 112283, + type: 'CLIENT_DELETION_REQUEST', + origin: 'CENTER', + server_owner_name: 'Siseministeerium', + security_server_id: { + instance_id: 'WAP', + type: 'SERVER', + member_class: 'MOP', + member_code: 'MEM227', + server_code: 'K8', + }, status: 'APPROVED', + created_at: '2020-12-13T10:09:40.10186Z', }, { - id: '123235', - created: '2021-01-21', - type: 'register_client', - serverOwnerName: 'Turvallisuus- ja kemikaalivirasto', - serverOnwerId: 'COM-555', - serverCode: 'dev-toolkit-confidential.i.x-road', + id: 947283, + type: 'AUTH_CERT_DELETION_REQUEST', + origin: 'CENTER', + server_owner_name: 'Turvallisuus- ja kemikaalivirasto', + security_server_id: { + instance_id: 'NEO', + type: 'SERVER', + member_class: 'AUS', + member_code: 'MEMBER9', + server_code: 'SR2', + }, status: 'PENDING', + created_at: '2020-12-13T10:09:40.10186Z', }, ], }; }, computed: { + ...mapState(useManagementRequests, ['getManagementRequests']), headers(): DataTableHeader[] { return [ { @@ -170,7 +207,7 @@ export default Vue.extend({ { text: this.$t('global.created') as string, align: 'start', - value: 'created', + value: 'created_at', class: 'xrd-table-header mr-table-header-created', }, { @@ -183,21 +220,15 @@ export default Vue.extend({ { text: this.$t('managementRequests.serverOwnerName') as string, align: 'start', - value: 'serverOwnerName', + value: 'server_owner_name', class: 'xrd-table-header mr-table-header-owner-name', }, { - text: this.$t('managementRequests.serverOnwerId') as string, + text: this.$t('managementRequests.serverIdentifier') as string, align: 'start', - value: 'serverOnwerId', + value: 'displayedServerId', class: 'xrd-table-header mr-table-header-owner-id', }, - { - text: this.$t('managementRequests.serverCode') as string, - align: 'start', - value: 'serverCode', - class: 'xrd-table-header mr-table-header-server-code', - }, { text: this.$t('global.status') as string, diff --git a/src/centralserver/admin-ui/src/views/Members/Member/Details/MemberDetails.vue b/src/centralserver/admin-ui/src/views/Members/Member/Details/MemberDetails.vue index fcd36cff87..a7100261d0 100644 --- a/src/centralserver/admin-ui/src/views/Members/Member/Details/MemberDetails.vue +++ b/src/centralserver/admin-ui/src/views/Members/Member/Details/MemberDetails.vue @@ -54,7 +54,9 @@ $t('global.memberCode') }} - 12121212 + {{ + memberCode + }} @@ -130,9 +132,12 @@ > @@ -141,26 +146,131 @@ + +
+
+ mdi-close-circle +
+
+ {{ $t('members.member.details.deleteMember') }} "{{ memberName }}" +
+
+ + + + + + + + {{ + $t('members.member.details.deleteMember') + }} + + + {{ + $t('members.member.details.areYouSure1', { + member: 'NIIS', + }) + }} +
+ + + +
+
+ + + {{ + $t('action.cancel') + }} + {{ + $t('action.delete') + }} + +
+
+
+ + + + + + {{ + $t('members.member.details.deleteMember') + }} + + + {{ + $t('members.member.details.areYouSure2', { + member: memberName, + group: 'opendata-providers', + }) + }} + + + + {{ + $t('action.cancel') + }} + {{ + $t('action.delete') + }} + + + @@ -244,6 +370,17 @@ export default Vue.extend({ justify-content: flex-end; } +.delete-action { + margin-top: 34px; + color: $XRoad-Link; + cursor: pointer; + display: flex; + flex-direction: row; + .action-text { + margin-top: 2px; + } +} + #member-details { margin-top: 24px; display: flex; diff --git a/src/centralserver/admin-ui/src/views/Members/Member/ManagementRequests/MemberManagementRequests.vue b/src/centralserver/admin-ui/src/views/Members/Member/ManagementRequests/MemberManagementRequests.vue index 8b05cfab18..1d9873d9b2 100644 --- a/src/centralserver/admin-ui/src/views/Members/Member/ManagementRequests/MemberManagementRequests.vue +++ b/src/centralserver/admin-ui/src/views/Members/Member/ManagementRequests/MemberManagementRequests.vue @@ -51,49 +51,79 @@ export default Vue.extend({ loading: false, managementRequests: [ { - id: '938726', - created: '2021-02-01', - type: 'change_owner', - serverOwnerName: 'Tartu Kesklinna Perearstikeskus OÜ', - serverOnwerId: 'DEV-333', - serverCode: 'sidecar', + id: 13, + type: 'AUTH_CERT_REGISTRATION_REQUEST', + origin: 'CENTER', + server_owner_name: 'Tartu Kesklinna Perearstikeskus OÜ', + security_server_id: { + instance_id: 'DEV7X', + type: 'SERVER', + member_class: 'TST', + member_code: 'MEMBER1', + server_code: 'RH1', + }, status: 'APPROVED', + created_at: '2021-07-07T10:09:42.10186Z', }, { - id: '736287', - created: '2021-05-05', - type: 'delete_certificate', - serverOwnerName: 'Eesti Põllumajandusloomade Jõudluskontrolli ASi', - serverOnwerId: 'COM-777', - serverCode: 'SS1', + id: 736287, + type: 'CLIENT_REGISTRATION_REQUEST', + origin: 'CENTER', + server_owner_name: 'Eesti Põllumajandusloomade Jõudluskontrolli ASi', + security_server_id: { + instance_id: 'DEV9X', + type: 'SERVER', + member_class: 'TST', + member_code: 'MEMBER22', + server_code: 'RH3', + }, status: 'REJECTED', + created_at: '2021-02-08T10:09:40.10186Z', }, { - id: '234234', - created: '2021-03-12', - type: 'delete_client', - serverOwnerName: 'Helsingin kristillisen koulun kannatusyhdistys', - serverOnwerId: 'COM-666', - serverCode: 'SS2', + id: 64, + type: 'OWNER_CHANGE_REQUEST', + origin: 'CENTER', + server_owner_name: 'Helsingin kristillisen koulun kannatusyhdistys', + security_server_id: { + instance_id: 'OPP', + type: 'SERVER', + member_class: 'RAA', + member_code: 'MEMBER7', + server_code: 'X1', + }, status: 'PENDING', + created_at: '2021-03-11T10:09:40.10186Z', }, { - id: '987283', - created: '2021-04-22', - type: 'register_certificate', - serverOwnerName: 'Siseministeerium', - serverOnwerId: 'DEV-444', - serverCode: 'SS2', + id: 112283, + type: 'CLIENT_DELETION_REQUEST', + origin: 'CENTER', + server_owner_name: 'Siseministeerium', + security_server_id: { + instance_id: 'WAP', + type: 'SERVER', + member_class: 'MOP', + member_code: 'MEM227', + server_code: 'K8', + }, status: 'APPROVED', + created_at: '2020-12-13T10:09:40.10186Z', }, { - id: '123235', - created: '2021-01-21', - type: 'register_client', - serverOwnerName: 'Turvallisuus- ja kemikaalivirasto', - serverOnwerId: 'COM-555', - serverCode: 'dev-toolkit-confidential.i.x-road', + id: 947283, + type: 'AUTH_CERT_DELETION_REQUEST', + origin: 'CENTER', + server_owner_name: 'Turvallisuus- ja kemikaalivirasto', + security_server_id: { + instance_id: 'NEO', + type: 'SERVER', + member_class: 'AUS', + member_code: 'MEMBER9', + server_code: 'SR2', + }, status: 'PENDING', + created_at: '2020-12-13T10:09:40.10186Z', }, ], }; diff --git a/src/centralserver/admin-ui/src/views/Members/Member/Member.vue b/src/centralserver/admin-ui/src/views/Members/Member/Member.vue index 015b48e749..c8540dd6a6 100644 --- a/src/centralserver/admin-ui/src/views/Members/Member/Member.vue +++ b/src/centralserver/admin-ui/src/views/Members/Member/Member.vue @@ -26,20 +26,10 @@ -->