Two step deletion in GUI
Delete archived needs in GUI
Resolves Issue
@@ -56,6 +56,11 @@ function genComponentConf() {
ng-click="self.reOpenPost()">
Reopen Post
</button>
+ <button class="won-button--filled red"
+ ng-if="self.isOwnPost && self.isInactive"
+ ng-click="self.deletePost()">
+ Delete Post
+ </button>
<button class="won-button--filled red"
ng-if="self.isOwnPost && self.isActive"
ng-click="self.closePost()">
@@ -124,14 +129,15 @@ function genComponentConf() {
"Deleting or archiving the Post will close all connections, do you want to proceed?",
buttons: [
{
- caption: "Delete (irreversible!)",
+ caption: "Delete",
callback: () => {
- this.needs__delete(this.post.get("uri"));
+ /*this.needs__delete(this.post.get("uri"));
this.router__stateGoCurrent({
useCase: undefined,
postUri: undefined,
});
- this.view__hideModalDialog();
+ this.view__hideModalDialog();*/
+ this.deletePost();
},
},
{
@@ -157,6 +163,35 @@ function genComponentConf() {
}
}
+ deletePost() {
+ if (this.isOwnPost) {
+ const payload = {
+ caption: "Attention!",
+ text: "Deleting the Post is irreversible, do you want to proceed?",
+ buttons: [
+ {
+ caption: "YES",
+ callback: () => {
+ this.needs__delete(this.post.get("uri"));
+ this.router__stateGoCurrent({
+ useCase: undefined,
+ postUri: undefined,
+ });
+ this.view__hideModalDialog();
+ },
+ },
+ {
+ caption: "NO",
+ callback: () => {
+ this.view__hideModalDialog();
+ },
+ },
+ ],
+ };
+ this.view__showModalDialog(payload);
+ }
+ }
+
generateReportPostMailParams() {
const subject = `[Report Post] - ${this.postUri}`;
const body = `Link to Post: ${this.linkToPost}%0D%0AReason:%0D%0A`; //hint: %0D%0A adds a linebreak
