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 (3)
{
"name": "ui",
"version": "3.5.1",
"version": "3.6.0",
"scripts": {
"dev": "vite",
"build": "vite build",
......@@ -12,7 +12,7 @@
"coverage": "vitest run --coverage"
},
"dependencies": {
"@coscine/api-client": "^3.10.0",
"@coscine/api-client": "3.10.0-issue-2981-datapubindb.3",
"@coscine/form-generator": "^4.0.5",
"@dynamic-mapper/mapper": "^1.10.4",
"@pinia/testing": "^0.1.3",
......
......@@ -113,8 +113,6 @@ export default defineComponent({
exact: true,
},
];
// TODO: comment in when UB gives green light
/*
if (
this.currentUserRole &&
this.currentUserRole.displayName === "Owner"
......@@ -130,7 +128,7 @@ export default defineComponent({
title: this.$t("sidebar.projectDataPublication").toString(),
},
});
}*/
}
return projectItems;
}
return [];
......
......@@ -85,7 +85,7 @@ export default defineComponent({
currentTab: 0,
tabsStatus: [true, false, false],
publicationRequestForCreation: {
dataPublicationServiceRorId: "",
publicationServiceId: "",
resourceIds: [],
message: "",
} as PublicationRequestForCreationDto,
......
......@@ -26,7 +26,7 @@ describe("DataPublicationProjectData", () => {
test("Should check button, update publication service and resources and check button again", async () => {
/* Test Pre-initialization steps */
const initialPropValue = {
dataPublicationServiceRorId: "",
publicationServiceRorId: "",
resourceIds: [],
message: "",
};
......@@ -66,14 +66,14 @@ describe("DataPublicationProjectData", () => {
expect(elementMessage.exists()).toBeTruthy();
// Check initial values
expect(wrapper.vm.modelValue.dataPublicationServiceRorId).toBe("");
expect(wrapper.vm.modelValue.publicationServiceRorId).toBe("");
expect(wrapper.vm.modelValue.resourceIds).toStrictEqual([]);
expect(wrapper.vm.modelValue.message).toBe("");
// Change value of elements
wrapper.setProps({
modelValue: {
dataPublicationServiceRorId: "PublicationService",
publicationServiceRorId: "PublicationService",
resourceIds: ["123", "456"],
message: "This is a message.",
},
......@@ -82,7 +82,7 @@ describe("DataPublicationProjectData", () => {
await wrapper.vm.$nextTick();
// Check values again
expect(wrapper.vm.modelValue.dataPublicationServiceRorId).toBe(
expect(wrapper.vm.modelValue.publicationServiceRorId).toBe(
"PublicationService",
);
expect(wrapper.vm.modelValue.resourceIds).toContain("123");
......
......@@ -203,14 +203,14 @@ import useProjectStore from "../../../store";
import useUserStore from "@/modules/user/store";
import useResourceStore from "@/modules/resource/store";
import useMainStore from "@/store/index";
import {
type DisciplineDto,
type UserDto,
type PublicationRequestForCreationDto,
type ResourceDto,
type OrganizationDto,
} from "@coscine/api-client/dist/types/Coscine.Api";
import type { VisitedProjectDto } from "@/modules/project/types";
import type {
DisciplineDto,
OrganizationDto,
PublicationRequestForCreationDto,
ResourceDto,
UserDto,
} from "@coscine/api-client/dist/types/Coscine.Api";
export default defineComponent({
props: {
......@@ -250,7 +250,7 @@ export default defineComponent({
const rules = {
modelValue: {
dataPublicationServiceRorId: { required },
publicationServiceRorId: { required },
resourceIds: { required },
message: { maxLength: maxLength(1000) },
},
......@@ -331,11 +331,11 @@ export default defineComponent({
deep: true,
},
selectedService() {
this.v$.modelValue.dataPublicationServiceRorId.$model =
this.v$.modelValue.publicationServiceRorId.$model =
this.selectedService?.uri ?? "";
this.selectedServiceText =
this.selectedService?.publicationAdvisoryService?.text ?? "";
this.selectedService?.publicationAdvisoryService?.description ?? "";
},
selectedResources() {
const resourceIds = this.selectedResources
......@@ -354,10 +354,11 @@ export default defineComponent({
if (newValue !== oldValue) {
await this.projectStore.retrievePublicationOrganizations(newValue);
this.selectedService = this.publicationServices.find(
(s) => s.uri === this.modelValue.dataPublicationServiceRorId,
(s) => s.uri === this.modelValue.publicationServiceRorId,
);
this.selectedServiceText =
this.publicationServices[0].publicationAdvisoryService?.text ?? "";
this.publicationServices[0].publicationAdvisoryService?.description ??
"";
}
},
},
......@@ -371,17 +372,18 @@ export default defineComponent({
* Initializes the content of the selected application profile based on the current state of the resource for creation.
*/
initTabContent() {
// An publication advisory service has been selected. Set selection in dropdown.
if (this.modelValue.dataPublicationServiceRorId) {
// A publication advisory service has been selected. Set selection in dropdown.
if (this.modelValue.publicationServiceRorId) {
this.selectedService = this.publicationServices.find(
(s) => s.uri === this.modelValue.dataPublicationServiceRorId,
(s) => s.uri === this.modelValue.publicationServiceRorId,
);
}
// Should there be only one option inside the publication services list, select it
else if (this.publicationServices.length === 1) {
this.selectedService = this.publicationServices[0];
this.selectedServiceText =
this.publicationServices[0].publicationAdvisoryService?.text ?? "";
this.publicationServices[0].publicationAdvisoryService?.description ??
"";
}
if (this.modelValue.resourceIds.length > 0) {
......
......@@ -168,7 +168,7 @@ export default defineComponent({
},
selectedPublicationService(): OrganizationDto | undefined {
const currentServices = this.projectStore?.publicationAdvisoryServices;
const selected = this.modelValue.dataPublicationServiceRorId;
const selected = this.modelValue.publicationServiceRorId;
return currentServices?.find((r) => selected === r.uri);
},
......
......@@ -78,8 +78,6 @@ export const ProjectRoutes: RouteRecordRaw[] = [
breadCrumb: "project.configMetadata",
},
},
// TODO: comment in when UB gives green light
/*
{
path: "project-data-publication",
name: "project-data-publication",
......@@ -89,7 +87,6 @@ export const ProjectRoutes: RouteRecordRaw[] = [
breadCrumb: "project.dataPublication",
},
},
*/
{
path: "quota",
name: "project-quota",
......
......@@ -487,12 +487,12 @@ __metadata:
languageName: node
linkType: hard
 
"@coscine/api-client@npm:^3.10.0":
version: 3.10.0
resolution: "@coscine/api-client@npm:3.10.0::__archiveUrl=https%3A%2F%2Fgit.rwth-aachen.de%2Fapi%2Fv4%2Fprojects%2F61847%2Fpackages%2Fnpm%2F%40coscine%2Fapi-client%2F-%2F%40coscine%2Fapi-client-3.10.0.tgz"
"@coscine/api-client@npm:3.10.0-issue-2981-datapubindb.3":
version: 3.10.0-issue-2981-datapubindb.3
resolution: "@coscine/api-client@npm:3.10.0-issue-2981-datapubindb.3::__archiveUrl=https%3A%2F%2Fgit.rwth-aachen.de%2Fapi%2Fv4%2Fprojects%2F61847%2Fpackages%2Fnpm%2F%40coscine%2Fapi-client%2F-%2F%40coscine%2Fapi-client-3.10.0-issue-2981-datapubindb.3.tgz"
dependencies:
axios: "npm:^1.6.2"
checksum: 10/90a56adf3f9af15da86fc85e02da1a2327bcebfc496986f764892bbe9fe629c67fbf857a7e1f03c96da994a6f86007429952ddf55154142159cfc1c61c0cf65d
checksum: 10/c3cb2b9feac637e89d211ae90d4e81d69d735761e2a470fe8ec7b498bc70bf6483ed14c6aa068469dbb0fad43bac013dcd8dc39d0bfa817d5153750d76f65219
languageName: node
linkType: hard
 
......@@ -13686,7 +13686,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "ui@workspace:."
dependencies:
"@coscine/api-client": "npm:^3.10.0"
"@coscine/api-client": "npm:3.10.0-issue-2981-datapubindb.3"
"@coscine/form-generator": "npm:^4.0.5"
"@dynamic-mapper/mapper": "npm:^1.10.4"
"@iconify-json/bi": "npm:^1.1.23"
......