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
Showing
with 1419 additions and 1018 deletions
......@@ -10,14 +10,14 @@
>
<b-form-input
id="ProjectName"
v-model="v$.projectForm.projectName.$model"
v-model="v$.projectForManipulation.projectName.$model"
:state="
v$.projectForm.projectName.$dirty
? !v$.projectForm.projectName.$error
v$.projectForManipulation.projectName.$dirty
? !v$.projectForManipulation.projectName.$error
: null
"
:placeholder="$t('form.project.projectName')"
:maxlength="v$.projectForm.projectName.maxLength.$params.max"
:maxlength="v$.projectForManipulation.projectName.maxLength.$params.max"
required
:disabled="disabled"
@input="translateProjectNameToDisplayName"
......@@ -25,7 +25,8 @@
<div class="invalid-tooltip">
{{
$t("form.project.projectNameHelp", {
maxLength: v$.projectForm.projectName.maxLength.$params.max,
maxLength:
v$.projectForManipulation.projectName.maxLength.$params.max,
})
}}
</div>
......@@ -41,14 +42,14 @@
>
<b-form-input
id="DisplayName"
v-model="v$.projectForm.displayName.$model"
v-model="v$.projectForManipulation.displayName.$model"
:state="
v$.projectForm.displayName.$dirty
? !v$.projectForm.displayName.$error
v$.projectForManipulation.displayName.$dirty
? !v$.projectForManipulation.displayName.$error
: null
"
:placeholder="$t('form.project.displayName')"
:maxlength="v$.projectForm.displayName.maxLength.$params.max"
:maxlength="v$.projectForManipulation.displayName.maxLength.$params.max"
required
:disabled="disabled"
@input="isLockedDisplayName = true"
......@@ -56,7 +57,8 @@
<div class="invalid-tooltip">
{{
$t("form.project.displayNameHelp", {
maxLength: v$.projectForm.displayName.maxLength.$params.max,
maxLength:
v$.projectForManipulation.displayName.maxLength.$params.max,
})
}}
</div>
......@@ -72,21 +74,22 @@
>
<b-form-textarea
id="Description"
v-model="v$.projectForm.description.$model"
v-model="v$.projectForManipulation.description.$model"
:state="
v$.projectForm.description.$dirty
? !v$.projectForm.description.$error
v$.projectForManipulation.description.$dirty
? !v$.projectForManipulation.description.$error
: null
"
:placeholder="$t('form.project.projectDescription')"
:maxlength="v$.projectForm.description.maxLength.$params.max"
:maxlength="v$.projectForManipulation.description.maxLength.$params.max"
required
:disabled="disabled"
/>
<div class="invalid-tooltip">
{{
$t("form.project.projectDescriptionHelp", {
maxLength: v$.projectForm.description.maxLength.$params.max,
maxLength:
v$.projectForManipulation.description.maxLength.$params.max,
})
}}
</div>
......@@ -97,13 +100,16 @@
<script lang="ts">
import { defineComponent, PropType, reactive, ref } from "vue";
import { required, maxLength } from "@vuelidate/validators";
import { NestedValidations, useVuelidate } from "@vuelidate/core";
import type { ProjectObject } from "@coscine/api-client/dist/types/Coscine.Api.Project";
import { useVuelidate, type BaseValidation } from "@vuelidate/core";
import type {
ProjectForCreationDto,
ProjectForUpdateDto,
} from "@coscine/api-client/dist/types/Coscine.Api/api";
export default defineComponent({
props: {
value: {
type: Object as PropType<ProjectObject>,
type: Object as PropType<ProjectForCreationDto | ProjectForUpdateDto>,
required: true,
},
disabled: {
......@@ -116,7 +122,9 @@ export default defineComponent({
},
},
emits: {
validation: (_: NestedValidations<ProjectObject>) => true,
validation: (
_: BaseValidation<ProjectForCreationDto | ProjectForUpdateDto>
) => true,
},
setup(props) {
......@@ -125,10 +133,10 @@ export default defineComponent({
will enable proper typings in the code
*/
const state = reactive({
projectForm: ref(props.value),
projectForManipulation: ref(props.value),
});
const rules = {
projectForm: {
projectForManipulation: {
projectName: { required, maxLength: maxLength(200) },
displayName: { required, maxLength: maxLength(25) },
description: { required, maxLength: maxLength(5000) },
......@@ -140,15 +148,15 @@ export default defineComponent({
data() {
return {
projectForm: this.value,
projectForManipulation: this.value,
isLockedDisplayName: false,
};
},
watch: {
projectForm: {
projectForManipulation: {
handler() {
this.$emit("validation", this.v$.projectForm);
this.$emit("validation", this.v$.projectForManipulation);
},
deep: true,
},
......@@ -156,12 +164,13 @@ export default defineComponent({
methods: {
translateProjectNameToDisplayName() {
if (!this.isLockedDisplayName && this.projectForm.projectName) {
this.projectForm.displayName = this.projectForm.projectName.substring(
0,
25
);
this.v$.projectForm.displayName?.$touch();
if (
!this.isLockedDisplayName &&
this.projectForManipulation.projectName
) {
this.projectForManipulation.displayName =
this.projectForManipulation.projectName.substring(0, 25);
this.v$.projectForManipulation.displayName?.$touch();
}
},
},
......
......@@ -2,7 +2,7 @@
<div>
<!-- Project Slug -->
<CoscineFormGroup
label-for="Slug"
label-for="ProjectSlug"
:label="$t('form.project.projectSlugLabel')"
:is-loading="isLoading"
type="input"
......@@ -20,7 +20,7 @@
label-for="ProjectPersistentId"
:label="$t('form.project.projectPersistentIdLabel')"
:is-loading="isLoading"
:info="true"
info
>
<template #popover>
{{ $t("form.project.projectPersistentIdPopover") }}
......@@ -65,13 +65,13 @@
</template>
<script lang="ts">
import type { ProjectDto } from "@coscine/api-client/dist/types/Coscine.Api/api";
import { defineComponent, PropType } from "vue";
import type { ProjectObject } from "@coscine/api-client/dist/types/Coscine.Api.Project";
export default defineComponent({
props: {
value: {
type: Object as PropType<ProjectObject>,
type: Object as PropType<ProjectDto>,
required: true,
},
isLoading: {
......
......@@ -21,7 +21,7 @@
v-if="
projectRole.user &&
currentUser &&
projectRole.user.id === currentUser.id
projectRole.user.userId === currentUser.id
"
class="badge badge-pill badge-primary ml-2"
>
......@@ -62,7 +62,7 @@
v-if="
projectRole.user &&
currentUser &&
projectRole.user.id === currentUser.id
projectRole.user.userId === currentUser.id
"
class="float-right"
variant="primary"
......@@ -127,15 +127,14 @@
<script lang="ts">
import { defineComponent } from "vue";
import type {
ProjectObject,
ProjectRoleObject,
UserObject,
} from "@coscine/api-client/dist/types/Coscine.Api.Project";
// import the store for current module
import useProjectStore from "../../store";
import useUserStore from "@/modules/user/store";
import type {
ProjectDto,
ProjectRoleDto,
UserDto,
} from "@coscine/api-client/dist/types/Coscine.Api/api";
export default defineComponent({
setup() {
......@@ -153,13 +152,13 @@ export default defineComponent({
},
computed: {
currentUser(): UserObject | null {
currentUser(): UserDto | null | undefined {
return this.userStore.user;
},
project(): ProjectObject | null {
project(): ProjectDto | null {
return this.projectStore.currentProject;
},
projectRoles(): ProjectRoleObject[] | null {
projectRoles(): ProjectRoleDto[] | null {
return this.projectStore.currentProjectRolesSorted;
},
isOwner(): boolean | undefined {
......@@ -180,17 +179,15 @@ export default defineComponent({
methods: {
leaveProject() {
this.projectStore.deleteProjectAssociation(this.project);
if (this.project) {
this.projectStore.deleteProjectAssociation(this.project, null);
}
},
},
});
</script>
<style scoped>
/* .svg .user-image {
} */
.user-image {
width: 2rem;
height: 2rem;
......
......@@ -70,8 +70,9 @@
!interactive
"
@click="deleteItem(row.item)"
>{{ removeText }}</b-button
>
{{ removeText }}
</b-button>
</div>
</template>
......@@ -114,13 +115,13 @@
</template>
<script lang="ts">
import type {
ProjectInvitationDto,
ProjectRoleDto,
RoleDto,
} from "@coscine/api-client/dist/types/Coscine.Api";
import { defineComponent, type PropType } from "vue";
import type {
InvitationReturnObject,
ProjectRoleObject,
RoleObject,
} from "@coscine/api-client/dist/types/Coscine.Api.Project";
import { TranslateResult } from "vue-i18n";
export default defineComponent({
......@@ -136,7 +137,7 @@ export default defineComponent({
},
items: {
default: () => [],
type: [Array, null] as PropType<InvitationReturnObject[] | null>,
type: [Array, null] as PropType<ProjectInvitationDto[] | null>,
},
filter: {
default: "",
......@@ -160,7 +161,7 @@ export default defineComponent({
},
ownerRole: {
default: null,
type: Object as PropType<RoleObject | null>,
type: Object as PropType<RoleDto | null>,
},
deleteText: {
default: "Delete",
......@@ -172,7 +173,7 @@ export default defineComponent({
},
roles: {
default: null,
type: [Array, null] as PropType<RoleObject[] | null>,
type: [Array, null] as PropType<RoleDto[] | null>,
},
sortBy: {
default: "user.surname",
......@@ -190,14 +191,14 @@ export default defineComponent({
};
},
methods: {
onFiltered(filteredItems: ProjectRoleObject[]) {
onFiltered(filteredItems: ProjectRoleDto[]) {
this.filteredRows = filteredItems.length;
this.$emit("tableFilteredRows", this.filteredRows);
},
deleteItem(item: ProjectRoleObject) {
deleteItem(item: ProjectRoleDto) {
this.$emit("selectedItem", item);
},
role(item: ProjectRoleObject) {
role(item: ProjectRoleDto) {
this.$emit("setRole", item);
},
checkExpiration(expiration: string) {
......@@ -227,10 +228,10 @@ export default defineComponent({
return this.$t("page.members.pendingStatus");
}
},
revokeInvitation(selectedInvitation: InvitationReturnObject) {
revokeInvitation(selectedInvitation: ProjectInvitationDto) {
this.$emit("revokeInvitation", selectedInvitation);
},
resendInvitation(selectedInvitation: InvitationReturnObject) {
resendInvitation(selectedInvitation: ProjectInvitationDto) {
this.$emit("resendInvitation", selectedInvitation);
},
},
......
......@@ -17,7 +17,7 @@
:filter-by="filterMock"
:selectable="selectableCheck"
label="displayName"
@input="setNewUser"
@input="selectUser"
@search="triggerFetchOptions"
>
<template v-if="searchString === ''" #no-options>
......@@ -75,7 +75,7 @@
:disabled="!isOwner"
text-field="displayName"
value-field="id"
@input="setNewRole"
@input="selectRole"
/>
</b-col>
......@@ -144,27 +144,33 @@ Vue.component("VSelect", vSelect);
import useUserStore from "@/modules/user/store";
import type {
ProjectObject,
ProjectRoleObject,
RoleObject,
} from "@coscine/api-client/dist/types/Coscine.Api.Project";
import type { UserObject } from "@coscine/api-client/dist/types/Coscine.Api.User";
ProjectDto,
ProjectRoleDto,
ProjectRoleUserDto,
PublicUserDto,
RoleDto,
} from "@coscine/api-client/dist/types/Coscine.Api/api";
import { PublicUserDto2ProjectRoleUserDto, userMapper } from "@/mapping/user";
export default defineComponent({
props: {
memberRole: {
default: null,
type: [Object, null, undefined] as PropType<
RoleObject | null | undefined
>,
},
project: {
default: null,
type: [Object, null] as PropType<ProjectObject | null>,
type: [Object, null] as PropType<ProjectDto | null>,
},
roles: {
default: null,
type: [Array, null] as PropType<RoleObject[] | null>,
type: [Array, null] as PropType<RoleDto[] | null>,
},
memberRole: {
default: null,
type: [Object, null, undefined] as PropType<RoleDto | null | undefined>,
},
projectMembers: {
default: undefined,
type: [Array, undefined] as PropType<
(ProjectRoleUserDto | undefined)[] | undefined
>,
},
isOwner: {
default: false,
......@@ -180,20 +186,15 @@ export default defineComponent({
return {
newUserRole: {
projectId: "",
role: {
id: "",
displayName: "",
},
user: {
id: "",
emailAddress: "",
},
} as ProjectRoleObject,
role: { id: "" },
user: {},
} as ProjectRoleDto,
queryTimer: 0,
queriedUsers: [] as UserObject[],
queriedUsers: [] as PublicUserDto[],
searchString: "",
selectableCheck: (option: UserObject) => !option.hasProjectRole,
selectedAddingUser: null as UserObject | null,
selectableCheck: (user: PublicUserDto) =>
!this.projectMembers?.some((pm) => pm?.userId === user.id),
selectedAddingUser: null as PublicUserDto | null,
};
},
computed: {
......@@ -203,8 +204,8 @@ export default defineComponent({
if (
emailRegex.test(this.searchString) ||
(this.selectedAddingUser &&
this.selectedAddingUser.emailAddress &&
emailRegex.test(this.selectedAddingUser.emailAddress))
this.selectedAddingUser.email &&
emailRegex.test(this.selectedAddingUser.email))
) {
return true;
} else {
......@@ -213,13 +214,10 @@ export default defineComponent({
},
emailInvitation(): boolean {
if (
this.newUserRole &&
this.newUserRole.projectId &&
this.newUserRole.role &&
this.newUserRole.role.id &&
this.newUserRole.user &&
!this.newUserRole.user.id &&
this.newUserRole.user.emailAddress
this.newUserRole?.projectId &&
this.newUserRole?.role?.id &&
!this.newUserRole?.user?.userId &&
this.newUserRole?.user?.emailAddress
) {
return true;
}
......@@ -230,7 +228,7 @@ export default defineComponent({
this.newUserRole &&
this.newUserRole.projectId &&
this.newUserRole.user &&
this.newUserRole.user.id &&
this.newUserRole.user.userId &&
this.newUserRole.role &&
this.newUserRole.role.id
) {
......@@ -252,7 +250,7 @@ export default defineComponent({
}
},
methods: {
addUser(projectRole: ProjectRoleObject) {
addUser(projectRole: ProjectRoleDto) {
this.searchString = "";
this.$emit("addUser", projectRole, () => {
this.newUserRole.user = undefined;
......@@ -263,21 +261,22 @@ export default defineComponent({
filterMock(option: unknown, label: string, search: string) {
return search.length > 0;
},
prepareInvitation(projectRole: ProjectRoleObject) {
prepareInvitation(projectRole: ProjectRoleDto) {
this.$emit("prepareInvitation", projectRole);
},
setFilter(filter: string) {
this.$emit("setFilter", filter);
},
setNewUser(value: UserObject) {
this.newUserRole.user = value;
if (this.project) {
this.newUserRole.projectId = this.project.id;
}
selectUser(selectedUser: PublicUserDto | null) {
this.newUserRole.user = userMapper.map(
PublicUserDto2ProjectRoleUserDto,
selectedUser
);
this.newUserRole.projectId = this.project?.id;
},
setNewRole(value: string) {
selectRole(roleId: string) {
this.newUserRole.role = {
id: value,
id: roleId,
};
},
triggerFetchOptions(search: string, loading: (value: boolean) => void) {
......@@ -296,14 +295,13 @@ export default defineComponent({
if (search && this.project && this.project.id) {
loading(true);
this.queriedUsers =
(await this.userStore.getUser(search, this.project.id)) ?? [];
(await this.userStore.searchUsers(search, this.project.id)) ?? [];
loading(false);
if (this.validEmail && this.queriedUsers.length == 0) {
// Add unknown entry as an entry to the list (email address of user to invite)
const obj = {
const obj: PublicUserDto = {
displayName: this.searchString,
emailAddress: this.searchString,
hasProjectRole: false,
email: this.searchString,
};
this.queriedUsers.push(obj);
loading(false);
......
......@@ -75,10 +75,10 @@ import useProjectStore from "../../../store";
import MembersTable from "../MembersTable.vue";
import type {
ProjectObject,
ProjectRoleObject,
RoleObject,
} from "@coscine/api-client/dist/types/Coscine.Api.Project";
ProjectDto,
ProjectRoleDto,
RoleDto,
} from "@coscine/api-client/dist/types/Coscine.Api/api";
export default defineComponent({
components: {
......@@ -91,21 +91,19 @@ export default defineComponent({
},
memberRole: {
default: null,
type: [Object, null, undefined] as PropType<
RoleObject | null | undefined
>,
type: [Object, null, undefined] as PropType<RoleDto | null | undefined>,
},
project: {
default: null,
type: [Object, null] as PropType<ProjectObject | null>,
type: [Object, null] as PropType<ProjectDto | null>,
},
projectRoles: {
default: null,
type: [Array, null] as PropType<ProjectRoleObject[] | null>,
type: [Array, null] as PropType<ProjectRoleDto[] | null>,
},
roles: {
default: null,
type: [Array, null] as PropType<RoleObject[] | null>,
type: [Array, null] as PropType<RoleDto[] | null>,
},
},
setup() {
......@@ -115,13 +113,13 @@ export default defineComponent({
},
data() {
return {
additionalMembers: [] as ProjectRoleObject[],
additionalMembers: [] as ProjectRoleDto[],
isBusy: false,
selectedProject: null as string | null,
};
},
computed: {
additionalProjects(): ProjectObject[] | null {
additionalProjects(): ProjectDto[] | null {
if (this.projects && this.project) {
const currentProject = this.project;
return this.projects.filter(
......@@ -130,7 +128,7 @@ export default defineComponent({
}
return null;
},
projects(): ProjectObject[] | null {
projects(): ProjectDto[] | null {
return this.projectStore.allProjects;
},
},
......@@ -142,7 +140,7 @@ export default defineComponent({
(projectRole) =>
!this.projectRoles?.some(
(currentProjectRole) =>
projectRole.user?.id === currentProjectRole.user?.id
projectRole.user?.userId === currentProjectRole.user?.userId
)
);
this.additionalMembers.forEach((additionalMember) => {
......@@ -166,7 +164,7 @@ export default defineComponent({
this.$bvModal.hide("importUserModal");
this.additionalMembers = [];
},
removeSelectedRow(projectRole: ProjectRoleObject) {
removeSelectedRow(projectRole: ProjectRoleDto) {
const index = this.additionalMembers.indexOf(projectRole);
this.additionalMembers.splice(index, 1);
},
......
......@@ -20,14 +20,14 @@
</template>
<script lang="ts">
import type { ExtendedSendInvitationObject } from "@/modules/project/types";
import type { ExtendedProjectInvitationDto } from "@/modules/project/types";
import { defineComponent, type PropType } from "vue";
export default defineComponent({
props: {
candidateForInvitation: {
required: true,
type: Object as PropType<ExtendedSendInvitationObject>,
type: Object as PropType<ExtendedProjectInvitationDto>,
},
},
});
......
......@@ -14,7 +14,7 @@
<b>{{ candidateForInvitation.email }}</b>
</template>
<template #role>
<b>{{ getRoleNameFromId(candidateForInvitation.role) }}</b>
<b>{{ getRoleNameFromId(candidateForInvitation.roleId) }}</b>
</template>
<template #projectName>
<b>{{ projectName }}</b>
......@@ -62,14 +62,14 @@
<script lang="ts">
import { defineComponent, type PropType } from "vue";
import type { RoleObject } from "@coscine/api-client/dist/types/Coscine.Api.Project";
import type { ExtendedSendInvitationObject } from "@/modules/project/types";
import type { RoleDto } from "@coscine/api-client/dist/types/Coscine.Api/api";
import type { ExtendedProjectInvitationDto } from "@/modules/project/types";
export default defineComponent({
props: {
candidateForInvitation: {
required: true,
type: Object as PropType<ExtendedSendInvitationObject>,
type: Object as PropType<ExtendedProjectInvitationDto>,
},
projectName: {
default: "",
......@@ -77,7 +77,7 @@ export default defineComponent({
},
roles: {
default: null,
type: [Array, null] as PropType<RoleObject[] | null>,
type: [Array, null] as PropType<RoleDto[] | null>,
},
},
methods: {
......@@ -97,8 +97,8 @@ export default defineComponent({
inviteUser() {
const text = this.$t("page.members.invitedUserText", {
email: this.candidateForInvitation.email,
role: this.candidateForInvitation.role
? this.getRoleNameFromId(this.candidateForInvitation.role)
role: this.candidateForInvitation.roleId
? this.getRoleNameFromId(this.candidateForInvitation.roleId)
: "",
projectName: this.projectName,
}).toString();
......@@ -107,6 +107,7 @@ export default defineComponent({
}).toString();
this.$emit(
"storeNewInvitation",
this.candidateForInvitation.projectId,
this.candidateForInvitation,
text,
errorText
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -37,7 +37,7 @@ import { defineComponent } from "vue";
import useProjectStore from "@/modules/project/store";
// import the main store
import useMainStore from "@/store/index";
import type { ProjectObject } from "@coscine/api-client/dist/types/Coscine.Api.Project";
import type { ProjectDto } from "@coscine/api-client/dist/types/Coscine.Api/api";
export default defineComponent({
setup() {
......@@ -48,7 +48,7 @@ export default defineComponent({
},
computed: {
project(): ProjectObject | null {
project(): ProjectDto | null {
return this.projectStore.currentProject;
},
},
......
......@@ -18,7 +18,7 @@ import FilesView from "./FilesView.vue";
import type Vue from "vue";
import { testUserState } from "@/data/mockup/testUser";
import { getTestUserState } from "@/data/mockup/testUser";
import { getTestResourceState } from "@/data/mockup/testResource";
import { testProjectState } from "@/data/mockup/testProject";
import useResourceStore from "../../store";
......@@ -40,7 +40,7 @@ describe("FilesView.vue", () => {
initialState: {
project: testProjectState,
resource: await getTestResourceState(),
user: testUserState,
user: getTestUserState(),
},
});
......@@ -48,7 +48,7 @@ describe("FilesView.vue", () => {
vi.mocked(resourceStore.getMetadata).mockReturnValue(
Promise.resolve(getMetadataResponse)
);
vi.mocked(resourceStore.getClass).mockReturnValue(
vi.mocked(resourceStore.getVocabularyInstances).mockReturnValue(
Promise.resolve({ en: [], de: [] })
);
......