Skip to content
Snippets Groups Projects

Product/510-niceProjectUrl

Merged Marcel Nellesen requested to merge Product/510-niceProjectUrl into Sprint/2020-10
3 files
+ 1192
459
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -59,7 +59,7 @@ 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({
@@ -93,7 +93,6 @@ export default Vue.extend({
},
projectId: String,
displayName: String,
handleDelete: Function,
},
methods: {
checkFormValidity() {
@@ -115,6 +114,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 +130,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