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 7

Showing
with 159 additions and 94 deletions
...@@ -305,6 +305,7 @@ $RECYCLE.BIN/ ...@@ -305,6 +305,7 @@ $RECYCLE.BIN/
# End of https://www.toptal.com/developers/gitignore/api/vue,node,macos,windows,linux,vscode,intellij+all # End of https://www.toptal.com/developers/gitignore/api/vue,node,macos,windows,linux,vscode,intellij+all
# Other
.husky .husky
.yarn/* .yarn/*
!.yarn/patches !.yarn/patches
......
{ {
"name": "ui", "name": "ui",
"version": "1.20.5", "version": "1.21.0",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
"coverage": "vitest run --coverage" "coverage": "vitest run --coverage"
}, },
"dependencies": { "dependencies": {
"@coscine/api-client": "^2.8.1", "@coscine/api-client": "^2.9.0",
"@coscine/form-generator": "^3.0.12", "@coscine/form-generator": "^3.0.12",
"@rdfjs-elements/formats-pretty": "^0.4.3", "@rdfjs-elements/formats-pretty": "^0.4.3",
"@rdfjs/data-model": "^2.0.0", "@rdfjs/data-model": "^2.0.0",
......
...@@ -83,14 +83,6 @@ export default defineComponent({ ...@@ -83,14 +83,6 @@ export default defineComponent({
if (this.projectStore.currentProjectRoles === null) { if (this.projectStore.currentProjectRoles === null) {
this.projectStore.retrieveProjectRoles(this.project); this.projectStore.retrieveProjectRoles(this.project);
} }
// Load Quotas for the project if not present
if (this.projectStore.currentQuotas === null) {
this.projectStore.retrieveQuotas(this.project);
}
// Load list of Enabled Resource Types if not present
if (this.resourceStore.resourceTypes === null) {
this.resourceStore.retrieveResourceTypes();
}
// Load list of all Project Role Types if not present // Load list of all Project Role Types if not present
if (this.projectStore.roles === null) { if (this.projectStore.roles === null) {
this.projectStore.retrieveRoles(); this.projectStore.retrieveRoles();
......
...@@ -130,9 +130,9 @@ export default defineComponent({ ...@@ -130,9 +130,9 @@ export default defineComponent({
}, },
}, },
created() { async created() {
this.isLoading = true; this.isLoading = true;
this.fetchData(); await this.fetchData();
this.isLoading = false; this.isLoading = false;
}, },
......
...@@ -69,6 +69,7 @@ ...@@ -69,6 +69,7 @@
<CoscineCard <CoscineCard
:title="$t('page.listProjects.addProject')" :title="$t('page.listProjects.addProject')"
type="create" type="create"
:style="cardStyle"
:to="toCreateSubProject()" :to="toCreateSubProject()"
@open-card="openCreateProject($event)" @open-card="openCreateProject($event)"
/> />
...@@ -85,6 +86,7 @@ ...@@ -85,6 +86,7 @@
:key="index" :key="index"
:title="subProject.displayName" :title="subProject.displayName"
type="project" type="project"
:style="cardStyle"
:to="toSubProject(subProject)" :to="toSubProject(subProject)"
@open-card="openProject($event, subProject)" @open-card="openProject($event, subProject)"
/> />
......
...@@ -391,11 +391,22 @@ export default defineComponent({ ...@@ -391,11 +391,22 @@ export default defineComponent({
}, },
}, },
created() { async created() {
await this.fetchData();
this.selectFirstResourceType(); this.selectFirstResourceType();
}, },
methods: { methods: {
async fetchData() {
// Load Quotas for the project if not present
if (this.projectStore.currentQuotas === null) {
await this.projectStore.retrieveQuotas(this.project);
}
// Load list of Enabled Resource Types if not present
if (this.resourceStore.resourceTypes === null) {
await this.resourceStore.retrieveResourceTypes();
}
},
async changeProjectQuota() { async changeProjectQuota() {
if ( if (
this.project && this.project &&
......
...@@ -11,10 +11,10 @@ ...@@ -11,10 +11,10 @@
<b-form-checkbox <b-form-checkbox
id="Archive" id="Archive"
:checked="resourceForm.archived" :checked="resourceForm.archived"
:disabled="!(isOwner || isResourceCreator) || !resourceForm" :disabled="!isUserAllowedToEdit"
switch switch
size="lg" size="lg"
@click.native.prevent="isArchiveModalVisible = true" @click.prevent="isArchiveModalVisible = true"
/> />
</CoscineFormGroup> </CoscineFormGroup>
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
type="delete" type="delete"
variant="danger" variant="danger"
:disabled=" :disabled="
!resourceForm || !isUserAllowedToEdit ||
(resourceTypeInformation && !resourceTypeInformation.canDelete) (resourceTypeInformation && !resourceTypeInformation.canDelete)
" "
@click.prevent="isDeleteModalVisible = true" @click.prevent="isDeleteModalVisible = true"
...@@ -61,12 +61,10 @@ ...@@ -61,12 +61,10 @@
<script lang="ts"> <script lang="ts">
import { defineComponent, type PropType } from "vue"; import { defineComponent, type PropType } from "vue";
import useProjectStore from "@/modules/project/store"; import useProjectStore from "@/modules/project/store";
import useUserStore from "@/modules/user/store";
import useResourceStore from "../../store"; import useResourceStore from "../../store";
import ArchiveResourceModal from "./modals/ArchiveResourceModal.vue"; import ArchiveResourceModal from "./modals/ArchiveResourceModal.vue";
import DeleteResourceModal from "./modals/DeleteResourceModal.vue"; import DeleteResourceModal from "./modals/DeleteResourceModal.vue";
import type { ResourceObject } from "@coscine/api-client/dist/types/Coscine.Api.Resources"; import type { ResourceObject } from "@coscine/api-client/dist/types/Coscine.Api.Resources";
import type { UserObject } from "@coscine/api-client/dist/types/Coscine.Api.User";
import type { ResourceTypeInformation } from "@coscine/api-client/dist/types/Coscine.Api.Resources"; import type { ResourceTypeInformation } from "@coscine/api-client/dist/types/Coscine.Api.Resources";
export default defineComponent({ export default defineComponent({
components: { components: {
...@@ -82,6 +80,10 @@ export default defineComponent({ ...@@ -82,6 +80,10 @@ export default defineComponent({
default: false, default: false,
type: Boolean, type: Boolean,
}, },
isUserAllowedToEdit: {
default: false,
type: Boolean,
},
}, },
emits: { emits: {
...@@ -91,10 +93,9 @@ export default defineComponent({ ...@@ -91,10 +93,9 @@ export default defineComponent({
setup() { setup() {
const projectStore = useProjectStore(); const projectStore = useProjectStore();
const userStore = useUserStore();
const resourceStore = useResourceStore(); const resourceStore = useResourceStore();
return { projectStore, userStore, resourceStore }; return { projectStore, resourceStore };
}, },
data() { data() {
...@@ -116,19 +117,6 @@ export default defineComponent({ ...@@ -116,19 +117,6 @@ export default defineComponent({
} }
return null; return null;
}, },
isOwner(): boolean | undefined {
return this.projectStore.currentUserRoleIsOwner;
},
user(): UserObject | null {
return this.userStore.user;
},
isResourceCreator(): boolean | undefined {
if (this.resourceForm.creator && this.user && this.user.id) {
return this.resourceForm.creator === this.user.id;
} else {
return undefined;
}
},
}, },
methods: { methods: {
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<FormGenerator <FormGenerator
v-else-if="resource" v-else-if="resource"
:key="resourceForm.applicationProfile" :key="resourceForm.applicationProfile"
:disabled-mode="!isOwner || resource.archived" :disabled-mode="!isUserAllowedToEdit || resource.archived"
:fixed-value-mode="true" :fixed-value-mode="true"
:fixed-values="resourceForm.fixedValues" :fixed-values="resourceForm.fixedValues"
:locale="$root.$i18n.locale" :locale="$root.$i18n.locale"
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
import { defineComponent, type PropType } from "vue"; import { defineComponent, type PropType } from "vue";
// import the store for current module // import the store for current module
import useResourceStore from "../../store"; import useResourceStore from "../../store";
import useProjectStore from "@/modules/project/store";
import useUserStore from "@/modules/user/store"; import useUserStore from "@/modules/user/store";
import "@/plugins/form-generator"; import "@/plugins/form-generator";
import type { Dataset } from "@rdfjs/types"; import type { Dataset } from "@rdfjs/types";
...@@ -47,6 +46,10 @@ export default defineComponent({ ...@@ -47,6 +46,10 @@ export default defineComponent({
type: Boolean, type: Boolean,
required: true, required: true,
}, },
isUserAllowedToEdit: {
default: false,
type: Boolean,
},
}, },
emits: { emits: {
...@@ -55,10 +58,9 @@ export default defineComponent({ ...@@ -55,10 +58,9 @@ export default defineComponent({
setup() { setup() {
const resourceStore = useResourceStore(); const resourceStore = useResourceStore();
const projectStore = useProjectStore();
const userStore = useUserStore(); const userStore = useUserStore();
return { resourceStore, projectStore, userStore }; return { resourceStore, userStore };
}, },
data() { data() {
...@@ -71,9 +73,6 @@ export default defineComponent({ ...@@ -71,9 +73,6 @@ export default defineComponent({
resource(): ResourceObject | null { resource(): ResourceObject | null {
return this.resourceStore.currentResource; return this.resourceStore.currentResource;
}, },
isOwner(): boolean | undefined {
return this.projectStore.currentUserRoleIsOwner;
},
user(): UserObject | null { user(): UserObject | null {
return this.userStore.user; return this.userStore.user;
}, },
...@@ -99,5 +98,3 @@ export default defineComponent({ ...@@ -99,5 +98,3 @@ export default defineComponent({
}, },
}); });
</script> </script>
<style></style>
...@@ -129,7 +129,7 @@ ...@@ -129,7 +129,7 @@
type="input" type="input"
> >
<b-form-input <b-form-input
v-if="resource" v-if="resource && resource.type"
id="ResourceType" id="ResourceType"
:value=" :value="
$t('resourceTypes.' + resource.type.displayName + '.displayName') $t('resourceTypes.' + resource.type.displayName + '.displayName')
...@@ -143,7 +143,12 @@ ...@@ -143,7 +143,12 @@
<!-- Resource Quota --> <!-- Resource Quota -->
<b-col> <b-col>
<CoscineFormGroup <CoscineFormGroup
v-if="resource && resource.resourceTypeOption.Size" v-if="
resource &&
resource.resourceTypeOption.Size &&
quotaCurrentBytes !== null &&
quotaMaximumBytes !== null
"
label-for="Quota" label-for="Quota"
:label="$t('page.settings.overview.quotaLabel')" :label="$t('page.settings.overview.quotaLabel')"
:is-loading=" :is-loading="
......
...@@ -62,7 +62,8 @@ ...@@ -62,7 +62,8 @@
variant="outline-primary" variant="outline-primary"
:disabled="!tabs[currentTab + 1].active" :disabled="!tabs[currentTab + 1].active"
@click.prevent="next" @click.prevent="next"
>{{ $t("buttons.next") }} >
{{ $t("buttons.next") }}
</b-button> </b-button>
</b-form-group> </b-form-group>
</div> </div>
...@@ -171,15 +172,23 @@ export default defineComponent({ ...@@ -171,15 +172,23 @@ export default defineComponent({
}, },
}, },
created() { async created() {
this.isLoading = true; this.isLoading = true;
this.getGroupedApplicationProfilesList(); this.getGroupedApplicationProfilesList();
this.fetchData(); await this.fetchData();
this.isLoading = false; this.isLoading = false;
}, },
methods: { methods: {
async fetchData() { async fetchData() {
// Load Quotas for the project if not present
if (this.projectStore.currentQuotas === null) {
await this.projectStore.retrieveQuotas(this.project);
}
// Load list of Enabled Resource Types if not present
if (this.resourceStore.resourceTypes === null) {
await this.resourceStore.retrieveResourceTypes();
}
// Load Project Visibilities if not present // Load Project Visibilities if not present
if (this.projectStore.visibilities === null) { if (this.projectStore.visibilities === null) {
await this.projectStore.retrieveVisibilities(); await this.projectStore.retrieveVisibilities();
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
v-model="resourceForm" v-model="resourceForm"
:application-profile="applicationProfile" :application-profile="applicationProfile"
:is-loading-form-generator="isLoading" :is-loading-form-generator="isLoading"
:is-user-allowed-to-edit="isUserAllowedToEdit"
@clickSave="clickSave" @clickSave="clickSave"
/> />
...@@ -48,6 +49,7 @@ ...@@ -48,6 +49,7 @@
v-if="resource" v-if="resource"
v-show="tabs[currentTab].step === 'action'" v-show="tabs[currentTab].step === 'action'"
:resource-form="resource" :resource-form="resource"
:is-user-allowed-to-edit="isUserAllowedToEdit"
@toggleArchive="toggleArchive" @toggleArchive="toggleArchive"
@clickDelete="clickDelete" @clickDelete="clickDelete"
/> />
...@@ -75,6 +77,7 @@ import { defineComponent } from "vue"; ...@@ -75,6 +77,7 @@ import { defineComponent } from "vue";
// import the store for current module // import the store for current module
import useResourceStore from "../store"; import useResourceStore from "../store";
import useProjectStore from "@/modules/project/store"; import useProjectStore from "@/modules/project/store";
import useUserStore from "@/modules/user/store";
import { navigateToProject } from "@/router"; import { navigateToProject } from "@/router";
import General from "../components/create-resource/General.vue"; import General from "../components/create-resource/General.vue";
import MetadataView from "../components/settings/MetadataView.vue"; import MetadataView from "../components/settings/MetadataView.vue";
...@@ -91,6 +94,7 @@ import type { ResourceCreationTab, ResourceTypeOption } from "../types"; ...@@ -91,6 +94,7 @@ import type { ResourceCreationTab, ResourceTypeOption } from "../types";
import type { ProjectObject } from "@coscine/api-client/dist/types/Coscine.Api.Project"; import type { ProjectObject } from "@coscine/api-client/dist/types/Coscine.Api.Project";
import useNotificationStore from "@/store/notification"; import useNotificationStore from "@/store/notification";
import type { Validation } from "@vuelidate/core"; import type { Validation } from "@vuelidate/core";
import type { UserObject } from "@coscine/api-client/dist/types/Coscine.Api.User";
export default defineComponent({ export default defineComponent({
components: { components: {
...@@ -103,9 +107,10 @@ export default defineComponent({ ...@@ -103,9 +107,10 @@ export default defineComponent({
setup() { setup() {
const resourceStore = useResourceStore(); const resourceStore = useResourceStore();
const projectStore = useProjectStore(); const projectStore = useProjectStore();
const userStore = useUserStore();
const notificationStore = useNotificationStore(); const notificationStore = useNotificationStore();
return { resourceStore, projectStore, notificationStore }; return { resourceStore, projectStore, userStore, notificationStore };
}, },
data() { data() {
...@@ -198,6 +203,25 @@ export default defineComponent({ ...@@ -198,6 +203,25 @@ export default defineComponent({
} }
return tabs; return tabs;
}, },
isOwner(): boolean | undefined {
return this.projectStore.currentUserRoleIsOwner;
},
user(): UserObject | null {
return this.userStore.user;
},
isResourceCreator(): boolean | undefined {
if (this.resourceForm.creator && this.user && this.user.id) {
return this.resourceForm.creator === this.user.id;
} else {
return undefined;
}
},
isUserAllowedToEdit(): boolean {
if ((this.isOwner || this.isResourceCreator) && this.resourceForm) {
return true;
}
return false;
},
}, },
watch: { watch: {
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<b-form-select <b-form-select
v-model="selectedProject" v-model="selectedProject"
:options="allProjectsOptions" :options="allProjectsOptions"
@change="queryData(searchText)" @change="queryData(searchText, selectedPage, paginationPageSize)"
> >
<template #first> <template #first>
<b-form-select-option :value="null"> <b-form-select-option :value="null">
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<b-form-select <b-form-select
v-model="selectedResource" v-model="selectedResource"
:options="projectResourcesOptions" :options="projectResourcesOptions"
@change="queryData(searchText)" @change="queryData(searchText, selectedPage, paginationPageSize)"
> >
<template #first> <template #first>
<b-form-select-option :value="null"> <b-form-select-option :value="null">
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
id="searchButton" id="searchButton"
variant="primary" variant="primary"
:disabled="resultsViewLoading" :disabled="resultsViewLoading"
@click="queryData(searchText)" @click="queryData(searchText, selectedPage, paginationPageSize)"
> >
{{ $t("page.search.search") }} {{ $t("page.search.search") }}
<b-spinner v-if="resultsViewLoading" variant="secondary" /> <b-spinner v-if="resultsViewLoading" variant="secondary" />
...@@ -132,10 +132,10 @@ ...@@ -132,10 +132,10 @@
</template> </template>
<b-table <b-table
id="resultsView" id="resultsView"
:items="filteredResults" :items="searchResults"
:fields="resultsViewFields" :fields="resultsViewFields"
:per-page="paginationPerPage" :per-page="pagination ? pagination.PageSize : 0"
:current-page="paginationCurrentPage" :current-page="1"
thead-class="d-none" thead-class="d-none"
style="min-height: 100%" style="min-height: 100%"
small small
...@@ -161,9 +161,7 @@ ...@@ -161,9 +161,7 @@
<!-- Show footer if there are results and only on the last page --> <!-- Show footer if there are results and only on the last page -->
<div <div
v-if=" v-if="
foot.items.length > 0 && foot.items.length > 0 && pagination && !pagination.HasNext
paginationCurrentPage ===
Math.ceil(paginationTotalRows / paginationPerPage)
" "
class="p-2 text-center text-muted border-top" class="p-2 text-center text-muted border-top"
> >
...@@ -183,16 +181,16 @@ ...@@ -183,16 +181,16 @@
<b-col align-self="center" class="p-0"> <b-col align-self="center" class="p-0">
<b-pagination <b-pagination
id="pagination" id="pagination"
v-model="paginationCurrentPage" v-model="selectedPage"
:total-rows="paginationTotalRows" :total-rows="pagination ? pagination.TotalCount : 0"
:per-page="paginationPerPage" :per-page="pagination ? pagination.PageSize : 0"
aria-controls="resultsView" aria-controls="resultsView"
align="center" align="center"
/> />
</b-col> </b-col>
<b-col align-self="center" class="p-0"> <b-col align-self="center" class="p-0">
<b-form-select <b-form-select
v-model="paginationPerPage" v-model="paginationPageSize"
:options="paginationPerPageOptions" :options="paginationPerPageOptions"
style="max-width: 5rem" style="max-width: 5rem"
/> />
...@@ -216,10 +214,8 @@ import useResourceStore from "@/modules/resource/store"; ...@@ -216,10 +214,8 @@ import useResourceStore from "@/modules/resource/store";
import type { ProjectObject } from "@coscine/api-client/dist/types/Coscine.Api.Project"; import type { ProjectObject } from "@coscine/api-client/dist/types/Coscine.Api.Project";
import type { ResourceObject } from "@coscine/api-client/dist/types/Coscine.Api.Resources"; import type { ResourceObject } from "@coscine/api-client/dist/types/Coscine.Api.Resources";
import type { import type { ItemSearchResult } from "@coscine/api-client/dist/types/Coscine.Api.Search";
ItemSearchResult, import { Pagination } from "../types";
SearchResult,
} from "@coscine/api-client/dist/types/Coscine.Api.Search";
export default defineComponent({ export default defineComponent({
components: { components: {
...@@ -249,9 +245,9 @@ export default defineComponent({ ...@@ -249,9 +245,9 @@ export default defineComponent({
resultsViewFields: ["type"], resultsViewFields: ["type"],
resultsViewLoading: true, resultsViewLoading: true,
paginationCurrentPage: 1, paginationPerPageOptions: [5, 10, 20, 50],
paginationPerPage: 100, selectedPage: 1,
paginationPerPageOptions: [5, 10, 20, 50, 100], paginationPageSize: 10
}; };
}, },
...@@ -294,30 +290,34 @@ export default defineComponent({ ...@@ -294,30 +290,34 @@ export default defineComponent({
}); });
}, },
paginationTotalRows(): number { paginationTotalRows(): number {
return this.filteredResults.length; if(this.searchStore.pagination?.TotalCount){
return this.searchStore.pagination.TotalCount;
} else return 0;
},
pagination(): Pagination | null {
return this.searchStore.pagination;
}, },
resultsForTable(): ItemSearchResult[] { resultsForTable(): ItemSearchResult[] {
const result: ItemSearchResult[] = []; const result: ItemSearchResult[] = [];
if (this.searchResults) { if (this.searchResults) {
if (this.searchResults.items) {
result.push( result.push(
...this.searchResults.items.filter((item) => ...this.searchResults.filter((item) =>
this.isFilteredItem(item) this.isFilteredItem(item)
) )
); );
} }
}
return result; return result;
}, },
searchResults(): SearchResult | null { searchResults(): ItemSearchResult[] | null {
return this.searchStore.searchResults; return this.searchStore.searchResults;
}, },
}, },
watch: { watch: {
searchText() { searchText() {
this.queryData(this.searchText); this.queryData(this.searchText, this.selectedPage, this.paginationPageSize);
}, },
selectedProject() { selectedProject() {
this.selectedResource = null; this.selectedResource = null;
this.projectResources = null; this.projectResources = null;
...@@ -326,8 +326,17 @@ export default defineComponent({ ...@@ -326,8 +326,17 @@ export default defineComponent({
this.retrieveResources(); this.retrieveResources();
this.retrieveSubProjects(); this.retrieveSubProjects();
}, },
resultsForTable() {
this.assignResultsFilter(); // resultsForTable() {
// this.assignResultsFilter();
// },
selectedPage() {
this.queryData(this.searchText, this.selectedPage, this.paginationPageSize);
},
paginationPageSize() {
this.queryData(this.searchText, this.selectedPage, this.paginationPageSize);
}, },
}, },
...@@ -362,11 +371,11 @@ export default defineComponent({ ...@@ -362,11 +371,11 @@ export default defineComponent({
const query = Object.fromEntries(urlSearchParams.entries()); const query = Object.fromEntries(urlSearchParams.entries());
return query !== null ? decodeURIComponent(query.q) : ""; return query !== null ? decodeURIComponent(query.q) : "";
}, },
async queryData(query: string) { async queryData(query: string, pageNumber: number, pageSize: number) {
this.resultsViewLoading = true; this.resultsViewLoading = true;
// attach search query, resulting in "/search?q=<searchTerm>" // attach search query, resulting in "/search?q=<searchTerm>"
this.$router.push({ name: "search", query: { q: query } }); this.$router.push({ name: "search", query: { q: query } });
await this.searchStore.retrieveSearchResults(query, this.selectedProject); await this.searchStore.retrieveSearchResults(query, pageNumber, pageSize, this.selectedProject);
this.resultsViewLoading = false; this.resultsViewLoading = false;
}, },
async retrieveResources() { async retrieveResources() {
......
...@@ -20,6 +20,7 @@ export const useSearchStore = defineStore({ ...@@ -20,6 +20,7 @@ export const useSearchStore = defineStore({
*/ */
state: (): SearchState => ({ state: (): SearchState => ({
searchResults: null, searchResults: null,
pagination: null
}), }),
/* /*
...@@ -45,6 +46,8 @@ export const useSearchStore = defineStore({ ...@@ -45,6 +46,8 @@ export const useSearchStore = defineStore({
actions: { actions: {
async retrieveSearchResults( async retrieveSearchResults(
query: string, query: string,
pageNumber: number,
pageSize: number,
projectObject?: ProjectObject | null projectObject?: ProjectObject | null
): Promise<boolean> { ): Promise<boolean> {
const notificationStore = useNotificationStore(); const notificationStore = useNotificationStore();
...@@ -53,7 +56,12 @@ export const useSearchStore = defineStore({ ...@@ -53,7 +56,12 @@ export const useSearchStore = defineStore({
if (projectObject && projectObject.id) { if (projectObject && projectObject.id) {
adaptedQuery = `(${adaptedQuery}) + (belongsToProject: "https://purl.org/coscine/projects/${projectObject.id}")`; adaptedQuery = `(${adaptedQuery}) + (belongsToProject: "https://purl.org/coscine/projects/${projectObject.id}")`;
} }
const response = await SearchApi.searchSearch(adaptedQuery); const response = await SearchApi.searchSearch(adaptedQuery, undefined, undefined, undefined, pageNumber, pageSize);
if(response.headers["x-pagination"]){
this.pagination = JSON.parse(response.headers["x-pagination"]);
}
this.searchResults = response.data; this.searchResults = response.data;
return true; return true;
} catch (error) { } catch (error) {
......
import type { SearchResult } from "@coscine/api-client/dist/types/Coscine.Api.Search"; import type { ItemSearchResult } from "@coscine/api-client/dist/types/Coscine.Api.Search";
export interface Pagination {
TotalCount: number;
PageSize: number;
CurrentPage: number;
TotalPages: number;
HasNext: boolean;
HasPrevious: boolean;
}
export interface SearchState { export interface SearchState {
/* /*
...@@ -6,5 +15,6 @@ export interface SearchState { ...@@ -6,5 +15,6 @@ export interface SearchState {
STATE TYPE DEFINITION STATE TYPE DEFINITION
-------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------
*/ */
searchResults: SearchResult | null; pagination: Pagination | null;
searchResults: ItemSearchResult[] | null;
} }
...@@ -331,6 +331,15 @@ __metadata: ...@@ -331,6 +331,15 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@coscine/api-client@npm:^2.9.0":
version: 2.9.0
resolution: "@coscine/api-client@npm:2.9.0"
dependencies:
axios: ^0.21.1
checksum: 5bc66ca4087d9a20c7373321c289402f29b55105fec5120bdbb4c832bdd5ba25a0e8d3482ca57a55364b1537724a550a0ae380d5e4a0e447d037daedaa3fa8c6
languageName: node
linkType: hard
"@coscine/form-generator@npm:^3.0.12": "@coscine/form-generator@npm:^3.0.12":
version: 3.0.12 version: 3.0.12
resolution: "@coscine/form-generator@npm:3.0.12" resolution: "@coscine/form-generator@npm:3.0.12"
...@@ -10368,7 +10377,7 @@ __metadata: ...@@ -10368,7 +10377,7 @@ __metadata:
version: 0.0.0-use.local version: 0.0.0-use.local
resolution: "ui@workspace:." resolution: "ui@workspace:."
dependencies: dependencies:
"@coscine/api-client": ^2.8.1 "@coscine/api-client": ^2.9.0
"@coscine/form-generator": ^3.0.12 "@coscine/form-generator": ^3.0.12
"@esbuild-plugins/node-globals-polyfill": ^0.1.1 "@esbuild-plugins/node-globals-polyfill": ^0.1.1
"@esbuild-plugins/node-modules-polyfill": ^0.1.4 "@esbuild-plugins/node-modules-polyfill": ^0.1.4
......