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WxF,EACZ,EAQYyF,IAAiB,KAAxB,GAAOA,GAAP,KAAOA,EAAiB,GAAA/H,CAAA,CAAAoF,IAAA,UAAAzE,CAAA,aAAAA,CAAA,EAAjBoH,IAAiB,GAAA/H,CAAA,CAAAgI,IAAA,CAAAC,CAAA,EAAAlC,IAAA,CAAjBgC,CAAiB,GAAA/H,CAAA,CAAAkI,IAAA,CAAAC,CAAA,EAAAC,OAAA,EAJtBC,EAAaC,SAAST,EAAM,EAEtBQ,CAAY,IAEpB,GAAON,GAAPQ,QAAOR,EAAiB,MCc9B,GAAaS,KAAU,KAAjB,GAAOA,GAAP,KAAOA,EAAU,GAAAxI,CAAA,CAAAoF,IAAA,UAAAzE,CAAA,aAAAA,CAAA,EAAV6H,IAAU,GAAAxI,CAAA,CAAAgI,IAAA,CAAAC,CAAA,EAAAlC,IAAA,CAAVyC,CAAU,GAAAxI,CAAA,CAAAkI,IAAA,CAAAC,CAAA,EAAAM,SAAA,CALR,CACP/C,EACAC,CAAiB,EACpByC,QAAA,CAXDM,EACAX,GACAY,EACAC,EACAC,EACAC,GACAxG,CAAa,IAOX,GAAOkG,GAAPO,QAAOP,EAAU,aAAAQ,EAAA,IAAAR,UAAA","names":["ɵɵelementStart","ɵɵlistener","ɵɵrestoreView","_r1","ctx_r1","ɵɵnextContext","ɵɵresetView","addNews","ɵɵelement","ɵɵelementEnd","_e","n","e","t","I","_r3","item_r4","$implicit","editNews","deleteNews","s","o","P","i","ɵɵproperty","newsBlock_r5","hovered","newsStatus","includes","newsStatusEnum","portalLevelValidated","ue","ɵɵtemplate","NewsComponent_ng_template_4_card_edit_bar_2_Template","index","index_r6","ɵɵpureFunction1","_c3","ɵɵpureFunction0","_c2","company","slug","ɵɵadvance","_c1","ɵɵpureFunction2","_c0","UserRolesEnum","admin","stand_admin","a","NewsComponent","_a","constructor","standService","router","activatedRoute","lang","newsGql","softDeleteNewsGQL","userService","NewsStatusEnum","isAdimin","ngOnInit","isInRole","getCurrentCompany","pipe","untilDestroyed","subscribe","newsQuery","watch","newsType","NewsTypeEnum","companies","all","companyLevelValidated","unpublished","companyId","_id","currentLanguageCode","first","canonical","__spreadValues","canonicalDefaultUrl","path","appendCompanyMetaTags","RobotsIndexEnum","noindex_follow","item","navigate","relativeTo","mutate","id","update","cache","evict","gc","ɵfac","ɵɵdirectiveInject","StandService","Router","ActivatedRoute","LOCALE_ID","NewsGQL","SoftDeleteNewsGQL","UsersService","ɵcmp","$","type","selectors","standalone","features","ɵɵStandaloneFeature","decls","vars","consts","i18n_0","$localize","ɵɵi18n","NewsComponent_button_2_Template","NewsComponent_ng_template_4_Template","ɵɵtemplateRefExtractor","ctx","newsScrollerTpl_r7","dependencies","RenderIfDirective","MatFabButton","MatIcon","PagedVirtualScrollerComponent","NewsBlockComponent","CardEditBarComponent","styles","encapsulation","changeDetection","__decorate","UntilDestroy","__metadata","String","routes","component","NewsRoutingModule","ɵmod","S","ɵinj","f","imports","RouterModule","forChild","_NewsRoutingModule","NewsModule","providers","CommonModule","PagedVirtualScrollerModule","MatButtonModule","MatIconModule","NewsBlockModule","_NewsModule","it"],"ignoreList":[],"sources":["src/app/stand/pages/news/news.component.html","src/app/stand/pages/news/news.component.ts","src/app/stand/pages/news/news-routing.module.ts","src/app/stand/pages/news/news.module.ts"],"sourcesContent":["
News
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n\r\n","import { UsersService } from '@shared/services/users/users.service';\r\nimport {\r\n Component,\r\n OnInit,\r\n ViewEncapsulation,\r\n ChangeDetectionStrategy,\r\n LOCALE_ID,\r\n Inject\r\n} from '@angular/core';\r\nimport { StandService } from 'app/stand/stand.service';\r\nimport { QueryRef } from 'apollo-angular';\r\nimport { ActivatedRoute, Router } from '@angular/router';\r\nimport { INews } from '@collections/news/interfaces/news.interface';\r\nimport { UserRolesEnum } from '@collections/users/enums/user-roles.enums';\r\nimport { NewsGQL, NewsResponse } from '@shared/services/news/news.gql.service';\r\nimport { NewsStatusEnum, NewsTypeEnum } from '@collections/news/enums/news.enums';\r\nimport { StandLayoutEnum } from '../../stand.enums';\r\nimport { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';\r\nimport { SoftDeleteNewsGQL } from '@shared/services/news/news-soft-delete.gql.service';\r\nimport { ICompany } from '@collections/companies/interfaces/company.interface';\r\nimport { RobotsIndexEnum } from 'app/shared/services/meta-data-service/meta-data.commons';\r\nimport { CardEditBarComponent } from '../../../shared/components/card-edit-bar/card-edit-bar.component';\r\nimport { NewsBlockComponent } from '../../../news/views/news-block/news-block.component';\r\nimport { PagedVirtualScrollerComponent } from '../../../shared/components/paged-virtual-scroller/paged-virtual-scroller.component';\r\nimport { MatIcon } from '@angular/material/icon';\r\nimport { MatFabButton } from '@angular/material/button';\r\nimport { RenderIfDirective } from '../../../shared/directives/render-if.directive';\r\n@UntilDestroy()\r\n@Component({\r\n selector: 'stand-news',\r\n templateUrl: './news.component.html',\r\n styleUrls: ['./news.component.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n standalone: true,\r\n imports: [\r\n RenderIfDirective,\r\n MatFabButton,\r\n MatIcon,\r\n PagedVirtualScrollerComponent,\r\n NewsBlockComponent,\r\n CardEditBarComponent,\r\n ],\r\n})\r\nexport class NewsComponent implements OnInit {\r\n newsQuery: QueryRef;\r\n UserRolesEnum = UserRolesEnum;\r\n newsStatusEnum = NewsStatusEnum;\r\n isAdimin = false;\r\n company: ICompany;\r\n\r\n constructor(\r\n private standService: StandService,\r\n private router: Router,\r\n private activatedRoute: ActivatedRoute,\r\n @Inject(LOCALE_ID) private lang: string,\r\n private newsGql: NewsGQL,\r\n private softDeleteNewsGQL: SoftDeleteNewsGQL,\r\n private userService: UsersService\r\n ) {\r\n\r\n }\r\n\r\n ngOnInit(): void {\r\n this.isAdimin = this.userService.isInRole([UserRolesEnum.admin, UserRolesEnum.stand_admin]);\r\n\r\n this.standService.getCurrentCompany()\r\n .pipe(untilDestroyed(this))\r\n .subscribe( company => {\r\n this.company = company;\r\n this.newsQuery = this.newsGql.watch({\r\n newsType: NewsTypeEnum.companies,\r\n newsStatus: this.isAdimin ? NewsStatusEnum.all : NewsStatusEnum.companyLevelValidated,\r\n unpublished: this.isAdimin,\r\n companyId: company._id,\r\n lang: this.standService.currentLanguageCode,\r\n first: 16\r\n });\r\n // tracking page on analytics browser side and metadata server-side\r\n const canonical = {...this.standService.canonicalDefaultUrl};\r\n canonical.path = canonical.path + '/news';\r\n this.standService.appendCompanyMetaTags(canonical, null, RobotsIndexEnum.noindex_follow);\r\n });\r\n }\r\n\r\n editNews(item: INews): void {\r\n this.router.navigate(['../', 'edit', 'news', this.company._id, this.lang, item._id], { relativeTo: this.activatedRoute });\r\n }\r\n\r\n addNews(): void {\r\n this.router.navigate(['../', 'edit', 'news', this.company._id, this.lang ], { relativeTo: this.activatedRoute });\r\n }\r\n\r\n deleteNews(item: INews): void {\r\n this.softDeleteNewsGQL.mutate({\r\n companyId: this.company._id,\r\n id: item._id\r\n }, {\r\n update(cache): void {\r\n cache.evict({\r\n id: `News:${item._id}`\r\n });\r\n cache.gc();\r\n }\r\n })\r\n .subscribe();\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { Routes, RouterModule } from '@angular/router';\r\nimport { NewsComponent } from './news.component';\r\n\r\nconst routes: Routes = [{\r\n path: '',\r\n component: NewsComponent\r\n}];\r\n\r\n@NgModule({\r\n imports: [\r\n RouterModule.forChild(routes)\r\n ],\r\n exports: [RouterModule]\r\n})\r\nexport class NewsRoutingModule {\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { NewsRoutingModule } from './news-routing.module';\r\nimport { NewsComponent } from './news.component';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { NewsGQL } from '@shared/services/news/news.gql.service';\r\nimport { PagedVirtualScrollerModule } from '@shared/components/paged-virtual-scroller/paged-virtual-scroller.module';\r\n\r\n\r\nimport { NewsBlockModule } from '@news/views/news-block/news-block.module';\r\nimport { SoftDeleteNewsGQL } from '@shared/services/news/news-soft-delete.gql.service';\r\n\r\n\r\n@NgModule({\r\n imports: [\r\n CommonModule,\r\n NewsRoutingModule,\r\n PagedVirtualScrollerModule,\r\n MatButtonModule,\r\n MatIconModule,\r\n NewsBlockModule,\r\n NewsComponent\r\n],\r\n providers: [\r\n NewsGQL,\r\n SoftDeleteNewsGQL\r\n ]\r\n})\r\nexport class NewsModule { }\r\n"]}