From fe85ef3cb9c9774c6819e8d8d0f233ab33e4042e Mon Sep 17 00:00:00 2001 From: sergeybodin Date: Thu, 21 Sep 2023 12:27:21 +0300 Subject: [PATCH] master --- .../companies/company/company.component.ts | 6 ---- .../layout/header/header.component.html | 10 +++---- .../layout/header/header.component.ts | 25 +++++++++++++---- .../homepage-portfolio.component.html | 2 +- .../pages/menu/pages-menu.component.html | 10 +++++-- .../pages/menu/pages-menu.component.ts | 13 +++++++-- .../list/member-section-list.component.html | 6 ++-- .../list/member-section-list.component.ts | 28 ++++++++----------- .../tree/item/pages-tree-item.component.html | 5 +--- .../tree/item/pages-tree-item.component.ts | 20 ++++++------- .../pages/tree/pages-tree.component.scss | 8 ++---- .../pages/tree/pages-tree.component.ts | 1 + .../publications/list/list.component.scss | 1 + src/environments/environment.ts | 2 +- 14 files changed, 75 insertions(+), 62 deletions(-) diff --git a/src/app/_modules/companies/company/company.component.ts b/src/app/_modules/companies/company/company.component.ts index c6feb7f..57c7c0e 100644 --- a/src/app/_modules/companies/company/company.component.ts +++ b/src/app/_modules/companies/company/company.component.ts @@ -12,12 +12,6 @@ export class CompanyComponent { constructor(private formsService: FormsService) { } - ngOnInit() { - - } - - ngOnDestroy() { - } get logo() { return this.company?.logo?.data.links?.full; diff --git a/src/app/_modules/layout/header/header.component.html b/src/app/_modules/layout/header/header.component.html index 23eaeb6..686199b 100644 --- a/src/app/_modules/layout/header/header.component.html +++ b/src/app/_modules/layout/header/header.component.html @@ -1,6 +1,5 @@ -
+
- @@ -8,7 +7,7 @@ - +
@@ -20,7 +19,6 @@
-
@@ -28,9 +26,9 @@ АИС СЦ ВНИИГАЗ -
+
-
+
diff --git a/src/app/_modules/layout/header/header.component.ts b/src/app/_modules/layout/header/header.component.ts index f79c875..a85d630 100644 --- a/src/app/_modules/layout/header/header.component.ts +++ b/src/app/_modules/layout/header/header.component.ts @@ -14,26 +14,41 @@ export class HeaderComponent { public user: any; public loading: boolean = false; public error: string = ''; - subscription: Subscription; + subscriptionUser: Subscription; showBottom = false; - constructor(private router: Router, private pagesService: PagesService, public authenticationService: AuthenticationService, private listsService: ListsService) { - this.subscription = this.authenticationService.user.subscribe(user => { + controlsSubscriptionMenu: Subscription; + resultSubscriptionMenu: Subscription; + + constructor( + private router: Router, + private pagesService: PagesService, + public authenticationService: AuthenticationService, + private listsService: ListsService + ) { + this.subscriptionUser = this.authenticationService.user.subscribe(user => { this.user = user; }); } ngOnInit() { - this.fetchMenu(); let showSettingSite = localStorage.getItem('showSettingSite'); if (showSettingSite === null || showSettingSite === 'no') { localStorage.setItem('showSettingSite', 'no'); this.listsService.result('showSettingSite').next(false); } + this.controlsSubscriptionMenu = this.listsService.controls('headerMenu').subscribe(controls => { + this.fetchMenu(); + }); + this.resultSubscriptionMenu = this.listsService.result('headerMenu').subscribe(res => { + this.menuItems = res?.data || []; + }); } ngOnDestroy() { - this.subscription?.unsubscribe(); + this.subscriptionUser?.unsubscribe(); + this.controlsSubscriptionMenu?.unsubscribe(); + this.resultSubscriptionMenu?.unsubscribe(); } diff --git a/src/app/_modules/pages/home/portfolio/homepage-portfolio.component.html b/src/app/_modules/pages/home/portfolio/homepage-portfolio.component.html index 38e9033..b3f011e 100644 --- a/src/app/_modules/pages/home/portfolio/homepage-portfolio.component.html +++ b/src/app/_modules/pages/home/portfolio/homepage-portfolio.component.html @@ -3,7 +3,7 @@

Портфолио

- +
diff --git a/src/app/_modules/pages/menu/pages-menu.component.html b/src/app/_modules/pages/menu/pages-menu.component.html index 9fbcbac..5c190b0 100644 --- a/src/app/_modules/pages/menu/pages-menu.component.html +++ b/src/app/_modules/pages/menu/pages-menu.component.html @@ -1,2 +1,8 @@ - + diff --git a/src/app/_modules/pages/menu/pages-menu.component.ts b/src/app/_modules/pages/menu/pages-menu.component.ts index ef7e594..bb403f2 100644 --- a/src/app/_modules/pages/menu/pages-menu.component.ts +++ b/src/app/_modules/pages/menu/pages-menu.component.ts @@ -1,4 +1,7 @@ import {Component, EventEmitter, Input, Output} from '@angular/core'; +import {AdvisoryMembersService} from "@app/_services/advisory-members.service"; +import {ListsService} from "@app/_services"; +import {Subscription} from "rxjs"; @Component({ selector: 'pages-menu', @@ -9,10 +12,15 @@ export class PagesMenuComponent { @Input() items = []; @Output() onSelected = new EventEmitter(); public hidden = false; - private hiddenPages = ['/o-tsentre/protivodeistvie-korruptsii', '/o-tsentre/zashchita-personalnykh-dannykh', '/o-tsentre/okhrana-truda']; + constructor() { + } + + ngOnInit() { + } + get visibleItems() { return this.items.filter(item => { @@ -23,8 +31,8 @@ export class PagesMenuComponent { close() { this.hidden = !this.hidden; - // setTimeout(() => {this.hidden = false;}, 100); } + leave(){ this.hidden = false; } @@ -32,5 +40,4 @@ export class PagesMenuComponent { itemSelect(event:any){ this.onSelected.emit(event); } - } diff --git a/src/app/_modules/pages/sections/types/basic/member/list/member-section-list.component.html b/src/app/_modules/pages/sections/types/basic/member/list/member-section-list.component.html index 67f5ebb..2aaae6e 100644 --- a/src/app/_modules/pages/sections/types/basic/member/list/member-section-list.component.html +++ b/src/app/_modules/pages/sections/types/basic/member/list/member-section-list.component.html @@ -5,7 +5,7 @@
- +
@@ -19,8 +19,8 @@ + +
Подробнее diff --git a/src/app/_modules/pages/sections/types/basic/member/list/member-section-list.component.ts b/src/app/_modules/pages/sections/types/basic/member/list/member-section-list.component.ts index da10129..912b317 100644 --- a/src/app/_modules/pages/sections/types/basic/member/list/member-section-list.component.ts +++ b/src/app/_modules/pages/sections/types/basic/member/list/member-section-list.component.ts @@ -21,21 +21,17 @@ export class MemberSectionListComponent { ngOnInit() { } - // - // - - getFields(member){ - - let fields:any = {}; - member.groups.data.forEach(group =>{ - group.fields.data.forEach(field =>{ - if(field.name&&field?.value?.data[0]){ - - fields[field.name] = field?.value?.data[0] - } - }) + getFields(member) { + let fields: any = {}; + member.groups.data.forEach(group => { + group.fields.data.forEach(field => { + if (field.name && field?.value?.data[0]) { + fields[field.name] = field?.value?.data[0] + } }) - return fields + }) + console.log(fields['member-doc'].links.download); + return fields } @@ -55,7 +51,7 @@ export class MemberSectionListComponent { return this.section.id; } - iconUrl(name:string){ + iconUrl(name: string) { return `url(/assets/images/icons/document/${name.toUpperCase()}.svg)` } @@ -67,7 +63,7 @@ export class MemberSectionListComponent { add() { - let attach = {modelType: 'object', group: 'sections', modelId: this.section.id, ord: this.ord}; + let attach = {modelType: 'object', group: 'sections', modelId: this.section.id, ord: this.ord}; this.formsService.createObject('page-section-list-member', {extraProps: {attach: attach}}); } diff --git a/src/app/_modules/pages/tree/item/pages-tree-item.component.html b/src/app/_modules/pages/tree/item/pages-tree-item.component.html index 16e29d3..3fc4249 100644 --- a/src/app/_modules/pages/tree/item/pages-tree-item.component.html +++ b/src/app/_modules/pages/tree/item/pages-tree-item.component.html @@ -7,10 +7,7 @@ {{noLogoLetters}}
- +

diff --git a/src/app/_modules/pages/tree/item/pages-tree-item.component.ts b/src/app/_modules/pages/tree/item/pages-tree-item.component.ts index ce9e81f..c9b2c44 100644 --- a/src/app/_modules/pages/tree/item/pages-tree-item.component.ts +++ b/src/app/_modules/pages/tree/item/pages-tree-item.component.ts @@ -19,9 +19,17 @@ export class PagesTreeItemComponent { constructor(private router: Router, private pagesService: PagesService, private formsService: FormsService, private listsService: ListsService) { } + ngOnInit() { + this.subscription = this.listsService.controls(this.listId).subscribe(res => { + if (this.touched) this.fetch(); + }); + } + + get listId() { return this.page.id; } + get parentListId() { return this.parent?.id || 'pages-tree-root'; } @@ -29,21 +37,16 @@ export class PagesTreeItemComponent { get logo() { return this.page?.logo?.data.links?.full; } + get noLogoLetters() { return this.page.name.replace(' ', '').slice(0, 2); } + get children() { return this.page.children?.data; } - ngOnInit() { - this.subscription = this.listsService.controls(this.listId).subscribe(res => { - if (this.touched) this.fetch(); - }); - } - - fetch() { let include = ['children.children']; this.pagesService.show(this.page.id, {include: include.join(',')}).subscribe(res => { @@ -66,11 +69,8 @@ export class PagesTreeItemComponent { }); } - toggle() { this.active = !this.active; if (this.active) this.fetch(); } - - } diff --git a/src/app/_modules/pages/tree/pages-tree.component.scss b/src/app/_modules/pages/tree/pages-tree.component.scss index fe3e516..1dfe339 100644 --- a/src/app/_modules/pages/tree/pages-tree.component.scss +++ b/src/app/_modules/pages/tree/pages-tree.component.scss @@ -3,10 +3,10 @@ background-image: url('~src/assets/images/icons/home_page_24dp.svg'); } -.item:not(.home){ +.item:not(.home){ .bar{ padding-left: 50px; - + } .item .bar{ padding-left: 100px; @@ -19,8 +19,6 @@ .item { - - .bar { display: flex; flex-direction: row; @@ -62,7 +60,7 @@ color: #ffffff; span{ display: none; - + } &::before { content: ""; diff --git a/src/app/_modules/pages/tree/pages-tree.component.ts b/src/app/_modules/pages/tree/pages-tree.component.ts index 4141732..c0ef196 100644 --- a/src/app/_modules/pages/tree/pages-tree.component.ts +++ b/src/app/_modules/pages/tree/pages-tree.component.ts @@ -68,6 +68,7 @@ export class PagesTreeComponent { add() { + //this.listsService.result('headerMenu').next(result); this.formsService.createModel('page', null, this.listId); } diff --git a/src/app/_modules/publications/list/list.component.scss b/src/app/_modules/publications/list/list.component.scss index da2f023..f7f6583 100644 --- a/src/app/_modules/publications/list/list.component.scss +++ b/src/app/_modules/publications/list/list.component.scss @@ -14,6 +14,7 @@ padding-left: 8px; &:hover{ color: var(--blue-2); + cursor: pointer; } }; &::before{ diff --git a/src/environments/environment.ts b/src/environments/environment.ts index c8304c4..fb0dc2e 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -6,7 +6,7 @@ export const environment = { production: false, apiUrl: 'http://api.vniigazv2.lc', clientId: 2, - clientSecret: 'XVBDBzHcJu52dGI5qctg8l6aT7Q8Ms9PKiAUHOVp', + clientSecret: 'Z4AOjzV1N676Yvudrm5SfpeFLxh00RigroxaBYCw', }; /*