Skip to content
Snippets Groups Projects

Sprint/2020-10

Merged Marcel Nellesen requested to merge Sprint/2020-10 into master
8 files
+ 5078
5046
Compare changes
  • Side-by-side
  • Inline
Files
8
@@ -57,14 +57,13 @@ 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';
import { GuidUtil, LinkUtil } from '@coscine/app-util';
Vue.use(VueI18n);
const i18n = new VueI18n({
locale: 'en',
messages: locales,
messages: coscine.i18n['project-creation'],
silentFallbackWarn: true,
});
@@ -93,7 +92,6 @@ export default Vue.extend({
},
projectId: String,
displayName: String,
handleDelete: Function,
},
methods: {
checkFormValidity() {
@@ -115,6 +113,14 @@ export default Vue.extend({
bvModalEvt.preventDefault();
this.handleSubmit();
},
afterDeleteHandler(projectSlug: string = ''){
if (projectSlug !== ''){
LinkUtil.redirectToExternalProject(projectSlug);
} else {
LinkUtil.redirectToRoot();
}
this.isWaitingForResponse = false;
},
handleSubmit() {
if (!this.checkFormValidity()) {
this.showHelp = true;
@@ -123,20 +129,27 @@ export default Vue.extend({
this.isWaitingForResponse = true;
SubProjectApi.getAccessibleParent(this.projectId, (response: any) =>{
let parentId = response.data.id;
ProjectApi.deleteProject(
ProjectApi.getProjectInformation(parentId,
(response: any) => {
ProjectApi.deleteProject(
this.projectId,
(response: any) => {
this.handleDelete({ id: parentId });
this.isWaitingForResponse = false;
},
(errorResponse: any) => {
this.handleDelete({ id: parentId });
this.isWaitingForResponse = false;
});
(response: any) => {
this.afterDeleteHandler(response.data.slug);
},
(errorResponse: any) => {
this.afterDeleteHandler(response.data.slug);
});
},(error: any) => {
ProjectApi.deleteProject(
this.projectId,
(response: any) => {
this.afterDeleteHandler();
},
(errorResponse: any) => {
this.afterDeleteHandler();
});
});
});
},
},
});
Loading