[PM-7004] Delete formGroup initialization in verify-recover-delete-org.component.ts
This commit is contained in:
parent
392fdb8a14
commit
0b191a27dd
|
@ -1,35 +1,33 @@
|
||||||
<form [formGroup]="formGroup" [bitSubmit]="submit">
|
<div class="row justify-content-md-center mt-5">
|
||||||
<div class="row justify-content-md-center mt-5">
|
<div class="col-3">
|
||||||
<div class="col-4">
|
<p class="lead text-center mb-4">{{ "deleteOrganization" | i18n }}</p>
|
||||||
<p class="lead text-center mb-4">{{ "deleteOrganization" | i18n }}</p>
|
<div class="card">
|
||||||
<div class="card">
|
<div class="card-body">
|
||||||
<div class="card-body">
|
<app-callout type="warning">{{
|
||||||
<app-callout type="warning">{{
|
"deletingOrganizationIsPermanentWarning" | i18n: name
|
||||||
"deletingOrganizationIsPermanentWarning" | i18n: name
|
}}</app-callout>
|
||||||
}}</app-callout>
|
<p class="text-center">
|
||||||
<p class="text-center">
|
<strong>{{ name }}</strong>
|
||||||
<strong>{{ name }}</strong>
|
</p>
|
||||||
</p>
|
<p>{{ "deleteRecoverOrgConfirmDesc" | i18n }}</p>
|
||||||
<p>{{ "deleteRecoverOrgConfirmDesc" | i18n }}</p>
|
<p>{{ "deletingOrganizationActiveUserAccountsWarning" | i18n }}</p>
|
||||||
<p>{{ "deletingOrganizationActiveUserAccountsWarning" | i18n }}</p>
|
<hr />
|
||||||
<hr />
|
<div class="d-flex">
|
||||||
<div class="d-flex">
|
<button
|
||||||
<button
|
type="submit"
|
||||||
type="submit"
|
bitButton
|
||||||
bitButton
|
buttonType="primary"
|
||||||
bitFormButton
|
class="btn btn-danger btn-block btn-submit"
|
||||||
buttonType="primary"
|
[bitAction]="submit"
|
||||||
class="btn btn-danger btn-block btn-submit"
|
[disabled]="loading"
|
||||||
[disabled]="loading"
|
>
|
||||||
>
|
<span>{{ "deleteOrganization" | i18n }}</span>
|
||||||
<span>{{ "deleteOrganization" | i18n }}</span>
|
</button>
|
||||||
</button>
|
<a routerLink="/login" class="btn btn-outline-secondary btn-block ml-2 mt-0">
|
||||||
<a routerLink="/login" class="btn btn-outline-secondary btn-block ml-2 mt-0">
|
{{ "cancel" | i18n }}
|
||||||
{{ "cancel" | i18n }}
|
</a>
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</div>
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import { Component, OnInit } from "@angular/core";
|
import { Component, OnInit } from "@angular/core";
|
||||||
import { FormBuilder, FormGroup } from "@angular/forms";
|
|
||||||
import { ActivatedRoute, Router } from "@angular/router";
|
import { ActivatedRoute, Router } from "@angular/router";
|
||||||
import { firstValueFrom } from "rxjs";
|
import { firstValueFrom } from "rxjs";
|
||||||
|
|
||||||
|
@ -20,7 +19,8 @@ export class VerifyRecoverDeleteOrgComponent implements OnInit {
|
||||||
loading = true;
|
loading = true;
|
||||||
name: string;
|
name: string;
|
||||||
|
|
||||||
protected formGroup: FormGroup;
|
private orgId: string;
|
||||||
|
private token: string;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private router: Router,
|
private router: Router,
|
||||||
|
@ -29,16 +29,13 @@ export class VerifyRecoverDeleteOrgComponent implements OnInit {
|
||||||
private i18nService: I18nService,
|
private i18nService: I18nService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private logService: LogService,
|
private logService: LogService,
|
||||||
private formBuilder: FormBuilder,
|
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
const qParams = await firstValueFrom(this.route.queryParams);
|
const qParams = await firstValueFrom(this.route.queryParams);
|
||||||
if (qParams.orgId != null && qParams.token != null && qParams.name != null) {
|
if (qParams.orgId != null && qParams.token != null && qParams.name != null) {
|
||||||
this.formGroup = this.formBuilder.group({
|
this.orgId = qParams.orgId;
|
||||||
orgId: [qParams.orgId],
|
this.token = qParams.token;
|
||||||
token: [qParams.token],
|
|
||||||
});
|
|
||||||
this.name = qParams.name;
|
this.name = qParams.name;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
} else {
|
} else {
|
||||||
|
@ -48,9 +45,8 @@ export class VerifyRecoverDeleteOrgComponent implements OnInit {
|
||||||
|
|
||||||
submit = async () => {
|
submit = async () => {
|
||||||
try {
|
try {
|
||||||
const { orgId, token } = this.formGroup.value;
|
const request = new OrganizationVerifyDeleteRecoverRequest(this.token);
|
||||||
const request = new OrganizationVerifyDeleteRecoverRequest(token);
|
await this.apiService.deleteUsingToken(this.orgId, request);
|
||||||
await this.apiService.deleteUsingToken(orgId, request);
|
|
||||||
this.platformUtilsService.showToast(
|
this.platformUtilsService.showToast(
|
||||||
"success",
|
"success",
|
||||||
this.i18nService.t("organizationDeleted"),
|
this.i18nService.t("organizationDeleted"),
|
||||||
|
|
Loading…
Reference in New Issue