Skip to content
Snippets Groups Projects

Sprint/2020-02

Merged Marcel Nellesen requested to merge Product/441-createProjectPage into Sprint/2020-02
5 files
+ 77
92
Compare changes
  • Side-by-side
  • Inline

Files

+ 29
29
@@ -31,11 +31,11 @@
</div>
</b-form-group>
</form>
<template v-slot:modal-footer="{ ok, cancel, hide }">
<template v-slot:modal-footer="{ ok, cancel }">
<b-button variant="secondary" @click="cancel()">
{{$t('cancel')}}
</b-button>
<b-button :disabled="isDeletionInProgress" :variant="deleteButtonStyle" @click="ok()">
<b-button :disabled="isWaitingForResponse" variant="danger" @click="ok()">
{{$t('deleteButton')}}
</b-button>
</template>
@@ -52,18 +52,19 @@
<script lang="ts">
import Vue from 'vue';
import { ProjectApi, defaultOnCatch } from '@coscine/api-connection';
import { ProjectApi, SubProjectApi } from '@coscine/api-connection';
import Loading from 'vue-loading-overlay';
import 'vue-loading-overlay/dist/vue-loading.css';
import locales from '../locale/locales';
import VueI18n from 'vue-i18n';
import { GuidUtil } from '@coscine/app-util';
Vue.use(VueI18n);
const i18n = new VueI18n({
locale: 'en', // set locale
messages: locales, // set locale messages
locale: 'en',
messages: locales,
silentFallbackWarn: true,
});
@@ -79,19 +80,19 @@ export default Vue.extend({
deleteInputState: null,
showHelp: false,
isWaitingForResponse: false,
isDeletionInProgress: false,
color: '#00549f',
deleteButtonStyle: 'danger',
}
},
beforeMount() {
i18n.locale = this.$props.languageLocale;
},
props: {
languageLocale: String,
languageLocale: {
default: 'en',
type: String
},
projectId: String,
displayName: String,
projectParentId: String,
handleDelete: Function,
},
methods: {
@@ -120,26 +121,22 @@ export default Vue.extend({
return;
}
this.isWaitingForResponse = true;
this.isDeletionInProgress = true;
ProjectApi.deleteProject(
this.projectId,
(response: any) => {
ProjectApi.getProjectInformation(
this.projectParentId,
(response: any) => {
this.handleDelete({ id: this.projectParentId });
this.isWaitingForResponse = false;
this.isDeletionInProgress = false;
},
(errorResponse: any) => {
this.handleDelete({ id: null });
this.isWaitingForResponse = false;
this.isDeletionInProgress = false;
},
);
},
defaultOnCatch,
);
SubProjectApi.getAccessibleParent(this.projectId, (response: any) =>{
let parentId = response.data.id;
ProjectApi.deleteProject(
this.projectId,
(response: any) => {
this.handleDelete({ id: parentId });
this.isWaitingForResponse = false;
},
(errorResponse: any) => {
this.handleDelete({ id: parentId });
this.isWaitingForResponse = false;
});
});
},
},
});
@@ -157,6 +154,9 @@ export default Vue.extend({
}
.modal footer button{
min-width: auto;
}
.modal-backdrop {
opacity: .5;
}
</style>
Loading