diff --git a/connect/communityGuard/connectRIGuard.guard.ts b/connect/communityGuard/connectRIGuard.guard.ts index 42c05c78..39ed42d1 100644 --- a/connect/communityGuard/connectRIGuard.guard.ts +++ b/connect/communityGuard/connectRIGuard.guard.ts @@ -30,8 +30,10 @@ export class ConnectRIGuard implements CanActivate, CanLoad { } })); } + canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable | boolean { - return this.check(route.queryParams['communityId']); + let community = route.params['community']?route.params['community']:route.queryParams['communityId']; + return community && this.check(community); } canLoad(route: Route, segments: UrlSegment[]): Observable | Promise | boolean { diff --git a/dashboard/entity/entities.component.ts b/dashboard/entity/entities.component.ts index 4c6deefe..823d6199 100644 --- a/dashboard/entity/entities.component.ts +++ b/dashboard/entity/entities.component.ts @@ -11,6 +11,7 @@ import {HelperFunctions} from "../../utils/HelperFunctions.class"; import {UserManagementService} from '../../services/user-management.service'; import {Subscriber} from "rxjs"; import {properties} from "../../../../environments/environment"; +import {ConnectHelper} from "../../connect/connectHelper"; @Component({ selector: 'entities', @@ -18,29 +19,29 @@ import {properties} from "../../../../environments/environment"; }) export class EntitiesComponent implements OnInit { - + @ViewChild('AlertModalSaveEntity') alertModalSaveEntity; @ViewChild('AlertModalDeleteEntities') alertModalDeleteEntities; private selectedEntities: string[] = []; - + public checkboxes: CheckEntity[] = []; - + public entities: Entity[] = []; - + public myForm: FormGroup; - + private searchText: RegExp = new RegExp(''); public keyword = ''; - + public communities: Portal[] = []; public selectedCommunityPid: string; - + @ViewChild('AlertModalRelatedPages') alertModalRelatedPages; - + public toggleIds: string[]; public toggleStatus: boolean; - public properties: EnvProperties = null; - + public properties: EnvProperties = properties; + public showLoading = true; public errorMessage = ''; public updateErrorMessage = ''; @@ -48,18 +49,19 @@ export class EntitiesComponent implements OnInit { public isPortalAdministrator = null; public filterForm: FormGroup; private subscriptions: any[] = []; - + constructor(private element: ElementRef, private route: ActivatedRoute, private _router: Router, private _helpContentService: HelpContentService, private userManagementService: UserManagementService, private _fb: FormBuilder) { } - + ngOnInit() { this.filterForm = this._fb.group({ keyword: [''], - status: ['all', Validators.required]}); - + status: ['all', Validators.required] + }); + this.myForm = this._fb.group({ pid: ['', Validators.required], name: ['', Validators.required], @@ -72,19 +74,16 @@ export class EntitiesComponent implements OnInit { this.subscriptions.push(this.filterForm.get('status').valueChanges.subscribe(value => { this.applyStatusFilter(); })); - - this.properties = properties; - this.subscriptions.push(this.route.queryParams.subscribe(params => { - HelperFunctions.scroll(); - this.userManagementService.getUserInfo().subscribe(user => { - this.selectedCommunityPid = params['communityId']; - this.applyCommunityFilter(this.selectedCommunityPid); - this.isPortalAdministrator = Session.isPortalAdministrator(user) && !this.selectedCommunityPid; - }); - })); - - + this.userManagementService.getUserInfo().subscribe(user => { + this.selectedCommunityPid = (this.route.snapshot.data.portal) ? this.route.snapshot.data.portal : this.route.snapshot.params[this.route.snapshot.data.param]; + ConnectHelper.setPortalTypeFromPid(this.selectedCommunityPid ); + this.applyCommunityFilter(this.selectedCommunityPid); + this.isPortalAdministrator = Session.isPortalAdministrator(user) && !this.selectedCommunityPid; + }); + + } + ngOnDestroy(): void { this.subscriptions.forEach(value => { if (value instanceof Subscriber) { @@ -94,6 +93,7 @@ export class EntitiesComponent implements OnInit { } }); } + getEntities(community_pid: string) { if (!Session.isLoggedIn()) { this._router.navigate(['/user-info'], @@ -107,12 +107,12 @@ export class EntitiesComponent implements OnInit { entities => { this.entities = entities; this.checkboxes = []; - + let self = this; entities.forEach(_ => { self.checkboxes.push({entity: _, checked: false}); }); - + this.showLoading = false; }, error => this.handleError('System error retrieving entities', error)); @@ -121,7 +121,7 @@ export class EntitiesComponent implements OnInit { entities => { this.entities = entities; this.checkboxes = []; - + let self = this; entities.forEach(_ => { self.checkboxes.push({entity: _, checked: false}); @@ -132,40 +132,40 @@ export class EntitiesComponent implements OnInit { } } } - + public toggleCheckBoxes(event) { this.checkboxes.forEach(_ => _.checked = event.target.checked); } - + public applyCheck(flag: boolean) { this.checkboxes.forEach(_ => _.checked = flag); } - + public getSelectedEntities(): string[] { return this.checkboxes.filter(entity => entity.checked === true).map(checkedEntity => checkedEntity.entity).map(res => res._id); } - + private deleteEntitiesFromArray(ids: string[]): void { for (let id of ids) { const i = this.checkboxes.findIndex(_ => _.entity._id === id); this.checkboxes.splice(i, 1); } } - + public confirmDeleteEntity(id: string) { // this.deleteConfirmationModal.ids = [id]; // this.deleteConfirmationModal.showModal(); this.selectedEntities = [id]; this.confirmDeleteEntitiesModalOpen(); } - + public confirmDeleteSelectedEntities() { // this.deleteConfirmationModal.ids = this.getSelectedEntities(); // this.deleteConfirmationModal.showModal(); this.selectedEntities = this.getSelectedEntities(); this.confirmDeleteEntitiesModalOpen(); } - + private confirmDeleteEntitiesModalOpen() { if (!Session.isLoggedIn()) { this._router.navigate(['/user-info'], @@ -179,7 +179,7 @@ export class EntitiesComponent implements OnInit { this.alertModalDeleteEntities.open(); } } - + public confirmedDeleteEntities(data: any) { if (!Session.isLoggedIn()) { this._router.navigate(['/user-info'], @@ -187,7 +187,7 @@ export class EntitiesComponent implements OnInit { } else { this.showLoading = true; this.updateErrorMessage = ''; - + this._helpContentService.deleteEntities(this.selectedEntities, this.properties.adminToolsAPIURL).subscribe( _ => { this.deleteEntitiesFromArray(this.selectedEntities); @@ -197,7 +197,7 @@ export class EntitiesComponent implements OnInit { ); } } - + public editEntity(i: number) { const entity: Entity = this.checkboxes[i].entity; this.myForm = this._fb.group({ @@ -208,7 +208,7 @@ export class EntitiesComponent implements OnInit { this.modalErrorMessage = ''; this.entitiesModalOpen(this.alertModalSaveEntity, '', 'Save Changes'); } - + public newEntity() { this.myForm = this._fb.group({ pid: ['', Validators.required], @@ -219,7 +219,7 @@ export class EntitiesComponent implements OnInit { this.modalErrorMessage = ''; this.entitiesModalOpen(this.alertModalSaveEntity, '', 'Save'); } - + private entitiesModalOpen(modal: any, title: string, yesBtn: string) { if (!Session.isLoggedIn()) { this._router.navigate(['/user-info'], @@ -232,7 +232,7 @@ export class EntitiesComponent implements OnInit { modal.open(); } } - + public entitySaveConfirmed(data: any) { if (!Session.isLoggedIn()) { this._router.navigate(['/user-info'], @@ -257,54 +257,54 @@ export class EntitiesComponent implements OnInit { } } } - - + + public entitySavedSuccessfully(entity: Entity) { this.checkboxes.push({entity: entity, checked: false}); this.applyCheck(false); } - + public entityUpdatedSuccessfully(entity: Entity) { this.checkboxes.find(checkItem => checkItem.entity._id === entity._id).entity = entity; this.applyCheck(false); } - + public filterBySearch(text: string) { this.searchText = new RegExp(text, 'i'); this.applyFilter(); } - + public applyFilter() { this.checkboxes = []; this.entities.filter(item => this.filterEntities(item)).forEach( _ => this.checkboxes.push({entity: _, checked: false}) ); } - + public filterEntities(entity: Entity): boolean { const textFlag = this.searchText.toString() === '' || (entity.name).match(this.searchText) != null; return textFlag; } - + public applyStatusFilter() { this.checkboxes = []; this.entities.filter(item => this.filterEntitiesByStatus(item)).forEach( _ => this.checkboxes.push({entity: _, checked: false}) ); } - + public filterEntitiesByStatus(entity: Entity): boolean { let status = this.filterForm.get("status").value; - return status == "all" || (status == "disabled" && !entity.isEnabled) || (status == "enabled" && entity.isEnabled); + return status == "all" || (status == "disabled" && !entity.isEnabled) || (status == "enabled" && entity.isEnabled); } - + handleError(message: string, error) { this.errorMessage = message; console.log('Server responded: ' + error); - + this.showLoading = false; } - + handleUpdateError(message: string, error) { if (error == null) { this.myForm = this._fb.group({ @@ -317,21 +317,21 @@ export class EntitiesComponent implements OnInit { this.updateErrorMessage = message; console.log('Server responded: ' + error); } - + this.showLoading = false; } - + public applyCommunityFilter(community_pid: string) { this.getEntities(community_pid); } - + public toggleEntities(status: boolean, ids: string[]) { // this.okModal.showModal(); this.toggleIds = ids; this.toggleStatus = status; this.confirmRelatedPagesModalOpen(); } - + private confirmRelatedPagesModalOpen() { if (!Session.isLoggedIn()) { this._router.navigate(['/user-info'], @@ -345,7 +345,7 @@ export class EntitiesComponent implements OnInit { this.alertModalRelatedPages.open(); } } - + public continueToggling(event: any) { if (!Session.isLoggedIn()) { this._router.navigate(['/user-info'], diff --git a/dashboard/page/pages.component.ts b/dashboard/page/pages.component.ts index 2cf11109..72a02567 100644 --- a/dashboard/page/pages.component.ts +++ b/dashboard/page/pages.component.ts @@ -15,6 +15,7 @@ import {map, startWith} from "rxjs/operators"; import {MatAutocompleteSelectedEvent} from "@angular/material"; import {PortalUtils} from "../portal/portalHelper"; import {properties} from "../../../../environments/environment"; +import {ConnectHelper} from "../../connect/connectHelper"; @Component({ selector: 'pages', @@ -100,20 +101,18 @@ export class PagesComponent implements OnInit { this.properties = properties; this.subscriptions.push(this.route.queryParams.subscribe(params => { - HelperFunctions.scroll(); - this.pagesType = ''; if (params['type']) { // this.pagesType = params['type']; this.filterForm.get('type').setValue(params['type']); } - this.selectedCommunityPid = params['communityId']; + this.selectedCommunityPid = (this.route.snapshot.data.portal)?this.route.snapshot.data.portal:this.route.snapshot.params[this.route.snapshot.data.param]; + ConnectHelper.setPortalTypeFromPid(this.selectedCommunityPid); this.keyword = ''; this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => { this.applyCommunityFilter(this.selectedCommunityPid); this.isPortalAdministrator = Session.isPortalAdministrator(user) && !this.selectedCommunityPid; })); - //this.getCommunities(); })); this.subscriptions.push(this._helpContentService.getEntities(this.properties.adminToolsAPIURL).subscribe( diff --git a/dashboard/portal/portals.component.html b/dashboard/portal/portals.component.html index a9a31c65..7d167c34 100644 --- a/dashboard/portal/portals.component.html +++ b/dashboard/portal/portals.component.html @@ -20,15 +20,15 @@ - - -
-
+ +
-
- - -
-
+
-
@@ -128,4 +120,4 @@ - + diff --git a/dashboard/portal/portals.component.ts b/dashboard/portal/portals.component.ts index 96c6af74..88286690 100644 --- a/dashboard/portal/portals.component.ts +++ b/dashboard/portal/portals.component.ts @@ -12,6 +12,7 @@ import {CheckPortal, Portal} from "../../utils/entities/adminTool/portal"; import {PortalUtils} from "./portalHelper"; import {properties} from "../../../../environments/environment"; import {CheckPage, Page} from "../../utils/entities/adminTool/page"; +import {AlertModal} from "../../utils/modal/alert"; @Component({ selector: 'portals', @@ -19,57 +20,59 @@ import {CheckPage, Page} from "../../utils/entities/adminTool/page"; }) export class PortalsComponent implements OnInit { - - @ViewChild('AlertModalSaveCommunity') alertModalSaveCommunity; - @ViewChild('AlertModalDeleteCommunities') alertModalDeleteCommunities; - private selectedCommunities: string[] = []; - + + @ViewChild('portalModal') portalModal: AlertModal; + @ViewChild('deleteModal') deleteModal: AlertModal; + private selectedPortals: string[] = []; + public checkboxes: CheckPortal[] = []; - public communities: Portal[] = []; - + public portals: Portal[] = []; + public portalFG: FormGroup; public filterForm: FormGroup; private subscriptions: any[] = []; - + private searchText: RegExp = new RegExp(''); public keyword = ''; - + public properties: EnvProperties = null; - + public showLoading = true; public errorMessage = ''; public updateErrorMessage = ''; public modalErrorMessage = ''; - public portalUtils:PortalUtils = new PortalUtils(); + public portalUtils: PortalUtils = new PortalUtils(); + ngOnInit() { this.portalFG = this._fb.group({ - name: '', - _id: '', - pid: '', - piwik:'', - type: '' + name: this._fb.control('', Validators.required), + _id: this._fb.control(''), + pid: this._fb.control('', Validators.required), + piwik: this._fb.control(''), + type: this._fb.control('', Validators.required), }); - this.filterForm = this._fb.group({ + this.filterForm = this._fb.group({ keyword: [''], - type: ['all', Validators.required]}); + type: ['all', Validators.required] + }); this.subscriptions.push(this.filterForm.get('keyword').valueChanges.subscribe(value => { this.filterBySearch(value); })); this.subscriptions.push(this.filterForm.get('type').valueChanges.subscribe(value => { this.applyTypeFilter(); })); - + HelperFunctions.scroll(); this.properties = properties; - this.getCommunities(); - + this.getPortals(); + } - + constructor(private element: ElementRef, private route: ActivatedRoute, private _router: Router, private _helpContentService: HelpContentService, private _fb: FormBuilder) { } - - + + ngOnDestroy(): void { this.subscriptions.forEach(value => { if (value instanceof Subscriber) { @@ -79,8 +82,8 @@ export class PortalsComponent implements OnInit { } }); } - - getCommunities() { + + getPortals() { if (!Session.isLoggedIn()) { this._router.navigate(['/user-info'], { queryParams: {'errorCode': LoginErrorCodes.NOT_VALID, 'redirectUrl': this._router.url} @@ -89,14 +92,14 @@ export class PortalsComponent implements OnInit { this.showLoading = true; this.updateErrorMessage = ''; this.errorMessage = ''; - - + + this.subscriptions.push(this._helpContentService.getPortalsFull(this.properties.adminToolsAPIURL).subscribe( - communities => { - this.communities = communities; - if(communities) { - communities.forEach(_ => { - this.checkboxes.push({community: _, checked: false}); + portals => { + this.portals = portals; + if (portals) { + portals.forEach(_ => { + this.checkboxes.push({portal: _, checked: false}); }); } this.showLoading = false; @@ -104,54 +107,48 @@ export class PortalsComponent implements OnInit { error => this.handleError('System error retrieving portals', error))); } } - + public toggleCheckBoxes(event) { this.checkboxes.forEach(_ => _.checked = event.target.checked); } - + public applyCheck(flag: boolean) { this.checkboxes.forEach(_ => _.checked = flag); } - - public getSelectedCommunities(): string[] { - return this.checkboxes.filter(community => community.checked === true).map(checkedCommunity => checkedCommunity.community).map(res => res._id); + + public getSelectedPortals(): string[] { + return this.checkboxes.filter(portal => portal.checked === true).map(checkedPortal => checkedPortal.portal).map(res => res._id); } - - private deleteCommunitiesFromArray(ids: string[]): void { + + private deletePortalsFromArray(ids: string[]): void { for (let id of ids) { - let i = this.checkboxes.findIndex(_ => _.community._id === id); + let i = this.checkboxes.findIndex(_ => _.portal._id === id); this.checkboxes.splice(i, 1); } } - - public confirmDeleteCommunity(id: string) { + + public confirmDeletePortal(id: string) { // this.deleteConfirmationModal.ids = [id]; // this.deleteConfirmationModal.showModal(); - this.selectedCommunities = [id]; + this.selectedPortals = [id]; this.confirmModalOpen(); } - - public confirmDeleteSelectedCommunities() { - this.selectedCommunities = this.getSelectedCommunities(); + + public confirmDeleteSelectedPortals() { + this.selectedPortals = this.getSelectedPortals(); this.confirmModalOpen(); } - + private confirmModalOpen() { - if (!Session.isLoggedIn()) { - this._router.navigate(['/user-info'], { - queryParams: {'errorCode': LoginErrorCodes.NOT_VALID, 'redirectUrl': this._router.url} - }); - } else { - this.alertModalDeleteCommunities.cancelButton = true; - this.alertModalDeleteCommunities.okButton = true; - this.alertModalDeleteCommunities.alertTitle = 'Delete Confirmation'; - this.alertModalDeleteCommunities.message = 'Are you sure you want to delete the selected portal(-ies)?'; - this.alertModalDeleteCommunities.okButtonText = 'Yes'; - this.alertModalDeleteCommunities.open(); - } + this.deleteModal.cancelButton = true; + this.deleteModal.okButton = true; + this.deleteModal.alertTitle = 'Delete Confirmation'; + this.deleteModal.message = 'Are you sure you want to delete the selected portal(-ies)?'; + this.deleteModal.okButtonText = 'Yes'; + this.deleteModal.open(); } - - public confirmedDeleteCommunities(data: any) { + + public confirmedDeletePortals(data: any) { if (!Session.isLoggedIn()) { this._router.navigate(['/user-info'], { queryParams: {'errorCode': LoginErrorCodes.NOT_VALID, 'redirectUrl': this._router.url} @@ -159,89 +156,76 @@ export class PortalsComponent implements OnInit { } else { this.showLoading = true; this.updateErrorMessage = ''; - - this.subscriptions.push(this._helpContentService.deleteCommunities(this.selectedCommunities, this.properties.adminToolsAPIURL).subscribe( + + this.subscriptions.push(this._helpContentService.deleteCommunities(this.selectedPortals, this.properties.adminToolsAPIURL).subscribe( _ => { - this.deleteCommunitiesFromArray(this.selectedCommunities); + this.deletePortalsFromArray(this.selectedPortals); this.showLoading = false; }, error => this.handleUpdateError('System error deleting the selected communities', error) )); } } - - public editCommunity(i: number) { - const community: Portal = this.checkboxes[i].community; + + public editPortal(i: number) { + const portal: Portal = this.checkboxes[i].portal; this.portalFG = this._fb.group({ - name: community.name, - _id: community._id, - type: community.type, - piwik:community.piwik, - pid: community.pid + name: this._fb.control(portal.name, Validators.required), + _id: this._fb.control(portal._id), + pid: this._fb.control(portal.pid, Validators.required), + piwik: this._fb.control(portal.piwik), + type: this._fb.control(portal.type, Validators.required), }); this.portalFG.controls['type'].disable(); this.modalErrorMessage = ''; - this.communitiesModalOpen(this.alertModalSaveCommunity, 'Update', 'Update Community'); + this.portalModalOpen('Update Portal', 'Update'); } - - public newCommunity() { + + public newPortal() { this.portalFG.controls['type'].enable(); this.portalFG = this._fb.group({ - name: '', - _id: '', - type: '', - piwik: '', - pid: '' + name: this._fb.control('', Validators.required), + _id: this._fb.control(''), + pid: this._fb.control('', Validators.required), + piwik: this._fb.control(''), + type: this._fb.control('', Validators.required), }); this.modalErrorMessage = ''; - this.communitiesModalOpen(this.alertModalSaveCommunity, '', 'Save'); + this.portalModalOpen('Create Portal', 'Save'); } - - private communitiesModalOpen(modal: any, title: string, yesBtn: string) { - if (!Session.isLoggedIn()) { - this._router.navigate(['/user-info'], { - queryParams: {'errorCode': LoginErrorCodes.NOT_VALID, 'redirectUrl': this._router.url} - }); - } else { - modal.cancelButton = true; - modal.okButton = true; - modal.alertTitle = title; - modal.okButtonText = yesBtn; - modal.open(); - } + + private portalModalOpen(title: string, yesBtn: string) { + this.portalModal.okButtonLeft = false; + this.portalModal.cancelButton = true; + this.portalModal.okButton = true; + this.portalModal.alertTitle = title; + this.portalModal.okButtonText = yesBtn; + this.portalModal.open(); } - - public communitySaveConfirmed(data: any) { - if (!Session.isLoggedIn()) { - this._router.navigate(['/user-info'], { - queryParams: {'errorCode': LoginErrorCodes.NOT_VALID, 'redirectUrl': this._router.url} - }); - } else { - + + public portalSaveConfirmed(data: any) { this.modalErrorMessage = ''; if (this.portalFG.getRawValue()['_id'].length > 0) { this.portalFG.controls['type'].enable(); this.subscriptions.push(this._helpContentService.updateCommunity(this.portalFG.value, this.properties.adminToolsAPIURL).subscribe( - community => { - this.communityUpdatedSuccessfully(community); + portal => { + this.portalUpdatedSuccessfully(portal); }, error => this.handleUpdateError('System error updating portal', error) )); - }else{ + } else { this.subscriptions.push(this._helpContentService.saveCommunity(this.portalFG.value, this.properties.adminToolsAPIURL).subscribe( - community => { - this.communitySavedSuccessfully(community); + portal => { + this.portalSavedSuccessfully(portal); }, error => this.handleUpdateError('System error creating portal', error) )); } - - } } - - public communityUpdateConfirmed(data: any) { + + public portalUpdateConfirmed(data: any) { if (!Session.isLoggedIn()) { this._router.navigate(['/user-info'], { queryParams: {'errorCode': LoginErrorCodes.NOT_VALID, 'redirectUrl': this._router.url} @@ -250,72 +234,74 @@ export class PortalsComponent implements OnInit { this.portalFG.controls['type'].enable(); this.subscriptions.push(this._helpContentService.updateCommunity(this.portalFG.value, this.properties.adminToolsAPIURL).subscribe( - community => { - this.communityUpdatedSuccessfully(community); + portal => { + this.portalUpdatedSuccessfully(portal); }, error => this.handleUpdateError('System error updating portal', error) )); } } - - public communitySavedSuccessfully(community: Portal) { - this.checkboxes.push({community: community, checked: false}); + + public portalSavedSuccessfully(portal: Portal) { + this.checkboxes.push({portal: portal, checked: false}); this.applyCheck(false); } - - public communityUpdatedSuccessfully(community: Portal) { - this.checkboxes.find(checkItem => checkItem.community._id === community._id).community = community; + + public portalUpdatedSuccessfully(portal: Portal) { + this.checkboxes.find(checkItem => checkItem.portal._id === portal._id).portal = portal; this.applyCheck(false); } - + public filterBySearch(text: string) { this.searchText = new RegExp(text, 'i'); this.applyFilter(); } - + public applyFilter() { this.checkboxes = []; - this.communities.filter(item => this.filterCommunities(item)).forEach( - _ => this.checkboxes.push({community: _, checked: false}) + this.portals.filter(item => this.filterPortals(item)).forEach( + _ => this.checkboxes.push({portal: _, checked: false}) ); } + public applyTypeFilter() { this.checkboxes = []; - this.communities.filter(item => this.filterByType(item)).forEach( - _ => this.checkboxes.push({community: _, checked: false}) + this.portals.filter(item => this.filterByType(item)).forEach( + _ => this.checkboxes.push({portal: _, checked: false}) ); } - - public filterByType(community: Portal): boolean { + + public filterByType(portal: Portal): boolean { let type = this.filterForm.get("type").value; - return type == "all" || (type == community.type); + return type == "all" || (type == portal.type); } - public filterCommunities(community: Portal): boolean { - const textFlag = this.searchText.toString() === '' || (community.name || community.type).match(this.searchText) != null; + + public filterPortals(portal: Portal): boolean { + const textFlag = this.searchText.toString() === '' || (portal.name || portal.type).match(this.searchText) != null; return textFlag; } - + handleUpdateError(message: string, error) { if (error == null) { this.portalFG = this._fb.group({ name: '', _id: '', pid: '', - piwik:'', + piwik: '', type: '' }); } else { this.updateErrorMessage = message; console.log('Server responded: ' + error); } - + this.showLoading = false; } - + handleError(message: string, error) { this.errorMessage = message; console.log('Server responded: ' + error); - + this.showLoading = false; } } diff --git a/dashboard/sharedComponents/admin-tabs/admin-tabs.component.ts b/dashboard/sharedComponents/admin-tabs/admin-tabs.component.ts index a77cbbda..dd439154 100644 --- a/dashboard/sharedComponents/admin-tabs/admin-tabs.component.ts +++ b/dashboard/sharedComponents/admin-tabs/admin-tabs.component.ts @@ -9,11 +9,10 @@ import {HelperFunctions} from "../../../utils/HelperFunctions.class"; selector: 'admin-tabs', template: `
` }) @@ -35,12 +34,6 @@ export class AdminTabsComponent implements OnInit { ngOnInit() { this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => { this.user = user; - - })); - this.subscriptions.push(this.route.queryParams.subscribe(params => { - HelperFunctions.scroll(); - this.portal = params['communityId']; - })); } ngOnDestroy(): void { diff --git a/sharedComponents/input/input.component.ts b/sharedComponents/input/input.component.ts index 069e110d..108d8432 100644 --- a/sharedComponents/input/input.component.ts +++ b/sharedComponents/input/input.component.ts @@ -40,7 +40,7 @@ export interface Option { -
+
diff --git a/utils/entities/adminTool/portal.ts b/utils/entities/adminTool/portal.ts index 02e30285..f1905f7f 100644 --- a/utils/entities/adminTool/portal.ts +++ b/utils/entities/adminTool/portal.ts @@ -195,7 +195,7 @@ export class Portal { } export interface CheckPortal { - community: Portal; + portal: Portal; checked: boolean; }