Skip to content
Snippets Groups Projects
Commit b1a16931 authored by Marcel Nellesen's avatar Marcel Nellesen
Browse files

Merge branch 'Sprint/2021-05' into 'master'

Sprint/2021 05

See merge request !71
parents b6063abb 3a8a3fda
No related branches found
No related tags found
1 merge request!71Sprint/2021 05
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
"dist/*" "dist/*"
], ],
"dependencies": { "dependencies": {
"@coscine/api-connection": "^1.26.0", "@coscine/api-connection": "^1.27.0",
"@coscine/app-util": "^1.8.1", "@coscine/app-util": "^1.8.1",
"@coscine/component-library": "^1.6.0", "@coscine/component-library": "^1.6.2",
"@types/jquery": "^3.5.5", "@types/jquery": "^3.5.5",
"@types/vuelidate": "^0.7.13", "@types/vuelidate": "^0.7.13",
"@voerro/vue-tagsinput": "^2.4.3", "@voerro/vue-tagsinput": "^2.4.3",
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
<div class="invalid-tooltip">{{ $t('projectDescriptionHelp') }}</div> <div class="invalid-tooltip">{{ $t('projectDescriptionHelp') }}</div>
</coscine-form-group> </coscine-form-group>
<!-- copy metadata from parent --> <!-- copy metadata from parent -->
<div class="h-divider"></div> <coscine-horizontal-divider />
<div> <div>
<h5>{{ $t('activatedImportFromParent') }}</h5> <h5>{{ $t('activatedImportFromParent') }}</h5>
</div> </div>
...@@ -245,12 +245,7 @@ ...@@ -245,12 +245,7 @@
v-bind:disabled="!(isOwner || isNewProject)" v-bind:disabled="!(isOwner || isNewProject)"
></b-form-radio-group> ></b-form-radio-group>
</coscine-form-group> </coscine-form-group>
<coscine-form-group <coscine-form-group labelFor="GrantId" :label="$t('projectGrantIdLabel')" :isLoading="isLoading" type="input">
labelFor="GrantId"
:label="$t('projectGrantIdLabel')"
:isLoading="isLoading"
type="input"
>
<b-form-input <b-form-input
id="GrantId" id="GrantId"
v-model="$v.form.GrantId.$model" v-model="$v.form.GrantId.$model"
...@@ -263,7 +258,7 @@ ...@@ -263,7 +258,7 @@
/> />
<div class="invalid-tooltip">{{ $t('projectGrantIdHelp') }}</div> <div class="invalid-tooltip">{{ $t('projectGrantIdHelp') }}</div>
</coscine-form-group> </coscine-form-group>
<div class="h-divider"></div> <coscine-horizontal-divider />
<div> <div>
<h5>{{ $t('activatedFeaturesHeadline') }}</h5> <h5>{{ $t('activatedFeaturesHeadline') }}</h5>
</div> </div>
...@@ -276,53 +271,32 @@ ...@@ -276,53 +271,32 @@
<b-skeleton type="text" animation="fade"></b-skeleton> <b-skeleton type="text" animation="fade"></b-skeleton>
</div> </div>
</template> </template>
<b-form-group <coscine-form-group
v-for="feature in $v.features.$each.$iter" v-for="feature in $v.features.$each.$iter"
:key="feature.id.$model" :key="feature.id.$model"
:label-for="feature.id.$model" :label-for="feature.id.$model"
label-cols-sm="3"
label-align-sm="right"
:label="feature.$model[language]" :label="feature.$model[language]"
> >
<b-form-checkbox :id="feature.id.$model" v-model="feature.activated.$model" switch></b-form-checkbox> <b-form-checkbox :id="feature.id.$model" v-model="feature.activated.$model" switch></b-form-checkbox>
</b-form-group> </coscine-form-group>
</b-skeleton-wrapper> </b-skeleton-wrapper>
</div> </div>
<div> <b-row>
<delete-modal <delete-modal
:projectId="projectId" :projectId="projectId"
:displayName="form.DisplayName" :displayName="form.DisplayName"
:projectParentId="form.ParentId" :projectParentId="form.ParentId"
:languageLocale="languageLocale" :languageLocale="languageLocale"
style="display: inline;"
v-show="isOwner" v-show="isOwner"
></delete-modal> ></delete-modal>
<b-button
variant="light"
name="archive"
id="project_archive_button"
disabled
@click.prevent="clickArchive"
v-show="isOwner || isNewProject"
>{{ $t('archive') }}</b-button
>
<b-button
variant="light"
id="project_clear_button"
@click.prevent="clickClearForm"
@click="$v.form.$reset"
v-show="isOwner || isNewProject"
>{{ $t('clearFormButton') }}</b-button
>
<b-button <b-button
type="submit" type="submit"
variant="primary" variant="primary"
class="btn-float-right" class="btn-right"
:disabled="$v.$invalid || isWaitingForResponse || isSavingProjectUpdates || !$v.$anyDirty" :disabled="$v.$invalid || isWaitingForResponse || isSavingProjectUpdates || !$v.$anyDirty"
name="save" name="save"
@click.prevent="clickSave" @click.prevent="clickSave"
v-show="isOwner || isNewProject" v-show="isOwner || isNewProject"
style="display: inline;"
> >
<b-iconstack animation="spin" v-if="isSavingProjectUpdates" aria-hidden="true"> <b-iconstack animation="spin" v-if="isSavingProjectUpdates" aria-hidden="true">
<b-icon stacked icon="dot" aria-hidden="true" shift-v="4"></b-icon> <b-icon stacked icon="dot" aria-hidden="true" shift-v="4"></b-icon>
...@@ -332,7 +306,7 @@ ...@@ -332,7 +306,7 @@
</b-iconstack> </b-iconstack>
{{ $t('save') }}</b-button {{ $t('save') }}</b-button
> >
</div> </b-row>
</b-form> </b-form>
<coscine-loading-spinner <coscine-loading-spinner
:isWaitingForResponse="isWaitingForResponse" :isWaitingForResponse="isWaitingForResponse"
...@@ -345,8 +319,35 @@ ...@@ -345,8 +319,35 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import {
FormGroupPlugin,
FormInputPlugin,
FormDatepickerPlugin,
ToastPlugin,
BButton,
BRow,
BIconstack,
BIcon,
BIconDot,
BSkeletonWrapper,
BSkeleton,
} from 'bootstrap-vue';
import Vue from 'vue'; import Vue from 'vue';
import { CoscineLoadingSpinner, CoscineFormGroup } from '@coscine/component-library'; Vue.use(FormGroupPlugin);
Vue.use(FormInputPlugin);
Vue.use(FormDatepickerPlugin);
Vue.use(ToastPlugin);
Vue.component('b-button', BButton);
Vue.component('b-row', BRow);
Vue.component('b-iconstack', BIconstack);
Vue.component('b-icon', BIcon);
Vue.component('BIconDot', BIconDot);
Vue.component('b-skeleton-wrapper', BSkeletonWrapper);
Vue.component('b-skeleton', BSkeleton);
Vue.component('b-skeleton', BSkeleton);
import { CoscineLoadingSpinner, CoscineFormGroup, CoscineHorizontalDivider } from '@coscine/component-library';
import '@coscine/component-library/dist/index.css';
import { validationMixin } from 'vuelidate'; import { validationMixin } from 'vuelidate';
import { required, minLength, maxLength } from 'vuelidate/lib/validators'; import { required, minLength, maxLength } from 'vuelidate/lib/validators';
import tag_inputs_helper from './utils/tag_inputs_helper'; import tag_inputs_helper from './utils/tag_inputs_helper';
...@@ -360,9 +361,6 @@ import { ...@@ -360,9 +361,6 @@ import {
} from '@coscine/api-connection'; } from '@coscine/api-connection';
import { GuidUtil, LinkUtil } from '@coscine/app-util'; import { GuidUtil, LinkUtil } from '@coscine/app-util';
import VueI18n from 'vue-i18n';
import {BootstrapVue, BootstrapVueIcons} from 'bootstrap-vue';
import '@voerro/vue-tagsinput/dist/style.css'; import '@voerro/vue-tagsinput/dist/style.css';
import Multiselect from 'vue-multiselect'; import Multiselect from 'vue-multiselect';
...@@ -370,8 +368,7 @@ import 'vue-multiselect/dist/vue-multiselect.min.css'; ...@@ -370,8 +368,7 @@ import 'vue-multiselect/dist/vue-multiselect.min.css';
import DeleteModal from './components/DeleteModal.vue'; import DeleteModal from './components/DeleteModal.vue';
Vue.use(BootstrapVue); import VueI18n from 'vue-i18n';
Vue.use(BootstrapVueIcons);
Vue.use(VueI18n); Vue.use(VueI18n);
const i18n = new VueI18n({ const i18n = new VueI18n({
...@@ -393,6 +390,7 @@ export default Vue.extend({ ...@@ -393,6 +390,7 @@ export default Vue.extend({
DeleteModal, DeleteModal,
CoscineLoadingSpinner, CoscineLoadingSpinner,
CoscineFormGroup, CoscineFormGroup,
CoscineHorizontalDivider,
}, },
validations: { validations: {
form: { form: {
...@@ -575,7 +573,10 @@ export default Vue.extend({ ...@@ -575,7 +573,10 @@ export default Vue.extend({
}); });
} else { } else {
this.isSavingProjectUpdates = true; this.isSavingProjectUpdates = true;
ProjectApi.updateProject(this.projectId, this.form, (response: any) => { ProjectApi.updateProject(
this.projectId,
this.form,
(response: any) => {
// update features // update features
for (const feature of this.features) { for (const feature of this.features) {
if ((feature as any).activated) { if ((feature as any).activated) {
...@@ -586,12 +587,19 @@ export default Vue.extend({ ...@@ -586,12 +587,19 @@ export default Vue.extend({
} }
this.isSavingProjectUpdates = false; this.isSavingProjectUpdates = false;
this.$v.$reset(); this.$v.$reset();
this.makeToast(this.$t('toastMessages.saveSuccessfulMessage').toString(), this.$t('toastMessages.saveSuccessfulTitle').toString()); this.makeToast(
this.$t('toastMessages.saveSuccessfulMessage').toString(),
this.$t('toastMessages.saveSuccessfulTitle').toString()
);
}, },
(error: any) => { (error: any) => {
this.isSavingProjectUpdates = false; this.isSavingProjectUpdates = false;
this.makeToast(this.$t('toastMessages.saveFailedMessage').toString(), this.$t('toastMessages.saveFailedTitle').toString()); this.makeToast(
}); this.$t('toastMessages.saveFailedMessage').toString(),
this.$t('toastMessages.saveFailedTitle').toString()
);
}
);
} }
}, },
handleAfterSave() { handleAfterSave() {
...@@ -679,13 +687,19 @@ export default Vue.extend({ ...@@ -679,13 +687,19 @@ export default Vue.extend({
for (const organization of this.form.Organization) { for (const organization of this.form.Organization) {
newOrganizations.push(organization); newOrganizations.push(organization);
} }
OrganizationApi.getOrganizationsWithFilter(search, (response: any) => { OrganizationApi.getOrganizationsWithFilter(
search,
(response: any) => {
for (const org of response.data.data) { for (const org of response.data.data) {
newOrganizations.push(org as any); newOrganizations.push(org as any);
} }
this.organizations = newOrganizations; this.organizations = newOrganizations;
this.loadingOrganizations = false; this.loadingOrganizations = false;
}, (error: any) => { this.loadingOrganizations = false; }); },
(error: any) => {
this.loadingOrganizations = false;
}
);
}, },
clickCopyMetadata() { clickCopyMetadata() {
if (this.parentData) { if (this.parentData) {
...@@ -716,7 +730,7 @@ export default Vue.extend({ ...@@ -716,7 +730,7 @@ export default Vue.extend({
}, },
}, },
async created() { async created() {
this.isLoading = (GuidUtil.isValidGuid(this.projectId)) ? true : false; this.isLoading = GuidUtil.isValidGuid(this.projectId) ? true : false;
i18n.locale = this.$props.languageLocale; i18n.locale = this.$props.languageLocale;
if (this.$props.languageLocale === 'en') { if (this.$props.languageLocale === 'en') {
this.disciplineLabel = 'displayNameEn'; this.disciplineLabel = 'displayNameEn';
...@@ -794,9 +808,7 @@ export default Vue.extend({ ...@@ -794,9 +808,7 @@ export default Vue.extend({
.projectdatepicker footer { .projectdatepicker footer {
display: none; display: none;
} }
.projectdatepicker button { .projectdatepicker button,
min-width: unset;
}
.b-calendar button { .b-calendar button {
min-width: unset; min-width: unset;
} }
...@@ -810,17 +822,8 @@ export default Vue.extend({ ...@@ -810,17 +822,8 @@ export default Vue.extend({
#CreateProject .multiselect__tags { #CreateProject .multiselect__tags {
border-radius: 0px; border-radius: 0px;
} }
#CreateProject .btn-float-right { #CreateProject .btn-right {
float: right; margin-left: auto;
margin-top: -37px;
display: inline;
}
#CreateProject .form-group.mandatory .col-form-label:after {
content: ' *';
color: #a70619;
}
#CreateProject .col-form-label {
font-weight: bold;
} }
.multiselect__tag { .multiselect__tag {
background-color: #00549f !important; background-color: #00549f !important;
...@@ -850,17 +853,6 @@ export default Vue.extend({ ...@@ -850,17 +853,6 @@ export default Vue.extend({
background-color: rgba(204, 7, 30, 0.9); background-color: rgba(204, 7, 30, 0.9);
border-radius: 0; 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 { .form-group .custom-control-label {
vertical-align: super; vertical-align: super;
} }
......
...@@ -34,8 +34,13 @@ ...@@ -34,8 +34,13 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { FormGroupPlugin , BFormInput } from 'bootstrap-vue';
import Vue from 'vue'; import Vue from 'vue';
Vue.use(FormGroupPlugin);
Vue.component('b-form-input', BFormInput);
import { CoscineLoadingSpinner, CoscineModal } from '@coscine/component-library'; import { CoscineLoadingSpinner, CoscineModal } from '@coscine/component-library';
import '@coscine/component-library/dist/index.css';
import { ProjectApi, SubProjectApi } from '@coscine/api-connection'; import { ProjectApi, SubProjectApi } from '@coscine/api-connection';
import VueI18n from 'vue-i18n'; import VueI18n from 'vue-i18n';
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment