Skip to content
Snippets Groups Projects

Topic/804-niceProjectUrl

Merged Marcel Nellesen requested to merge Topic/804-niceProjectUrl into Product/510-niceProjectUrl
All threads resolved!
3 files
+ 1192
459
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -59,7 +59,7 @@ import 'vue-loading-overlay/dist/vue-loading.css';
@@ -59,7 +59,7 @@ import 'vue-loading-overlay/dist/vue-loading.css';
import locales from '../locale/locales';
import locales from '../locale/locales';
import VueI18n from 'vue-i18n';
import VueI18n from 'vue-i18n';
import { GuidUtil } from '@coscine/app-util';
import { GuidUtil, LinkUtil } from '@coscine/app-util';
Vue.use(VueI18n);
Vue.use(VueI18n);
const i18n = new VueI18n({
const i18n = new VueI18n({
@@ -93,7 +93,6 @@ export default Vue.extend({
@@ -93,7 +93,6 @@ export default Vue.extend({
},
},
projectId: String,
projectId: String,
displayName: String,
displayName: String,
handleDelete: Function,
},
},
methods: {
methods: {
checkFormValidity() {
checkFormValidity() {
@@ -115,6 +114,14 @@ export default Vue.extend({
@@ -115,6 +114,14 @@ export default Vue.extend({
bvModalEvt.preventDefault();
bvModalEvt.preventDefault();
this.handleSubmit();
this.handleSubmit();
},
},
 
afterDeleteHandler(projectSlug: string = ''){
 
if (projectSlug !== ''){
 
LinkUtil.redirectToExternalProject(projectSlug);
 
} else {
 
LinkUtil.redirectToRoot();
 
}
 
this.isWaitingForResponse = false;
 
},
handleSubmit() {
handleSubmit() {
if (!this.checkFormValidity()) {
if (!this.checkFormValidity()) {
this.showHelp = true;
this.showHelp = true;
@@ -123,20 +130,27 @@ export default Vue.extend({
@@ -123,20 +130,27 @@ export default Vue.extend({
this.isWaitingForResponse = true;
this.isWaitingForResponse = true;
SubProjectApi.getAccessibleParent(this.projectId, (response: any) =>{
SubProjectApi.getAccessibleParent(this.projectId, (response: any) =>{
let parentId = response.data.id;
let parentId = response.data.id;
ProjectApi.getProjectInformation(parentId,
ProjectApi.deleteProject(
(response: any) => {
 
ProjectApi.deleteProject(
this.projectId,
this.projectId,
(response: any) => {
(response: any) => {
this.handleDelete({ id: parentId });
this.afterDeleteHandler(response.data.slug);
this.isWaitingForResponse = false;
},
},
(errorResponse: any) => {
(errorResponse: any) => {
this.afterDeleteHandler(response.data.slug);
this.handleDelete({ id: parentId });
});
this.isWaitingForResponse = false;
},(error: any) => {
});
ProjectApi.deleteProject(
 
this.projectId,
 
(response: any) => {
 
this.afterDeleteHandler();
 
},
 
(errorResponse: any) => {
 
this.afterDeleteHandler();
 
});
 
});
});
});
},
},
},
},
});
});
Loading