@coscine/project-creation
Advanced tools
Comparing version 1.6.1 to 1.7.0
/*! | ||
* @coscine/project-creation v1.6.0 | ||
* @coscine/project-creation v1.6.1 | ||
* (c) | ||
@@ -11,3 +11,3 @@ * Released under the MIT License. | ||
import { required, maxLength } from 'vuelidate/lib/validators'; | ||
import { SubProjectApi, ProjectApi, redirectToProject, ActivatedFeaturesApi, VisibilityApi, ProjectRoleApi, DisciplineApi, InstituteApi } from '@coscine/api-connection'; | ||
import { SubProjectApi, ProjectApi, redirectToProject, ActivatedFeaturesApi, VisibilityApi, ProjectRoleApi, DisciplineApi, OrganizationApi } from '@coscine/api-connection'; | ||
import { GuidUtil } from '@coscine/app-util'; | ||
@@ -24,2 +24,74 @@ import VueI18n from 'vue-i18n'; | ||
function _unsupportedIterableToArray(o, minLen) { | ||
if (!o) return; | ||
if (typeof o === "string") return _arrayLikeToArray(o, minLen); | ||
var n = Object.prototype.toString.call(o).slice(8, -1); | ||
if (n === "Object" && o.constructor) n = o.constructor.name; | ||
if (n === "Map" || n === "Set") return Array.from(n); | ||
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); | ||
} | ||
function _arrayLikeToArray(arr, len) { | ||
if (len == null || len > arr.length) len = arr.length; | ||
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; | ||
return arr2; | ||
} | ||
function _createForOfIteratorHelper(o) { | ||
if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { | ||
if (Array.isArray(o) || (o = _unsupportedIterableToArray(o))) { | ||
var i = 0; | ||
var F = function () {}; | ||
return { | ||
s: F, | ||
n: function () { | ||
if (i >= o.length) return { | ||
done: true | ||
}; | ||
return { | ||
done: false, | ||
value: o[i++] | ||
}; | ||
}, | ||
e: function (e) { | ||
throw e; | ||
}, | ||
f: F | ||
}; | ||
} | ||
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | ||
} | ||
var it, | ||
normalCompletion = true, | ||
didErr = false, | ||
err; | ||
return { | ||
s: function () { | ||
it = o[Symbol.iterator](); | ||
}, | ||
n: function () { | ||
var step = it.next(); | ||
normalCompletion = step.done; | ||
return step; | ||
}, | ||
e: function (e) { | ||
didErr = true; | ||
err = e; | ||
}, | ||
f: function () { | ||
try { | ||
if (!normalCompletion && it.return != null) it.return(); | ||
} finally { | ||
if (didErr) throw err; | ||
} | ||
} | ||
}; | ||
} | ||
var tag_inputs_helper = { | ||
@@ -33,8 +105,7 @@ checkKeywords: function checkKeywords(value, maxCount) { | ||
} else if (value !== undefined) { | ||
var _iteratorNormalCompletion = true; | ||
var _didIteratorError = false; | ||
var _iteratorError = undefined; | ||
var _iterator = _createForOfIteratorHelper(value), | ||
_step; | ||
try { | ||
for (var _iterator = value[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { | ||
for (_iterator.s(); !(_step = _iterator.n()).done;) { | ||
var keyword = _step.value; | ||
@@ -44,14 +115,5 @@ count += keyword.length; | ||
} catch (err) { | ||
_didIteratorError = true; | ||
_iteratorError = err; | ||
_iterator.e(err); | ||
} finally { | ||
try { | ||
if (!_iteratorNormalCompletion && _iterator.return != null) { | ||
_iterator.return(); | ||
} | ||
} finally { | ||
if (_didIteratorError) { | ||
throw _iteratorError; | ||
} | ||
} | ||
_iterator.f(); | ||
} | ||
@@ -68,8 +130,8 @@ } | ||
var keywordString = ''; | ||
var _iteratorNormalCompletion2 = true; | ||
var _didIteratorError2 = false; | ||
var _iteratorError2 = undefined; | ||
var _iterator2 = _createForOfIteratorHelper(form.Keywords), | ||
_step2; | ||
try { | ||
for (var _iterator2 = form.Keywords[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { | ||
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { | ||
var keyword = _step2.value; | ||
@@ -79,14 +141,5 @@ keywordString += keyword + delimiter; | ||
} catch (err) { | ||
_didIteratorError2 = true; | ||
_iteratorError2 = err; | ||
_iterator2.e(err); | ||
} finally { | ||
try { | ||
if (!_iteratorNormalCompletion2 && _iterator2.return != null) { | ||
_iterator2.return(); | ||
} | ||
} finally { | ||
if (_didIteratorError2) { | ||
throw _iteratorError2; | ||
} | ||
} | ||
_iterator2.f(); | ||
} | ||
@@ -133,4 +186,4 @@ | ||
projectDiscipline: 'Disziplin', | ||
projectInstituteLabel: 'Teilnehmende Institute:', | ||
projectInstitute: 'Teilnehmende Institute', | ||
projectOrganizationLabel: 'Teilnehmende Organization:', | ||
projectOrganization: 'Teilnehmende Organization', | ||
projectVisibilityLabel: 'Sichtbarkeit:', | ||
@@ -178,4 +231,4 @@ projectVisibility: 'Sichtbarkeit', | ||
projectDiscipline: 'Discipline', | ||
projectInstituteLabel: 'Participating Institutes:', | ||
projectInstitute: 'Participating Institutes', | ||
projectOrganizationLabel: 'Participating Organizations:', | ||
projectOrganization: 'Participating Organizations', | ||
projectVisibilityLabel: 'Visibility:', | ||
@@ -438,2 +491,14 @@ projectVisibility: 'Visibility', | ||
function _await(value, then, direct) { | ||
if (direct) { | ||
return then ? then(value) : value; | ||
} | ||
if (!value || !value.then) { | ||
value = Promise.resolve(value); | ||
} | ||
return then ? value.then(then) : value; | ||
} | ||
Vue.use(BootstrapVue); | ||
@@ -488,3 +553,3 @@ Vue.use(VueI18n); | ||
}, | ||
Institute: { | ||
Organization: { | ||
required: required | ||
@@ -534,3 +599,3 @@ }, | ||
Discipline: [], | ||
Institute: [], | ||
Organization: [], | ||
Keywords: [], | ||
@@ -549,3 +614,3 @@ Visibility: {}, | ||
Discipline: [], | ||
Institute: [], | ||
Organization: [], | ||
Keywords: [], | ||
@@ -557,3 +622,3 @@ Visibility: {}, | ||
disciplines: [], | ||
institutes: [], | ||
organizations: [], | ||
visibilities: [], | ||
@@ -592,5 +657,5 @@ keywordoptions: [], | ||
}, | ||
'form.Institute': function formInstitute(newVal, oldVal) { | ||
'form.Organization': function formOrganization(newVal, oldVal) { | ||
if (oldVal.length > 0) { | ||
this.$v.form.Institute.$touch(); | ||
this.$v.form.Organization.$touch(); | ||
} | ||
@@ -646,8 +711,7 @@ }, | ||
// activate initial features | ||
var _iteratorNormalCompletion = true; | ||
var _didIteratorError = false; | ||
var _iteratorError = undefined; | ||
var _iterator = _createForOfIteratorHelper(_this.features), | ||
_step; | ||
try { | ||
for (var _iterator = _this.features[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { | ||
for (_iterator.s(); !(_step = _iterator.n()).done;) { | ||
var feature = _step.value; | ||
@@ -660,14 +724,5 @@ | ||
} catch (err) { | ||
_didIteratorError = true; | ||
_iteratorError = err; | ||
_iterator.e(err); | ||
} finally { | ||
try { | ||
if (!_iteratorNormalCompletion && _iterator.return != null) { | ||
_iterator.return(); | ||
} | ||
} finally { | ||
if (_didIteratorError) { | ||
throw _iteratorError; | ||
} | ||
} | ||
_iterator.f(); | ||
} | ||
@@ -682,8 +737,7 @@ | ||
// update features | ||
var _iteratorNormalCompletion2 = true; | ||
var _didIteratorError2 = false; | ||
var _iteratorError2 = undefined; | ||
var _iterator2 = _createForOfIteratorHelper(_this.features), | ||
_step2; | ||
try { | ||
for (var _iterator2 = _this.features[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { | ||
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { | ||
var feature = _step2.value; | ||
@@ -698,14 +752,5 @@ | ||
} catch (err) { | ||
_didIteratorError2 = true; | ||
_iteratorError2 = err; | ||
_iterator2.e(err); | ||
} finally { | ||
try { | ||
if (!_iteratorNormalCompletion2 && _iterator2.return != null) { | ||
_iterator2.return(); | ||
} | ||
} finally { | ||
if (_didIteratorError2) { | ||
throw _iteratorError2; | ||
} | ||
} | ||
_iterator2.f(); | ||
} | ||
@@ -764,3 +809,3 @@ | ||
this.form.Discipline = data.disciplines; | ||
this.form.Institute = data.institutes; | ||
this.form.Organization = data.organizations; | ||
var keywords = data.keywords ? data.keywords.split(';') : []; | ||
@@ -785,6 +830,6 @@ this.form.Keywords = keywords; | ||
to.Institute = []; | ||
to.Organization = []; | ||
for (var institute in from.Institute) { | ||
to.Institute.push(from.Institute[institute]); | ||
for (var organization in from.Organization) { | ||
to.Organization.push(from.Organization[organization]); | ||
} | ||
@@ -801,130 +846,127 @@ | ||
to.ParentId = from.ParentId; | ||
}, | ||
checkSelectedOrganisationLabels: function checkSelectedOrganisationLabels() { | ||
if (this.organizations.length > 0) { | ||
for (var organization in this.form.Organization) { | ||
var orgEntry = this.form.Organization[organization]; | ||
if (orgEntry.url === orgEntry.displayName) { | ||
var realOrgEntry = this.organizations.find(function (entry) { | ||
return entry.url === orgEntry.url; | ||
}); | ||
orgEntry.displayName = realOrgEntry.displayName; | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
created: function created() { | ||
var _this2 = this; | ||
try { | ||
var _this3 = this; | ||
i18n$1.locale = this.$props.languageLocale; | ||
i18n$1.locale = _this3.$props.languageLocale; | ||
if (this.$props.languageLocale === 'en') { | ||
this.disciplineLabel = 'displayNameEn'; | ||
} else { | ||
this.disciplineLabel = 'displayNameDe'; | ||
} | ||
if (_this3.$props.languageLocale === 'en') { | ||
_this3.disciplineLabel = 'displayNameEn'; | ||
} else { | ||
_this3.disciplineLabel = 'displayNameDe'; | ||
} | ||
this.startDateSelected(new Date()); | ||
VisibilityApi.getVisibilities(function (response) { | ||
var _iteratorNormalCompletion3 = true; | ||
var _didIteratorError3 = false; | ||
var _iteratorError3 = undefined; | ||
_this3.startDateSelected(new Date()); | ||
try { | ||
for (var _iterator3 = response.data[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { | ||
var visibility = _step3.value; | ||
VisibilityApi.getVisibilities(function (response) { | ||
var _iterator3 = _createForOfIteratorHelper(response.data), | ||
_step3; | ||
if (visibility.displayName === 'Project Members') { | ||
_this2.initialState.Visibility = visibility; | ||
_this2.form.Visibility = visibility; | ||
} | ||
try { | ||
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) { | ||
var visibility = _step3.value; | ||
_this2.visibilities.push({ | ||
text: visibility.displayName, | ||
value: visibility.id | ||
}); | ||
} | ||
} catch (err) { | ||
_didIteratorError3 = true; | ||
_iteratorError3 = err; | ||
} finally { | ||
try { | ||
if (!_iteratorNormalCompletion3 && _iterator3.return != null) { | ||
_iterator3.return(); | ||
if (visibility.displayName === 'Project Members') { | ||
_this3.initialState.Visibility = visibility; | ||
_this3.form.Visibility = visibility; | ||
} | ||
_this3.visibilities.push({ | ||
text: visibility.displayName, | ||
value: visibility.id | ||
}); | ||
} | ||
} catch (err) { | ||
_iterator3.e(err); | ||
} finally { | ||
if (_didIteratorError3) { | ||
throw _iteratorError3; | ||
} | ||
_iterator3.f(); | ||
} | ||
} | ||
}); | ||
}); | ||
if (GuidUtil.isValidGuid(this.projectId)) { | ||
this.displayNameIsLocked = true; | ||
this.isNewProject = false; // Load features | ||
if (GuidUtil.isValidGuid(_this3.projectId)) { | ||
_this3.displayNameIsLocked = true; | ||
_this3.isNewProject = false; // Load features | ||
ActivatedFeaturesApi.listAllFeaturesOfProject(this.projectId, function (response) { | ||
response.data.forEach(function (feature) { | ||
_this2.features.push(feature); | ||
ActivatedFeaturesApi.listAllFeaturesOfProject(_this3.projectId, function (response) { | ||
response.data.forEach(function (feature) { | ||
_this3.features.push(feature); | ||
}); | ||
}); | ||
}); | ||
ProjectApi.getProjectInformation(this.projectId, function (response) { | ||
_this2.fillForm(response.data); | ||
ProjectApi.getProjectInformation(_this3.projectId, function (response) { | ||
_this3.fillForm(response.data); | ||
_this2.tranferFormValues(_this2.form, _this2.initialState); | ||
}); | ||
ProjectRoleApi.getUserRoles(this.projectId, function (response) { | ||
_this2.checkOwnership(response.data); | ||
}); | ||
} else { | ||
ActivatedFeaturesApi.listAllFeatures(function (response) { | ||
response.data.forEach(function (feature) { | ||
_this2.features.push(feature); | ||
_this3.tranferFormValues(_this3.form, _this3.initialState); | ||
_this3.checkSelectedOrganisationLabels(); | ||
}); | ||
}); | ||
this.isNewProject = true; | ||
this.tranferFormValues(this.form, this.initialState); | ||
} | ||
ProjectRoleApi.getUserRoles(_this3.projectId, function (response) { | ||
_this3.checkOwnership(response.data); | ||
}); | ||
} else { | ||
ActivatedFeaturesApi.listAllFeatures(function (response) { | ||
response.data.forEach(function (feature) { | ||
_this3.features.push(feature); | ||
}); | ||
}); | ||
_this3.isNewProject = true; | ||
DisciplineApi.getDisciplines(function (response) { | ||
var _iteratorNormalCompletion4 = true; | ||
var _didIteratorError4 = false; | ||
var _iteratorError4 = undefined; | ||
_this3.tranferFormValues(_this3.form, _this3.initialState); | ||
} | ||
try { | ||
for (var _iterator4 = response.data[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { | ||
var datum = _step4.value; | ||
return _await(DisciplineApi.getDisciplines(function (response) { | ||
return response.data; | ||
}), function (disciplines) { | ||
var _iterator4 = _createForOfIteratorHelper(disciplines), | ||
_step4; | ||
_this2.disciplines.push(datum); | ||
} | ||
} catch (err) { | ||
_didIteratorError4 = true; | ||
_iteratorError4 = err; | ||
} finally { | ||
try { | ||
if (!_iteratorNormalCompletion4 && _iterator4.return != null) { | ||
_iterator4.return(); | ||
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) { | ||
var discipline = _step4.value; | ||
_this3.disciplines.push(discipline); | ||
} | ||
} catch (err) { | ||
_iterator4.e(err); | ||
} finally { | ||
if (_didIteratorError4) { | ||
throw _iteratorError4; | ||
} | ||
_iterator4.f(); | ||
} | ||
} | ||
}); | ||
InstituteApi.getInstitutes(function (response) { | ||
var _iteratorNormalCompletion5 = true; | ||
var _didIteratorError5 = false; | ||
var _iteratorError5 = undefined; | ||
try { | ||
for (var _iterator5 = response.data[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) { | ||
var datum = _step5.value; | ||
return _await(OrganizationApi.getOrganizations(function (response) { | ||
return response.data; | ||
}), function (organizationUris) { | ||
for (var organizationUri in organizationUris) { | ||
for (var subOrg in organizationUris[organizationUri]) { | ||
var org = organizationUris[organizationUri][subOrg]; | ||
var displayName = org["http://www.w3.org/1999/02/22-rdf-syntax-ns#label"][0]["value"]; | ||
var pushedOrg = { | ||
displayName: displayName, | ||
url: subOrg | ||
}; | ||
_this2.institutes.push(datum); | ||
} | ||
} catch (err) { | ||
_didIteratorError5 = true; | ||
_iteratorError5 = err; | ||
} finally { | ||
try { | ||
if (!_iteratorNormalCompletion5 && _iterator5.return != null) { | ||
_iterator5.return(); | ||
_this3.organizations.push(pushedOrg); | ||
} | ||
} | ||
} finally { | ||
if (_didIteratorError5) { | ||
throw _iteratorError5; | ||
} | ||
} | ||
} | ||
}); | ||
_this3.checkSelectedOrganisationLabels(); | ||
}); | ||
}); | ||
} catch (e) { | ||
return Promise.reject(e); | ||
} | ||
} | ||
@@ -1185,17 +1227,17 @@ }); | ||
attrs: { | ||
"label-for": "Institute", | ||
"label-for": "Organization", | ||
"label-cols-sm": "3", | ||
"label-align-sm": "right", | ||
"label": _vm.$t('projectInstituteLabel') | ||
"label": _vm.$t('projectOrganizationLabel') | ||
} | ||
}, [_c('multiselect', { | ||
attrs: { | ||
"id": "Institute", | ||
"id": "Organization", | ||
"disabled": !(this.isOwner || _vm.isNewProject), | ||
"options": _vm.institutes, | ||
"options": _vm.organizations, | ||
"multiple": true, | ||
"hide-selected": true, | ||
"label": "displayName", | ||
"track-by": "displayName", | ||
"placeholder": _vm.$t('projectInstitute') | ||
"track-by": "url", | ||
"placeholder": _vm.$t('projectOrganization') | ||
}, | ||
@@ -1214,7 +1256,7 @@ scopedSlots: _vm._u([{ | ||
model: { | ||
value: _vm.form.Institute, | ||
value: _vm.form.Organization, | ||
callback: function callback($$v) { | ||
_vm.$set(_vm.form, "Institute", $$v); | ||
_vm.$set(_vm.form, "Organization", $$v); | ||
}, | ||
expression: "form.Institute" | ||
expression: "form.Organization" | ||
} | ||
@@ -1424,3 +1466,3 @@ })], 1), _vm._v(" "), _c('b-form-group', { | ||
if (!inject) return; | ||
inject("data-v-7a621066_0", { | ||
inject("data-v-20331d88_0", { | ||
source: "#CreateProject .vdp-datepicker .form-control{background-color:#fff}#CreateProject .multiselect{min-height:calc(1.4em + .75rem + 2px)}#CreateProject .multiselect__input{border:0;min-height:calc(1.4em + .75rem + 2px)}#CreateProject .multiselect__tags{border-radius:0}#CreateProject .btn-float-right{float:right}#CreateProject .vdp-datepicker__calendar-button{height:calc(1.4em + .75rem + 2px)}#CreateProject .form-group.mandatory .col-form-label:after{content:\" *\";color:#a70619}#CreateProject .col-form-label{font-weight:700}.multiselect__tag{background-color:#00549f!important}.multiselect__option--highlight{background-color:#00549f!important;background:#00549f!important}.multiselect__option--selected.multiselect__option--highlight{background-color:#a70619!important}.multiselect__tag-icon:focus,.multiselect__tag-icon:hover{background-color:#a70619!important}.invalid-tooltip{position:absolute;top:100%;z-index:5;display:none;max-width:100%;padding:.25rem .5rem;margin-top:.1rem;font-size:.76563rem;line-height:1.4;color:#fff;background-color:rgba(204,7,30,.9);border-radius:0}#project_archive_button,#project_clear_button{display:none}.h-divider{margin-top:5px;margin-bottom:10px;height:1px;width:100%;border-top:1px solid #bebbbb}.form-group .custom-control-label{vertical-align:super}", | ||
@@ -1427,0 +1469,0 @@ map: undefined, |
/*! | ||
* @coscine/project-creation v1.6.0 | ||
* @coscine/project-creation v1.6.1 | ||
* (c) | ||
@@ -27,2 +27,74 @@ * Released under the MIT License. | ||
function _unsupportedIterableToArray(o, minLen) { | ||
if (!o) return; | ||
if (typeof o === "string") return _arrayLikeToArray(o, minLen); | ||
var n = Object.prototype.toString.call(o).slice(8, -1); | ||
if (n === "Object" && o.constructor) n = o.constructor.name; | ||
if (n === "Map" || n === "Set") return Array.from(n); | ||
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); | ||
} | ||
function _arrayLikeToArray(arr, len) { | ||
if (len == null || len > arr.length) len = arr.length; | ||
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; | ||
return arr2; | ||
} | ||
function _createForOfIteratorHelper(o) { | ||
if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { | ||
if (Array.isArray(o) || (o = _unsupportedIterableToArray(o))) { | ||
var i = 0; | ||
var F = function () {}; | ||
return { | ||
s: F, | ||
n: function () { | ||
if (i >= o.length) return { | ||
done: true | ||
}; | ||
return { | ||
done: false, | ||
value: o[i++] | ||
}; | ||
}, | ||
e: function (e) { | ||
throw e; | ||
}, | ||
f: F | ||
}; | ||
} | ||
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | ||
} | ||
var it, | ||
normalCompletion = true, | ||
didErr = false, | ||
err; | ||
return { | ||
s: function () { | ||
it = o[Symbol.iterator](); | ||
}, | ||
n: function () { | ||
var step = it.next(); | ||
normalCompletion = step.done; | ||
return step; | ||
}, | ||
e: function (e) { | ||
didErr = true; | ||
err = e; | ||
}, | ||
f: function () { | ||
try { | ||
if (!normalCompletion && it.return != null) it.return(); | ||
} finally { | ||
if (didErr) throw err; | ||
} | ||
} | ||
}; | ||
} | ||
var tag_inputs_helper = { | ||
@@ -36,8 +108,7 @@ checkKeywords: function checkKeywords(value, maxCount) { | ||
} else if (value !== undefined) { | ||
var _iteratorNormalCompletion = true; | ||
var _didIteratorError = false; | ||
var _iteratorError = undefined; | ||
var _iterator = _createForOfIteratorHelper(value), | ||
_step; | ||
try { | ||
for (var _iterator = value[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { | ||
for (_iterator.s(); !(_step = _iterator.n()).done;) { | ||
var keyword = _step.value; | ||
@@ -47,14 +118,5 @@ count += keyword.length; | ||
} catch (err) { | ||
_didIteratorError = true; | ||
_iteratorError = err; | ||
_iterator.e(err); | ||
} finally { | ||
try { | ||
if (!_iteratorNormalCompletion && _iterator.return != null) { | ||
_iterator.return(); | ||
} | ||
} finally { | ||
if (_didIteratorError) { | ||
throw _iteratorError; | ||
} | ||
} | ||
_iterator.f(); | ||
} | ||
@@ -71,8 +133,8 @@ } | ||
var keywordString = ''; | ||
var _iteratorNormalCompletion2 = true; | ||
var _didIteratorError2 = false; | ||
var _iteratorError2 = undefined; | ||
var _iterator2 = _createForOfIteratorHelper(form.Keywords), | ||
_step2; | ||
try { | ||
for (var _iterator2 = form.Keywords[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { | ||
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { | ||
var keyword = _step2.value; | ||
@@ -82,14 +144,5 @@ keywordString += keyword + delimiter; | ||
} catch (err) { | ||
_didIteratorError2 = true; | ||
_iteratorError2 = err; | ||
_iterator2.e(err); | ||
} finally { | ||
try { | ||
if (!_iteratorNormalCompletion2 && _iterator2.return != null) { | ||
_iterator2.return(); | ||
} | ||
} finally { | ||
if (_didIteratorError2) { | ||
throw _iteratorError2; | ||
} | ||
} | ||
_iterator2.f(); | ||
} | ||
@@ -136,4 +189,4 @@ | ||
projectDiscipline: 'Disziplin', | ||
projectInstituteLabel: 'Teilnehmende Institute:', | ||
projectInstitute: 'Teilnehmende Institute', | ||
projectOrganizationLabel: 'Teilnehmende Organization:', | ||
projectOrganization: 'Teilnehmende Organization', | ||
projectVisibilityLabel: 'Sichtbarkeit:', | ||
@@ -181,4 +234,4 @@ projectVisibility: 'Sichtbarkeit', | ||
projectDiscipline: 'Discipline', | ||
projectInstituteLabel: 'Participating Institutes:', | ||
projectInstitute: 'Participating Institutes', | ||
projectOrganizationLabel: 'Participating Organizations:', | ||
projectOrganization: 'Participating Organizations', | ||
projectVisibilityLabel: 'Visibility:', | ||
@@ -441,2 +494,14 @@ projectVisibility: 'Visibility', | ||
function _await(value, then, direct) { | ||
if (direct) { | ||
return then ? then(value) : value; | ||
} | ||
if (!value || !value.then) { | ||
value = Promise.resolve(value); | ||
} | ||
return then ? value.then(then) : value; | ||
} | ||
Vue.use(BootstrapVue); | ||
@@ -491,3 +556,3 @@ Vue.use(VueI18n); | ||
}, | ||
Institute: { | ||
Organization: { | ||
required: validators.required | ||
@@ -537,3 +602,3 @@ }, | ||
Discipline: [], | ||
Institute: [], | ||
Organization: [], | ||
Keywords: [], | ||
@@ -552,3 +617,3 @@ Visibility: {}, | ||
Discipline: [], | ||
Institute: [], | ||
Organization: [], | ||
Keywords: [], | ||
@@ -560,3 +625,3 @@ Visibility: {}, | ||
disciplines: [], | ||
institutes: [], | ||
organizations: [], | ||
visibilities: [], | ||
@@ -595,5 +660,5 @@ keywordoptions: [], | ||
}, | ||
'form.Institute': function formInstitute(newVal, oldVal) { | ||
'form.Organization': function formOrganization(newVal, oldVal) { | ||
if (oldVal.length > 0) { | ||
this.$v.form.Institute.$touch(); | ||
this.$v.form.Organization.$touch(); | ||
} | ||
@@ -649,8 +714,7 @@ }, | ||
// activate initial features | ||
var _iteratorNormalCompletion = true; | ||
var _didIteratorError = false; | ||
var _iteratorError = undefined; | ||
var _iterator = _createForOfIteratorHelper(_this.features), | ||
_step; | ||
try { | ||
for (var _iterator = _this.features[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { | ||
for (_iterator.s(); !(_step = _iterator.n()).done;) { | ||
var feature = _step.value; | ||
@@ -663,14 +727,5 @@ | ||
} catch (err) { | ||
_didIteratorError = true; | ||
_iteratorError = err; | ||
_iterator.e(err); | ||
} finally { | ||
try { | ||
if (!_iteratorNormalCompletion && _iterator.return != null) { | ||
_iterator.return(); | ||
} | ||
} finally { | ||
if (_didIteratorError) { | ||
throw _iteratorError; | ||
} | ||
} | ||
_iterator.f(); | ||
} | ||
@@ -685,8 +740,7 @@ | ||
// update features | ||
var _iteratorNormalCompletion2 = true; | ||
var _didIteratorError2 = false; | ||
var _iteratorError2 = undefined; | ||
var _iterator2 = _createForOfIteratorHelper(_this.features), | ||
_step2; | ||
try { | ||
for (var _iterator2 = _this.features[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { | ||
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { | ||
var feature = _step2.value; | ||
@@ -701,14 +755,5 @@ | ||
} catch (err) { | ||
_didIteratorError2 = true; | ||
_iteratorError2 = err; | ||
_iterator2.e(err); | ||
} finally { | ||
try { | ||
if (!_iteratorNormalCompletion2 && _iterator2.return != null) { | ||
_iterator2.return(); | ||
} | ||
} finally { | ||
if (_didIteratorError2) { | ||
throw _iteratorError2; | ||
} | ||
} | ||
_iterator2.f(); | ||
} | ||
@@ -767,3 +812,3 @@ | ||
this.form.Discipline = data.disciplines; | ||
this.form.Institute = data.institutes; | ||
this.form.Organization = data.organizations; | ||
var keywords = data.keywords ? data.keywords.split(';') : []; | ||
@@ -788,6 +833,6 @@ this.form.Keywords = keywords; | ||
to.Institute = []; | ||
to.Organization = []; | ||
for (var institute in from.Institute) { | ||
to.Institute.push(from.Institute[institute]); | ||
for (var organization in from.Organization) { | ||
to.Organization.push(from.Organization[organization]); | ||
} | ||
@@ -804,130 +849,127 @@ | ||
to.ParentId = from.ParentId; | ||
}, | ||
checkSelectedOrganisationLabels: function checkSelectedOrganisationLabels() { | ||
if (this.organizations.length > 0) { | ||
for (var organization in this.form.Organization) { | ||
var orgEntry = this.form.Organization[organization]; | ||
if (orgEntry.url === orgEntry.displayName) { | ||
var realOrgEntry = this.organizations.find(function (entry) { | ||
return entry.url === orgEntry.url; | ||
}); | ||
orgEntry.displayName = realOrgEntry.displayName; | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
created: function created() { | ||
var _this2 = this; | ||
try { | ||
var _this3 = this; | ||
i18n$1.locale = this.$props.languageLocale; | ||
i18n$1.locale = _this3.$props.languageLocale; | ||
if (this.$props.languageLocale === 'en') { | ||
this.disciplineLabel = 'displayNameEn'; | ||
} else { | ||
this.disciplineLabel = 'displayNameDe'; | ||
} | ||
if (_this3.$props.languageLocale === 'en') { | ||
_this3.disciplineLabel = 'displayNameEn'; | ||
} else { | ||
_this3.disciplineLabel = 'displayNameDe'; | ||
} | ||
this.startDateSelected(new Date()); | ||
apiConnection.VisibilityApi.getVisibilities(function (response) { | ||
var _iteratorNormalCompletion3 = true; | ||
var _didIteratorError3 = false; | ||
var _iteratorError3 = undefined; | ||
_this3.startDateSelected(new Date()); | ||
try { | ||
for (var _iterator3 = response.data[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { | ||
var visibility = _step3.value; | ||
apiConnection.VisibilityApi.getVisibilities(function (response) { | ||
var _iterator3 = _createForOfIteratorHelper(response.data), | ||
_step3; | ||
if (visibility.displayName === 'Project Members') { | ||
_this2.initialState.Visibility = visibility; | ||
_this2.form.Visibility = visibility; | ||
} | ||
try { | ||
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) { | ||
var visibility = _step3.value; | ||
_this2.visibilities.push({ | ||
text: visibility.displayName, | ||
value: visibility.id | ||
}); | ||
} | ||
} catch (err) { | ||
_didIteratorError3 = true; | ||
_iteratorError3 = err; | ||
} finally { | ||
try { | ||
if (!_iteratorNormalCompletion3 && _iterator3.return != null) { | ||
_iterator3.return(); | ||
if (visibility.displayName === 'Project Members') { | ||
_this3.initialState.Visibility = visibility; | ||
_this3.form.Visibility = visibility; | ||
} | ||
_this3.visibilities.push({ | ||
text: visibility.displayName, | ||
value: visibility.id | ||
}); | ||
} | ||
} catch (err) { | ||
_iterator3.e(err); | ||
} finally { | ||
if (_didIteratorError3) { | ||
throw _iteratorError3; | ||
} | ||
_iterator3.f(); | ||
} | ||
} | ||
}); | ||
}); | ||
if (appUtil.GuidUtil.isValidGuid(this.projectId)) { | ||
this.displayNameIsLocked = true; | ||
this.isNewProject = false; // Load features | ||
if (appUtil.GuidUtil.isValidGuid(_this3.projectId)) { | ||
_this3.displayNameIsLocked = true; | ||
_this3.isNewProject = false; // Load features | ||
apiConnection.ActivatedFeaturesApi.listAllFeaturesOfProject(this.projectId, function (response) { | ||
response.data.forEach(function (feature) { | ||
_this2.features.push(feature); | ||
apiConnection.ActivatedFeaturesApi.listAllFeaturesOfProject(_this3.projectId, function (response) { | ||
response.data.forEach(function (feature) { | ||
_this3.features.push(feature); | ||
}); | ||
}); | ||
}); | ||
apiConnection.ProjectApi.getProjectInformation(this.projectId, function (response) { | ||
_this2.fillForm(response.data); | ||
apiConnection.ProjectApi.getProjectInformation(_this3.projectId, function (response) { | ||
_this3.fillForm(response.data); | ||
_this2.tranferFormValues(_this2.form, _this2.initialState); | ||
}); | ||
apiConnection.ProjectRoleApi.getUserRoles(this.projectId, function (response) { | ||
_this2.checkOwnership(response.data); | ||
}); | ||
} else { | ||
apiConnection.ActivatedFeaturesApi.listAllFeatures(function (response) { | ||
response.data.forEach(function (feature) { | ||
_this2.features.push(feature); | ||
_this3.tranferFormValues(_this3.form, _this3.initialState); | ||
_this3.checkSelectedOrganisationLabels(); | ||
}); | ||
}); | ||
this.isNewProject = true; | ||
this.tranferFormValues(this.form, this.initialState); | ||
} | ||
apiConnection.ProjectRoleApi.getUserRoles(_this3.projectId, function (response) { | ||
_this3.checkOwnership(response.data); | ||
}); | ||
} else { | ||
apiConnection.ActivatedFeaturesApi.listAllFeatures(function (response) { | ||
response.data.forEach(function (feature) { | ||
_this3.features.push(feature); | ||
}); | ||
}); | ||
_this3.isNewProject = true; | ||
apiConnection.DisciplineApi.getDisciplines(function (response) { | ||
var _iteratorNormalCompletion4 = true; | ||
var _didIteratorError4 = false; | ||
var _iteratorError4 = undefined; | ||
_this3.tranferFormValues(_this3.form, _this3.initialState); | ||
} | ||
try { | ||
for (var _iterator4 = response.data[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { | ||
var datum = _step4.value; | ||
return _await(apiConnection.DisciplineApi.getDisciplines(function (response) { | ||
return response.data; | ||
}), function (disciplines) { | ||
var _iterator4 = _createForOfIteratorHelper(disciplines), | ||
_step4; | ||
_this2.disciplines.push(datum); | ||
} | ||
} catch (err) { | ||
_didIteratorError4 = true; | ||
_iteratorError4 = err; | ||
} finally { | ||
try { | ||
if (!_iteratorNormalCompletion4 && _iterator4.return != null) { | ||
_iterator4.return(); | ||
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) { | ||
var discipline = _step4.value; | ||
_this3.disciplines.push(discipline); | ||
} | ||
} catch (err) { | ||
_iterator4.e(err); | ||
} finally { | ||
if (_didIteratorError4) { | ||
throw _iteratorError4; | ||
} | ||
_iterator4.f(); | ||
} | ||
} | ||
}); | ||
apiConnection.InstituteApi.getInstitutes(function (response) { | ||
var _iteratorNormalCompletion5 = true; | ||
var _didIteratorError5 = false; | ||
var _iteratorError5 = undefined; | ||
try { | ||
for (var _iterator5 = response.data[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) { | ||
var datum = _step5.value; | ||
return _await(apiConnection.OrganizationApi.getOrganizations(function (response) { | ||
return response.data; | ||
}), function (organizationUris) { | ||
for (var organizationUri in organizationUris) { | ||
for (var subOrg in organizationUris[organizationUri]) { | ||
var org = organizationUris[organizationUri][subOrg]; | ||
var displayName = org["http://www.w3.org/1999/02/22-rdf-syntax-ns#label"][0]["value"]; | ||
var pushedOrg = { | ||
displayName: displayName, | ||
url: subOrg | ||
}; | ||
_this2.institutes.push(datum); | ||
} | ||
} catch (err) { | ||
_didIteratorError5 = true; | ||
_iteratorError5 = err; | ||
} finally { | ||
try { | ||
if (!_iteratorNormalCompletion5 && _iterator5.return != null) { | ||
_iterator5.return(); | ||
_this3.organizations.push(pushedOrg); | ||
} | ||
} | ||
} finally { | ||
if (_didIteratorError5) { | ||
throw _iteratorError5; | ||
} | ||
} | ||
} | ||
}); | ||
_this3.checkSelectedOrganisationLabels(); | ||
}); | ||
}); | ||
} catch (e) { | ||
return Promise.reject(e); | ||
} | ||
} | ||
@@ -1188,17 +1230,17 @@ }); | ||
attrs: { | ||
"label-for": "Institute", | ||
"label-for": "Organization", | ||
"label-cols-sm": "3", | ||
"label-align-sm": "right", | ||
"label": _vm.$t('projectInstituteLabel') | ||
"label": _vm.$t('projectOrganizationLabel') | ||
} | ||
}, [_c('multiselect', { | ||
attrs: { | ||
"id": "Institute", | ||
"id": "Organization", | ||
"disabled": !(this.isOwner || _vm.isNewProject), | ||
"options": _vm.institutes, | ||
"options": _vm.organizations, | ||
"multiple": true, | ||
"hide-selected": true, | ||
"label": "displayName", | ||
"track-by": "displayName", | ||
"placeholder": _vm.$t('projectInstitute') | ||
"track-by": "url", | ||
"placeholder": _vm.$t('projectOrganization') | ||
}, | ||
@@ -1217,7 +1259,7 @@ scopedSlots: _vm._u([{ | ||
model: { | ||
value: _vm.form.Institute, | ||
value: _vm.form.Organization, | ||
callback: function callback($$v) { | ||
_vm.$set(_vm.form, "Institute", $$v); | ||
_vm.$set(_vm.form, "Organization", $$v); | ||
}, | ||
expression: "form.Institute" | ||
expression: "form.Organization" | ||
} | ||
@@ -1427,3 +1469,3 @@ })], 1), _vm._v(" "), _c('b-form-group', { | ||
if (!inject) return; | ||
inject("data-v-7a621066_0", { | ||
inject("data-v-20331d88_0", { | ||
source: "#CreateProject .vdp-datepicker .form-control{background-color:#fff}#CreateProject .multiselect{min-height:calc(1.4em + .75rem + 2px)}#CreateProject .multiselect__input{border:0;min-height:calc(1.4em + .75rem + 2px)}#CreateProject .multiselect__tags{border-radius:0}#CreateProject .btn-float-right{float:right}#CreateProject .vdp-datepicker__calendar-button{height:calc(1.4em + .75rem + 2px)}#CreateProject .form-group.mandatory .col-form-label:after{content:\" *\";color:#a70619}#CreateProject .col-form-label{font-weight:700}.multiselect__tag{background-color:#00549f!important}.multiselect__option--highlight{background-color:#00549f!important;background:#00549f!important}.multiselect__option--selected.multiselect__option--highlight{background-color:#a70619!important}.multiselect__tag-icon:focus,.multiselect__tag-icon:hover{background-color:#a70619!important}.invalid-tooltip{position:absolute;top:100%;z-index:5;display:none;max-width:100%;padding:.25rem .5rem;margin-top:.1rem;font-size:.76563rem;line-height:1.4;color:#fff;background-color:rgba(204,7,30,.9);border-radius:0}#project_archive_button,#project_clear_button{display:none}.h-divider{margin-top:5px;margin-bottom:10px;height:1px;width:100%;border-top:1px solid #bebbbb}.form-group .custom-control-label{vertical-align:super}", | ||
@@ -1430,0 +1472,0 @@ map: undefined, |
{ | ||
"name": "@coscine/project-creation", | ||
"version": "1.6.1", | ||
"version": "1.7.0", | ||
"main": "./dist/index.js", | ||
@@ -25,11 +25,11 @@ "module": "dist/index.esm.js", | ||
"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", | ||
@@ -45,3 +45,3 @@ "vuejs-datepicker": "^1.6.2", | ||
"@semantic-release/git": "^9.0.0", | ||
"@semantic-release/gitlab": "^6.0.3", | ||
"@semantic-release/gitlab": "^6.0.4", | ||
"@semantic-release/npm": "^7.0.5", | ||
@@ -51,13 +51,13 @@ "@semantic-release/release-notes-generator": "^9.0.1", | ||
"@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", | ||
@@ -64,0 +64,0 @@ "vue-template-compiler": "^2.6.11" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
113159
2752
Updated@coscine/app-util@^1.3.2
Updated@types/jquery@^3.3.35
Updated@types/vuelidate@^0.7.13
Updatedbootstrap-vue@^2.12.0
Updatedjquery@^3.5.0
Updatedvue-i18n@^8.17.3