Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
Loading items

Target

Select target project
  • coscine/frontend/apps/ui
1 result
Select Git revision
Loading items
Show changes
Commits on Source (11)
Showing
with 749 additions and 513 deletions
......@@ -6,7 +6,7 @@
"name": "Launch Chrome",
"request": "launch",
"type": "chrome",
"url": "https://d-sp16.devlef.campus.rwth-aachen.de/",
"url": "https://d-sp28.devlef.campus.rwth-aachen.de/",
"webRoot": "${workspaceFolder}"
},
......@@ -24,3 +24,4 @@
}
]
}
......@@ -5,6 +5,7 @@
},
"cSpell.words": [
"Coscine",
"Orcid",
"pinia",
"RWTH",
"vite",
......
{
"name": "ui",
"version": "2.1.0",
"version": "2.2.0",
"private": true,
"scripts": {
"dev": "vite",
......@@ -13,7 +13,7 @@
"coverage": "vitest run --coverage"
},
"dependencies": {
"@coscine/api-client": "^3.1.0",
"@coscine/api-client": "^3.2.0",
"@coscine/form-generator": "^3.2.2",
"@dynamic-mapper/mapper": "^1.10.2",
"@pinia/testing": "^0.1.2",
......
......@@ -11,9 +11,9 @@
{{ `${messageType}${$t("banner.separator")}` }}
</span>
{{ messageBody }}
<span v-if="maintenance.url">
<span v-if="maintenance.href">
{{ $t("banner.maintenance.linkText") }}
<a :href="maintenance.url" target="_blank"
<a :href="maintenance.href" target="_blank"
>{{ $t("banner.maintenance.moreInformation") }}
</a>
</span>
......
......@@ -18,19 +18,20 @@ import useUserStore from "@/modules/user/store";
import { loadingCounterEventHandler } from "@/plugins/loadingCounter";
import { defineComponent } from "vue";
import type { StoreDefinition } from "pinia";
export default defineComponent({
setup() {
const mainStore = useMainStore();
loadingCounterEventHandler(useAdminStore);
loadingCounterEventHandler(useErrorStore);
loadingCounterEventHandler(useLoginStore);
loadingCounterEventHandler(usePidStore);
loadingCounterEventHandler(useProjectStore);
loadingCounterEventHandler(useResourceStore);
loadingCounterEventHandler(useSearchStore);
loadingCounterEventHandler(useUserStore);
loadingCounterEventHandler(useAdminStore as unknown as StoreDefinition);
loadingCounterEventHandler(useErrorStore as unknown as StoreDefinition);
loadingCounterEventHandler(useLoginStore as unknown as StoreDefinition);
loadingCounterEventHandler(usePidStore as unknown as StoreDefinition);
loadingCounterEventHandler(useProjectStore as unknown as StoreDefinition);
loadingCounterEventHandler(useResourceStore as unknown as StoreDefinition);
loadingCounterEventHandler(useSearchStore as unknown as StoreDefinition);
loadingCounterEventHandler(useUserStore as unknown as StoreDefinition);
return { mainStore };
},
......
import type {
FileDto,
MetadataDto,
FileTreeDto,
MetadataTreeDto,
TreeDataType,
} from "@coscine/api-client/dist/types/Coscine.Api";
export const getMetadataTreeResponse: MetadataDto[] = [
export const getMetadataTreeResponse: MetadataTreeDto[] = [
{
version: "1693212042",
availableVersions: ["1693212042"],
definition:
definition: {
content:
'@base <https://purl.org/coscine/resources/4103cbea-ffa3-40a5-9e5c-b99cc16f0007/folder_1/folder_2/A.txt/@type=metadata&version=1693212042>.\r\n\r\n@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.\r\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.\r\n@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.\r\n@prefix ns2: <http://purl.org/dc/terms/>.\r\n\r\n_:b8477997 ns2:created "2023-08-15"^^xsd:date;\r\n ns2:creator "Petar Hristov";\r\n ns2:title "Title inside Form Generator";\r\n a <https://purl.org/coscine/ap/base/>.\r\n',
format: "text/turtle",
type: "text/turtle",
},
path: "folder_1/folder_2/A.txt",
type: "Leaf" as TreeDataType.Leaf,
},
{
version: "1692777419",
availableVersions: ["1692777419"],
definition:
definition: {
content:
'@base <https://purl.org/coscine/resources/4103cbea-ffa3-40a5-9e5c-b99cc16f0007/file_1.txt/@type=metadata&version=1692777419>.\r\n\r\n@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.\r\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.\r\n@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.\r\n@prefix ns2: <http://purl.org/dc/terms/>.\r\n\r\n_:b8425359 ns2:created "2023-08-18"^^xsd:date;\r\n ns2:creator "Petar Hristov";\r\n ns2:title "file_1";\r\n a <https://purl.org/coscine/ap/base/>.\r\n',
format: "text/turtle",
type: "text/turtle",
},
path: "file_1.txt",
type: "Leaf" as TreeDataType.Leaf,
},
......@@ -32,25 +36,29 @@ export const getMetadataTreeResponse: MetadataDto[] = [
"1692341031",
"1692779210",
],
definition:
definition: {
content:
'@base <https://purl.org/coscine/resources/4103cbea-ffa3-40a5-9e5c-b99cc16f0007/file_0.txt/@type=metadata&version=1692779210>.\r\n\r\n@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.\r\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.\r\n@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.\r\n@prefix ns2: <http://purl.org/dc/terms/>.\r\n\r\n_:b8425361 ns2:created "2023-08-18"^^xsd:date;\r\n ns2:creator "Petar Hristov";\r\n ns2:title "Revised";\r\n a <https://purl.org/coscine/ap/base/>.\r\n',
format: "text/turtle",
type: "text/turtle",
},
path: "file_0.txt",
type: "Leaf" as TreeDataType.Leaf,
},
{
version: "1693209938",
availableVersions: ["1693209938"],
definition:
definition: {
content:
'@base <https://purl.org/coscine/resources/4103cbea-ffa3-40a5-9e5c-b99cc16f0007/my_folder/file_of_folder.txt/@type=metadata&version=1693209938>.\r\n\r\n@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.\r\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.\r\n@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.\r\n@prefix ns2: <http://purl.org/dc/terms/>.\r\n\r\n_:b8477996 ns2:created "2023-08-15"^^xsd:date;\r\n ns2:creator "Petar Hristov";\r\n ns2:title "From Insomnia";\r\n a <https://purl.org/coscine/ap/base/>.\r\n',
format: "text/turtle",
type: "text/turtle",
},
path: "my_folder/file_of_folder.txt",
type: "Leaf" as TreeDataType.Leaf,
},
];
export const getFileTreeResponse: FileDto[] = [
export const getFileTreeResponse: FileTreeDto[] = [
{
parentDirectory: "",
directory: "",
name: "folder_1",
size: 0,
creationDate: "2023-09-01T16:57:48.2525218+02:00",
......@@ -59,7 +67,7 @@ export const getFileTreeResponse: FileDto[] = [
type: "Tree" as TreeDataType.Tree,
},
{
parentDirectory: "",
directory: "",
name: "my_folder",
size: 0,
creationDate: "2023-09-01T16:57:48.2525245+02:00",
......@@ -68,7 +76,7 @@ export const getFileTreeResponse: FileDto[] = [
type: "Tree" as TreeDataType.Tree,
},
{
parentDirectory: "",
directory: "",
name: "file_0.txt",
extension: "txt",
size: 2513352,
......
import type { AdminState } from "@/modules/admin/types";
import {
QuotaUnit,
ResourceTypeStatus,
type ResourceState,
} from "@/modules/resource/types";
import type { QuotaUnit } from "@coscine/api-client/dist/types/Coscine.Api/api";
export const testAdminState: AdminState = {
project: {
id: "9b3241c3-fa8c-413f-a8ae-3b2f8116f024",
projectName: "Some Other Project",
name: "Some Other Project",
displayName: "Some Other Project",
quotas: [
},
projectQuotas: [
{
relationId: "0e229e78-7359-4c75-88e9-83c93eac11fb",
resourceType: "rdsnrw",
projectId: "a93180bd-4e88-4115-8cf5-2faf6fa9063d",
totalUsed: {
value: 0,
unit: QuotaUnit.Byte,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
totalReserved: {
value: 0,
unit: QuotaUnit.GibiByte,
value: 1,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
allocated: {
value: 5,
unit: QuotaUnit.GibiByte,
value: 2,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
maximum: {
value: 5,
unit: QuotaUnit.GibiByte,
value: 2,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
resourceType: {
id: "c2ff6445-c793-4591-89c9-39bd7845a760",
specificType: "rdss3wormrwth",
},
resourceQuotas: [
{
resource: { id: "321ab675-1104-4dbd-af48-de5f9ad94c8b" },
usedPercentage: 0,
used: {
value: 0,
unit: "https://qudt.org/vocab/unit/BYTE" as QuotaUnit.Byte,
},
reserved: {
value: 1,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
},
],
},
{
relationId: "29eed474-1b91-4167-8d22-d603856268a1",
resourceType: "rdss3wormrwth",
projectId: "a93180bd-4e88-4115-8cf5-2faf6fa9063d",
totalUsed: {
value: 0,
unit: QuotaUnit.Byte,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
totalReserved: {
value: 0,
unit: QuotaUnit.GibiByte,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
allocated: {
value: 4,
unit: QuotaUnit.GibiByte,
value: 0,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
maximum: {
value: 4,
unit: QuotaUnit.GibiByte,
value: 0,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
resourceType: {
id: "aad875ab-7c5e-4602-bf00-521e8d0dcbf5",
specificType: "rdss3ude",
},
resourceQuotas: [],
},
{
relationId: "7a9a8b26-7406-49e1-9e06-1935160ff7e4",
resourceType: "linked",
projectId: "a93180bd-4e88-4115-8cf5-2faf6fa9063d",
totalUsed: {
value: 0,
unit: QuotaUnit.Byte,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
totalReserved: {
value: 0,
unit: QuotaUnit.GibiByte,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
allocated: {
value: 5,
unit: QuotaUnit.GibiByte,
value: 0,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
maximum: {
value: 5,
unit: QuotaUnit.GibiByte,
value: 0,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
resourceType: {
id: "31a07098-b604-4e76-8c2d-4c1947d51409",
specificType: "linked",
},
resourceQuotas: [
{
resource: { id: "625133e6-5f96-4a59-8629-b2d507ed2ccb" },
used: {
value: 0,
unit: "https://qudt.org/vocab/unit/BYTE" as QuotaUnit.Byte,
},
reserved: {
value: 0,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
},
],
},
{
relationId: "11cdfbe1-de1b-41aa-87e7-3e6307c13ede",
resourceType: "rdss3ude",
projectId: "a93180bd-4e88-4115-8cf5-2faf6fa9063d",
totalUsed: {
value: 0,
unit: QuotaUnit.Byte,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
totalReserved: {
value: 0,
unit: QuotaUnit.GibiByte,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
allocated: {
value: 5,
unit: QuotaUnit.GibiByte,
value: 0,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
maximum: {
value: 5,
unit: QuotaUnit.GibiByte,
value: 0,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
resourceType: {
id: "60429070-f229-47da-8328-87f318152b94",
specificType: "rdss3tudo",
},
resourceQuotas: [],
},
{
relationId: "37a6fb50-d749-49fa-8bd6-bc26b9927439",
resourceType: "rdsrwth",
projectId: "a93180bd-4e88-4115-8cf5-2faf6fa9063d",
totalUsed: {
value: 0,
unit: QuotaUnit.Byte,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
totalReserved: {
value: 5,
unit: QuotaUnit.GibiByte,
value: 0,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
allocated: {
value: 5,
unit: QuotaUnit.GibiByte,
value: 0,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
maximum: {
value: 5,
unit: QuotaUnit.GibiByte,
value: 0,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
resourceType: {
id: "e7c3e103-0a3d-4d88-8ea9-b40b07410cd8",
specificType: "rdsude",
},
resourceQuotas: [],
},
{
relationId: "9f4d4cb8-359d-4075-9641-10e2990503ce",
resourceType: "rdss3tudo",
projectId: "a93180bd-4e88-4115-8cf5-2faf6fa9063d",
totalUsed: {
value: 0,
unit: QuotaUnit.Byte,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
totalReserved: {
value: 0,
unit: QuotaUnit.GibiByte,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
allocated: {
value: 5,
unit: QuotaUnit.GibiByte,
value: 0,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
maximum: {
value: 5,
unit: QuotaUnit.GibiByte,
value: 0,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
resourceType: {
id: "502ca81e-2d69-4270-be32-b23cdd732bf3",
specificType: "rdss3nrw",
},
resourceQuotas: [],
},
{
relationId: "70c4a9c0-d564-4718-9a6e-59c64128091f",
resourceType: "gitlab",
projectId: "a93180bd-4e88-4115-8cf5-2faf6fa9063d",
totalUsed: {
value: 0,
unit: QuotaUnit.Byte,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
totalReserved: {
value: 0,
unit: QuotaUnit.GibiByte,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
allocated: {
value: 5,
unit: QuotaUnit.GibiByte,
value: 0,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
maximum: {
value: 5,
unit: QuotaUnit.GibiByte,
value: 0,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
resourceType: {
id: "1720b9e5-d13d-4da2-bc0c-2630a9654548",
specificType: "rdsnrw",
},
resourceQuotas: [],
},
{
relationId: "6fe9e161-61b1-46f1-b3a0-1cdda1fc379e",
resourceType: "rdss3rwth",
projectId: "a93180bd-4e88-4115-8cf5-2faf6fa9063d",
totalUsed: {
value: 0,
unit: QuotaUnit.Byte,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
totalReserved: {
value: 5,
unit: QuotaUnit.GibiByte,
value: 0,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
allocated: {
value: 7,
unit: QuotaUnit.GibiByte,
value: 0,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
maximum: {
value: 7,
unit: QuotaUnit.GibiByte,
value: 0,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
resourceType: {
id: "31bb99eb-6c09-4f2a-9a05-903c4cbc4ccc",
specificType: "gitlab",
},
resourceQuotas: [
{
resource: { id: "9e01402a-571c-4867-816b-ff604817ec4f" },
used: {
value: 0,
unit: "https://qudt.org/vocab/unit/BYTE" as QuotaUnit.Byte,
},
reserved: {
value: 0,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
},
],
},
{
relationId: "437302c2-f42b-4295-b003-36718a2a1eea",
resourceType: "rdss3nrw",
projectId: "a93180bd-4e88-4115-8cf5-2faf6fa9063d",
totalUsed: {
value: 0,
unit: QuotaUnit.Byte,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
totalReserved: {
value: 0,
unit: QuotaUnit.GibiByte,
value: 1,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
allocated: {
value: 1,
unit: QuotaUnit.GibiByte,
value: 5,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
maximum: {
value: 5,
unit: QuotaUnit.GibiByte,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
resourceType: {
id: "90b453a6-9a2c-4941-b100-82cfe8279b6e",
specificType: "rdsrwth",
},
resourceQuotas: [
{
resource: { id: "887785a9-c6ea-4cdf-b85d-575201f9b551" },
usedPercentage: 0,
used: {
value: 0,
unit: "https://qudt.org/vocab/unit/BYTE" as QuotaUnit.Byte,
},
reserved: {
value: 1,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
},
],
},
{
projectId: "a93180bd-4e88-4115-8cf5-2faf6fa9063d",
totalUsed: {
value: 0.0000015143305,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
totalReserved: {
value: 4,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
allocated: {
value: 5,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
maximum: {
value: 6,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
resourceType: {
id: "92edf4f2-0e9e-4f09-a2dd-a313de25227d",
specificType: "rdss3rwth",
},
resourceQuotas: [
{
resource: { id: "4103cbea-ffa3-40a5-9e5c-b99cc16f0007" },
usedPercentage: 0.000037858263,
used: {
value: 1626,
unit: "https://qudt.org/vocab/unit/BYTE" as QuotaUnit.Byte,
},
reserved: {
value: 4,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
},
],
},
{
relationId: "bd2270a9-ac0f-4e8b-9097-e37c0baa729c",
resourceType: "rdsude",
projectId: "a93180bd-4e88-4115-8cf5-2faf6fa9063d",
totalUsed: {
value: 0,
unit: QuotaUnit.Byte,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
totalReserved: {
value: 0,
unit: QuotaUnit.GibiByte,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
allocated: {
value: 5,
unit: QuotaUnit.GibiByte,
value: 0,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
maximum: {
value: 5,
unit: QuotaUnit.GibiByte,
value: 0,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
resourceType: {
id: "7d702d3f-80ec-45a5-8ed2-bd2524439de5",
specificType: "s3",
},
resourceQuotas: [],
},
{
relationId: "297c0f6d-c5ca-4be4-8a59-c6b0bb2b0937",
resourceType: "rdstudo",
projectId: "a93180bd-4e88-4115-8cf5-2faf6fa9063d",
totalUsed: {
value: 0,
unit: QuotaUnit.Byte,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
totalReserved: {
value: 0,
unit: QuotaUnit.GibiByte,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
allocated: {
value: 5,
unit: QuotaUnit.GibiByte,
value: 0,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
maximum: {
value: 5,
unit: QuotaUnit.GibiByte,
value: 0,
unit: "https://qudt.org/vocab/unit/GibiBYTE" as QuotaUnit.GibiByte,
},
resourceType: {
id: "0b97899c-3a13-4cb3-835b-f22387fd4300",
specificType: "rdstudo",
},
],
resourceQuotas: [],
},
],
};
export const testResourceState: ResourceState = {
......
......@@ -2,9 +2,8 @@ import { type LoginState } from "@/modules/login/types";
import { useLocalStorage } from "@vueuse/core";
export const testLoginState: LoginState = {
currentTosVersion: "1",
currentTosVersion: { version: "1", isCurrent: true },
expiredSession: false,
tosAccepted: { version: ["1"] },
loginStoredData: useLocalStorage("coscine.login.storedData", ""),
loginUrls: {
orcidUrl: "http://example.org",
......
import { userMapper, PublicUserDto2ProjectRoleUserDto } from "@/mapping/user";
import {
type VisitedProjectDto,
type ProjectState,
} from "@/modules/project/types";
import type { RoleDto } from "@coscine/api-client/dist/types/Coscine.Api";
import { testDiscipline, testOrganization, getTestUser } from "./testUser";
import {
testDiscipline,
testOrganizationFromShibboleth,
getTestShibbolethUser,
} from "./testUser";
export const testOwnerRole: RoleDto = {
id: "ownerRole",
......@@ -26,13 +29,13 @@ export const testSlug = "testProject";
export const testProject: VisitedProjectDto = {
id: "987654321",
displayName: "Test Project",
projectName: "Test Project Full",
name: "Test Project Full",
description: "Test Project Description",
principleInvestigators: "Test PI",
startDate: "2023-01-01",
endDate: "2033-01-01",
disciplines: [testDiscipline],
organizations: [testOrganization],
organizations: [testOrganizationFromShibboleth],
visibility: { id: "1234", displayName: "Project Members" },
slug: testSlug,
invitations: [],
......@@ -45,13 +48,13 @@ export const testProject: VisitedProjectDto = {
],
roles: [
{
projectId: "987654321",
project: { id: "987654321" },
role: testOwnerRole,
user: userMapper.map(PublicUserDto2ProjectRoleUserDto, getTestUser()),
user: getTestShibbolethUser(),
},
], // TODO: Beware the object types!
subProjects: [],
creator: getTestUser().id,
creator: { id: getTestShibbolethUser().id },
};
export const testProjectState: ProjectState = {
......@@ -59,7 +62,7 @@ export const testProjectState: ProjectState = {
currentSlug: testSlug,
disciplines: [testDiscipline],
licenses: [{ id: "452545", displayName: "TestLicense" }],
organizations: [testOrganization],
organizations: [testOrganizationFromShibboleth],
roles: [testOwnerRole, testMemberRole, testGuestRole],
topLevelProjects: [testProject],
visibilities: [
......
......@@ -8,7 +8,7 @@ import {
baseApplicationProfileFormat,
} from "./metadata/applicationProfile";
import { radarFixedValues } from "./metadata/fixedValues";
import { testDiscipline, getTestUser } from "./testUser";
import { testDiscipline, getTestShibbolethUser } from "./testUser";
import type {
ResourceTypeInformationDto,
ResourceTypeStatus,
......@@ -50,9 +50,9 @@ export const getTestResource: () => Promise<VisitedResourceObject> =
apUrl
);
const resourceObject: VisitedResourceObject = {
applicationProfile: apUrl,
applicationProfile: { uri: apUrl },
archived: false,
creator: getTestUser().id,
creator: getTestShibbolethUser().id,
dateCreated: null,
description: "TestResource",
disciplines: [testDiscipline],
......@@ -64,13 +64,13 @@ export const getTestResource: () => Promise<VisitedResourceObject> =
license: {},
pid: "21.11102/eeb8d803-46a1-49ba-a47c-81cd4f49cd65",
rawApplicationProfile: ap,
resourceName: "TestResource",
name: "TestResource",
storedColumns: null,
type: {
specificType: testResourceType.specificType,
specificType: testResourceType.specificType ?? undefined,
id: testResourceType.id,
options: {
gitLabOptions: {},
gitLab: {},
},
},
usageRights: "",
......
This diff is collapsed.
......@@ -2,48 +2,112 @@ import { type UserState } from "@/modules/user/types";
import type {
DisciplineDto,
UserDto,
UserInstituteDto,
UserOrganizationDto,
} from "@coscine/api-client/dist/types/Coscine.Api/api";
export const testOrganization: UserOrganizationDto = {
name: "TestOrg",
readOnly: true,
rorUri: "example.com",
export const testOrganizationFromShibboleth: UserOrganizationDto = {
displayName: "Test SSO Organization",
readOnly: true, // Shibboleth organizations are always read-only
uri: "example.com",
};
export const testInstitute: UserOrganizationDto = {
name: "TestInstitute",
readOnly: true,
rorUri: "example.com#institute",
export const testInstituteFromShibboleth: UserInstituteDto = {
displayName: "Test SSO Institute",
readOnly: true, // Shibboleth institutes are always read-only
uri: "example.com#institute",
};
export const testOrganizationFromOrcid: UserOrganizationDto = {
displayName: "Test ORCiD Organization",
readOnly: true, // ORCiD organizations are never read-only
uri: "example.com",
};
export const testInstituteFromOrcid: UserInstituteDto = {
displayName: "Test ORCiD Institute",
readOnly: true, // ORCiD institutes are never read-only
uri: "example.com#institute",
};
export const testDiscipline: DisciplineDto = {
id: "1",
displayNameDe: "Test",
displayNameEn: "Test",
url: "example.com",
uri: "example.com",
};
export const testLanguage = { id: "1", displayName: "en" };
export const getTestUser: () => UserDto = () => {
/**
* Generates a mock Shibboleth user data object for testing purposes.
*
* @returns {UserDto} A mock Shibboleth user data object.
*/
export const getTestShibbolethUser: () => UserDto = () => {
return {
id: "d302cb44-c934-4b54-a581-9765cab96fca",
lastName: "Coscine",
firstName: "Example",
givenName: "Coscine",
familyName: "Example",
displayName: "Coscine Example",
email: "example@example.com",
emails: [
{ email: "example@university.com", isConfirmed: true, isPrimary: true },
],
disciplines: [testDiscipline],
language: testLanguage,
organizations: [testOrganization],
institutes: [testInstitute],
organizations: [testOrganizationFromShibboleth],
institutes: [testInstituteFromShibboleth],
};
};
/**
* Generates a mock ORCID user data object for testing purposes.
*
* @returns {UserDto} A mock ORCID user data object.
*/
export const getTestOrcidUser: () => UserDto = () => {
return {
id: "d302cb44-c934-4b54-a581-9765cab96fca",
givenName: "Coscine",
familyName: "Example",
displayName: "Coscine Example",
emails: [
{ email: "example@orcid.com", isConfirmed: true, isPrimary: true },
],
disciplines: [testDiscipline],
language: testLanguage,
organizations: [testOrganizationFromOrcid],
institutes: [testInstituteFromOrcid],
};
};
export const getTestShibbolethUserState: () => UserState = () => {
return {
userProfile: {
disciplines: [testDiscipline],
languages: [testLanguage, { id: "2", displayName: "de" }],
organizations: [testOrganizationFromShibboleth],
institutes: [testInstituteFromShibboleth],
titles: [
{
id: "1",
displayName: "Prof.",
},
{
id: "2",
displayName: "Dr.",
},
],
tokens: null,
},
user: getTestShibbolethUser(),
};
};
export const getTestUserState: () => UserState = () => {
export const getTestOrcidUserState: () => UserState = () => {
return {
userProfile: {
disciplines: [testDiscipline],
languages: [testLanguage, { id: "2", displayName: "de" }],
organizations: [testOrganization],
institutes: [testInstitute],
organizations: [testOrganizationFromShibboleth],
institutes: [testInstituteFromShibboleth],
titles: [
{
id: "1",
......@@ -56,6 +120,6 @@ export const getTestUserState: () => UserState = () => {
],
tokens: null,
},
user: getTestUser(),
user: getTestOrcidUser(),
};
};
import { MapperConfiguration, MappingPair } from "@dynamic-mapper/mapper";
import type { QuotaDto } from "@coscine/api-client/dist/types/Coscine.Api";
import { QuotaDimObject } from "@coscine/api-client/dist/types/Coscine.Api.Admin";
/**
* @deprecated - Delete this mapping pair once APIv2 is used globally.
*/
export const QuotaDimObject2QuotaDto = new MappingPair<
QuotaDimObject,
QuotaDto
>();
const configuration = new MapperConfiguration((cfg) => {
// Other maps
cfg.createAutoMap(QuotaDimObject2QuotaDto, {});
});
export const adminMapper = configuration.createMapper();
......@@ -24,6 +24,7 @@ export const OrganizationDto2OrganizationForProjectManipulationDto =
const configuration = new MapperConfiguration((cfg) => {
cfg.createAutoMap(ProjectDto2ProjectForUpdateDto, {
name: (opt) => opt.mapFrom((e) => e.name ?? ""),
disciplines: (opt) =>
opt.mapFromUsing(
(e) => e.disciplines,
......@@ -45,7 +46,9 @@ const configuration = new MapperConfiguration((cfg) => {
.createAutoMap(VisibilityDto2VisibilityForProjectManipulationDto, {})
.forSourceMember("displayName", (opt) => opt.ignore());
cfg.createAutoMap(DisciplineDto2DisciplineForProjectManipulationDto, {});
cfg.createAutoMap(OrganizationDto2OrganizationForProjectManipulationDto, {});
cfg.createAutoMap(OrganizationDto2OrganizationForProjectManipulationDto, {
uri: (opt) => opt.mapFrom((e) => e.uri ?? ""),
});
});
export const projectMapper = configuration.createMapper();
......@@ -70,8 +70,11 @@ export const ResourceTypeInformationDto2ResourceTypeOptionsForCreationDto =
const configuration = new MapperConfiguration((cfg) => {
cfg.createAutoMap(ResourceDto2ResourceForUpdateDto, {
usageNote: (opt) => opt.mapFrom((e) => e.usageRights),
license: (opt) =>
opt.mapFromUsing(
opt
.preCondition((e) => e.license?.id !== undefined)
.mapFromUsing(
(e) => e.license,
LicenseDto2LicenseForResourceManipulationDto
),
......@@ -98,31 +101,31 @@ const configuration = new MapperConfiguration((cfg) => {
gitlabResourceTypeOptions: (opt) =>
opt
.mapFromUsing(
(e) => e.gitLabOptions,
(e) => e.gitLab,
GitLabOptionsDto2GitlabResourceTypeOptionsForUpdateDto
)
.condition((con) => con.gitLabOptions !== undefined),
.condition((con) => con.gitLab !== undefined),
rdsResourceTypeOptions: (opt) =>
opt
.mapFromUsing(
(e) => e.rdsOptions,
(e) => e.rds,
RdsOptionsDto2RdsResourceTypeOptionsForManipulationDto
)
.condition((con) => con.rdsOptions !== undefined),
.condition((con) => con.rds !== undefined),
rdsS3ResourceTypeOptions: (opt) =>
opt
.mapFromUsing(
(e) => e.rdsS3Options,
(e) => e.rdsS3,
RdsS3OptionsDto2RdsS3ResourceTypeOptionsForManipulationDto
)
.condition((con) => con.rdsS3Options !== undefined),
.condition((con) => con.rdsS3 !== undefined),
rdsS3WormResourceTypeOptions: (opt) =>
opt
.mapFromUsing(
(e) => e.rdsS3WormOptions,
(e) => e.rdsS3Worm,
RdsS3WormOptionsDto2RdsS3WormResourceTypeOptionsForManipulationDto
)
.condition((con) => con.rdsS3WormOptions !== undefined),
.condition((con) => con.rdsS3Worm !== undefined),
});
cfg.createMap(ResourceTypeInformationDto2ResourceTypeOptionsForCreationDto, {
linkedResourceTypeOptions: (opt) =>
......@@ -176,26 +179,28 @@ const configuration = new MapperConfiguration((cfg) => {
});
cfg.createAutoMap(GitLabOptionsDto2GitlabResourceTypeOptionsForUpdateDto, {});
cfg.createAutoMap(RdsOptionsDto2RdsResourceTypeOptionsForManipulationDto, {
size: (opt) =>
quota: (opt) =>
opt.mapFromUsing((e) => e.size, QuotaDto2QuotaForManipulationDto),
});
cfg.createAutoMap(
RdsS3OptionsDto2RdsS3ResourceTypeOptionsForManipulationDto,
{
size: (opt) =>
quota: (opt) =>
opt.mapFromUsing((e) => e.size, QuotaDto2QuotaForManipulationDto),
}
);
cfg.createAutoMap(
RdsS3WormOptionsDto2RdsS3WormResourceTypeOptionsForManipulationDto,
{
size: (opt) =>
quota: (opt) =>
opt.mapFromUsing((e) => e.size, QuotaDto2QuotaForManipulationDto),
}
);
// Other maps
cfg.createAutoMap(LicenseDto2LicenseForResourceManipulationDto, {});
cfg.createAutoMap(LicenseDto2LicenseForResourceManipulationDto, {
id: (opt) => opt.mapFrom((e) => e.id ?? ""),
});
cfg
.createAutoMap(VisibilityDto2VisibilityForResourceManipulationDto, {})
.forSourceMember("displayName", (opt) => opt.ignore());
......
......@@ -3,7 +3,7 @@ import { v4 as uuidv4 } from "uuid";
import type {
TreeDataType,
FileDto,
FileTreeDto,
} from "@coscine/api-client/dist/types/Coscine.Api";
import type {
FileInformation,
......@@ -11,12 +11,12 @@ import type {
} from "@/modules/resource/types";
export const TreeDto2FileInformation = new MappingPair<
FileDto,
FileTreeDto,
FileInformation
>();
export const TreeDto2FolderInformation = new MappingPair<
FileDto,
FileTreeDto,
FolderInformation
>();
......@@ -24,7 +24,7 @@ const configuration = new MapperConfiguration((cfg) => {
cfg.createMap(TreeDto2FileInformation, {
id: (opt) => opt.mapFrom((_) => uuidv4()),
name: (opt) => opt.mapFrom((dto) => dto.name ?? ""),
parentDirectory: (opt) => opt.mapFrom((dto) => dto.parentDirectory ?? ""),
parentDirectory: (opt) => opt.mapFrom((dto) => dto.directory ?? ""),
path: (opt) => opt.mapFrom((dto) => dto.path ?? ""),
type: (opt) => opt.mapFrom((_) => "Leaf" as TreeDataType.Leaf),
isFolder: (opt) => opt.mapFrom((_) => false),
......@@ -38,7 +38,7 @@ const configuration = new MapperConfiguration((cfg) => {
cfg.createMap(TreeDto2FolderInformation, {
id: (opt) => opt.mapFrom((_) => uuidv4()),
name: (opt) => opt.mapFrom((dto) => dto.name ?? ""),
parentDirectory: (opt) => opt.mapFrom((dto) => dto.parentDirectory ?? ""),
parentDirectory: (opt) => opt.mapFrom((dto) => dto.directory ?? ""),
path: (opt) => opt.mapFrom((dto) => dto.path ?? ""),
type: (opt) => opt.mapFrom((_) => "Tree" as TreeDataType.Tree),
isFolder: (opt) => opt.mapFrom((_) => true),
......
......@@ -5,18 +5,12 @@ import type {
DisciplineForUserManipulationDto,
LanguageDto,
LanguageForUserManipulationDto,
ProjectRoleUserDto,
PublicUserDto,
TitleDto,
TitleForUserManipulationDto,
UserDto,
UserForUpdateDto,
} from "@coscine/api-client/dist/types/Coscine.Api";
export const PublicUserDto2ProjectRoleUserDto = new MappingPair<
PublicUserDto,
ProjectRoleUserDto
>();
export const UserDto2UserForUpdateDto = new MappingPair<
UserDto,
UserForUpdateDto
......@@ -35,16 +29,11 @@ export const LanguageDto2LanguageForUserManipulationDto = new MappingPair<
>();
const configuration = new MapperConfiguration((cfg) => {
cfg.createAutoMap(PublicUserDto2ProjectRoleUserDto, {
emailAddress: (opt) => opt.mapFrom((u) => u.email),
userId: (opt) => opt.mapFrom((u) => u.id),
firstName: (opt) => opt.mapFrom((u) => u.firstName),
lastName: (opt) => opt.mapFrom((u) => u.lastName),
});
cfg.createMap(UserDto2UserForUpdateDto, {
firstName: (opt) => opt.auto(),
lastName: (opt) => opt.auto(),
email: (opt) => opt.auto(),
givenName: (opt) => opt.mapFrom((dto) => dto.givenName ?? ""),
familyName: (opt) => opt.mapFrom((dto) => dto.familyName ?? ""),
email: (opt) =>
opt.mapFrom((dto) => dto.emails?.find((e) => e.isPrimary)?.email ?? ""),
title: (opt) =>
opt
.condition((dto) => undefined !== dto.title)
......@@ -61,11 +50,11 @@ const configuration = new MapperConfiguration((cfg) => {
),
institute: (opt) =>
opt.mapFrom((dto) =>
dto.institutes?.length ? dto.institutes[0].name : ""
dto.institutes?.length ? dto.institutes[0].displayName : ""
),
organization: (opt) =>
opt.mapFrom((dto) =>
dto.organizations?.length ? dto.organizations[0].name : null
dto.organizations?.length ? dto.organizations[0].displayName : null
),
});
cfg.createAutoMap(TitleDto2TitleForUserManipulationDto, {});
......
......@@ -110,7 +110,7 @@
<b-form-input
v-if="row.item.isQuotaAvailable === true"
id="quotaInputField"
v-model.number="newQuotas[row.item.resourceTypeId]"
v-model.number="newQuotas[row.item.resourceType.id]"
type="number"
aria-describedby="projectHelp"
:placeholder="$t('page.admin.newQuotaInputPlaceHolder')"
......@@ -164,22 +164,17 @@ import { defineComponent } from "vue";
import useAdminStore from "../store";
// import the main store
import type {
AdminProjectObject,
QuotaDimObject,
} from "@coscine/api-client/dist/types/Coscine.Api.Admin";
import type { UpdateQuotaParameterObject } from "@coscine/api-client/dist/types/Coscine.Api.Admin";
import useResourceStore from "@/modules/resource/store";
import type { ExtendedProjectQuotaObject } from "../types";
import type { ExtendedProjectQuotaDto } from "../types";
import { isNumber } from "lodash";
import useNotificationStore from "@/store/notification";
import { FileUtil } from "@/modules/resource/utils/FileUtil";
import type {
ProjectDto,
QuotaDto,
ResourceTypeInformationDto,
} from "@coscine/api-client/dist/types/Coscine.Api/api";
import { QuotaUnit } from "@/modules/resource/types";
import { adminMapper, QuotaDimObject2QuotaDto } from "@/mapping/admin";
export default defineComponent({
setup() {
......@@ -200,36 +195,37 @@ export default defineComponent({
},
computed: {
project(): AdminProjectObject | null {
project(): ProjectDto | null | undefined {
return this.adminStore.project;
},
projectQuotas(): ExtendedProjectQuotaObject[] | null {
projectQuotas(): ExtendedProjectQuotaDto[] | null {
if (!this.project) {
return null; // In case project can't be resolved return null
}
// Retrieve all project quotas (incl. for hidden resources)
const projectQuotas = this.project.quotas;
const projectQuotas = this.adminStore.projectQuotas;
// Get all resource types
const resourceTypes: ResourceTypeInformationDto[] | null | undefined =
this.resourceStore.resourceTypes;
if (!projectQuotas || !resourceTypes) {
return null; // In case resource types can't be resolved return null
}
return projectQuotas.map((entry) => {
// Find corresponding entry
const resourceType = resourceTypes.find(
(q) => q.specificType === entry.resourceType
const resourceType = this.resourceTypes?.find(
(q) => q.specificType === entry.resourceType?.specificType
);
// Populate the extended project quota object
const extended = {
...entry,
iDisplayName: this.$t(
`resourceTypes.${entry.resourceType}.displayName`
`resourceTypes.${entry.resourceType?.specificType}.displayName`
).toString(),
isEnabled: resourceType?.isEnabled,
isQuotaAvailable: resourceType?.isQuotaAvailable,
resourceTypeId: resourceType?.id,
free:
entry.maximum && entry.allocated
? {
......@@ -237,36 +233,32 @@ export default defineComponent({
this.toGiB(entry.maximum) - this.toGiB(entry.allocated),
unit: QuotaUnit.GibiByte,
}
: { unit: QuotaUnit.GibiByte, value: undefined },
} as ExtendedProjectQuotaObject;
: undefined,
} as ExtendedProjectQuotaDto;
// For every resource type that has no quota available, set the value to be undefined
if (!extended.isQuotaAvailable) {
extended.allocated = {
unit: extended.allocated?.unit,
value: undefined,
};
extended.free = { unit: extended.free?.unit, value: undefined };
extended.maximum = { unit: extended.maximum?.unit, value: undefined };
extended.totalReserved = {
unit: extended.totalReserved?.unit,
value: undefined,
};
extended.totalUsed = {
unit: extended.totalUsed?.unit,
value: undefined,
};
extended.allocated = undefined;
extended.free = undefined;
extended.maximum = undefined;
extended.totalReserved = undefined;
extended.totalUsed = undefined;
}
// Push to the newly filtered array
return extended;
});
},
filteredProjectQuotas(): ExtendedProjectQuotaObject[] | null {
filteredProjectQuotas(): ExtendedProjectQuotaDto[] | null {
if (this.showOnlyEnabledResources && this.projectQuotas) {
return this.projectQuotas.filter((entry) => entry.isEnabled);
} else {
return this.projectQuotas;
}
},
resourceTypes(): ResourceTypeInformationDto[] | null | undefined {
return this.resourceStore.resourceTypes;
},
headers() {
// Define as computed property to have table
// header text react on language changes.
......@@ -330,38 +322,39 @@ export default defineComponent({
methods: {
async saveNewQuota(
project: AdminProjectObject | null,
resourceQuota: ExtendedProjectQuotaObject
project: ProjectDto | null | undefined,
resourceQuota: ExtendedProjectQuotaDto
) {
if (
project &&
project.id &&
resourceQuota.resourceTypeId &&
resourceQuota.resourceType?.id &&
this.isQuotaValueValid(resourceQuota)
) {
const updatedQuota: UpdateQuotaParameterObject = {
maximumGiB: this.newQuotas[resourceQuota.resourceTypeId],
const quota: QuotaDto = {
value: this.newQuotas[resourceQuota.resourceType?.id],
unit: QuotaUnit.GibiByte,
};
if (isNumber(updatedQuota.maximumGiB) && updatedQuota.maximumGiB >= 0) {
if (isNumber(quota.value) && quota.value >= 0) {
this.isWaitingForResponse = true;
const success = await this.adminStore.updateProjectQuota(
project.id,
resourceQuota.resourceTypeId,
updatedQuota
resourceQuota.resourceType.id,
quota
);
if (success) {
// On Success
delete this.newQuotas[resourceQuota.resourceTypeId];
if (this.project && this.project.id) {
delete this.newQuotas[resourceQuota.resourceType.id];
if (this.project?.id) {
// Refresh the quota values
await this.adminStore.retrieveProjectQuotas(this.project.id);
await this.adminStore.retrieveProjectAndQuotas(this.project.id);
}
this.notificationStore.postNotification({
title: this.$t("page.admin.toast.success.title").toString(),
body: this.$t("page.admin.toast.success.body", {
resourceType: resourceQuota.iDisplayName,
projectName: this.project?.displayName,
newQuota: updatedQuota.maximumGiB,
newQuota: quota.value,
}).toString(),
});
} else {
......@@ -376,17 +369,17 @@ export default defineComponent({
}
}
},
isQuotaValueValid(projectQuotaObject: ExtendedProjectQuotaObject): boolean {
isQuotaValueValid(projectQuotaObject: ExtendedProjectQuotaDto): boolean {
if (
projectQuotaObject.resourceTypeId &&
projectQuotaObject.resourceType?.id &&
projectQuotaObject.totalReserved
) {
return (
// Value must be a positive number, that is greater
// than the total reserved resource quota.
isNumber(this.newQuotas[projectQuotaObject.resourceTypeId]) &&
this.newQuotas[projectQuotaObject.resourceTypeId] >= 0 &&
this.newQuotas[projectQuotaObject.resourceTypeId] >=
isNumber(this.newQuotas[projectQuotaObject.resourceType.id]) &&
this.newQuotas[projectQuotaObject.resourceType.id] >= 0 &&
this.newQuotas[projectQuotaObject.resourceType.id] >=
this.toGiB(projectQuotaObject.totalReserved)
);
} else return false;
......@@ -396,10 +389,9 @@ export default defineComponent({
* @param quota - The quota to be converted.
* @returns {number} - The quota value in GiB.
*/
toGiB(quota: QuotaDimObject): number {
const quotaDto = adminMapper.map(QuotaDimObject2QuotaDto, quota);
toGiB(quota: QuotaDto): number {
// Almost all displayed values inside the html must be shown in GiB, making this method necessary to ensure that's always the case.
return FileUtil.convertCapacityUnits(quotaDto, QuotaUnit.GibiByte);
return FileUtil.convertCapacityUnits(quota, QuotaUnit.GibiByte);
},
formatUsed(quota: QuotaDto): string {
return FileUtil.formatBytes(
......
......@@ -58,7 +58,7 @@ describe("Admin", () => {
});
// Ensure the project names are set correctly inside the fields and that every one of those is readonly
expect(coscineFormGroupInputs.flatMap((e) => e.vm.$props.value)).toEqual([
wrapper.vm.$pinia.state.value.admin.project.projectName,
wrapper.vm.$pinia.state.value.admin.project.name,
wrapper.vm.$pinia.state.value.admin.project.displayName,
wrapper.vm.$pinia.state.value.admin.project.id,
]);
......@@ -79,7 +79,7 @@ describe("Admin", () => {
.find("tbody")
.findAll("tr");
// Resource types both "active" and "hidden" are displayed and their count is equal to the count in the store
expect(rowsOfEnabledAndHiddenResTypes.length).toEqual(
expect(rowsOfEnabledAndHiddenResTypes.length).toBeGreaterThanOrEqual(
wrapper.vm.$pinia.state.value.resource.resourceTypes.length
);
......
......@@ -35,7 +35,7 @@
label-cols-sm="2"
label-align-sm="left"
>
<b-form-input :value="project ? project.projectName : ''" readonly />
<b-form-input :value="project ? project.name : ''" readonly />
</CoscineFormGroup>
<!-- Project Display Name -->
......@@ -68,9 +68,9 @@ import { defineComponent } from "vue";
// import the store for current module
import useAdminStore from "../store";
import type { AdminProjectObject } from "@coscine/api-client/dist/types/Coscine.Api.Admin";
import QuotaTable from "../components/QuotaTable.vue";
import type { ProjectDto } from "@coscine/api-client/dist/types/Coscine.Api";
export default defineComponent({
components: {
......@@ -90,7 +90,7 @@ export default defineComponent({
},
computed: {
project(): AdminProjectObject | null {
project(): ProjectDto | null | undefined {
return this.adminStore.project;
},
},
......@@ -100,7 +100,7 @@ export default defineComponent({
if (!this.projectString.trim()) {
this.adminStore.project = null;
} else {
await this.adminStore.retrieveProjectQuotas(this.projectString);
await this.adminStore.retrieveProjectAndQuotas(this.projectString);
}
},
},
......