deploy confirm
parent
f4b6f9de1b
commit
ea5fac5fcb
|
|
@ -2,6 +2,7 @@ import {Component, Input} from '@angular/core';
|
|||
import {AdvisoriesService} from "@app/_services/advisories.service";
|
||||
import {FormsService, ListsService} from "@app/_services";
|
||||
import {Subscription} from "rxjs";
|
||||
import { DialogService } from '@app/_services/dialog.service';
|
||||
|
||||
@Component({
|
||||
selector: 'advisories-tree-advisory',
|
||||
|
|
@ -17,7 +18,7 @@ export class AdvisoriesTreeAdvisoryComponent {
|
|||
public touched = false;
|
||||
|
||||
|
||||
constructor(private advisoriesService: AdvisoriesService, private listsService: ListsService, private formsService: FormsService) {
|
||||
constructor(private advisoriesService: AdvisoriesService, private listsService: ListsService, private formsService: FormsService, private dialog: DialogService) {
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -83,9 +84,13 @@ export class AdvisoriesTreeAdvisoryComponent {
|
|||
}
|
||||
|
||||
delete() {
|
||||
if (confirm(`Удалить ${this.advisory.caption}`)) this.advisoriesService.delete(this.advisory.id).subscribe(res => {
|
||||
this.listsService.refresh(this.parent.id);
|
||||
});
|
||||
this.dialog.confirm(`Удалить ${this.advisory.caption}`).subscribe(
|
||||
resp=>{
|
||||
if (resp) this.advisoriesService.delete(this.advisory.id).subscribe(res => {
|
||||
this.listsService.refresh(this.parent.id);
|
||||
});
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
addAdvisory() {
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import {Router} from "@angular/router";
|
|||
import {AdvisoryCompaniesService} from "@app/_services/advisory-companies.service";
|
||||
import {FormsService, ListsService} from "@app/_services";
|
||||
import {Subscription} from "rxjs";
|
||||
import { DialogService } from '@app/_services/dialog.service';
|
||||
|
||||
@Component({
|
||||
selector: 'advisories-tree-company',
|
||||
|
|
@ -18,7 +19,7 @@ export class AdvisoriesTreeCompanyComponent {
|
|||
public touched = false;
|
||||
|
||||
|
||||
constructor(private advisoryCompaniesService: AdvisoryCompaniesService, private listsService: ListsService, private formsService: FormsService, private router: Router) {
|
||||
constructor(private advisoryCompaniesService: AdvisoryCompaniesService, private listsService: ListsService, private formsService: FormsService, private router: Router, private dialog: DialogService) {
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -89,11 +90,14 @@ export class AdvisoriesTreeCompanyComponent {
|
|||
|
||||
|
||||
delete() {
|
||||
if (confirm('Исключить организацию из списка участников комитета?')) {
|
||||
this.advisoryCompaniesService.delete(this.advisoryCompany.id).subscribe(res => {
|
||||
this.listsService.refresh(this.parent?.id);
|
||||
});
|
||||
}
|
||||
this.dialog.confirm('Исключить организацию из списка участников комитета?').subscribe(
|
||||
resp=>{
|
||||
if (resp) {
|
||||
this.advisoryCompaniesService.delete(this.advisoryCompany.id).subscribe(res => {
|
||||
this.listsService.refresh(this.parent?.id);
|
||||
});
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import {Component, Input} from '@angular/core';
|
||||
import {AdvisoryMembersService} from "@app/_services/advisory-members.service";
|
||||
import {ListsService} from "@app/_services";
|
||||
import { DialogService } from '@app/_services/dialog.service';
|
||||
|
||||
@Component({
|
||||
selector: 'advisories-tree-member',
|
||||
|
|
@ -11,7 +12,7 @@ export class AdvisoriesTreeMemberComponent {
|
|||
@Input() advisoryMember: any;
|
||||
@Input() parent: any;
|
||||
|
||||
constructor(private advisoryMembersService: AdvisoryMembersService, private listsService: ListsService) {
|
||||
constructor(private advisoryMembersService: AdvisoryMembersService, private listsService: ListsService, private dialog: DialogService) {
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -41,12 +42,14 @@ export class AdvisoriesTreeMemberComponent {
|
|||
|
||||
|
||||
delete() {
|
||||
if (confirm('Исключить сотрудника из участников комитета?')) {
|
||||
this.advisoryMembersService.delete(this.advisoryMember.id).subscribe(res => {
|
||||
this.listsService.refresh(this.parent?.id);
|
||||
});
|
||||
}
|
||||
this.dialog.confirm('Исключить сотрудника из участников комитета?').subscribe(
|
||||
resp=>{
|
||||
if (resp) {
|
||||
this.advisoryMembersService.delete(this.advisoryMember.id).subscribe(res => {
|
||||
this.listsService.refresh(this.parent?.id);
|
||||
});
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import {Component, Input} from '@angular/core';
|
|||
import {AuthenticationService} from "@app/_services";
|
||||
import {Router} from "@angular/router";
|
||||
import { PagesService } from '@app/_services/pages.service';
|
||||
import { DialogService } from '@app/_services/dialog.service';
|
||||
|
||||
|
||||
@Component({
|
||||
|
|
@ -13,7 +14,7 @@ export class HeaderUserBarComponent {
|
|||
public menuItems = <any>[];
|
||||
public ddHidden = true;
|
||||
|
||||
constructor(public authService: AuthenticationService, private router: Router, private pagesService: PagesService) {
|
||||
constructor(public authService: AuthenticationService, private router: Router, private pagesService: PagesService, private dialog: DialogService) {
|
||||
}
|
||||
|
||||
get user() {
|
||||
|
|
@ -39,12 +40,16 @@ export class HeaderUserBarComponent {
|
|||
|
||||
|
||||
logout() {
|
||||
if (confirm('Вы деествительно хотите выйти из системы?')) {
|
||||
this.pagesService.editMode = false;
|
||||
this.authService.logout();
|
||||
this.ddHidden = true;
|
||||
this.router.navigate(['']).then();
|
||||
}
|
||||
this.dialog.confirm('Вы деествительно хотите выйти из системы?').subscribe(
|
||||
resp=>{
|
||||
if (resp) {
|
||||
this.pagesService.editMode = false;
|
||||
this.authService.logout();
|
||||
this.ddHidden = true;
|
||||
this.router.navigate(['']).then();
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
link(link: string) {
|
||||
|
|
|
|||
|
|
@ -8,6 +8,17 @@ import { DialogService } from '@app/_services/dialog.service';
|
|||
styleUrls: ['page-menu.component.scss']
|
||||
})
|
||||
export class PageMenuComponent {
|
||||
|
||||
delete() {
|
||||
this.dialog.confirm('Удалить этот блок?').subscribe(
|
||||
resp=>{
|
||||
if (resp) this.objectsService.destroy(this.section.id).subscribe(res => {
|
||||
this.listsService.refresh();
|
||||
});
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
@Input() page: any;
|
||||
@Input() section: any;
|
||||
@Input() editMode: boolean;
|
||||
|
|
@ -54,13 +65,5 @@ export class PageMenuComponent {
|
|||
});
|
||||
}
|
||||
|
||||
delete() {
|
||||
this.dialog.prompt('Удалить этот блок?').subscribe(
|
||||
resp=>{
|
||||
if (resp) this.objectsService.destroy(this.section.id).subscribe(res => {
|
||||
this.listsService.refresh();
|
||||
});
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import {Component, Input} from '@angular/core';
|
||||
import {FormsService, ListsService, ObjectsService} from "@app/_services";
|
||||
import { DialogService } from '@app/_services/dialog.service';
|
||||
|
||||
@Component({
|
||||
selector: 'cards-section-item',
|
||||
|
|
@ -11,7 +12,7 @@ export class CardsSectionItemComponent {
|
|||
@Input() type: any;
|
||||
@Input() editMode = false;
|
||||
|
||||
constructor(private objectsService: ObjectsService, private formsService: FormsService, private listsService: ListsService) {
|
||||
constructor(private objectsService: ObjectsService, private formsService: FormsService, private listsService: ListsService, private dialog: DialogService) {
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -23,10 +24,13 @@ export class CardsSectionItemComponent {
|
|||
}
|
||||
|
||||
delete() {
|
||||
if (confirm('r u sure?')) this.objectsService.destroy(this.card.id).subscribe(res => {
|
||||
this.listsService.refresh();
|
||||
});
|
||||
this.dialog.confirm('Удалить эту карточку?').subscribe(
|
||||
resp=>{
|
||||
if (resp) this.objectsService.destroy(this.card.id).subscribe(res => {
|
||||
this.listsService.refresh();
|
||||
});
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import {Component, Input} from '@angular/core';
|
|||
import {PagesService} from "@app/_services/pages.service";
|
||||
import {FormsService, ListsService} from "@app/_services";
|
||||
import {Subscription} from "rxjs";
|
||||
import { DialogService } from '@app/_services/dialog.service';
|
||||
|
||||
@Component({
|
||||
selector: 'pages-tree-item',
|
||||
|
|
@ -18,7 +19,8 @@ export class PagesTreeItemComponent {
|
|||
constructor(
|
||||
public pagesService: PagesService,
|
||||
private formsService: FormsService,
|
||||
private listsService: ListsService) {
|
||||
private listsService: ListsService,
|
||||
private dialog: DialogService) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
|
@ -85,26 +87,36 @@ export class PagesTreeItemComponent {
|
|||
}
|
||||
|
||||
delete() {
|
||||
if (confirm('r u sure?')) this.pagesService.delete(this.page.id).subscribe(res => {
|
||||
this.listsService.refresh(this.parentListId);
|
||||
this.refresh();
|
||||
});
|
||||
|
||||
this.dialog.confirm(`Удалить страницу ${this.page.name}?`).subscribe(
|
||||
resp=>{
|
||||
if (resp) this.pagesService.delete(this.page.id).subscribe(res => {
|
||||
this.listsService.refresh(this.parentListId);
|
||||
this.refresh();
|
||||
});
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
restore() {
|
||||
if (confirm(`Восстановить страницу ${this.page.name}?`)) this.pagesService.restore(this.page.id, {}).subscribe(res => {
|
||||
this.listsService.refresh(this.parentListId);
|
||||
this.refresh();
|
||||
});
|
||||
|
||||
this.dialog.confirm(`Восстановить страницу ${this.page.name}?`).subscribe(
|
||||
resp=>{
|
||||
if (resp) this.pagesService.restore(this.page.id, {}).subscribe(res => {
|
||||
this.listsService.refresh(this.parentListId);
|
||||
this.refresh();
|
||||
});
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
clone() {
|
||||
if (confirm(`Копировать страницу ${this.page.name}?`)) this.pagesService.clone(this.page.id, {recursive: true}).subscribe(res => {
|
||||
this.listsService.refresh(this.parentListId);
|
||||
this.refresh();
|
||||
});
|
||||
this.dialog.confirm(`Копировать страницу ${this.page.name}?`).subscribe(
|
||||
resp=>{
|
||||
if (resp) this.pagesService.clone(this.page.id, {recursive: true}).subscribe(res => {
|
||||
this.listsService.refresh(this.parentListId);
|
||||
this.refresh();
|
||||
});
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
private refresh(){
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import {Component, Input} from '@angular/core';
|
||||
import {FormsService, ListsService} from "@app/_services";
|
||||
import {PublicationsService} from "@app/_services/publications.service";
|
||||
import { DialogService } from '@app/_services/dialog.service';
|
||||
|
||||
@Component({
|
||||
selector: 'publications-list-item',
|
||||
|
|
@ -12,7 +13,7 @@ export class PublicationsListItemComponent {
|
|||
@Input() editMode: boolean;
|
||||
currentPoster:any;
|
||||
|
||||
constructor(private publicationsService: PublicationsService, private formsService: FormsService, private listsService: ListsService) {
|
||||
constructor(private publicationsService: PublicationsService, private formsService: FormsService, private listsService: ListsService, private dialog: DialogService) {
|
||||
}
|
||||
|
||||
get listId() {
|
||||
|
|
@ -33,12 +34,15 @@ export class PublicationsListItemComponent {
|
|||
}
|
||||
|
||||
delete() {
|
||||
if (confirm('R u sure?')) {
|
||||
this.publicationsService.delete(this.publication.id).subscribe(res => {
|
||||
this.listsService.refresh(this.listId, true);
|
||||
});
|
||||
}
|
||||
this.dialog.confirm('Удалить эту новость?').subscribe(
|
||||
resp=>{
|
||||
if (resp) {
|
||||
this.publicationsService.delete(this.publication.id).subscribe(res => {
|
||||
this.listsService.refresh(this.listId, true);
|
||||
});
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import {Component, Input} from '@angular/core';
|
||||
import {FormsService, ListsService, UsersService} from "@app/_services";
|
||||
import { DialogService } from '@app/_services/dialog.service';
|
||||
|
||||
@Component({
|
||||
selector: 'users-list-item',
|
||||
|
|
@ -10,7 +11,7 @@ export class UsersListItemComponent {
|
|||
@Input() user: any;
|
||||
@Input() listId: string;
|
||||
|
||||
constructor(private usersService: UsersService, private formsService: FormsService, private listsService: ListsService) {
|
||||
constructor(private usersService: UsersService, private formsService: FormsService, private listsService: ListsService, private dialog: DialogService) {
|
||||
}
|
||||
|
||||
get role() {
|
||||
|
|
@ -29,9 +30,12 @@ export class UsersListItemComponent {
|
|||
}
|
||||
|
||||
delete() {
|
||||
if (confirm(`Удалить пользователя ${this.user.name}?`)) this.usersService.delete(this.user.id).subscribe(res => {
|
||||
this.listsService.refresh(this.listId, true);
|
||||
});
|
||||
this.dialog.confirm(`Удалить пользователя ${this.user.name}?`).subscribe(
|
||||
resp=>{
|
||||
if (resp) this.usersService.delete(this.user.id).subscribe(res => {
|
||||
this.listsService.refresh(this.listId, true);
|
||||
});
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ export class DialogService {
|
|||
alert(txt:string){
|
||||
this.modalAllertSubject.next(txt)
|
||||
}
|
||||
prompt(txt:string){
|
||||
confirm(txt:string){
|
||||
this.modalPromptSubject.next(txt);
|
||||
this.userResp = new BehaviorSubject(null)
|
||||
return this.userResp;
|
||||
|
|
|
|||
Loading…
Reference in New Issue