From ff526e6376b37e9b0a609f6860dd140883374565 Mon Sep 17 00:00:00 2001 From: Shaelyn Tolkamp Date: Wed, 3 Jan 2024 10:28:26 -0800 Subject: [PATCH] Remove settings from sidebar and administration and topics components and routing --- .../administration.component.html | 23 --- .../administration.component.scss | 16 -- .../administration.component.spec.ts | 25 --- .../administration.component.ts | 12 -- .../add-edit-topic.component.html | 75 -------- .../add-edit-topic.component.scss | 94 ---------- .../add-edit-topic.component.ts | 93 ---------- .../topic-table-rows.component.html | 11 -- .../topic-table-rows.component.scss | 6 - .../topic-table-rows.component.ts | 119 ------------- .../topics/topics-resolver.services.ts | 20 --- .../topics/topics.component.html | 20 --- .../topics/topics.component.scss | 10 -- .../administration/topics/topics.component.ts | 161 ------------------ src/app/app-routing.module.ts | 17 -- src/app/app.module.ts | 12 -- src/app/services/topic.service.ts | 63 ------- src/app/sidebar/sidebar.component.html | 1 - 18 files changed, 778 deletions(-) delete mode 100644 src/app/administration/administration.component.html delete mode 100644 src/app/administration/administration.component.scss delete mode 100644 src/app/administration/administration.component.spec.ts delete mode 100644 src/app/administration/administration.component.ts delete mode 100644 src/app/administration/topics/add-edit-topic/add-edit-topic.component.html delete mode 100644 src/app/administration/topics/add-edit-topic/add-edit-topic.component.scss delete mode 100644 src/app/administration/topics/add-edit-topic/add-edit-topic.component.ts delete mode 100644 src/app/administration/topics/topic-table-rows/topic-table-rows.component.html delete mode 100644 src/app/administration/topics/topic-table-rows/topic-table-rows.component.scss delete mode 100644 src/app/administration/topics/topic-table-rows/topic-table-rows.component.ts delete mode 100644 src/app/administration/topics/topics-resolver.services.ts delete mode 100644 src/app/administration/topics/topics.component.html delete mode 100644 src/app/administration/topics/topics.component.scss delete mode 100644 src/app/administration/topics/topics.component.ts delete mode 100644 src/app/services/topic.service.ts diff --git a/src/app/administration/administration.component.html b/src/app/administration/administration.component.html deleted file mode 100644 index 76e261e17..000000000 --- a/src/app/administration/administration.component.html +++ /dev/null @@ -1,23 +0,0 @@ - -
-
-
-
-

Topics

-

System Level management of Topics.

- Manage Topics -
-
-
-
-

Field Management

-

System Level management of Fields

- COMING SOON -
-
-
-
\ No newline at end of file diff --git a/src/app/administration/administration.component.scss b/src/app/administration/administration.component.scss deleted file mode 100644 index d64483948..000000000 --- a/src/app/administration/administration.component.scss +++ /dev/null @@ -1,16 +0,0 @@ -@import "~assets/styles/base/base.scss"; -@import "~assets/styles/components/feature-block.scss"; - -.feature-blocks { - margin-bottom: 20px; -} - -.flex-container { - @media screen and (min-width: 800px) { - justify-content: space-between; - > div { - flex: 49%; - max-width: 49%; - } - } -} diff --git a/src/app/administration/administration.component.spec.ts b/src/app/administration/administration.component.spec.ts deleted file mode 100644 index d68004460..000000000 --- a/src/app/administration/administration.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { AdministrationComponent } from './administration.component'; - -describe('AdministrationComponent', () => { - let component: AdministrationComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [AdministrationComponent] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(AdministrationComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/administration/administration.component.ts b/src/app/administration/administration.component.ts deleted file mode 100644 index 139db71fe..000000000 --- a/src/app/administration/administration.component.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Component } from '@angular/core'; - -@Component({ - selector: 'app-administration', - templateUrl: './administration.component.html', - styleUrls: ['./administration.component.scss'] -}) -export class AdministrationComponent { - - constructor() { } - -} diff --git a/src/app/administration/topics/add-edit-topic/add-edit-topic.component.html b/src/app/administration/topics/add-edit-topic/add-edit-topic.component.html deleted file mode 100644 index 4229a8f53..000000000 --- a/src/app/administration/topics/add-edit-topic/add-edit-topic.component.html +++ /dev/null @@ -1,75 +0,0 @@ -
- - - - - - - -
\ No newline at end of file diff --git a/src/app/administration/topics/add-edit-topic/add-edit-topic.component.scss b/src/app/administration/topics/add-edit-topic/add-edit-topic.component.scss deleted file mode 100644 index 3ae7929e7..000000000 --- a/src/app/administration/topics/add-edit-topic/add-edit-topic.component.scss +++ /dev/null @@ -1,94 +0,0 @@ -@import "~assets/styles/base/base.scss"; - -.day-calculator-modal { - position: relative; - border-radius: 0.3rem; - background: #ffffff; /* Old browsers */ - width: 100%; -} - -@media (min-width: 768px) { - .day-calculator-modal { - padding: 1rem; - background: #ffffff; /* Old browsers */ - } -} - -h2 { - margin-bottom: 2rem; - letter-spacing: -0.04rem; - font-weight: 600; -} - -label { - margin-bottom: 0.5rem; - color: #171717; - font-size: 1rem; - font-weight: 600; -} - -input { - height: 2.75rem; - font-size: 1rem; -} - -.close-btn { - position: absolute; - top: 1.25rem; - right: 1.25rem; -} - -.intro-text { - margin-bottom: 2rem; -} - -.form-btns { - margin-bottom: 2.5rem; -} - -@media (max-width: 767px) { - h2 { - margin-right: 3rem; - margin-bottom: 1.5rem; - line-height: 1.75rem; - font-size: 1.75rem; - } - - p, label { - line-height: 1.25rem; - font-size: 0.9375rem; - } - - .close-btn { - right: 1rem; - } - - .form-btns { - margin-bottom: 1.5rem; - } -} - -.explore-btn { - padding: 0; - border-width: 0; - font-size: inherit; - font-weight: 600; - vertical-align: inherit; -} - -button.calendar, button.calendar:active { - width: 2.75rem; - background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACIAAAAcCAYAAAAEN20fAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAOxAAADsQBlSsOGwAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAEUSURBVEiJ7ZQxToVAEIY/YCHGxN6XGOIpnpaEsBSeQC9ArZbm9TZ6ADyBNzAhQGGl8Riv4BLAWAgmkpBYkH1b8FWT2WK/zJ8ZJ4qiI6XUI3ANnGKWBnht2/ZBDRK3hgVGNsCd7/ui+JkEIrKtqurLpEWaphd933+IyI3LEIdpCYCiKD6HcuOa/nwOa0ScJEnk0BJg0UTUWJRl6RxCYEzEmomsIlPU3IPW+grIAbquy+q6fluy/28RIBeRMwDXdXMgXLj/B2uimRXpui4D9sBeRLKl+1N+L+t6RwbWrZliTTTr1oxYtzVWiTQAcRxvTX+eJMnlUDaO1vpZRO5NS0x48sIwfPc87xg4B04MCzQi8hIEwe4bl1DnFMCN2zsAAAAASUVORK5CYII=') !important; - background-repeat: no-repeat; - background-size: 23px; - background-position: center; -} - -.input-group { - margin-bottom: 30px; -} - -.hide-show { - color: blue; - cursor: pointer; -} diff --git a/src/app/administration/topics/add-edit-topic/add-edit-topic.component.ts b/src/app/administration/topics/add-edit-topic/add-edit-topic.component.ts deleted file mode 100644 index 11be19e8b..000000000 --- a/src/app/administration/topics/add-edit-topic/add-edit-topic.component.ts +++ /dev/null @@ -1,93 +0,0 @@ -import { Component, OnInit, Input, OnDestroy } from '@angular/core'; -import { DialogComponent, DialogService } from 'ng2-bootstrap-modal'; -import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; - -import { Topic } from 'app/models/topic'; -import { TopicService } from 'app/services/topic.service'; -import { Subject } from 'rxjs/Subject'; - -export interface DataModel { - title: string; - message: string; - model: Topic; -} - -@Component({ - templateUrl: './add-edit-topic.component.html', - styleUrls: ['./add-edit-topic.component.scss'] -}) - -// NOTE: dialog components must not implement OnDestroy -// otherwise they don't return a result -export class AddEditTopicComponent extends DialogComponent implements DataModel, OnInit, OnDestroy { - @Input() model: Topic; - title: string; - message: string; - topic: Topic; - isNew: boolean; - networkMsg: string; - - private ngUnsubscribe: Subject = new Subject(); - - constructor(dialogService: DialogService, - public activeModal: NgbActiveModal, // also used in template - private topicService: TopicService) { - super(dialogService); - } - - ngOnInit() { - if (this.model === undefined) { - this.isNew = true; - } else { - this.isNew = false; - } - this.topic = new Topic(this.model); - } - - public cancelVC() { - this.activeModal.close({ - isSaved: false, - newTopic: null - }); - } - saveVC() { - this.networkMsg = ''; - if (this.isNew) { - this.topicService.add(this.topic) - .subscribe( - () => { - this.result = true; - this.isNew = false; - this.activeModal.close({ - isSaved: true, - newTopic: this.topic - }); - }, - error => { - console.log('error =', error); - this.networkMsg = error; - }); - } else { - this.topicService.save(this.topic) - .takeUntil(this.ngUnsubscribe) - .subscribe( - () => { - this.result = true; - this.isNew = false; - this.activeModal.close({ - isSaved: true, - newTopic: this.topic - }); - }, - error => { - console.log('error =', error); - this.networkMsg = error; - }); - } - } - - ngOnDestroy() { - this.ngUnsubscribe.next(); - this.ngUnsubscribe.complete(); - } -} diff --git a/src/app/administration/topics/topic-table-rows/topic-table-rows.component.html b/src/app/administration/topics/topic-table-rows/topic-table-rows.component.html deleted file mode 100644 index 98d1f140d..000000000 --- a/src/app/administration/topics/topic-table-rows/topic-table-rows.component.html +++ /dev/null @@ -1,11 +0,0 @@ - - {{topic.name}} - {{topic.description}} - {{topic.type}} - {{topic.pillar}} - - - - - diff --git a/src/app/administration/topics/topic-table-rows/topic-table-rows.component.scss b/src/app/administration/topics/topic-table-rows/topic-table-rows.component.scss deleted file mode 100644 index 9c88e3849..000000000 --- a/src/app/administration/topics/topic-table-rows/topic-table-rows.component.scss +++ /dev/null @@ -1,6 +0,0 @@ -@import "assets/styles/base/base.scss"; - -tr:hover { - // cursor: pointer; - background-color: #e2f1ff; -} diff --git a/src/app/administration/topics/topic-table-rows/topic-table-rows.component.ts b/src/app/administration/topics/topic-table-rows/topic-table-rows.component.ts deleted file mode 100644 index 246b18b5b..000000000 --- a/src/app/administration/topics/topic-table-rows/topic-table-rows.component.ts +++ /dev/null @@ -1,119 +0,0 @@ -import { Component, Input, OnInit, ChangeDetectorRef, OnDestroy } from '@angular/core'; - -import { TableComponent } from 'app/shared/components/table-template/table.component'; -import { TableObject } from 'app/shared/components/table-template/table-object'; -import { ConfirmComponent } from 'app/confirm/confirm.component'; -import { AddEditTopicComponent } from '../add-edit-topic/add-edit-topic.component'; -import { DialogService } from 'ng2-bootstrap-modal'; -import { Subject } from 'rxjs'; -import { TopicService } from 'app/services/topic.service'; -import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; - -@Component({ - selector: 'tbody[app-topic-table-rows]', - templateUrl: './topic-table-rows.component.html', - styleUrls: ['./topic-table-rows.component.scss'] -}) - -export class TopicTableRowsComponent implements OnInit, OnDestroy, TableComponent { - @Input() data: TableObject; - @Input() columnData: Array; - @Input() smallTable: boolean; - - public topics: any; - public paginationData: any; - public dropdownItems = ['Edit', 'Delete']; - public columns: any; - public useSmallTable: boolean; - - private ngUnsubscribe: Subject = new Subject(); - - constructor( - private changeDetectorRef: ChangeDetectorRef, - private dialogService: DialogService, - private modalService: NgbModal, - private topicService: TopicService, - ) { } - - ngOnInit() { - this.topics = this.data.data; - this.paginationData = this.data.paginationData; - this.columns = this.columnData; - this.useSmallTable = this.smallTable; - } - - deleteTopic(topic) { - this.dialogService.addDialog(ConfirmComponent, - { - title: 'Delete Valued Component', - message: 'Click OK to delete this Topic or Cancel to return to the list.', - okOnly: true, - }, { - backdropColor: 'rgba(0, 0, 0, 0.5)' - }) - .takeUntil(this.ngUnsubscribe) - .subscribe( - isConfirmed => { - if (isConfirmed) { - // Delete the VC - this.topicService.delete(topic) - .subscribe( - () => { - this.topics.splice(this.topics.indexOf(topic), 1); - this.changeDetectorRef.detectChanges(); - }, - error => { - console.log('error =', error); - }); - } - } - ); - } - - editTopic(topic) { - let dlg = this.modalService.open(AddEditTopicComponent, { backdrop: 'static', windowClass: 'day-calculator-modal' }); - dlg.componentInstance.model = topic; - dlg.result.then(result => { - if (result.isSaved) { - let newTopicArray = []; - this.topics.filter(x => { - if (x._id === result.newTopic._id) { - newTopicArray.push({ - description: result.newTopic.description, - name: result.newTopic.name, - pillar: result.newTopic.pillar, - type: result.newTopic.type, - _id: result.newTopic._id - }); - } else { - newTopicArray.push(x); - } - this.topics = newTopicArray; - this.changeDetectorRef.detectChanges(); - }); - } - }); - return; - } - - selectItem(item, topic) { - switch (item) { - case 'Edit': { - this.editTopic(topic); - break; - } - case 'Delete': { - this.deleteTopic(topic); - break; - } - default: { - break; - } - } - } - - ngOnDestroy() { - this.ngUnsubscribe.next(); - this.ngUnsubscribe.complete(); - } -} diff --git a/src/app/administration/topics/topics-resolver.services.ts b/src/app/administration/topics/topics-resolver.services.ts deleted file mode 100644 index 544e0567c..000000000 --- a/src/app/administration/topics/topics-resolver.services.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Resolve, ActivatedRouteSnapshot } from '@angular/router'; -import { Observable } from 'rxjs/Observable'; - -import { TopicService } from 'app/services/topic.service'; -import { TableTemplateUtils } from 'app/shared/utils/table-template-utils'; - -@Injectable() -export class TopicsResolver implements Resolve { - - constructor( - private topicService: TopicService, - private tableTemplateUtils: TableTemplateUtils, - ) { } - - resolve(route: ActivatedRouteSnapshot): Observable { - let tableParams = this.tableTemplateUtils.getParamsFromUrl(route.params); - return this.topicService.getAllTopics(tableParams.currentPage, tableParams.pageSize, tableParams.sortBy); - } -} diff --git a/src/app/administration/topics/topics.component.html b/src/app/administration/topics/topics.component.html deleted file mode 100644 index 50f261976..000000000 --- a/src/app/administration/topics/topics.component.html +++ /dev/null @@ -1,20 +0,0 @@ - -
-
-
-
-
- - -
-
- There are no topics. -
-
\ No newline at end of file diff --git a/src/app/administration/topics/topics.component.scss b/src/app/administration/topics/topics.component.scss deleted file mode 100644 index 082b8bf85..000000000 --- a/src/app/administration/topics/topics.component.scss +++ /dev/null @@ -1,10 +0,0 @@ -@import "~assets/styles/base/base.scss"; - -.clickable-row { - cursor: pointer; -} - -.create-button { - margin-top: 3.5rem; - float: right; -} diff --git a/src/app/administration/topics/topics.component.ts b/src/app/administration/topics/topics.component.ts deleted file mode 100644 index f4b30c31f..000000000 --- a/src/app/administration/topics/topics.component.ts +++ /dev/null @@ -1,161 +0,0 @@ -import { ChangeDetectorRef, ChangeDetectionStrategy, Component, OnInit, OnDestroy } from '@angular/core'; -import { ActivatedRoute, Router } from '@angular/router'; -import { Subject } from 'rxjs/Subject'; -import 'rxjs/add/operator/takeUntil'; -import * as _ from 'lodash'; -import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; - -import { TopicService } from 'app/services/topic.service'; - -import { TopicTableRowsComponent } from './topic-table-rows/topic-table-rows.component'; -import { AddEditTopicComponent } from './add-edit-topic/add-edit-topic.component'; - -import { Topic } from 'app/models/topic'; -import { TableObject } from 'app/shared/components/table-template/table-object'; -import { TableParamsObject } from 'app/shared/components/table-template/table-params-object'; - -import { TableTemplateUtils } from 'app/shared/utils/table-template-utils'; - -@Component({ - selector: 'app-users', - templateUrl: './topics.component.html', - styleUrls: ['./topics.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush -}) - -export class TopicsComponent implements OnInit, OnDestroy { - public topics: Array; - public loading = true; - - public topicTableData: TableObject; - public topicTableColumns: any[] = [ - { - name: 'Name', - value: 'name', - width: '30%' - }, - { - name: 'Description', - value: 'description', - width: '20%' - }, - { - name: 'Type', - value: 'type', - width: '20%' - }, - { - name: 'Pillar', - value: 'pillar', - width: '20%' - }, - { - name: 'Action', - value: 'null', - width: '10%', - nosort: true - } - ]; - - public tableParams: TableParamsObject = new TableParamsObject(); - - private ngUnsubscribe: Subject = new Subject(); - - constructor( - private route: ActivatedRoute, - private topicService: TopicService, - private router: Router, - private modalService: NgbModal, - private tableTemplateUtils: TableTemplateUtils, - private _changeDetectionRef: ChangeDetectorRef - ) { } - - ngOnInit() { - this.route.params.subscribe(params => { - this.tableParams = this.tableTemplateUtils.getParamsFromUrl(params); - - this.route.data - .takeUntil(this.ngUnsubscribe) - .subscribe((res: any) => { - if (res.topics) { - if (res.topics.data && res.topics.data.length > 0) { - this.tableParams.totalListItems = res.topics.totalCount; - this.topics = res.topics.data; - } else { - this.tableParams.totalListItems = 0; - this.topics = []; - } - this.setTopicRowData(); - this.loading = false; - this._changeDetectionRef.detectChanges(); - } else { - alert('Uh-oh, couldn\'t load topics'); - // project not found --> navigate back to search - this.router.navigate(['/search']); - } - }); - }); - } - - setTopicRowData() { - let topicList = []; - this.topics.forEach(topic => { - topicList.push( - { - name: topic.name, - description: topic.description, - type: topic.type, - pillar: topic.pillar, - _id: topic._id - } - ); - }); - this.topicTableData = new TableObject( - TopicTableRowsComponent, - topicList, - this.tableParams - ); - } - - setColumnSort(column) { - if (this.tableParams.sortBy.charAt(0) === '+') { - this.tableParams.sortBy = '-' + column; - } else { - this.tableParams.sortBy = '+' + column; - } - this.getPaginatedTopics(this.tableParams.currentPage); - } - - getPaginatedTopics(pageNumber) { - // Go to top of page after clicking to a different page. - window.scrollTo(0, 0); - this.loading = true; - - this.tableParams = this.tableTemplateUtils.updateTableParams(this.tableParams, pageNumber, this.tableParams.sortBy); - - this.topicService.getAllTopics(pageNumber, this.tableParams.pageSize, this.tableParams.sortBy) - .takeUntil(this.ngUnsubscribe) - .subscribe((res: any) => { - this.tableParams.totalListItems = res.totalCount; - this.topics = res.data; - this.tableTemplateUtils.updateUrl(this.tableParams.sortBy, this.tableParams.currentPage, this.tableParams.pageSize); - this.setTopicRowData(); - this.loading = false; - this._changeDetectionRef.detectChanges(); - }); - } - - addTopic() { - let dlg = this.modalService.open(AddEditTopicComponent, { backdrop: 'static', windowClass: 'day-calculator-modal' }); - dlg.result.then(result => { - if (result.isSaved) { - this.getPaginatedTopics(this.tableParams.currentPage); - } - }); - } - - ngOnDestroy() { - this.ngUnsubscribe.next(); - this.ngUnsubscribe.complete(); - } -} diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index d16cbda76..d67935b2a 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -5,8 +5,6 @@ import { AddEditContactComponent } from './contacts/add-edit-contact/add-edit-co import { LoginComponent } from './login/login.component'; import { NotAuthorizedComponent } from './not-authorized/not-authorized.component'; import { SearchComponent } from './search/search.component'; -import { AdministrationComponent } from './administration/administration.component'; -import { TopicsComponent } from './administration/topics/topics.component'; import { MapComponent } from './map/map.component'; import { MetricsComponent } from './metrics/metrics.component'; import { ContactsComponent } from './contacts/contacts.component'; @@ -16,7 +14,6 @@ import { ContactsResolver } from './contacts/contacts-resolver.service'; import { ActivityComponentResolver } from './activity/activity-component-resolver.services'; import { CanDeactivateGuard } from 'app/services/can-deactivate-guard.service'; import { AddEditActivityComponent } from './activity/add-edit-activity/add-edit-activity.component'; -import { TopicsResolver } from './administration/topics/topics-resolver.services'; import { PinsGlobalComponentResolver } from './project/pins-list/pins-global-resolver.service'; import { ProjectGroupResolver } from './project/project-groups/project-group-resolver.services'; import { ProjectContactsGroupResolver } from './project/project-groups/project-contact-group-resolver.services'; @@ -41,11 +38,6 @@ const routes: Routes = [ path: 'login', component: LoginComponent }, - { - path: 'administration', - component: AdministrationComponent, - canActivate: [AuthGuard], - }, { path: 'o/:orgId/edit', component: AddEditOrganizationComponent, @@ -83,14 +75,6 @@ const routes: Routes = [ organizations: LinkOrganizationResolver } }, - { - path: 'administration/topics', - component: TopicsComponent, - canActivate: [AuthGuard], - resolve: { - topics: TopicsResolver - } - }, { path: 'not-authorized', component: NotAuthorizedComponent @@ -250,7 +234,6 @@ const routes: Routes = [ PinsGlobalComponentResolver, ProjectContactsGroupResolver, ProjectGroupResolver, - TopicsResolver, ProjectNotificationDocumentsResolver, AuthGuard, ] diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 663055305..c736a7d59 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -18,7 +18,6 @@ import { SharedModule } from './shared/shared.module'; import { EditorModule } from '@tinymce/tinymce-angular'; // components -import { AdministrationComponent } from 'app/administration/administration.component'; import { AppComponent } from 'app/app.component'; import { AddCommentComponent } from 'app/comment-period/add-comment/add-comment.component'; import { AddDocumentTableRowsComponent } from 'app/comment-periods/add-edit-comment-period/add-documents/add-document-table-rows/add-document-table-rows.component'; @@ -42,7 +41,6 @@ import { ReviewCommentsTabComponent } from 'app/comment-period/review-comments-t import { ReviewCommentsTabTableRowsComponent } from 'app/comment-period/review-comments-tab/review-comments-tab-table-rows/review-comments-tab-table-rows.component'; import { SearchComponent } from 'app/search/search.component'; import { SidebarComponent } from 'app/sidebar/sidebar.component'; -import { TopicsComponent } from 'app/administration/topics/topics.component'; import { UploadComponent } from 'app/project/project-documents/upload/upload.component'; // services @@ -57,17 +55,14 @@ import { KeycloakService } from 'app/services/keycloak.service'; import { ProjectService } from 'app/services/project.service'; import { SearchService } from 'app/services/search.service'; import { UserService } from 'app/services/user.service'; -import { TopicService } from 'app/services/topic.service'; import { SideBarService } from 'app/services/sidebar.service'; // feature modules import { TokenInterceptor } from 'app/shared/utils/token-interceptor'; import { DayCalculatorModalComponent } from './day-calculator-modal/day-calculator-modal.component'; -import { AddEditTopicComponent } from 'app/administration/topics/add-edit-topic/add-edit-topic.component'; import { MapComponent } from './map/map.component'; import { MetricsComponent } from './metrics/metrics.component'; import { ActivityComponent } from './activity/activity.component'; -import { TopicTableRowsComponent } from './administration/topics/topic-table-rows/topic-table-rows.component'; import { ContactsComponent } from './contacts/contacts.component'; import { UserTableRowsComponent } from './contacts/user-table-rows/user-table-rows.component'; import { ActivityTableRowsComponent } from 'app/activity/activity-table-rows/activity-table-rows.component'; @@ -114,9 +109,7 @@ export function initConfig(configService: ConfigService, keycloakService: Keyclo AddEditContactComponent, AddEditProjectNotificationComponent, AddEditOrganizationComponent, - AddEditTopicComponent, AddLabelComponent, - AdministrationComponent, AppComponent, CommentPeriodComponent, CommentPeriodDetailsTabComponent, @@ -149,8 +142,6 @@ export function initConfig(configService: ConfigService, keycloakService: Keyclo SearchHelpComponent, SidebarComponent, ToggleButtonComponent, - TopicsComponent, - TopicTableRowsComponent, UploadComponent, UserTableRowsComponent ], @@ -200,7 +191,6 @@ export function initConfig(configService: ConfigService, keycloakService: Keyclo RecentActivityService, SearchService, SideBarService, - TopicService, UserService ], entryComponents: [ @@ -210,7 +200,6 @@ export function initConfig(configService: ConfigService, keycloakService: Keyclo AddEditActivityComponent, AddEditContactComponent, AddEditOrganizationComponent, - AddEditTopicComponent, CommentPeriodComponent, CommentPeriodsComponent, CommentPeriodsTableRowsComponent, @@ -226,7 +215,6 @@ export function initConfig(configService: ConfigService, keycloakService: Keyclo OrganizationsTableRowsComponent, PinsTableRowsComponent, ReviewCommentsTabTableRowsComponent, - TopicTableRowsComponent, UploadComponent, UserTableRowsComponent ], diff --git a/src/app/services/topic.service.ts b/src/app/services/topic.service.ts deleted file mode 100644 index dbd43157d..000000000 --- a/src/app/services/topic.service.ts +++ /dev/null @@ -1,63 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Observable } from 'rxjs/Observable'; -import 'rxjs/add/operator/mergeMap'; -import 'rxjs/add/operator/map'; -import 'rxjs/add/operator/catch'; -import * as _ from 'lodash'; - -import { ApiService } from './api'; -import { Topic } from 'app/models/topic'; - -@Injectable() -export class TopicService { - - readonly accepted = 'Accepted'; - readonly pending = 'Pending'; - readonly rejected = 'Rejected'; - - constructor( - private api: ApiService, - ) { } - - // get all topics - getAllTopics(pageNum: number = 1, pageSize: number = 10000, sortBy: string = null): Observable { - return this.api.getTopics(pageNum, pageSize, sortBy) - .map((res: Array) => { - if (res.length) { - let topics: Array = []; - res[0].results.forEach(topic => { - topics.push(new Topic(topic)); - }); - return { totalCount: res[0].total_items, data: topics }; - } - return {}; - }) - .catch(error => this.api.handleError(error)); - } - - add(orig: Topic): Observable { - // make a (deep) copy of the passed-in topic so we don't change it - const topic = _.cloneDeep(orig); - - // ID must not exist on POST - delete topic._id; - return this.api.addTopic(topic) - .catch(error => this.api.handleError(error)); - } - - save(orig: Topic): Observable { - // make a (deep) copy of the passed-in topic so we don't change it - const topic = _.cloneDeep(orig); - - return this.api.saveTopic(topic) - .catch(error => this.api.handleError(error)); - } - - delete(orig: Topic): Observable { - // make a (deep) copy of the passed-in topic so we don't change it - const topic = _.cloneDeep(orig); - - return this.api.deleteTopic(topic) - .catch(error => this.api.handleError(error)); - } -} diff --git a/src/app/sidebar/sidebar.component.html b/src/app/sidebar/sidebar.component.html index 13de47146..40c7f44f2 100644 --- a/src/app/sidebar/sidebar.component.html +++ b/src/app/sidebar/sidebar.component.html @@ -21,7 +21,6 @@ notifications_activeActivity Posts contactsContacts businessOrganizations - settingsSettings chrome_reader_modeE-Guide