Skip to content
Snippets Groups Projects

Compare revisions

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

Source

Select target project
No results found
Select Git revision
Loading items

Target

Select target project
  • coscine/frontend/libraries/project-creation
1 result
Select Git revision
Loading items
Show changes
Commits on Source (3)
This diff is collapsed.
{
"name": "@coscine/project-creation",
"version": "1.6.1",
"version": "1.7.0",
"main": "./dist/index.js",
"module": "dist/index.esm.js",
"types": "dist/index.d.ts",
......@@ -22,15 +22,15 @@
"dist/*"
],
"dependencies": {
"@coscine/api-connection": "^1.12.0",
"@coscine/app-util": "^1.3.1",
"@types/jquery": "^3.3.34",
"@types/vuelidate": "^0.7.11",
"@coscine/api-connection": "^1.13.0",
"@coscine/app-util": "^1.3.2",
"@types/jquery": "^3.3.35",
"@types/vuelidate": "^0.7.13",
"@voerro/vue-tagsinput": "^2.2.0",
"bootstrap-vue": "^2.9.0",
"jquery": "^3.4.1",
"bootstrap-vue": "^2.12.0",
"jquery": "^3.5.0",
"vue": "^2.6.11",
"vue-i18n": "^8.16.0",
"vue-i18n": "^8.17.3",
"vue-multiselect": "^2.1.6",
"vuejs-datepicker": "^1.6.2",
"vue-loading-overlay": "^3.3.2",
......@@ -41,22 +41,22 @@
"@hutson/semantic-delivery-gitlab": "^9.1.0",
"@semantic-release/commit-analyzer": "^8.0.1",
"@semantic-release/git": "^9.0.0",
"@semantic-release/gitlab": "^6.0.3",
"@semantic-release/gitlab": "^6.0.4",
"@semantic-release/npm": "^7.0.5",
"@semantic-release/release-notes-generator": "^9.0.1",
"@types/chai": "^4.2.11",
"@types/mocha": "^7.0.2",
"@vue/cli-plugin-babel": "^4.2.3",
"@vue/cli-plugin-babel": "^4.3.1",
"@vue/cli-plugin-typescript": "^4.3.1",
"@vue/cli-plugin-unit-mocha": "^4.2.3",
"@vue/cli-service": "^4.2.3",
"@vue/test-utils": "1.0.0-beta.32",
"bili": "^4.8.1",
"@vue/cli-plugin-unit-mocha": "^4.3.1",
"@vue/cli-service": "^4.3.1",
"@vue/test-utils": "1.0.0-beta.33",
"bili": "^4.9.1",
"chai": "^4.2.0",
"rollup": "^2.3.0",
"rollup": "^2.7.2",
"rollup-plugin-typescript2": "^0.27.0",
"rollup-plugin-vue": "^5.1.6",
"semantic-release": "^17.0.4",
"semantic-release": "^17.0.7",
"typescript": "^3.8.3",
"vue-template-compiler": "^2.6.11"
},
......
......@@ -103,7 +103,8 @@
:hide-selected="true"
:label="disciplineLabel"
:track-by="disciplineLabel"
:placeholder="$t('projectDiscipline')">
:placeholder="$t('projectDiscipline')"
>
<template slot="singleLabel" slot-scope="props" v-bind:disabled="!(this.isOwner || isNewProject)">
{{ props.option[disciplineLabel] }}
</template>
......@@ -112,16 +113,17 @@
</template>
</multiselect>
</b-form-group>
<b-form-group class="mandatory" label-for="Institute" label-cols-sm="3" label-align-sm="right" :label="$t('projectInstituteLabel')">
<multiselect id="Institute"
v-model="form.Institute"
<b-form-group class="mandatory" label-for="Organization" label-cols-sm="3" label-align-sm="right" :label="$t('projectOrganizationLabel')">
<multiselect id="Organization"
v-model="form.Organization"
v-bind:disabled="!(this.isOwner || isNewProject)"
:options="institutes"
:options="organizations"
:multiple="true"
:hide-selected="true"
label="displayName"
track-by="displayName"
:placeholder="$t('projectInstitute')">
track-by="url"
:placeholder="$t('projectOrganization')"
>
<template slot="singleLabel" slot-scope="props" v-bind:disabled="!(this.isOwner || isNewProject)">
{{ props.option.displayName }}
</template>
......@@ -136,9 +138,11 @@
v-bind:disabled="!(this.isOwner || isNewProject)"
:options="keywordoptions"
:placeholder="$t('projectKeywords')"
:multiple="true" :taggable="true"
:multiple="true"
:taggable="true"
:tag-placeholder="$t('tagPlaceholder')"
@tag="addTag">
@tag="addTag"
>
</multiselect>
</b-form-group>
<b-form-group class="mandatory" label-for="Visibility" label-cols-sm="3" label-align-sm="right" :label="$t('projectVisibilityLabel')" v-bind:disabled="!(this.isOwner || isNewProject)">
......@@ -235,7 +239,7 @@ import { de, en } from 'vuejs-datepicker/dist/locale';
import { validationMixin } from 'vuelidate';
import { required, minLength, maxLength } from 'vuelidate/lib/validators';
import tag_inputs_helper from './utils/tag_inputs_helper';
import { ProjectApi, ProjectRoleApi, DisciplineApi, InstituteApi, VisibilityApi, redirectToProject, ActivatedFeaturesApi } from '@coscine/api-connection';
import { ProjectApi, ProjectRoleApi, DisciplineApi, OrganizationApi, VisibilityApi, redirectToProject, ActivatedFeaturesApi } from '@coscine/api-connection';
import { GuidUtil } from '@coscine/app-util';
import locales from './locale/locales';
......@@ -302,7 +306,7 @@ export default Vue.extend({
Discipline: {
required,
},
Institute: {
Organization: {
required,
},
Keywords: {
......@@ -347,7 +351,7 @@ export default Vue.extend({
StartDate: new Date(),
EndDate: new Date(),
Discipline: [] as object[],
Institute: [] as object[],
Organization: [] as Organization[],
Keywords: [] as object[],
Visibility: {},
GrantId: '',
......@@ -361,14 +365,14 @@ export default Vue.extend({
StartDate: new Date(),
EndDate: new Date(),
Discipline: [] as object[],
Institute: [] as object[],
Organization: [] as Organization[],
Keywords: [] as object[],
Visibility: {},
GrantId: '',
ParentId: String,
},
disciplines: [] as object[],
institutes: [] as object[],
organizations: [] as Organization[],
visibilities: [] as object[],
keywordoptions: [] as object[],
disabledEndDates: {to: new Date(1000, 1, 1) },
......@@ -400,9 +404,9 @@ export default Vue.extend({
this.$v.form!.Discipline!.$touch()
}
},
'form.Institute': function(newVal, oldVal) {
'form.Organization': function(newVal, oldVal) {
if(oldVal.length > 0) {
this.$v.form!.Institute!.$touch()
this.$v.form!.Organization!.$touch()
}
},
'form.Keywords': function(newVal, oldVal) {
......@@ -515,7 +519,7 @@ export default Vue.extend({
this.startDateSelected(new Date(this.form.StartDate));
this.form.EndDate = new Date(data.endDate);
this.form.Discipline = data.disciplines;
this.form.Institute = data.institutes;
this.form.Organization = data.organizations;
const keywords = data.keywords ? data.keywords.split(';') : [];
this.form.Keywords = keywords;
this.form.Visibility = data.visibility;
......@@ -533,9 +537,9 @@ export default Vue.extend({
for (let keyword in from.Keywords) {
to.Keywords.push(from.Keywords[keyword]);
}
to.Institute = [] as object[];
for (let institute in from.Institute) {
to.Institute.push(from.Institute[institute]);
to.Organization = [] as Organization[];
for (let organization in from.Organization) {
to.Organization.push(from.Organization[organization]);
}
to.Discipline = [] as object[];
for (let discipline in from.Discipline) {
......@@ -545,8 +549,20 @@ export default Vue.extend({
to.GrantId = from.GrantId;
to.ParentId = from.ParentId;
},
checkSelectedOrganisationLabels() {
if (this.organizations.length > 0) {
for (let organization in this.form.Organization) {
var orgEntry = this.form.Organization[organization] as Organization;
if (orgEntry.url === orgEntry.displayName) {
let realOrgEntry = this.organizations.find(
(entry: Organization) => entry.url === orgEntry.url) as Organization;
orgEntry.displayName = realOrgEntry.displayName;
}
}
}
},
},
created() {
async created() {
i18n.locale = this.$props.languageLocale;
if (this.$props.languageLocale === 'en') {
this.disciplineLabel = 'displayNameEn';
......@@ -578,7 +594,8 @@ export default Vue.extend({
ProjectApi.getProjectInformation(this.projectId,
(response: any) => { this.fillForm(response.data);
this.tranferFormValues(this.form, this.initialState); });
this.tranferFormValues(this.form, this.initialState);
this.checkSelectedOrganisationLabels(); });
ProjectRoleApi.getUserRoles(this.projectId,
(response: any) => { this.checkOwnership(response.data); });
} else {
......@@ -593,10 +610,22 @@ export default Vue.extend({
this.tranferFormValues(this.form, this.initialState);
}
DisciplineApi.getDisciplines(
(response: any) => { for (const datum of response.data) { this.disciplines.push(datum); } });
InstituteApi.getInstitutes(
(response: any) => { for (const datum of response.data) { this.institutes.push(datum); } });
let disciplines = await DisciplineApi.getDisciplines((response: any) => { return response.data } );
for (let discipline of disciplines) {
this.disciplines.push(discipline);
}
let organizationUris = await OrganizationApi.getOrganizations((response: any) => { return response.data; } );
for (let organizationUri in organizationUris) {
for (let subOrg in organizationUris[organizationUri]) {
let org = organizationUris[organizationUri][subOrg];
let displayName = org["http://www.w3.org/1999/02/22-rdf-syntax-ns#label"][0]["value"];
let pushedOrg = { displayName, url: subOrg };
this.organizations.push(pushedOrg);
}
}
this.checkSelectedOrganisationLabels();
},
});
</script>
......
......@@ -5,3 +5,8 @@ declare var coscine: {
};
declare var _spPageContextInfo: any;
declare class Organization {
url: string;
displayName: string;
};
\ No newline at end of file
......@@ -29,8 +29,8 @@ export default {
projectPrincipleInvestigatorsHelp: 'Dieses Feld ist erforderlich und besitzt eine Maximallänge von 500 Zeichen.',
projectDisciplineLabel: 'Disziplin:',
projectDiscipline: 'Disziplin',
projectInstituteLabel: 'Teilnehmende Institute:',
projectInstitute: 'Teilnehmende Institute',
projectOrganizationLabel: 'Teilnehmende Organization:',
projectOrganization: 'Teilnehmende Organization',
projectVisibilityLabel: 'Sichtbarkeit:',
projectVisibility: 'Sichtbarkeit',
projectGrantIdLabel: 'Grant ID:',
......
......@@ -29,8 +29,8 @@ export default {
projectPrincipleInvestigatorsHelp: 'This is a required field and can only be up to 500 characters long.',
projectDisciplineLabel: 'Discipline:',
projectDiscipline: 'Discipline',
projectInstituteLabel: 'Participating Institutes:',
projectInstitute: 'Participating Institutes',
projectOrganizationLabel: 'Participating Organizations:',
projectOrganization: 'Participating Organizations',
projectVisibilityLabel: 'Visibility:',
projectVisibility: 'Visibility',
projectGrantIdLabel: 'Grant ID:',
......