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
  • 2.11.0-privacyPolicy
  • APIv2
  • Docs/Setup
  • Experiment/fix-debugging
  • Experimental/Heinrichs-cypress
  • Feature/xxxx-turnOffDataPub
  • Fix/xxxx-ToS400Error
  • Fix/xxxx-migrateLogin
  • Fix/xxxx-tokenUploadButton
  • Hotfix/0038-correctDownload
  • Hotfix/1917-PublicFilesVisibility
  • Hotfix/1963-fixOrganizationField
  • Hotfix/2015-PublicFilesVisibility
  • Hotfix/2130-uiv2ContactChange
  • Hotfix/2144-invitationCall
  • Hotfix/2150-fixUpload
  • Hotfix/2160-userOrgsInst
  • Hotfix/2190-requiredFieldsForUserProfile
  • Hotfix/2196-RCVTableTranslation
  • Hotfix/2212-fixFiles
  • Hotfix/2226-userProfileSaveButton
  • Hotfix/2232-dependencyFix
  • Hotfix/2233-fixMe
  • Hotfix/2258-saveButtonWorksAsExpected
  • Hotfix/2296-selectedValuesNotReturned
  • Hotfix/2308-defaultLicense
  • Hotfix/2335-fixingSearchRCV
  • Hotfix/2353-dropShape
  • Hotfix/2370-fixDeleteButton
  • Hotfix/2378-linkedFix
  • Hotfix/2379-filesDragAndDrop
  • Hotfix/2382-guestStillBuggy
  • Hotfix/2384-guestsAndLinked
  • Hotfix/2427-adminTrouble
  • Hotfix/2459-EncodingPath
  • Hotfix/2465-orcidLink
  • Hotfix/2465-orcidLink-v1.25.1
  • Hotfix/2504-formGen
  • Hotfix/2541-resCreate
  • Hotfix/2601-correctMetadataIdentity
  • Hotfix/2611-feedback
  • Hotfix/2618-turtle
  • Hotfix/2681-validationErrors
  • Hotfix/2684-correctEncoding
  • Hotfix/2684-fixSubMetadata
  • Hotfix/2713-validateEntryName
  • Hotfix/2734-allowEmptyLicense
  • Hotfix/2765-encodingAgain
  • Hotfix/2852-adaptTextForToSUi
  • Hotfix/2853-optimizationV4
  • Hotfix/2943-reloadingResources
  • Hotfix/2943-searchHighlighting
  • Hotfix/2957-styleAndUpgrade
  • Hotfix/2971-fixTextInDataPub
  • Hotfix/2989-cookieLength
  • Hotfix/662-keepSidebarExpanded
  • Hotfix/xxxx-correctLinking
  • Hotfix/xxxx-folderRecursive
  • Hotfix/xxxx-fullscreenCss
  • Hotfix/xxxx-homepageDisplay
  • Hotfix/xxxx-liveReleaseFixes
  • Hotfix/xxxx-partnerProjects
  • Hotfix/xxxx-workingFileIndex
  • Issue/1782-structualDataIntegration
  • Issue/1792-newMetadataStructure
  • Issue/1822-coscineUIv2App
  • Issue/1824-componentsUIv2
  • Issue/1824-routerAdditions
  • Issue/1825-codeQualityPipelines
  • Issue/1833-newLogin
  • Issue/1843-multipleFilesValidation
  • Issue/1860-searchScoping
  • Issue/1861-searchMetadata
  • Issue/1862-searchFacets
  • Issue/1863-paginationForSearch
  • Issue/1926-userProfile
  • Issue/1927-projectAppMigration
  • Issue/1928-sidebarmenuAddition
  • Issue/1929-vuexToPinia
  • Issue/1938-internalHandling
  • Issue/1951-quotaImplementation
  • Issue/1953-owlImports
  • Issue/1957-resourceAppMigration
  • Issue/1957-resourceAppMigrationNew
  • Issue/1962-SearchAppUI2
  • Issue/1964-tokenExpiryUIv2
  • Issue/1965-userListMigration
  • Issue/1970-breadcrumbs
  • Issue/1971-projectEditCreateMigration
  • Issue/1972-homeDepot
  • Issue/1974-shibbolethLogout
  • Issue/1976-resouceCreationVaildEmail
  • Issue/1979-supportAdminUIv2Migration
  • Issue/1980-userManagement
  • Issue/1985-adaptSidebar
  • Issue/2002-migrateResourceCreate
  • Issue/2003-resourceSettings
  • Issue/2008-quotaManagement
  • Issue/2011-pathConfig
  • Issue/2016-BannerMigration
  • 1.28.0-pilot
  • v1.0.0
  • v1.1.0
  • v1.10.0
  • v1.10.1
  • v1.10.2
  • v1.10.3
  • v1.11.0
  • v1.11.1
  • v1.11.2
  • v1.11.3
  • v1.11.4
  • v1.11.5
  • v1.11.6
  • v1.11.7
  • v1.12.0
  • v1.13.0
  • v1.14.0
  • v1.14.1
  • v1.14.2
  • v1.14.3
  • v1.15.0
  • v1.15.1
  • v1.16.0
  • v1.16.1
  • v1.16.2
  • v1.16.3
  • v1.17.0
  • v1.17.1
  • v1.17.2
  • v1.18.0
  • v1.18.1
  • v1.19.0
  • v1.2.0
  • v1.20.0
  • v1.20.1
  • v1.20.2
  • v1.20.3
  • v1.20.4
  • v1.20.5
  • v1.21.0
  • v1.22.0
  • v1.22.1
  • v1.22.2
  • v1.23.0
  • v1.23.1
  • v1.23.2
  • v1.23.3
  • v1.23.4
  • v1.23.5
  • v1.23.6
  • v1.23.6-patch-2417-2427
  • v1.24.0
  • v1.24.1
  • v1.25.0
  • v1.25.1
  • v1.26.0
  • v1.26.1
  • v1.27.0
  • v1.27.1
  • v1.27.1-pilot
  • v1.28.0
  • v1.29.0
  • v1.29.1
  • v1.29.2
  • v1.3.0
  • v1.30.0
  • v1.30.1
  • v1.30.2
  • v1.31.0
  • v1.32.0
  • v1.4.0
  • v1.4.1
  • v1.5.0
  • v1.6.0
  • v1.6.1
  • v1.6.2
  • v1.7.0
  • v1.8.0
  • v1.8.1
  • v1.8.2
  • v1.9.0
  • v2.0.0
  • v2.1.0
  • v2.10.0
  • v2.10.1
  • v2.11.0
  • v2.12.0
  • v2.12.1
  • v2.12.2
  • v2.12.3
  • v2.12.4
  • v2.12.5
  • v2.13.0
  • v2.13.1
  • v2.13.2
  • v2.13.3
  • v2.13.4
  • v2.14.0
  • v2.15.0
200 results

Target

Select target project
  • coscine/frontend/apps/ui
1 result
Select Git revision
  • 2.11.0-privacyPolicy
  • APIv2
  • Docs/Setup
  • Experiment/fix-debugging
  • Experimental/Heinrichs-cypress
  • Feature/xxxx-turnOffDataPub
  • Fix/xxxx-ToS400Error
  • Fix/xxxx-migrateLogin
  • Fix/xxxx-tokenUploadButton
  • Hotfix/0038-correctDownload
  • Hotfix/1917-PublicFilesVisibility
  • Hotfix/1963-fixOrganizationField
  • Hotfix/2015-PublicFilesVisibility
  • Hotfix/2130-uiv2ContactChange
  • Hotfix/2144-invitationCall
  • Hotfix/2150-fixUpload
  • Hotfix/2160-userOrgsInst
  • Hotfix/2190-requiredFieldsForUserProfile
  • Hotfix/2196-RCVTableTranslation
  • Hotfix/2212-fixFiles
  • Hotfix/2226-userProfileSaveButton
  • Hotfix/2232-dependencyFix
  • Hotfix/2233-fixMe
  • Hotfix/2258-saveButtonWorksAsExpected
  • Hotfix/2296-selectedValuesNotReturned
  • Hotfix/2308-defaultLicense
  • Hotfix/2335-fixingSearchRCV
  • Hotfix/2353-dropShape
  • Hotfix/2370-fixDeleteButton
  • Hotfix/2378-linkedFix
  • Hotfix/2379-filesDragAndDrop
  • Hotfix/2382-guestStillBuggy
  • Hotfix/2384-guestsAndLinked
  • Hotfix/2427-adminTrouble
  • Hotfix/2459-EncodingPath
  • Hotfix/2465-orcidLink
  • Hotfix/2465-orcidLink-v1.25.1
  • Hotfix/2504-formGen
  • Hotfix/2541-resCreate
  • Hotfix/2601-correctMetadataIdentity
  • Hotfix/2611-feedback
  • Hotfix/2618-turtle
  • Hotfix/2681-validationErrors
  • Hotfix/2684-correctEncoding
  • Hotfix/2684-fixSubMetadata
  • Hotfix/2713-validateEntryName
  • Hotfix/2734-allowEmptyLicense
  • Hotfix/2765-encodingAgain
  • Hotfix/2852-adaptTextForToSUi
  • Hotfix/2853-optimizationV4
  • Hotfix/2943-reloadingResources
  • Hotfix/2943-searchHighlighting
  • Hotfix/2957-styleAndUpgrade
  • Hotfix/2971-fixTextInDataPub
  • Hotfix/2989-cookieLength
  • Hotfix/662-keepSidebarExpanded
  • Hotfix/xxxx-correctLinking
  • Hotfix/xxxx-folderRecursive
  • Hotfix/xxxx-fullscreenCss
  • Hotfix/xxxx-homepageDisplay
  • Hotfix/xxxx-liveReleaseFixes
  • Hotfix/xxxx-partnerProjects
  • Hotfix/xxxx-workingFileIndex
  • Issue/1782-structualDataIntegration
  • Issue/1792-newMetadataStructure
  • Issue/1822-coscineUIv2App
  • Issue/1824-componentsUIv2
  • Issue/1824-routerAdditions
  • Issue/1825-codeQualityPipelines
  • Issue/1833-newLogin
  • Issue/1843-multipleFilesValidation
  • Issue/1860-searchScoping
  • Issue/1861-searchMetadata
  • Issue/1862-searchFacets
  • Issue/1863-paginationForSearch
  • Issue/1926-userProfile
  • Issue/1927-projectAppMigration
  • Issue/1928-sidebarmenuAddition
  • Issue/1929-vuexToPinia
  • Issue/1938-internalHandling
  • Issue/1951-quotaImplementation
  • Issue/1953-owlImports
  • Issue/1957-resourceAppMigration
  • Issue/1957-resourceAppMigrationNew
  • Issue/1962-SearchAppUI2
  • Issue/1964-tokenExpiryUIv2
  • Issue/1965-userListMigration
  • Issue/1970-breadcrumbs
  • Issue/1971-projectEditCreateMigration
  • Issue/1972-homeDepot
  • Issue/1974-shibbolethLogout
  • Issue/1976-resouceCreationVaildEmail
  • Issue/1979-supportAdminUIv2Migration
  • Issue/1980-userManagement
  • Issue/1985-adaptSidebar
  • Issue/2002-migrateResourceCreate
  • Issue/2003-resourceSettings
  • Issue/2008-quotaManagement
  • Issue/2011-pathConfig
  • Issue/2016-BannerMigration
  • 1.28.0-pilot
  • v1.0.0
  • v1.1.0
  • v1.10.0
  • v1.10.1
  • v1.10.2
  • v1.10.3
  • v1.11.0
  • v1.11.1
  • v1.11.2
  • v1.11.3
  • v1.11.4
  • v1.11.5
  • v1.11.6
  • v1.11.7
  • v1.12.0
  • v1.13.0
  • v1.14.0
  • v1.14.1
  • v1.14.2
  • v1.14.3
  • v1.15.0
  • v1.15.1
  • v1.16.0
  • v1.16.1
  • v1.16.2
  • v1.16.3
  • v1.17.0
  • v1.17.1
  • v1.17.2
  • v1.18.0
  • v1.18.1
  • v1.19.0
  • v1.2.0
  • v1.20.0
  • v1.20.1
  • v1.20.2
  • v1.20.3
  • v1.20.4
  • v1.20.5
  • v1.21.0
  • v1.22.0
  • v1.22.1
  • v1.22.2
  • v1.23.0
  • v1.23.1
  • v1.23.2
  • v1.23.3
  • v1.23.4
  • v1.23.5
  • v1.23.6
  • v1.23.6-patch-2417-2427
  • v1.24.0
  • v1.24.1
  • v1.25.0
  • v1.25.1
  • v1.26.0
  • v1.26.1
  • v1.27.0
  • v1.27.1
  • v1.27.1-pilot
  • v1.28.0
  • v1.29.0
  • v1.29.1
  • v1.29.2
  • v1.3.0
  • v1.30.0
  • v1.30.1
  • v1.30.2
  • v1.31.0
  • v1.32.0
  • v1.4.0
  • v1.4.1
  • v1.5.0
  • v1.6.0
  • v1.6.1
  • v1.6.2
  • v1.7.0
  • v1.8.0
  • v1.8.1
  • v1.8.2
  • v1.9.0
  • v2.0.0
  • v2.1.0
  • v2.10.0
  • v2.10.1
  • v2.11.0
  • v2.12.0
  • v2.12.1
  • v2.12.2
  • v2.12.3
  • v2.12.4
  • v2.12.5
  • v2.13.0
  • v2.13.1
  • v2.13.2
  • v2.13.3
  • v2.13.4
  • v2.14.0
  • v2.15.0
200 results
Show changes

Commits on Source 31

Showing
with 611 additions and 396 deletions
...@@ -2,6 +2,14 @@ ...@@ -2,6 +2,14 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0", "version": "0.2.0",
"configurations": [ "configurations": [
{
"name": "Launch Chrome",
"request": "launch",
"type": "chrome",
"url": "https://d-sp16.devlef.campus.rwth-aachen.de/",
"webRoot": "${workspaceFolder}"
},
{ {
"type": "node", "type": "node",
"request": "launch", "request": "launch",
......
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
"Coscine", "Coscine",
"pinia", "pinia",
"RWTH", "RWTH",
"vite" "vite",
"Vuelidate"
], ],
"eslint.nodePath": ".yarn/sdks", "eslint.nodePath": ".yarn/sdks",
"prettier.prettierPath": ".yarn/sdks/prettier/index.js", "prettier.prettierPath": ".yarn/sdks/prettier/index.js",
......
{ {
"name": "ui", "name": "ui",
"version": "1.32.0", "version": "2.0.0",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
...@@ -13,8 +13,9 @@ ...@@ -13,8 +13,9 @@
"coverage": "vitest run --coverage" "coverage": "vitest run --coverage"
}, },
"dependencies": { "dependencies": {
"@coscine/api-client": "^2.12.0", "@coscine/api-client": "^3.0.0",
"@coscine/form-generator": "^3.2.2", "@coscine/form-generator": "^3.2.2",
"@dynamic-mapper/mapper": "^1.10.2",
"@pinia/testing": "^0.1.2", "@pinia/testing": "^0.1.2",
"@rdfjs-elements/formats-pretty": "^0.6.3", "@rdfjs-elements/formats-pretty": "^0.6.3",
"@rdfjs/data-model": "^2.0.1", "@rdfjs/data-model": "^2.0.1",
...@@ -95,5 +96,5 @@ ...@@ -95,5 +96,5 @@
"vitest": "^0.32.2", "vitest": "^0.32.2",
"vue-template-compiler": "^2.7.14" "vue-template-compiler": "^2.7.14"
}, },
"packageManager": "yarn@3.6.1" "packageManager": "yarn@3.6.3"
} }
...@@ -56,8 +56,8 @@ export default defineComponent({ ...@@ -56,8 +56,8 @@ export default defineComponent({
return this.$route.meta?.requiresAuth ?? false; return this.$route.meta?.requiresAuth ?? false;
}, },
areTosAccepted(): boolean | null { areTosAccepted(): boolean | null | undefined {
return this.loginStore.areTosAccepted; return this.userStore.user?.areToSAccepted;
}, },
localeChange(): string { localeChange(): string {
...@@ -91,10 +91,6 @@ export default defineComponent({ ...@@ -91,10 +91,6 @@ export default defineComponent({
window.location.reload(); window.location.reload();
}, },
async isLoggedIn() {
await this.initializeAfterLogin();
},
async areTosAccepted() { async areTosAccepted() {
await this.initializeUser(); await this.initializeUser();
}, },
...@@ -110,25 +106,23 @@ export default defineComponent({ ...@@ -110,25 +106,23 @@ export default defineComponent({
methods: { methods: {
async initialize() { async initialize() {
if (this.isLoggedIn) {
// Fetch Current TOS Version // Fetch Current TOS Version
if (!this.loginStore.currentTosVersion) { if (!this.loginStore.currentTosVersion) {
await this.loginStore.retrieveCurrentTosVersion(); await this.loginStore.retrieveCurrentTosVersion();
} }
await this.initializeAfterLogin(); await this.initializeUser();
},
async initializeAfterLogin() {
if (this.isLoggedIn) {
await this.loginStore.retrieveTosAcceptanceStatus();
} }
}, },
async initializeUser() { async initializeUser() {
if (this.areTosAccepted) {
if (!this.userStore.user) { if (!this.userStore.user) {
await this.userStore.retrieveUser(); await this.userStore.retrieveUser();
this.userStore.setUserLanguagePreference(); this.userStore.setUserLanguagePreference();
await this.userStore.retrieveMemberOrganizations();
// Forward to ToS page. Don't change the logic bellow. Variable may be null or undefined.
if (this.areTosAccepted === false) {
this.$router.push({ name: "tos" });
} }
} }
}, },
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
import { defineComponent } from "vue"; import { defineComponent } from "vue";
// import the main store // import the main store
import useMainStore from "@/store/index"; import useMainStore from "@/store/index";
import type { MaintenanceReturnObject } from "@coscine/api-client/dist/types/Coscine.Api.Notices"; import type { MaintenanceDto } from "@coscine/api-client/dist/types/Coscine.Api";
export default defineComponent({ export default defineComponent({
setup() { setup() {
...@@ -34,7 +34,7 @@ export default defineComponent({ ...@@ -34,7 +34,7 @@ export default defineComponent({
}, },
computed: { computed: {
maintenance(): MaintenanceReturnObject { maintenance(): MaintenanceDto {
return this.mainStore.coscine.banner.maintenance; return this.mainStore.coscine.banner.maintenance;
}, },
visibility(): boolean { visibility(): boolean {
......
...@@ -20,12 +20,12 @@ ...@@ -20,12 +20,12 @@
<div v-if="info" class="d-inline ml-1"> <div v-if="info" class="d-inline ml-1">
<!-- Information Circle Icon --> <!-- Information Circle Icon -->
<b-icon :id="`${labelFor}-info`" icon="info-circle" /> <b-icon :id="`${labelFor}Info`" icon="info-circle" />
<!-- Popover --> <!-- Popover -->
<b-popover <b-popover
over over
:target="`${labelFor}-info`" :target="`${labelFor}Info`"
triggers="hover focus" triggers="hover focus"
placement="bottom" placement="bottom"
> >
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
@change="$emit('input', value)" @change="$emit('input', value)"
@hidden="hideModal" @hidden="hideModal"
> >
<div class="v_gapped_container">
<div> <div>
{{ body }} {{ body }}
</div> </div>
...@@ -13,11 +14,13 @@ ...@@ -13,11 +14,13 @@
<div class="mt-4"> <div class="mt-4">
<slot name="buttons" /> <slot name="buttons" />
</div> </div>
</div>
</b-modal> </b-modal>
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent } from "vue"; import { type PropType, defineComponent } from "vue";
import type { TranslateResult } from "vue-i18n";
export default defineComponent({ export default defineComponent({
name: "CoscineModal", name: "CoscineModal",
...@@ -28,11 +31,15 @@ export default defineComponent({ ...@@ -28,11 +31,15 @@ export default defineComponent({
}, },
title: { title: {
default: "", default: "",
type: String, type: [String, Object] as PropType<
string | TranslateResult | null | undefined
>,
}, },
body: { body: {
default: "", default: "",
type: String, type: [String, Object] as PropType<
string | TranslateResult | null | undefined
>,
}, },
}, },
methods: { methods: {
......
...@@ -25,6 +25,9 @@ ...@@ -25,6 +25,9 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import type { PropType } from "vue";
import type { TranslateResult } from "vue-i18n";
export default { export default {
name: "LoadingSpinner", name: "LoadingSpinner",
...@@ -43,7 +46,7 @@ export default { ...@@ -43,7 +46,7 @@ export default {
}, },
textAfter: { textAfter: {
default: "", default: "",
type: String, type: [String, Object] as PropType<string | TranslateResult>,
}, },
}, },
}; };
......
...@@ -24,11 +24,11 @@ import useProjectStore from "@/modules/project/store"; ...@@ -24,11 +24,11 @@ import useProjectStore from "@/modules/project/store";
// import the resource store // import the resource store
import useResourceStore from "@/modules/resource/store"; import useResourceStore from "@/modules/resource/store";
import type {
ProjectObject,
ResourceObject,
} from "@coscine/api-client/dist/types/Coscine.Api.Project";
import type { RawLocation } from "vue-router"; import type { RawLocation } from "vue-router";
import type {
ProjectDto,
ResourceDto,
} from "@coscine/api-client/dist/types/Coscine.Api/api";
interface RouteLink { interface RouteLink {
to: RawLocation; to: RawLocation;
...@@ -82,7 +82,7 @@ export default defineComponent({ ...@@ -82,7 +82,7 @@ export default defineComponent({
this.resource && this.resource.type this.resource && this.resource.type
? `${this.$t( ? `${this.$t(
"resourceTypes." + "resourceTypes." +
this.resource.type.displayName + this.resource.type.specificType +
".displayName" ".displayName"
)}: ${this.resource.displayName}` )}: ${this.resource.displayName}`
: path, : path,
...@@ -114,15 +114,15 @@ export default defineComponent({ ...@@ -114,15 +114,15 @@ export default defineComponent({
return breadcrumbs; return breadcrumbs;
}, },
parentProjects(): ProjectObject[] | null { parentProjects(): ProjectDto[] | null {
return this.projectStore.currentParentProjects; return this.projectStore.currentParentProjects;
}, },
project(): ProjectObject | null { project(): ProjectDto | null {
return this.projectStore.currentProject; return this.projectStore.currentProject;
}, },
resource(): ResourceObject | null { resource(): ResourceDto | null {
return this.resourceStore.currentResource; return this.resourceStore.currentResource;
}, },
}, },
...@@ -137,11 +137,11 @@ export default defineComponent({ ...@@ -137,11 +137,11 @@ export default defineComponent({
if ( if (
this.resource && this.resource &&
this.resource.type && this.resource.type &&
this.resource.type.displayName this.resource.type.specificType
) { ) {
title = title.replace( title = title.replace(
`${this.$t( `${this.$t(
"resourceTypes." + this.resource.type.displayName + ".displayName" "resourceTypes." + this.resource.type.specificType + ".displayName"
)}: `, )}: `,
"" ""
); );
......
...@@ -149,7 +149,7 @@ import useMainStore from "@/store/index"; ...@@ -149,7 +149,7 @@ import useMainStore from "@/store/index";
import useLoginStore from "@/modules/login/store"; import useLoginStore from "@/modules/login/store";
// import the user store // import the user store
import useUserStore from "@/modules/user/store"; import useUserStore from "@/modules/user/store";
import type { UserObject } from "@coscine/api-client/dist/types/Coscine.Api.User"; import type { UserDto } from "@coscine/api-client/dist/types/Coscine.Api/api";
export default defineComponent({ export default defineComponent({
setup() { setup() {
...@@ -180,7 +180,7 @@ export default defineComponent({ ...@@ -180,7 +180,7 @@ export default defineComponent({
} }
return false; return false;
}, },
user(): null | UserObject { user(): UserDto | null | undefined {
return this.userStore.user; return this.userStore.user;
}, },
}, },
......
...@@ -35,12 +35,6 @@ import useProjectStore from "@/modules/project/store"; ...@@ -35,12 +35,6 @@ import useProjectStore from "@/modules/project/store";
// import the resource store // import the resource store
import useResourceStore from "@/modules/resource/store"; import useResourceStore from "@/modules/resource/store";
import type {
ProjectObject,
ResourceObject,
RoleObject,
} from "@coscine/api-client/dist/types/Coscine.Api.Project";
import VueSidebarMenu from "vue-sidebar-menu"; import VueSidebarMenu from "vue-sidebar-menu";
import "vue-sidebar-menu/dist/vue-sidebar-menu.css"; import "vue-sidebar-menu/dist/vue-sidebar-menu.css";
import type { import type {
...@@ -48,6 +42,11 @@ import type { ...@@ -48,6 +42,11 @@ import type {
SidebarComponentItem, SidebarComponentItem,
SidebarHeaderItem, SidebarHeaderItem,
} from "vue-sidebar-menu"; } from "vue-sidebar-menu";
import type {
ProjectDto,
ResourceDto,
RoleDto,
} from "@coscine/api-client/dist/types/Coscine.Api/api";
Vue.use(VueSidebarMenu); Vue.use(VueSidebarMenu);
...@@ -67,7 +66,7 @@ export default defineComponent({ ...@@ -67,7 +66,7 @@ export default defineComponent({
}; };
}, },
computed: { computed: {
currentUserRole(): RoleObject | undefined | null { currentUserRole(): RoleDto | undefined | null {
return this.projectStore.currentUserRole; return this.projectStore.currentUserRole;
}, },
menu(): Array<SidebarItem | SidebarComponentItem | SidebarHeaderItem> { menu(): Array<SidebarItem | SidebarComponentItem | SidebarHeaderItem> {
...@@ -84,10 +83,10 @@ export default defineComponent({ ...@@ -84,10 +83,10 @@ export default defineComponent({
...this.settingsMenu, ...this.settingsMenu,
]; ];
}, },
project(): ProjectObject | null { project(): ProjectDto | null {
return this.projectStore.currentProject; return this.projectStore.currentProject;
}, },
projects(): ProjectObject[] | null { projects(): ProjectDto[] | null {
return this.projectStore.topLevelProjects; return this.projectStore.topLevelProjects;
}, },
projectMenu(): Array<SidebarItem> { projectMenu(): Array<SidebarItem> {
...@@ -137,7 +136,7 @@ export default defineComponent({ ...@@ -137,7 +136,7 @@ export default defineComponent({
} }
return []; return [];
}, },
resources(): ResourceObject[] | null { resources(): ResourceDto[] | null {
return this.projectStore.currentResources; return this.projectStore.currentResources;
}, },
resourcesMenu(): Array<SidebarItem> { resourcesMenu(): Array<SidebarItem> {
...@@ -158,7 +157,7 @@ export default defineComponent({ ...@@ -158,7 +157,7 @@ export default defineComponent({
(resource.type (resource.type
? `${this.$t( ? `${this.$t(
"resourceTypes." + "resourceTypes." +
resource.type.displayName + resource.type.specificType +
".displayName" ".displayName"
)}: ` )}: `
: "") + resource.displayName, : "") + resource.displayName,
...@@ -175,7 +174,7 @@ export default defineComponent({ ...@@ -175,7 +174,7 @@ export default defineComponent({
(resource.type (resource.type
? `${this.$t( ? `${this.$t(
"resourceTypes." + "resourceTypes." +
resource.type.displayName + resource.type.specificType +
".displayName" ".displayName"
)}: ` )}: `
: "") + resource.displayName, : "") + resource.displayName,
...@@ -240,7 +239,7 @@ export default defineComponent({ ...@@ -240,7 +239,7 @@ export default defineComponent({
sidebarActive(): boolean { sidebarActive(): boolean {
return this.mainStore.sidebarActive; return this.mainStore.sidebarActive;
}, },
subProjects(): ProjectObject[] | null { subProjects(): ProjectDto[] | null {
return this.projectStore.currentSubProjects; return this.projectStore.currentSubProjects;
}, },
subProjectsMenu(): Array<SidebarItem> { subProjectsMenu(): Array<SidebarItem> {
......
This diff is collapsed.
import { userMapper, PublicUserDto2ProjectRoleUserDto } from "@/mapping/user";
import { import {
type VisitedProjectObject, type VisitedProjectDto,
type ProjectState, type ProjectState,
} from "@/modules/project/types"; } from "@/modules/project/types";
import { type RoleObject } from "@coscine/api-client/dist/types/Coscine.Api.Project"; import type { RoleDto } from "@coscine/api-client/dist/types/Coscine.Api";
import { testDiscipline, testOrganization, testUser } from "./testUser"; import { testDiscipline, testOrganization, getTestUser } from "./testUser";
export const testOwnerRole: RoleObject = { export const testOwnerRole: RoleDto = {
id: "ownerRole", id: "ownerRole",
displayName: "Owner", displayName: "Owner",
description: "owner",
}; };
export const testMemberRole: RoleObject = { export const testMemberRole: RoleDto = {
id: "memberRole", id: "memberRole",
displayName: "Member", displayName: "Member",
description: "member",
}; };
export const testGuestRole: RoleObject = { export const testGuestRole: RoleDto = {
id: "guestRole", id: "guestRole",
displayName: "Guest", displayName: "Guest",
description: "guest",
}; };
export const testSlug = "testProject"; export const testSlug = "testProject";
export const testProject: VisitedProjectObject = {
export const testProject: VisitedProjectDto = {
id: "987654321", id: "987654321",
displayName: "Test Project", displayName: "Test Project",
projectName: "Test Project Full", projectName: "Test Project Full",
...@@ -38,9 +43,15 @@ export const testProject: VisitedProjectObject = { ...@@ -38,9 +43,15 @@ export const testProject: VisitedProjectObject = {
displayName: "Test Resource", displayName: "Test Resource",
}, },
], ],
roles: [{ projectId: "987654321", role: testOwnerRole, user: testUser }], roles: [
{
projectId: "987654321",
role: testOwnerRole,
user: userMapper.map(PublicUserDto2ProjectRoleUserDto, getTestUser()),
},
], // TODO: Beware the object types!
subProjects: [], subProjects: [],
creator: testUser.id, creator: getTestUser().id,
}; };
export const testProjectState: ProjectState = { export const testProjectState: ProjectState = {
......
import { import type {
type VisitedResourceObject, VisitedResourceObject,
type ResourceState, ResourceState,
} from "@/modules/resource/types"; } from "@/modules/resource/types";
import { parseRDFDefinition } from "@/modules/resource/utils/linkedData"; import { parseRDFDefinition } from "@/modules/resource/utils/linkedData";
import {
type ResourceTypeStatus,
type ResourceTypeInformation,
} from "@coscine/api-client/dist/types/Coscine.Api.Resources";
import { radarApplicationProfile } from "./metadata/applicationProfile"; import { radarApplicationProfile } from "./metadata/applicationProfile";
import { radarFixedValues } from "./metadata/fixedValues"; import { radarFixedValues } from "./metadata/fixedValues";
import { testDiscipline, testUser } from "./testUser"; import { testDiscipline, getTestUser } from "./testUser";
import type {
ResourceTypeInformationDto,
ResourceTypeStatus,
} from "@coscine/api-client/dist/types/Coscine.Api";
export const testResourceType: ResourceTypeInformation = { export const testResourceType: ResourceTypeInformationDto = {
displayName: "gitlab", specificType: "gitlab",
id: "123497", id: "123497",
canCreate: true, canCreate: true,
canCreateLinks: true, canCreateLinks: true,
...@@ -28,11 +28,11 @@ export const testResourceType: ResourceTypeInformation = { ...@@ -28,11 +28,11 @@ export const testResourceType: ResourceTypeInformation = {
isQuotaAdjustable: true, isQuotaAdjustable: true,
isQuotaAvailable: true, isQuotaAvailable: true,
resourceContent: { resourceContent: {
entriesView: { columns: { always: [] } }, entriesView: { columns: { always: new Set<string>() } },
metadataView: { editableDataUrl: false, editableKey: false }, metadataView: { editableDataUrl: false, editableKey: false },
readOnly: false, readOnly: false,
}, },
resourceCreate: { resourceCreation: {
components: [], components: [],
}, },
status: "active" as ResourceTypeStatus, status: "active" as ResourceTypeStatus,
...@@ -49,25 +49,26 @@ export const getTestResource: () => Promise<VisitedResourceObject> = ...@@ -49,25 +49,26 @@ export const getTestResource: () => Promise<VisitedResourceObject> =
const resourceObject: VisitedResourceObject = { const resourceObject: VisitedResourceObject = {
applicationProfile: apUrl, applicationProfile: apUrl,
archived: false, archived: false,
creator: testUser.id, creator: getTestUser().id,
dateCreated: null, dateCreated: null,
deleted: false,
description: "TestResource", description: "TestResource",
disciplines: [testDiscipline], disciplines: [testDiscipline],
displayName: "TestResource", displayName: "TestResource",
fixedValues: radarFixedValues, fixedValues: radarFixedValues,
fullApplicationProfile: ap, fullApplicationProfile: ap,
id: "eeb8d803-46a1-49ba-a47c-81cd4f49cd65", id: "eeb8d803-46a1-49ba-a47c-81cd4f49cd65",
keywords: "", keywords: [],
license: null, license: {},
pid: "21.11102/eeb8d803-46a1-49ba-a47c-81cd4f49cd65", pid: "21.11102/eeb8d803-46a1-49ba-a47c-81cd4f49cd65",
rawApplicationProfile: ap, rawApplicationProfile: ap,
resourceName: "TestResource", resourceName: "TestResource",
resourceTypeOption: { id: "5234" },
storedColumns: null, storedColumns: null,
type: { type: {
displayName: testResourceType.displayName, specificType: testResourceType.specificType,
id: testResourceType.id, id: testResourceType.id,
options: {
gitLabOptions: {},
},
}, },
usageRights: "", usageRights: "",
quota: null, quota: null,
......
import { type UserState } from "@/modules/user/types"; import { type UserState } from "@/modules/user/types";
import { import type {
type DisciplineObject, DisciplineDto,
type OrganizationObject, UserDto,
} from "@coscine/api-client/dist/types/Coscine.Api.Project"; UserOrganizationDto,
import type { UserObject } from "@coscine/api-client/dist/types/Coscine.Api.User"; } from "@coscine/api-client/dist/types/Coscine.Api/api";
export const testOrganization: OrganizationObject = { export const testOrganization: UserOrganizationDto = {
displayName: "TestOrg", name: "TestOrg",
url: "example.com", readOnly: true,
rorUri: "example.com",
}; };
export const testInstitute: OrganizationObject = { export const testInstitute: UserOrganizationDto = {
displayName: "TestInstitute", name: "TestInstitute",
url: "example.com#institute", readOnly: true,
rorUri: "example.com#institute",
}; };
export const testDiscipline: DisciplineObject = { export const testDiscipline: DisciplineDto = {
id: "1", id: "1",
displayNameDe: "Test", displayNameDe: "Test",
displayNameEn: "Test", displayNameEn: "Test",
url: "example.com", url: "example.com",
}; };
export const testLanguage = { id: "1", displayName: "en" }; export const testLanguage = { id: "1", displayName: "en" };
export const testUser: UserObject = {
export const getTestUser: () => UserDto = () => {
return {
id: "d302cb44-c934-4b54-a581-9765cab96fca", id: "d302cb44-c934-4b54-a581-9765cab96fca",
surname: "Coscine", lastName: "Coscine",
givenname: "Example", firstName: "Example",
displayName: "Coscine Example", displayName: "Coscine Example",
emailAddress: "example@example.com", email: "example@example.com",
disciplines: [testDiscipline], disciplines: [testDiscipline],
language: testLanguage, language: testLanguage,
organizations: [testOrganization],
institutes: [testInstitute],
};
}; };
export const testUserState: UserState = { export const getTestUserState: () => UserState = () => {
return {
userProfile: { userProfile: {
contactChange: [],
disciplines: [testDiscipline], disciplines: [testDiscipline],
languages: [testLanguage, { id: "2", displayName: "de" }], languages: [testLanguage, { id: "2", displayName: "de" }],
userMemberships: [testOrganization, testInstitute], organizations: [testOrganization],
organizations: [testOrganization, testInstitute], institutes: [testInstitute],
titles: [ titles: [
{ {
id: "1", id: "1",
...@@ -49,6 +56,6 @@ export const testUserState: UserState = { ...@@ -49,6 +56,6 @@ export const testUserState: UserState = {
], ],
tokens: null, tokens: null,
}, },
user: testUser, user: getTestUser(),
tokenValidityBounds: null, };
}; };
...@@ -79,6 +79,7 @@ export default { ...@@ -79,6 +79,7 @@ export default {
loading: "Laden...", loading: "Laden...",
or: "ODER", or: "ODER",
none: "k. A.", none: "k. A.",
gb: "{number} GB",
}, },
title: { title: {
......
...@@ -77,6 +77,7 @@ export default { ...@@ -77,6 +77,7 @@ export default {
loading: "Loading...", loading: "Loading...",
or: "OR", or: "OR",
none: "n/a", none: "n/a",
gb: "{number} GB",
}, },
title: { title: {
......
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();
import { MapperConfiguration, MappingPair } from "@dynamic-mapper/mapper";
import type {
DisciplineDto,
DisciplineForProjectManipulationDto,
OrganizationDto,
OrganizationForProjectManipulationDto,
ProjectDto,
ProjectForUpdateDto,
VisibilityDto,
VisibilityForProjectManipulationDto,
} from "@coscine/api-client/dist/types/Coscine.Api";
export const ProjectDto2ProjectForUpdateDto = new MappingPair<
ProjectDto,
ProjectForUpdateDto
>();
export const VisibilityDto2VisibilityForProjectManipulationDto =
new MappingPair<VisibilityDto, VisibilityForProjectManipulationDto>();
export const DisciplineDto2DisciplineForProjectManipulationDto =
new MappingPair<DisciplineDto, DisciplineForProjectManipulationDto>();
export const OrganizationDto2OrganizationForProjectManipulationDto =
new MappingPair<OrganizationDto, OrganizationForProjectManipulationDto>();
const configuration = new MapperConfiguration((cfg) => {
cfg.createAutoMap(ProjectDto2ProjectForUpdateDto, {
disciplines: (opt) =>
opt.mapFromUsing(
(e) => e.disciplines,
DisciplineDto2DisciplineForProjectManipulationDto
),
visibility: (opt) =>
opt.mapFromUsing(
(e) => e.visibility,
VisibilityDto2VisibilityForProjectManipulationDto
),
organizations: (opt) =>
opt.mapFromUsing(
(e) => e.organizations,
OrganizationDto2OrganizationForProjectManipulationDto
),
});
// Other maps
cfg
.createAutoMap(VisibilityDto2VisibilityForProjectManipulationDto, {})
.forSourceMember("displayName", (opt) => opt.ignore());
cfg.createAutoMap(DisciplineDto2DisciplineForProjectManipulationDto, {});
cfg.createAutoMap(OrganizationDto2OrganizationForProjectManipulationDto, {});
});
export const projectMapper = configuration.createMapper();
import { MapperConfiguration, MappingPair } from "@dynamic-mapper/mapper";
import type {
DisciplineDto,
DisciplineForResourceManipulationDto,
GitLabOptionsDto,
GitlabResourceTypeOptionsForCreationDto,
GitlabResourceTypeOptionsForUpdateDto,
LicenseDto,
LicenseForResourceManipulationDto,
QuotaDto,
QuotaForManipulationDto,
RdsOptionsDto,
RdsResourceTypeOptionsForManipulationDto,
RdsS3OptionsDto,
RdsS3ResourceTypeOptionsForManipulationDto,
RdsS3WormOptionsDto,
RdsS3WormResourceTypeOptionsForManipulationDto,
ResourceDto,
ResourceForUpdateDto,
ResourceTypeInformationDto,
ResourceTypeOptionsDto,
ResourceTypeOptionsForCreationDto,
ResourceTypeOptionsForUpdateDto,
VisibilityDto,
VisibilityForResourceManipulationDto,
} from "@coscine/api-client/dist/types/Coscine.Api";
import { CoscineResourceTypes } from "@/modules/resource/types";
export const LicenseDto2LicenseForResourceManipulationDto = new MappingPair<
LicenseDto,
LicenseForResourceManipulationDto
>();
export const VisibilityDto2VisibilityForResourceManipulationDto =
new MappingPair<VisibilityDto, VisibilityForResourceManipulationDto>();
export const DisciplineDto2DisciplineForResourceManipulationDto =
new MappingPair<DisciplineDto, DisciplineForResourceManipulationDto>();
export const ResourceDto2ResourceForUpdateDto = new MappingPair<
ResourceDto,
ResourceForUpdateDto
>();
export const ResourceTypeOptionsDto2ResourceTypeOptionsForUpdateDto =
new MappingPair<ResourceTypeOptionsDto, ResourceTypeOptionsForUpdateDto>();
export const QuotaDto2QuotaForManipulationDto = new MappingPair<
QuotaDto,
QuotaForManipulationDto
>();
export const GitLabOptionsDto2GitlabResourceTypeOptionsForUpdateDto =
new MappingPair<GitLabOptionsDto, GitlabResourceTypeOptionsForUpdateDto>();
export const RdsOptionsDto2RdsResourceTypeOptionsForManipulationDto =
new MappingPair<RdsOptionsDto, RdsResourceTypeOptionsForManipulationDto>();
export const RdsS3OptionsDto2RdsS3ResourceTypeOptionsForManipulationDto =
new MappingPair<
RdsS3OptionsDto,
RdsS3ResourceTypeOptionsForManipulationDto
>();
export const RdsS3WormOptionsDto2RdsS3WormResourceTypeOptionsForManipulationDto =
new MappingPair<
RdsS3WormOptionsDto,
RdsS3WormResourceTypeOptionsForManipulationDto
>();
export const ResourceTypeInformationDto2ResourceTypeOptionsForCreationDto =
new MappingPair<
ResourceTypeInformationDto,
ResourceTypeOptionsForCreationDto
>();
const configuration = new MapperConfiguration((cfg) => {
cfg.createAutoMap(ResourceDto2ResourceForUpdateDto, {
license: (opt) =>
opt.mapFromUsing(
(e) => e.license,
LicenseDto2LicenseForResourceManipulationDto
),
visibility: (opt) =>
opt.mapFromUsing(
(e) => e.visibility,
VisibilityDto2VisibilityForResourceManipulationDto
),
disciplines: (opt) =>
opt.mapFromUsing(
(e) => e.disciplines,
DisciplineDto2DisciplineForResourceManipulationDto
),
resourceTypeOptions: (opt) =>
opt.mapFromUsing(
(e) => e.type?.options,
ResourceTypeOptionsDto2ResourceTypeOptionsForUpdateDto
),
});
// Resource type options maps
cfg.createAutoMap(ResourceTypeOptionsDto2ResourceTypeOptionsForUpdateDto, {
linkedResourceTypeOptions: (opt) => opt.ignore(),
gitlabResourceTypeOptions: (opt) =>
opt
.mapFromUsing(
(e) => e.gitLabOptions,
GitLabOptionsDto2GitlabResourceTypeOptionsForUpdateDto
)
.condition((con) => con.gitLabOptions !== undefined),
rdsResourceTypeOptions: (opt) =>
opt
.mapFromUsing(
(e) => e.rdsOptions,
RdsOptionsDto2RdsResourceTypeOptionsForManipulationDto
)
.condition((con) => con.rdsOptions !== undefined),
rdsS3ResourceTypeOptions: (opt) =>
opt
.mapFromUsing(
(e) => e.rdsS3Options,
RdsS3OptionsDto2RdsS3ResourceTypeOptionsForManipulationDto
)
.condition((con) => con.rdsS3Options !== undefined),
rdsS3WormResourceTypeOptions: (opt) =>
opt
.mapFromUsing(
(e) => e.rdsS3WormOptions,
RdsS3WormOptionsDto2RdsS3WormResourceTypeOptionsForManipulationDto
)
.condition((con) => con.rdsS3WormOptions !== undefined),
});
cfg.createMap(ResourceTypeInformationDto2ResourceTypeOptionsForCreationDto, {
linkedResourceTypeOptions: (opt) =>
opt
.preCondition(
(rti) => rti.generalType === CoscineResourceTypes.LinkedData.General
)
.mapFrom((rti) =>
rti.generalType === CoscineResourceTypes.LinkedData.General
? {}
: undefined
),
gitlabResourceTypeOptions: (opt) =>
opt
.preCondition(
(rti) => rti.generalType === CoscineResourceTypes.Gitlab.General
)
.mapFrom((rti) =>
rti.generalType === CoscineResourceTypes.Gitlab.General
? ({} as GitlabResourceTypeOptionsForCreationDto)
: undefined
),
rdsResourceTypeOptions: (opt) =>
opt
.preCondition(
(rti) => rti.generalType === CoscineResourceTypes.Rds.General
)
.mapFrom((rti) =>
rti.generalType === CoscineResourceTypes.Rds.General ? {} : undefined
),
rdsS3ResourceTypeOptions: (opt) =>
opt
.preCondition(
(rti) => rti.generalType === CoscineResourceTypes.RdsS3.General
)
.mapFrom((rti) =>
rti.generalType === CoscineResourceTypes.RdsS3.General
? {}
: undefined
),
rdsS3WormResourceTypeOptions: (opt) =>
opt
.preCondition(
(rti) => rti.generalType === CoscineResourceTypes.RdsS3Worm.General
)
.mapFrom((rti) =>
rti.generalType === CoscineResourceTypes.RdsS3Worm.General
? {}
: undefined
),
});
cfg.createAutoMap(GitLabOptionsDto2GitlabResourceTypeOptionsForUpdateDto, {});
cfg.createAutoMap(RdsOptionsDto2RdsResourceTypeOptionsForManipulationDto, {
size: (opt) =>
opt.mapFromUsing((e) => e.size, QuotaDto2QuotaForManipulationDto),
});
cfg.createAutoMap(
RdsS3OptionsDto2RdsS3ResourceTypeOptionsForManipulationDto,
{
size: (opt) =>
opt.mapFromUsing((e) => e.size, QuotaDto2QuotaForManipulationDto),
}
);
cfg.createAutoMap(
RdsS3WormOptionsDto2RdsS3WormResourceTypeOptionsForManipulationDto,
{
size: (opt) =>
opt.mapFromUsing((e) => e.size, QuotaDto2QuotaForManipulationDto),
}
);
// Other maps
cfg.createAutoMap(LicenseDto2LicenseForResourceManipulationDto, {});
cfg
.createAutoMap(VisibilityDto2VisibilityForResourceManipulationDto, {})
.forSourceMember("displayName", (opt) => opt.ignore());
cfg.createAutoMap(DisciplineDto2DisciplineForResourceManipulationDto, {});
cfg.createAutoMap(QuotaDto2QuotaForManipulationDto, {});
});
export const resourceMapper = configuration.createMapper();