How to use sameBucket method in argos

Best JavaScript code snippet using argos

dashboard.component.ts

Source:dashboard.component.ts Github

copy

Full Screen

1import * as _ from 'lodash';2import { Component, OnInit, OnDestroy, ViewChild, ElementRef, ChangeDetectorRef } from '@angular/core';3import { Subscription } from 'rxjs/internal/Subscription';4import { FieldOfPlayService, SolutionService, CompetencyDomainService, SectorService,5 ClientNeedService, ServiceLineService, SubserviceLineService, ServicesService,6 UserService, CountriesService, PermissibilityService, LeftHandFilterService, ConfigItemsService} from '../../../providers/provider.index';7import { PreviewService, SubserviceLineFilter, SubserviceLineOptions, SolutionFilter,8 CompetencyFilter, SectorFilter, ClientFilter, FilterNodeParent, FieldOfPlayFilter } from '../../../models/model.index';9@Component({10 selector: 'app-dashboard',11 templateUrl: './dashboard.component.html',12 styleUrls: ['./dashboard.component.scss'],13 providers: [ServiceLineService]14})15export class DashboardComponent implements OnInit, OnDestroy {16 // Variables of the component17 @ViewChild('sortOptions', {static: false}) sortOptions: ElementRef;18 scrollbarOptions = { axis: 'y', theme: 'minimal'};19 iconArray = [];20 defaultColor = '#2E2E38';21 enableGrid: boolean = false;22 enableLeftHandFilter: boolean = false; // responsive23 enableBucketsLeftHand: Array<string> = [];24 loading: boolean = true;25 loadingResult: boolean = true;26 onlyOneServiceLine: boolean = true; // enable or disable prefix of subservice line - Left-handFilter27 all: number = 0; // counter of request ready28 previosLeftHand: boolean = false;29 previousResult: Array<any> = [];30 extraterritorial: boolean = false;31 stringSearch: string = '';32 country: string = '';33 previousCountry: string = '';34 previousClient: any = {};35 client: any = {};36 selectedssl = [];37 sameBucket: string[] = [];38 sameFilter: boolean;39 // search result items40 result = 0;41 limit = 6;42 sortby: boolean = true;43 // pagination variables44 page = 1;45 pageSize = 12;46 maxPages = 3;47 overWrite = [48 {item: 'ch1', optional: 'Ch1'},49 {item: 'ch1nsa', optional: 'Ch1nsa'},50 {item: 'euAuditedNoValuation', optional: 'EuAuditedNoValuation'},51 {item: 'euaudited', optional: 'Euaudited'},52 {item: 'euAuditedNoValuation', optional: 'EuauditedNoTax'},53 {item: 'eusubject', optional: 'Eusubject'},54 {item: 'otAudited', optional: 'OtAudited'},55 {item: 'otSubject', optional: 'OtSubject'},56 {item: 'secaudited', optional: 'Secaudited'},57 {item: 'secsubject', optional: 'Secsubject'},58 {item: 'ch2', optional: 'Ch2'}59 ];60 moreRestrictive = [61 { value: 'Prohib', ranking: 5},62 { value: 'AA', ranking: 4},63 { value: 'ASTCC', ranking: 3},64 { value: 'Allowed', ranking: 2},65 { value: 'N/A', ranking: 1}];66 FilterTree: FilterNodeParent [];67 resultFilter: PreviewService[] = [];68 enableResultFilter: number = 0;69 resultFilterSL: PreviewService[] = [];70 data: PreviewService[] = [];71 allssl: SubserviceLineFilter[] = [];72 allSolution: SolutionFilter[] = [];73 allCompetency: CompetencyFilter[] = [];74 allFieldofplay: FieldOfPlayFilter[] = [];75 allSector: SectorFilter[] = [];76 allClient: ClientFilter[] = [];77 serviceLineOptions: SubserviceLineOptions[] = [];78 matchFilter: any = {};79 filterNav: any;80 countryList: Array<any> = [];81 allIndependenceSelected = [];82 allIndependenceSelectedString = '';83 // subscription84 subscription: Subscription;85 subscriptionSSL: Subscription;86 subscriptionSolution: Subscription;87 subscriptionCompetency: Subscription;88 subscriptionSector: Subscription;89 subscriptionClient: Subscription;90 subscriptionMatch: Subscription;91 subscriptionFilter: Subscription;92 subscriptionCountry: Subscription;93 subscriptionCountryList: Subscription;94 subscriptionPermissibility: Subscription;95 subscriptionFieldofPlay: Subscription;96 constructor(private serviceLineService: ServiceLineService , private subserviceLineService: SubserviceLineService,97 private solutionsService: SolutionService, private competencyDomainService: CompetencyDomainService,98 private sectorService: SectorService, private clientNeedService: ClientNeedService,99 private servicesService: ServicesService, private userService: UserService,100 private countryService: CountriesService, private permissibilityservice: PermissibilityService,101 private fieldofplayService: FieldOfPlayService, private leftHandService: LeftHandFilterService,102 private configService: ConfigItemsService,103 private cdRef: ChangeDetectorRef104 ) {}105 // hooks106 ngOnInit() {107 this.getServiceLine();108 this.subscriptionFunctions();109 this.getIndependenceRestrictionOption();110 this.FilterTree = this.leftHandService.FilterTree;111 this.countryList = this.countryService.countryList;112 this.data = this.servicesService.services;113 this.allssl = this.subserviceLineService.subserviceline;114 this.allSolution = this.solutionsService.solution;115 this.allCompetency = this.competencyDomainService.competencydomain;116 this.allSector = this.sectorService.sector;117 this.allClient = this.clientNeedService.clientNeed;118 this.allFieldofplay = this.fieldofplayService.fieldofplay;119 this.country = this.userService.selectedcountry;120 this.previousCountry = this.userService.previousselectedcountry;121 if (this.previousCountry === '') {122 this.userService.savePreviousCountry(this.country);123 } else if (this.previousCountry !== this.country) {124 // this.getServices('normal');125 // this.servicesService.fetchAllPermissibility(this.country).subscribe();126 this.userService.savePreviousCountry(this.country);127 }128 // filters129 this.filterNav = this.userService.filter;130 this.client = this.filterNav.client;131 this.previousClient = this.userService.previousselectedclient;132 this.matchFilter = this.servicesService.matchFilter;133 this.allIndependenceSelected = this.servicesService.independencePermissibilityByUser;134 if (this.allssl.length === 0) {135 this.getAllSubserviceLine();136 }137 if (this.allSolution.length === 0) {138 this.getAllSolutions();139 }140 if (this.allFieldofplay.length === 0) {141 this.getAllFieldofPlay();142 }143 if (this.allCompetency.length === 0) {144 this.getAllCompetency();145 }146 if (this.allSector.length === 0) {147 this.getAllSector();148 }149 if (this.allClient.length === 0) {150 this.getAllClientNeeds();151 }152 if (this.countryList.length === 0) {153 this.getCountryList();154 }155 }156 subscriptionFunctions() { // call all subscriptions157 this.subscriptionCountry = this.userService.selectedcountryChanged.subscribe(country => {158 this.loadingResult = true;159 this.country = country;160 this.data = [];161 this.resultFilter = [];162 this.enableResultFilter = 0;163 this.removeMatchFilter();164 this.userService.savePreviousCountry(this.country);165 let tokenOverride = [];166 if (this.filterNav.client.GISId) {167 if (this.filterNav.client.permissibility.length > 0) {168 const override = [];169 _.forOwn(this.filterNav.client.permissibility[0], (value, key) => {170 if (value === 'override') {171 override.push(key);172 }173 });174 tokenOverride = override;175 }176 if (tokenOverride.length > 0) {177 this.extraterritorial = true;178 this.userService.savePreviousClient(this.filterNav.client);179 }180 }181 console.log('token cliente', tokenOverride);182 if (tokenOverride.length > 0) {183 this.getServices('extraterritorial', tokenOverride);184 } else {185 this.getServices('normal');186 this.servicesService.fetchAllPermissibility(country).subscribe();187 }188 });189 this.subscriptionCountryList = this.countryService.countryListChanged190 .subscribe((countries: any[]) => this.countryList = countries );191 this.subscription = this.servicesService.servicesChanged192 .subscribe((services: PreviewService[]) => {193 this.data = services;194 if (this.data && this.data.length > 0 && this.data[0].independenceRestrictions) {195 // console.log('service complete', this.data);196 this.checkFilterItems('subcribe data');197 this.setTotalServiceLineOption();198 }199 return;200 });201 this.subscriptionSSL = this.subserviceLineService.subservicelineChanged202 .subscribe((serviceLine: SubserviceLineFilter[]) => this.allssl = serviceLine);203 this.subscriptionSolution = this.solutionsService.solutionChanged204 .subscribe((solution: SolutionFilter[]) => this.allSolution = solution);205 this.subscriptionCompetency = this.competencyDomainService.competencyChanged206 .subscribe((competency: CompetencyFilter[]) => this.allCompetency = competency);207 this.subscriptionSector = this.sectorService.sectorChanged208 .subscribe((sector: SectorFilter[]) => this.allSector = sector);209 this.subscriptionFieldofPlay = this.fieldofplayService.fieldofplayChanged210 .subscribe((fop: FieldOfPlayFilter[]) => this.allFieldofplay = fop);211 this.subscriptionClient = this.clientNeedService.clientNeedChanged212 .subscribe((client: SectorFilter[]) => this.allClient = client);213 this.subscriptionPermissibility = this.servicesService.independencePermissibilityByUserChanged214 .subscribe((result: any) => {215 console.log('allIndependenceSelected sub', result);216 this.allIndependenceSelected = result;217 if (this.allIndependenceSelected.length > 0) {218 const selectedValues = this.allIndependenceSelected.reduce((value, selectedValue) => { const final = this.iconArray[this.iconArray.map(icon => icon.value).indexOf(selectedValue)].label;219 return value.concat(final); }, [] );220 this.allIndependenceSelectedString = selectedValues.join(', ');221 this.checkFilterItems('permissibility');222 }223 });224 this.subscriptionMatch = this.servicesService.matchFiltertChanged225 .subscribe((res: any) => {226 this.matchFilter = res;227 if (this.matchFilter.word !== '' && this.matchFilter) {228 this.checkFilterItems('subscribe subscriptionMatch');229 }230 });231 this.subscriptionFilter = this.userService.getfilterApp()232 .subscribe(filterData => {233 console.log('subscriptionFilter', filterData);234 this.filterNav = filterData;235 console.log('this.extraterritorial 1111', this.extraterritorial);236 if (this.filterNav.client.GISId) {237 if (!this.client.GISId) {238 let tokenOverride = [];239 if (this.filterNav.client.permissibility.length > 0) {240 const override = [];241 _.forOwn(this.filterNav.client.permissibility[0], (value, key) => {242 if (value === 'override') {243 override.push(key);244 }245 });246 tokenOverride = override;247 }248 if (tokenOverride.length > 0) {249 this.loadingResult = true;250 this.data = [];251 this.resultFilter = [];252 this.enableResultFilter = 0;253 this.extraterritorial = true;254 this.getServices('extraterritorial', tokenOverride);255 }256 this.client = this.filterNav.client;257 this.userService.savePreviousClient(this.client);258 }259 if (!this.matchFilter) {260 this.checkFilterItems('subscriptionFilter !this.matchFilter');261 } else {262 if (this.matchFilter.word === '') {263 this.checkFilterItems('subscriptionFilter !this.matchFilter else');264 }265 }266 } else {267 if (this.filterNav.client.GISId || this.client.GISId) {268 console.log('this.extraterritorial', this.extraterritorial);269 if (this.extraterritorial) {270 console.log('execute 1');271 this.servicesService.fetchAllPermissibility(this.country).subscribe();272 this.extraterritorial = false;273 }274 this.checkFilterItems('subscriptionFilter filterNav remove');275 this.updateCardFilter(this.FilterTree);276 this.orderByServices('asc', 'Service Title');277 this.client = {};278 this.servicesService.removeIndependencePermissibilityByUser();279 }280 }281 } );282 }283 getServiceLine() {284 this.serviceLineService.getServiceLineValues()285 .subscribe((data: SubserviceLineOptions[]) => {286 this.serviceLineOptions = data;287 this.getAdminTable();288 let tokenOverride = [];289 let copytoken = [];290 // console.log('prev', this.previousClient);291 if (this.filterNav.client.GISId) {292 if (this.filterNav.client.permissibility.length > 0) {293 const override = [];294 _.forOwn(this.filterNav.client.permissibility[0], (value, key) => {295 if (value === 'override') {296 override.push(key);297 }298 });299 if (!this.previousClient.GISId) {300 tokenOverride = override;301 } else if (override.length > 0) {302 this.extraterritorial = true;303 }304 copytoken = override;305 }306 307 this.userService.savePreviousClient(this.filterNav.client);308 // console.log('lleno', this.previousClient);309 }310 // console.log('client', this.filterNav.client);311 // console.log('token', tokenOverride);312 if (this.data && this.data.length > 0 && this.data[0].independenceRestrictions && tokenOverride.length === 0) {313 if (this.previousCountry !== this.country) {314 // console.log('token extraterritorial', this.extraterritorial);315 if (this.extraterritorial) {316 // console.log('por aqui this.previousCountry !== this.country tokenoverride 0');317 this.loadingResult = true;318 this.data = [];319 this.resultFilter = [];320 this.enableResultFilter = 0;321 this.extraterritorial = true;322 this.getServices('extraterritorial', copytoken);323 } else {324 this.setTotalServiceLineOption();325 }326 } else {327 // console.log('con data y tokenoverride 0');328 this.setTotalServiceLineOption();329 }330 } else if (this.data && this.data.length > 0 && tokenOverride.length > 0) {331 // console.log('con data y tokenoverride > 0');332 this.loadingResult = true;333 this.data = [];334 this.resultFilter = [];335 this.enableResultFilter = 0;336 this.extraterritorial = true;337 this.getServices('extraterritorial', tokenOverride);338 }339 if (this.data.length === 0 && this.previousCountry === '' && tokenOverride.length === 0) {340 // console.log('if 1', this.extraterritorial);341 this.getServices('normal');342 this.servicesService.fetchAllPermissibility(this.country).subscribe();343 } else if (this.data.length === 0 && this.previousCountry === '' && tokenOverride.length > 0) {344 this.extraterritorial = true;345 // console.log('else if 2', this.extraterritorial);346 this.getServices('extraterritorial', tokenOverride);347 } else {348 this.checkFilterItems('getServiceLine');349 }350 this.validateUploadedInformation();351 });352 }353 getAdminTable() {354 this.configService.fetchAdminTable().subscribe(adminItem => {355 this.serviceLineOptions.filter(op => op.value !== 'All').map(item => {356 const record = adminItem.filter(ele => ele.ServiceLineCode === item.value);357 if (record.length > 0) {358 const options = [];359 _.forOwn(record[0], (value: boolean, key: string) => {360 if (key !== 'Id' && key !== 'ServiceLineCode' && value) {361 options.push(key);362 }363 });364 item.dependency = options;365 }366 });367 if (this.filterNav.serviceLine.length > 0) {368 this.checkAllSLSelectedInHome();369 }370 });371 }372 getShowingItems(totalItems) {373 this.limit = totalItems;374 this.cdRef.detectChanges();375 }376 showPermissibility = (e) => this.servicesService.setPermissibilitySelectedByUser(e);377 removeMatchFilter = () => { // Remove fuzzy filter378 this.servicesService.removeMatchFilter();379 this.removeFilter();380 }381 removeIndepenceRestrictionsFilter = () => { // Remove fuzzy filter382 this.servicesService.removeIndependencePermissibilityByUser();383 this.removeFilter();384 }385 removeFilter(): void {386 this.previousResult = [];387 this.stringSearch = '';388 this.checkFilterItems('remove removeMatchFilter');389 this.updateCardFilter(this.FilterTree);390 }391 displayFilters = () => this.enableLeftHandFilter = !this.enableLeftHandFilter;392 listGridView = () => this.enableGrid = !this.enableGrid;393 validateUploadedInformation() {394 if (this.allClient.length > 0 && this.allCompetency.length > 0 && this.allSector.length > 0395 && this.allSolution.length > 0 && this.allssl.length > 0 && this.allFieldofplay.length > 0) {396 const selectedOptions = this.serviceLineOptions.filter( item => item.selected);397 if (selectedOptions.length === 1 && selectedOptions[0].name === 'All') {398 this.serviceLineOptions.map(item => ({...item, selected: item.name === 'All' ? true : false}));399 this.callFilterByParent(this.serviceLineOptions);400 } else {401 this.onlyOneServiceLine = selectedOptions.length === 1 ? false : true ;402 this.callFilterByParent(selectedOptions);403 }404 this.FilterTree[2].children = this.allSolution;405 this.FilterTree[3].children = this.allFieldofplay;406 this.FilterTree[4].children = this.allSector;407 this.FilterTree[5].children = this.allClient;408 this.loading = false;409 }410 }411 callFilterByParent(parent) {412 this.getSubserviceLineByParent(parent);413 this.getCompetencyDomainByParent(parent);414 }415 orderByServices(order = '', option = '') {416 const priority = this.iconArray.map((e , i: number) => ({name: e.value, value: (i + 1) + e.value}));417 this.sortby = order === '' ? !this.sortby : true;418 const criteria = !this.sortby ? 'desc' : 'asc';419 const optionSelected = this.sortOptions !== undefined && option === '' ? this.sortOptions.nativeElement.value : 'Service Title';420 if (optionSelected === 'Service Title') {421 this.resultFilter = _.orderBy(this.resultFilter, [service => service.Name.toLowerCase()], [criteria]);422 this.enableResultFilter = this.resultFilter.filter(e => !e.disable).length;423 } else {424 if (this.filterNav.client.GISId) {425 this.resultFilter.filter(e => !e.disable).map(e => {426 e.mixRestrictions = '';427 if (e.independenceRestrictions !== undefined) {428 const applicable = [];429 const restrictions = [];430 let highRestriction = '';431 let derogation = 0;432 if (e.independenceRestrictions.ServiceLineCode !== '01' && e.independenceRestrictions.ServiceLineCode !== '03' && e.independenceRestrictions.ServiceLineCode !== null) {433 if (this.filterNav.client.permissibility[0].without && this.filterNav.client.permissibility[0].with) {434 derogation = 0;435 } else if (this.filterNav.client.permissibility[0].without) {436 derogation = 2;437 } else if (this.filterNav.client.permissibility[0].with) {438 derogation = 1;439 }440 }441 _.forOwn(this.filterNav.client.permissibility[0], (value, key) => {442 if ((e.independenceRestrictions.ServiceLineCode === '01' || e.independenceRestrictions.ServiceLineCode === '03') && e.independenceRestrictions.ServiceLineCode !== null ) {443 if ((key === 'eusubject' || key === 'euaudited') && key !== 'euAuditedNoValuation') {444 applicable.push('euaudited');445 } else {446 if (key === 'euAuditedNoValuation' && e.independenceRestrictions.EuAuditedNoValuation === '') {447 applicable.push('eusubject');448 } else {449 if (key !== 'without' && key !== 'with' && key !== 'down') {450 applicable.push(key); // Store column header applicable to the token451 }452 }453 }454 } else {455 if (e.independenceRestrictions.ServiceLineCode !== null) {456 if (key !== 'without' && key !== 'with' && key !== 'down') {457 applicable.push(key);458 }459 }460 }461 });462 if (applicable.length > 0) {463 applicable.map(ele => { // Validate which column is more restrictive464 const options = this.overWrite.filter(i => i.item === ele);465 if (options.length > 0) {466 if (derogation === 0) {467 const result = this.moreRestrictive.filter(i => i.value === e.independenceRestrictions[options[0].optional]);468 if (result.length > 0) { // get the ranking of restriction and store it469 restrictions.push(result[0].ranking);470 }471 } else if (derogation === 1 || derogation === 2) {472 if (derogation === 1 && ele !== 'eusubject') {473 const result = this.moreRestrictive.filter(i => i.value === e.independenceRestrictions[options[0].optional]);474 if (result.length > 0) { // get the ranking of restriction and store it475 restrictions.push(result[0].ranking);476 }477 } else if (derogation === 2 && ele !== 'euaudited') {478 const result = this.moreRestrictive.filter(i => i.value === e.independenceRestrictions[options[0].optional]);479 if (result.length > 0) { // get the ranking of restriction and store it480 restrictions.push(result[0].ranking);481 }482 }483 }484 highRestriction = this.moreRestrictive.filter(item => item.ranking === Math.max(...restrictions)).length > 0 ?485 this.moreRestrictive.filter(item => item.ranking === Math.max(...restrictions))[0].value : '';486 // const item = this.moreRestrictive.filter(i => i.value === e.independenceRestrictions[options[0].optional]);487 // if (item.length > 0) { // get the ranking of restriction and store it488 // restrictions.push(item[0].ranking);489 // }490 const orderIcon = priority.filter( i => i.name === highRestriction);491 if (orderIcon.length > 0) {492 e.mixRestrictions = orderIcon[0].value;493 }494 }495 });496 }497 }498 });499 this.resultFilter = _.orderBy(this.resultFilter, ['mixRestrictions'], [criteria]); // Order by independence restriction label500 this.enableResultFilter = this.resultFilter.filter(item => !item.disable).length;501 }502 }503 }504 getSelectedServiceValues(e) {505 this.cleanExcept('sector');506 this.sameBucket = this.sameBucket.filter((item: any) => item === 'SE');507 const selectedOptions = this.serviceLineOptions // get options selected by the user508 .map( element => ({509 ...element, selected : (element.name === 'All' ? false : (element.name === e.target.id ? e.target.checked : element.selected))510 }))511 .filter( item => item.selected === true);512 if (e.target.id === 'All' || selectedOptions.length === 0) { // if the user selected all or unchecked all options513 this.checkedAllOption(e);514 } else {515 this.uncheckedAllOption(e);516 }517 this.enableBucketsLeftHand = [];518 this.serviceLineOptions.filter(i => i.selected && i.value !== 'All').map(ele => {519 this.enableBucketsLeftHand = _.union(this.enableBucketsLeftHand, ele.dependency);520 });521 this.userService.saveSlFilter(this.serviceLineOptions.filter(i => i.selected ));522 this.onlyOneServiceLine = this.serviceLineOptions.filter(i => i.selected && i.prefix !== 'All').length === 1 ? false : true;523 this.checkFilterItems('getSelectedServiceValues');524 }525 checkedAllOption(e) {526 this.serviceLineOptions = this.serviceLineOptions527 .map (elem => ({...elem, selected: elem.name !== 'All' ? false : true }));528 this.callFilterByParent(this.serviceLineOptions);529 }530 uncheckedAllOption(e) {531 this.onlyOneServiceLine = true;532 this.serviceLineOptions = this.serviceLineOptions533 .map (elem => ({534 ...elem,535 selected: (elem.name === 'All' ? false : (elem.name === e.target.id ? e.target.checked : elem.selected))536 })537 );538 this.callFilterByParent(this.serviceLineOptions);539 }540 checkFilterItems(where: string) {541 if (this.data.length > 0) {542 if ( this.matchFilter !== undefined && this.matchFilter.word !== '' && this.previousResult.length === 0 && this.stringSearch !== this.matchFilter.word ||543 this.matchFilter !== undefined && this.matchFilter.word !== '' && this.stringSearch !== this.matchFilter.word) {544 this.loadingResult = true;545 this.stringSearch = this.matchFilter.word;546 let copyData = this.data.map((e: any) => {547 if (e.pacemodel === 'Mercury' && e.mercury.length === 0) {548 e.disable = true;549 } else if ((e.pacemodel === 'GFIS Global' || e.pacemodel === 'PACE' || e.pacemodel === 'GFIS Local') && e.gfis.length === 0) {550 e.disable = true;551 } else {552 e.disable = false;553 }554 return e;555 });556 if (this.matchFilter.serviceLineName.length === 0) {557 this.serviceLineOptions = this.serviceLineOptions.map(e => ({...e, selected: e.name === 'All' ? true : false}));558 this.cleanExcept('sector');559 this.onlyOneServiceLine = true;560 this.userService.saveSlFilter(this.serviceLineOptions.filter(i => i.selected ));561 }562 this.servicesService.FuzzySearchServices(this.matchFilter)563 .subscribe((data: any) => {564 if (copyData.length > 0) {565 if (this.filterNav.client.GISId) {566 if (this.filterNav.client.permissibility.length > 0 && this.allIndependenceSelected.length > 0) {567 copyData.filter(e => !e.disable).map(e => {568 const applicable = [];569 const restrictions = [];570 let highRestriction = '';571 let status = 0; // update when any restriction match with the permissibility filter572 let derogation = 0;573 if (e.independenceRestrictions.ServiceLineCode !== '01' && e.independenceRestrictions.ServiceLineCode !== '03' && e.independenceRestrictions.ServiceLineCode !== null) {574 if (this.filterNav.client.permissibility[0].without && this.filterNav.client.permissibility[0].with) {575 derogation = 0;576 } else if (this.filterNav.client.permissibility[0].without) {577 derogation = 2;578 } else if (this.filterNav.client.permissibility[0].with) {579 derogation = 1;580 }581 }582 _.forOwn(this.filterNav.client.permissibility[0], (value, key) => {583 if ((e.independenceRestrictions.ServiceLineCode === '01' || e.independenceRestrictions.ServiceLineCode === '03') && e.independenceRestrictions.ServiceLineCode !== null ) {584 if ((key === 'eusubject' || key === 'euaudited') && key !== 'euAuditedNoValuation') {585 applicable.push('euaudited');586 } else {587 if (key === 'euAuditedNoValuation' && e.independenceRestrictions.EuAuditedNoValuation === '') {588 applicable.push('eusubject');589 } else {590 if (key !== 'without' && key !== 'with' && key !== 'down') {591 applicable.push(key); // Store column header applicable to the token592 }593 }594 }595 } else {596 if (e.independenceRestrictions.ServiceLineCode !== null) {597 if (key !== 'without' && key !== 'with' && key !== 'down') {598 applicable.push(key);599 }600 }601 }602 });603 if (applicable.length > 0) {604 applicable.map(ele => { // Validate which column is more restrictive605 const option = this.overWrite.filter(i => i.item === ele);606 if (option.length > 0) {607 if (derogation === 0) {608 const result = this.moreRestrictive.filter(i => i.value === e.independenceRestrictions[option[0].optional]);609 if (result.length > 0) { // get the ranking of restriction and store it610 restrictions.push(result[0].ranking);611 }612 } else if (derogation === 1 || derogation === 2) {613 if (derogation === 1 && ele !== 'eusubject') {614 const result = this.moreRestrictive.filter(i => i.value === e.independenceRestrictions[option[0].optional]);615 if (result.length > 0) { // get the ranking of restriction and store it616 restrictions.push(result[0].ranking);617 }618 } else if (derogation === 2 && ele !== 'euaudited') {619 const result = this.moreRestrictive.filter(i => i.value === e.independenceRestrictions[option[0].optional]);620 if (result.length > 0) { // get the ranking of restriction and store it621 restrictions.push(result[0].ranking);622 }623 }624 }625 highRestriction = this.moreRestrictive.filter(item => item.ranking === Math.max(...restrictions)).length > 0 ?626 this.moreRestrictive.filter(item => item.ranking === Math.max(...restrictions))[0].value : '';627 }628 });629 }630 if (this.allIndependenceSelected.includes(highRestriction)) {631 status += 1;632 if (e.disable) {633 e.disable = false;634 }635 } else {636 if (status === 0) {637 e.disable = true;638 }639 }640 });641 }642 }643 this.previousResult = data;644 copyData = copyData.map(e => ({...e, disable : e.disable ? true : !data.includes(e.IdService)}));645 this.resultFilter = copyData;646 this.data = this.data.map( item => ({647 ...item,648 disable: this.resultFilter.filter( e => e.Id === item.Id).length > 0 ? this.resultFilter.filter( e => e.Id === item.Id)[0].disable : true649 }));650 this.enableResultFilter = this.resultFilter.filter(item => !item.disable).length;651 this.result = this.enableResultFilter;652 this.resultFilterSL = this.resultFilter;653 this.loadingResult = false;654 }},655 errorService => console.log('error endpoint', errorService.message));656 } else {657 if (this.stringSearch !== '') { // validate if the search coming with a string658 this.loadingResult = true;659 let copyData = this.data.map((e: any) => {660 if (e.pacemodel === 'Mercury' && e.mercury.length === 0) {661 e.disable = true;662 } else if ((e.pacemodel === 'GFIS Global' || e.pacemodel === 'PACE' || e.pacemodel === 'GFIS Local') && e.gfis.length === 0) {663 e.disable = true;664 } else {665 e.disable = false;666 }667 return e;668 });669 // filter data with services from the search670 copyData = copyData.map(e => ({...e, disable : e.disable ? true : !this.previousResult.includes(e.IdService)}));671 if (this.filterNav.serviceLine.length > 0) {672 if (this.filterNav.serviceLine[0].value === 'All') {673 this.resultFilter = copyData.map(e => ({...e, disable : e.disable ? true : false}));674 } else {675 const sl = this.filterNav.serviceLine.map(e => e.value);676 this.resultFilter = copyData.map(e => ({...e, disable : e.disable ? true : !sl.includes(e.ServiceLineCode[0])}));677 }678 if (this.filterNav.client.GISId) {679 if (this.filterNav.client.permissibility.length > 0 && this.allIndependenceSelected.length > 0) {680 this.resultFilter.filter(e => !e.disable).map(e => {681 const applicable = [];682 const restrictions = [];683 let highRestriction = '';684 let status = 0; // update when any restriction match with the permissibility filter685 let derogation = 0;686 if (e.independenceRestrictions.ServiceLineCode !== '01' && e.independenceRestrictions.ServiceLineCode !== '03' && e.independenceRestrictions.ServiceLineCode !== null) {687 if (this.filterNav.client.permissibility[0].without && this.filterNav.client.permissibility[0].with) {688 derogation = 0;689 } else if (this.filterNav.client.permissibility[0].without) {690 derogation = 2;691 } else if (this.filterNav.client.permissibility[0].with) {692 derogation = 1;693 }694 }695 _.forOwn(this.filterNav.client.permissibility[0], (value, key) => {696 if ((e.independenceRestrictions.ServiceLineCode === '01' || e.independenceRestrictions.ServiceLineCode === '03') && e.independenceRestrictions.ServiceLineCode !== null ) {697 if ((key === 'eusubject' || key === 'euaudited') && key !== 'euAuditedNoValuation') {698 applicable.push('euaudited');699 } else {700 if (key === 'euAuditedNoValuation' && e.independenceRestrictions.EuAuditedNoValuation === '') {701 applicable.push('eusubject');702 } else {703 if (key !== 'without' && key !== 'with' && key !== 'down') {704 applicable.push(key); // Store column header applicable to the token705 }706 }707 }708 } else {709 if (e.independenceRestrictions.ServiceLineCode !== null) {710 if (key !== 'without' && key !== 'with' && key !== 'down') {711 applicable.push(key);712 }713 }714 }715 });716 if (applicable.length > 0) {717 applicable.map(ele => { // Validate which column is more restrictive718 const option = this.overWrite.filter(i => i.item === ele);719 if (option.length > 0) {720 if (derogation === 0) {721 const result = this.moreRestrictive.filter(i => i.value === e.independenceRestrictions[option[0].optional]);722 if (result.length > 0) { // get the ranking of restriction and store it723 restrictions.push(result[0].ranking);724 }725 } else if (derogation === 1 || derogation === 2) {726 if (derogation === 1 && ele !== 'eusubject') {727 const result = this.moreRestrictive.filter(i => i.value === e.independenceRestrictions[option[0].optional]);728 if (result.length > 0) { // get the ranking of restriction and store it729 restrictions.push(result[0].ranking);730 }731 } else if (derogation === 2 && ele !== 'euaudited') {732 const result = this.moreRestrictive.filter(i => i.value === e.independenceRestrictions[option[0].optional]);733 if (result.length > 0) { // get the ranking of restriction and store it734 restrictions.push(result[0].ranking);735 }736 }737 }738 highRestriction = this.moreRestrictive.filter(item => item.ranking === Math.max(...restrictions)).length > 0 ?739 this.moreRestrictive.filter(item => item.ranking === Math.max(...restrictions))[0].value : '';740 }741 });742 }743 if (this.allIndependenceSelected.includes(highRestriction)) {744 status += 1;745 if (e.disable) {746 e.disable = false;747 }748 } else {749 if (status === 0) {750 e.disable = true;751 }752 }753 });754 this.data = this.data.map( item => ({755 ...item,756 disable: this.resultFilter.filter( e => e.Id === item.Id).length > 0 ? this.resultFilter.filter( e => e.Id === item.Id)[0].disable : true757 }));758 } else {759 this.data = this.data.map( item => ({760 ...item,761 disable: this.resultFilter.filter( e => e.Id === item.Id).length > 0 ? this.resultFilter.filter( e => e.Id === item.Id)[0].disable : true762 }));763 if (this.previosLeftHand) {764 this.updateCardFilter(this.FilterTree);765 }766 }767 } else {768 this.data = this.data.map( item => ({769 ...item,770 disable: this.resultFilter.filter( e => e.Id === item.Id).length > 0 ? this.resultFilter.filter( e => e.Id === item.Id)[0].disable : true771 }));772 if (this.previosLeftHand) {773 this.updateCardFilter(this.FilterTree);774 }775 }776 this.enableResultFilter = this.resultFilter.filter(item => !item.disable).length;777 this.result = this.resultFilter.filter( e => e.disable === false).length; // result number grey bar778 this.resultFilterSL = this.resultFilter;779 this.loadingResult = false;780 } else {781 if (this.filterNav.client.GISId) {782 if (this.filterNav.client.permissibility.length > 0 && this.allIndependenceSelected.length > 0) {783 copyData.filter(e => !e.disable).map(e => {784 const applicable = [];785 const restrictions = [];786 let highRestriction = '';787 let status = 0; // update when any restriction match with the permissibility filter788 let derogation = 0;789 if (e.independenceRestrictions.ServiceLineCode !== '01' && e.independenceRestrictions.ServiceLineCode !== '03') {790 if (this.filterNav.client.permissibility[0].without && this.filterNav.client.permissibility[0].with) {791 derogation = 0;792 } else if (this.filterNav.client.permissibility[0].without) {793 derogation = 2;794 } else if (this.filterNav.client.permissibility[0].with) {795 derogation = 1;796 }797 }798 _.forOwn(this.filterNav.client.permissibility[0], (value, key) => {799 if (e.independenceRestrictions.ServiceLineCode === '01' || e.independenceRestrictions.ServiceLineCode === '03') {800 if ((key === 'eusubject' || key === 'euaudited') && key !== 'euAuditedNoValuation') {801 applicable.push('euaudited');802 } else {803 if (key === 'euAuditedNoValuation' && e.independenceRestrictions.EuAuditedNoValuation === '') {804 applicable.push('eusubject');805 } else {806 if (key !== 'without' && key !== 'with' && key !== 'down') {807 applicable.push(key); // Store column header applicable to the token808 }809 }810 }811 } else {812 if (e.independenceRestrictions.ServiceLineCode !== null) {813 if (key !== 'without' && key !== 'with' && key !== 'down') {814 applicable.push(key);815 }816 }817 }818 });819 if (applicable.length > 0) {820 applicable.map(ele => { // Validate which column is more restrictive821 const option = this.overWrite.filter(i => i.item === ele);822 if (option.length > 0) {823 if (derogation === 0) {824 const result = this.moreRestrictive.filter(i => i.value === e.independenceRestrictions[option[0].optional]);825 if (result.length > 0) { // get the ranking of restriction and store it826 restrictions.push(result[0].ranking);827 }828 } else if (derogation === 1 || derogation === 2) {829 if (derogation === 1 && ele !== 'eusubject') {830 const result = this.moreRestrictive.filter(i => i.value === e.independenceRestrictions[option[0].optional]);831 if (result.length > 0) { // get the ranking of restriction and store it832 restrictions.push(result[0].ranking);833 }834 } else if (derogation === 2 && ele !== 'euaudited') {835 const result = this.moreRestrictive.filter(i => i.value === e.independenceRestrictions[option[0].optional]);836 if (result.length > 0) { // get the ranking of restriction and store it837 restrictions.push(result[0].ranking);838 }839 }840 }841 highRestriction = this.moreRestrictive.filter(ele => ele.ranking === Math.max(...restrictions)).length > 0 ?842 this.moreRestrictive.filter(ele => ele.ranking === Math.max(...restrictions))[0].value : '';843 }844 });845 }846 if (this.allIndependenceSelected.includes(highRestriction)) {847 status += 1;848 if (e.disable) {849 e.disable = false;850 }851 } else {852 if (status === 0) {853 e.disable = true;854 }855 }856 });857 }858 }859 this.resultFilter = copyData;860 this.data = this.data.map( item => ({861 ...item,862 disable: this.resultFilter.filter( e => e.Id === item.Id).length > 0 ? this.resultFilter.filter( e => e.Id === item.Id)[0].disable : true863 }));864 this.enableResultFilter = this.resultFilter.filter(item => !item.disable).length;865 this.result = this.resultFilter.filter( e => e.disable === false).length;866 if (this.previosLeftHand) {867 this.updateCardFilter(this.FilterTree);868 }869 this.resultFilterSL = this.resultFilter;870 this.loadingResult = false;871 }872 } else {873 const copyData = this.data.map((e: any) => {874 if (e.pacemodel === 'Mercury' && e.mercury.length === 0) {875 e.disable = true;876 } else if ((e.pacemodel === 'GFIS Global' || e.pacemodel === 'PACE' || e.pacemodel === 'GFIS Local') && e.gfis.length === 0) {877 e.disable = true;878 } else {879 e.disable = false;880 }881 return e;882 });883 if (this.filterNav.serviceLine.length > 0) {884 if (this.filterNav.serviceLine[0].value === 'All') {885 this.resultFilter = copyData.map(e => ({...e, disable : e.disable ? true : false}));886 } else {887 const sl = this.filterNav.serviceLine.map(e => e.value);888 this.resultFilter = copyData.map(e => ({...e, disable : e.disable ? true : !sl.includes(e.ServiceLineCode[0])}));889 }890 if (this.filterNav.client.GISId) {891 if (this.filterNav.client.permissibility.length > 0 && this.allIndependenceSelected.length > 0) {892 this.resultFilter.filter(e => !e.disable).map(e => {893 const applicable = [];894 const restrictions = [];895 let highRestriction = '';896 let status = 0; // update when any restriction match with the permissibility filter897 let derogation = 0;898 if (e.independenceRestrictions.ServiceLineCode !== '01' && e.independenceRestrictions.ServiceLineCode !== '03' && e.independenceRestrictions.ServiceLineCode !== null) {899 if (this.filterNav.client.permissibility[0].without && this.filterNav.client.permissibility[0].with) {900 derogation = 0;901 } else if (this.filterNav.client.permissibility[0].without) {902 derogation = 2;903 } else if (this.filterNav.client.permissibility[0].with) {904 derogation = 1;905 }906 }907 _.forOwn(this.filterNav.client.permissibility[0], (value, key) => {908 if ((e.independenceRestrictions.ServiceLineCode === '01' || e.independenceRestrictions.ServiceLineCode === '03') && e.independenceRestrictions.ServiceLineCode !== null ) {909 if ((key === 'eusubject' || key === 'euaudited') && key !== 'euAuditedNoValuation') {910 applicable.push('euaudited');911 } else {912 if (key === 'euAuditedNoValuation' && e.independenceRestrictions.EuAuditedNoValuation === '') {913 applicable.push('eusubject');914 } else {915 if (key !== 'without' && key !== 'with' && key !== 'down') {916 applicable.push(key); // Store column header applicable to the token917 }918 }919 }920 } else {921 if (e.independenceRestrictions.ServiceLineCode !== null) {922 if (key !== 'without' && key !== 'with' && key !== 'down') {923 applicable.push(key);924 }925 }926 }927 });928 if (applicable.length > 0) {929 applicable.map(ele => { // Validate which column is more restrictive930 const option = this.overWrite.filter(i => i.item === ele);931 if (option.length > 0) {932 if (derogation === 0) {933 const result = this.moreRestrictive.filter(i => i.value === e.independenceRestrictions[option[0].optional]);934 if (result.length > 0) { // get the ranking of restriction and store it935 restrictions.push(result[0].ranking);936 }937 } else if (derogation === 1 || derogation === 2) {938 if (derogation === 1 && ele !== 'eusubject') {939 const result = this.moreRestrictive.filter(i => i.value === e.independenceRestrictions[option[0].optional]);940 if (result.length > 0) { // get the ranking of restriction and store it941 restrictions.push(result[0].ranking);942 }943 } else if (derogation === 2 && ele !== 'euaudited') {944 const result = this.moreRestrictive.filter(i => i.value === e.independenceRestrictions[option[0].optional]);945 if (result.length > 0) { // get the ranking of restriction and store it946 restrictions.push(result[0].ranking);947 }948 }949 }950 highRestriction = this.moreRestrictive.filter(item => item.ranking === Math.max(...restrictions)).length > 0 ?951 this.moreRestrictive.filter(item => item.ranking === Math.max(...restrictions))[0].value : '';952 }953 });954 }955 if (this.allIndependenceSelected.includes(highRestriction)) {956 status += 1;957 if (e.disable) {958 e.disable = false;959 }960 } else {961 if (status === 0) {962 e.disable = true;963 }964 }965 });966 }967 }968 this.data = this.data.map( item => ({969 ...item,970 disable: this.resultFilter.filter( e => e.Id === item.Id).length > 0 ? this.resultFilter.filter( e => e.Id === item.Id)[0].disable : true971 }));972 this.enableResultFilter = this.resultFilter.filter(item => !item.disable).length;973 this.result = this.resultFilter.filter( e => e.disable === false).length; // result number grey bar974 this.resultFilterSL = this.resultFilter;975 // this.servicesService.setServices(this.resultFilter);976 if (this.previosLeftHand) {977 this.updateCardFilter(this.FilterTree);978 }979 this.loadingResult = false;980 } else { // all ok981 if (this.filterNav.client.GISId) {982 if (this.filterNav.client.permissibility.length > 0 && this.allIndependenceSelected.length > 0) {983 copyData.filter(e => !e.disable).map(e => {984 const applicable = [];985 const restrictions = [];986 let highRestriction = '';987 let status = 0; // update when any restriction match with the permissibility filter988 let derogation = 0;989 if (e.independenceRestrictions.ServiceLineCode !== '01' && e.independenceRestrictions.ServiceLineCode !== '03' && e.independenceRestrictions.ServiceLineCode !== null) {990 if (this.filterNav.client.permissibility[0].without && this.filterNav.client.permissibility[0].with) {991 derogation = 0;992 } else if (this.filterNav.client.permissibility[0].without) {993 derogation = 2;994 } else if (this.filterNav.client.permissibility[0].with) {995 derogation = 1;996 }997 }998 _.forOwn(this.filterNav.client.permissibility[0], (value, key) => {999 if ((e.independenceRestrictions.ServiceLineCode === '01' || e.independenceRestrictions.ServiceLineCode === '03') && e.independenceRestrictions.ServiceLineCode !== null ) {1000 if ((key === 'eusubject' || key === 'euaudited') && key !== 'euAuditedNoValuation') {1001 applicable.push('euaudited');1002 } else {1003 if (key === 'euAuditedNoValuation' && e.independenceRestrictions.EuAuditedNoValuation === '') {1004 applicable.push('eusubject');1005 } else {1006 if (key !== 'without' && key !== 'with' && key !== 'down') {1007 applicable.push(key); // Store column header applicable to the token1008 }1009 }1010 }1011 } else {1012 if (e.independenceRestrictions.ServiceLineCode !== null) {1013 if (key !== 'without' && key !== 'with' && key !== 'down') {1014 applicable.push(key);1015 }1016 }1017 }1018 });1019 if (applicable.length > 0) {1020 applicable.map(ele => { // Validate which column is more restrictive1021 const option = this.overWrite.filter(i => i.item === ele);1022 if (option.length > 0) {1023 if (derogation === 0) {1024 const result = this.moreRestrictive.filter(i => i.value === e.independenceRestrictions[option[0].optional]);1025 if (result.length > 0) { // get the ranking of restriction and store it1026 restrictions.push(result[0].ranking);1027 }1028 } else if (derogation === 1 || derogation === 2) {1029 if (derogation === 1 && ele !== 'eusubject') {1030 const result = this.moreRestrictive.filter(i => i.value === e.independenceRestrictions[option[0].optional]);1031 if (result.length > 0) { // get the ranking of restriction and store it1032 restrictions.push(result[0].ranking);1033 }1034 } else if (derogation === 2 && ele !== 'euaudited') {1035 const result = this.moreRestrictive.filter(i => i.value === e.independenceRestrictions[option[0].optional]);1036 if (result.length > 0) { // get the ranking of restriction and store it1037 restrictions.push(result[0].ranking);1038 }1039 }1040 }1041 highRestriction = this.moreRestrictive.filter(item => item.ranking === Math.max(...restrictions)).length > 0 ?1042 this.moreRestrictive.filter(item => item.ranking === Math.max(...restrictions))[0].value : '';1043 }1044 });1045 }1046 if (this.allIndependenceSelected.includes(highRestriction)) {1047 status += 1;1048 if (e.disable) {1049 e.disable = false;1050 }1051 } else {1052 if (status === 0) {1053 e.disable = true;1054 }1055 }1056 });1057 }1058 }1059 this.resultFilter = copyData;1060 this.enableResultFilter = this.resultFilter.filter(item => !item.disable).length;1061 this.result = this.resultFilter.filter( e => e.disable === false).length;1062 this.data = this.data.map( item => ({1063 ...item,1064 disable: this.resultFilter.filter( e => e.Id === item.Id).length > 0 ? this.resultFilter.filter( e => e.Id === item.Id)[0].disable : true1065 }));1066 if (this.previosLeftHand) {1067 this.updateCardFilter(this.FilterTree);1068 }1069 this.resultFilterSL = this.resultFilter;1070 this.loadingResult = false;1071 }1072 }1073 }1074 this.orderByServices('asc');1075 }1076 }1077 updateCardFilter(tree) {1078 const filters = ['SS', 'CO', 'FOP', 'SE', 'CL', 'SO'];1079 const options = _.intersection(this.sameBucket, filters);1080 this.sameFilter = options.length === 0 || options.length === 1 ? true : false;1081 let total = 6;1082 let applicableSSL = [];1083 let applicableCO = [];1084 let applicableSO = [];1085 let applicableFOP = [];1086 let applicableSE = [];1087 let applicableCL = [];1088 const services = this.data.filter(e => !e.disable);1089 this.FilterTree.map((father: FilterNodeParent) => {1090 const totalChildren = father.children.length;1091 const child = father.children.filter(s => !s.selected).length;1092 father.children.filter(s => s.selected).map(son => {1093 switch (father.id) {1094 case 'SSL':1095 const CodeSSL = son.id.split('SSL')[1];1096 if (applicableSSL.length > 0) {1097 let filterServices = [];1098 filterServices = services;1099 filterServices.filter(ele => ele.IdSubServiceCode.length > 0).map(element => {1100 if (element.IdSubServiceCode.filter(e => e === CodeSSL).length > 0) {1101 applicableSSL = _.union(applicableSSL, [element.IdService]);1102 }1103 });1104 } else {1105 services.filter(ele => ele.IdSubServiceCode.length > 0).map(element => {1106 if (element.IdSubServiceCode.filter(e => e === CodeSSL).length > 0) {1107 applicableSSL = _.union(applicableSSL, [element.IdService]);1108 }1109 });1110 }1111 break;1112 case 'competency':1113 const CodeCompetency = son.id.split('CO')[1];1114 if (applicableCO.length > 0) {1115 let filterServices = [];1116 filterServices = services;1117 filterServices.filter(ele => ele.IdCompetencyDomain.length > 0).map(element => {1118 if (element.IdCompetencyDomain.filter(e => e === CodeCompetency).length > 0) {1119 applicableCO = _.union(applicableCO, [element.IdService]);1120 }1121 });1122 } else {1123 services.filter(ele => ele.IdCompetencyDomain.length > 0).map(element => {1124 if (element.IdCompetencyDomain.filter(e => e === CodeCompetency).length > 0) {1125 applicableCO = _.union(applicableCO, [element.IdService]);1126 }1127 });1128 }1129 break;1130 case 'SSL2':1131 const CodeSolution = son.id.split('SO')[1];1132 if (applicableSO.length > 0) {1133 let filterServices = [];1134 filterServices = services;1135 filterServices.filter(ele => ele.IdSolution.length > 0).map(element => {1136 if (element.IdSolution.filter(e => e === parseInt(CodeSolution, 10)).length > 0) {1137 applicableSO = _.union(applicableSO, [element.IdService]);1138 }1139 });1140 } else {1141 services.filter(ele => ele.IdSolution.length > 0).map(element => {1142 if (element.IdSolution.filter(e => e === parseInt(CodeSolution, 10)).length > 0) {1143 applicableSO = _.union(applicableSO, [element.IdService]);1144 }1145 });1146 }1147 break;1148 case 'fop':1149 const CodeFop = son.id.split('FOP')[1];1150 if (applicableFOP.length > 0) {1151 let filterServices = [];1152 filterServices = services;1153 filterServices.filter(ele => ele.IdFop.length > 0).map(element => {1154 if (element.IdFop.filter(e => e === parseInt(CodeFop, 10)).length > 0) {1155 applicableFOP = _.union(applicableFOP, [element.IdService]);1156 }1157 });1158 } else {1159 services.filter(ele => ele.IdFop.length > 0).map(element => {1160 if (element.IdFop.filter(e => e === parseInt(CodeFop, 10)).length > 0) {1161 applicableFOP = _.union(applicableFOP, [element.IdService]);1162 }1163 });1164 }1165 break;1166 case 'sector':1167 const CodeSector = son.id.split('SE')[1];1168 if (applicableSE.length > 0 ) {1169 let filterServices = [];1170 filterServices = services;1171 filterServices.filter(ele => ele.IdSector.length > 0).map(element => {1172 if (element.IdSector.filter(e => e === parseInt(CodeSector, 10)).length > 0) {1173 applicableSE = _.union(applicableSE, [element.IdService]);1174 }1175 });1176 } else {1177 services.filter(ele => ele.IdSector.length > 0).map(element => {1178 if (element.IdSector.filter(e => e === parseInt(CodeSector, 10)).length > 0) {1179 applicableSE = _.union(applicableSE, [element.IdService]);1180 }1181 });1182 }1183 break;1184 case 'clientNeed':1185 const CodeClient = son.id.split('CL')[1];1186 if (applicableCL.length > 0) {1187 let filterServices = [];1188 filterServices = services;1189 filterServices.filter(ele => ele.IdClientNeed.length > 0).map(element => {1190 if (element.IdClientNeed.filter(e => e === parseInt(CodeClient, 10)).length > 0) {1191 applicableCL = _.union(applicableCL, [element.IdService]);1192 }1193 });1194 } else {1195 services.filter(ele => ele.IdClientNeed.length > 0).map(element => {1196 if (element.IdClientNeed.filter(e => e === parseInt(CodeClient, 10)).length > 0) {1197 applicableCL = _.union(applicableCL, [element.IdService]);1198 }1199 });1200 }1201 break;1202 default:1203 break;1204 }1205 });1206 if (totalChildren === child) { total -= 1; }1207 });1208 const items = {1209 applicableSSL,1210 applicableCO,1211 applicableSO,1212 applicableSE,1213 applicableFOP,1214 applicableCL1215 };1216 let result = [];1217 _.forOwn(items, (value, key) => {1218 if (value.length > 0 || options.includes(key.slice(10).slice(0, 2))) {1219 if (result.length === 0) {1220 result = value;1221 } else if (result.length > 0) {1222 result = _.intersection(result, value);1223 }1224 }1225 });1226 if (result.length > 0) {1227 const filterData = _.intersection(result, this.data.map(e => e.IdService));1228 const resultMatch = this.data.filter(item => filterData.includes(item.IdService));1229 this.resultFilter = resultMatch;1230 this.enableResultFilter = this.resultFilter.filter(item => !item.disable).length;1231 this.result = this.enableResultFilter;1232 this.previosLeftHand = true;1233 } else {1234 if (total === 0) {1235 this.previosLeftHand = false;1236 this.checkFilterItems('no match');1237 } else {1238 this.previosLeftHand = true;1239 const filterData = _.intersection(result, this.data.map(e => e.IdService));1240 const resultMatch = this.data.filter(item => filterData.includes(item.IdService));1241 this.resultFilter = resultMatch;1242 this.enableResultFilter = this.resultFilter.filter(item => !item.disable).length;1243 this.result = this.enableResultFilter;1244 }1245 }1246 this.orderByServices('asc');1247 }1248// sort by parent1249getSubserviceLineByParent(parent) {1250 let result = [];1251 const SlSelected = parent.filter(item => item.selected);1252 if (this.allssl.length > 0) {1253 if (SlSelected.length > 0 && SlSelected[0].value !== 'All') {1254 SlSelected.map( sl => {1255 const SSL = this.allssl.filter(e => e.parent === sl.value);1256 result = _.union(result, SSL);1257 });1258 } else {1259 result = this.allssl;1260 }1261 }1262 this.all += 1;1263 this.allReady();1264 return this.FilterTree[0].children = result;1265}1266getCompetencyDomainByParent(parent) {1267let result = [];1268const CompetencySelected = parent.filter(item => item.selected);1269if (this.allCompetency.length > 0) {1270 if (CompetencySelected.length > 0 && CompetencySelected[0].value !== 'All') {1271 CompetencySelected.map( sl => {1272 const competency = this.allCompetency.filter(e => e.parent === sl.value);1273 result = _.union(result, competency);1274 });1275 } else {1276 result = this.allCompetency;1277 }1278}1279this.all += 1;1280this.allReady();1281this.FilterTree[1].children = result;1282return;1283}1284getCompetencyDomainBySSL(...parent) {1285if (parent[0].length === 0) {1286 const selectedOptions = this.serviceLineOptions.filter( item => item.selected);1287 this.getCompetencyDomainByParent(selectedOptions);1288} else {1289 this.allCompetency = this.allCompetency.map(item => ({...item, selected: false}));1290 let result = [];1291 parent[0].map( ssl => {1292 const filter = this.allCompetency.filter( e => e.subparent === ssl);1293 this.FilterTree[1].children = this.allCompetency;1294 result = _.union(result, filter);1295 });1296 this.sameBucket = this.sameBucket.filter(item => item !== 'CO');1297 this.FilterTree[1].children = _.orderBy(result, ['label'], ['asc'] );1298}1299}1300getFilterOption(option) {1301const parseString = String(option.id);1302if (option.state && this.sameBucket.length === 0) {1303 this.sameBucket.push(parseString.slice(0, 2));1304} else if (option.state && this.sameBucket.length > 0) {1305 this.sameBucket.push(parseString.slice(0, 2));1306} else if (!option.state && this.sameBucket.length > 0) {1307 const total = this.sameBucket.filter(e => e === parseString.slice(0, 2)).length;1308 if (total > 0) {1309 const removeOrAdd = total === 1 ? false : true;1310 if (removeOrAdd) {1311 const options = this.sameBucket.filter(e => e === parseString.slice(0, 2));1312 this.sameBucket = this.sameBucket.filter(e => e !== parseString.slice(0, 2));1313 options.splice(-1, 1);1314 this.sameBucket = [].concat(this.sameBucket, options);1315 } else {1316 this.sameBucket = this.sameBucket.filter(e => e !== parseString.slice(0, 2));1317 }1318 }1319}1320const validacion = parseString.search('SSL');1321if (validacion === 0) {1322 const code = parseString.split('SSL')[1];1323 if (this.selectedssl.length > 0) {1324 const found = this.selectedssl.find(element => element === code);1325 if (found === undefined) {1326 this.selectedssl.push(code);1327 } else {1328 if ( this.selectedssl.indexOf(code) > -1 ) {1329 this.selectedssl.splice(this.selectedssl.indexOf(code), 1);1330 }1331 }1332 } else {1333 this.selectedssl.push(code);1334 }1335 this.getCompetencyDomainBySSL(this.selectedssl);1336}1337this.updateFilterTree(option);1338}1339updateFilterTree(item) {1340if (item.state) { this.previosLeftHand = true; }1341const tree = this.FilterTree.map(node => {1342 const result = node.children.filter(e => e.id === item.id);1343 if (result.length > 0) {1344 node.children = node.children.map( ele => {1345 ele.selected = ele.id === item.id ? item.state : ele.selected;1346 return ele;1347 });1348 return node;1349 }1350 return node;1351});1352this.FilterTree = tree;1353this.checkFilterItems('updateFilterTree');1354}1355clearAll() {1356this.sameBucket = [];1357this.previosLeftHand = false;1358const clearTree = this.FilterTree.map(element => {1359 element.children.map(child => {1360 child.selected = false;1361 return child;1362 });1363 return element;1364});1365this.FilterTree = clearTree;1366const selectedOptions = this.serviceLineOptions.filter( item => item.selected === true);1367if ( selectedOptions[0].value === 'All') {1368 this.callFilterByParent(this.serviceLineOptions);1369} else {1370 this.callFilterByParent(selectedOptions);1371}1372this.selectedssl = [];1373this.checkFilterItems('click clearAll');1374}1375clearAllLeftFilter() {1376const clearTree = this.FilterTree.map(element => {1377 element.children.map(child => {1378 child.selected = false;1379 return child;1380 });1381 return element;1382});1383this.FilterTree = clearTree;1384}1385cleanExcept(option) {1386this.selectedssl = [];1387this.FilterTree = this.FilterTree.map(element => {1388 if (element.id !== option) {1389 element.children.map(child => {1390 child.selected = false;1391 return child;1392 });1393 }1394 return element;1395});1396const selectedOptions = this.serviceLineOptions.filter( item => item.selected === true);1397if (selectedOptions[0].value === 'All') {1398 this.callFilterByParent(this.serviceLineOptions);1399} else {1400 this.callFilterByParent(selectedOptions);1401}1402}1403allReady() {1404if (this.all === 6) {1405 const selectedOptions = this.serviceLineOptions.filter( item => item.selected);1406 if (selectedOptions.length === 1 && selectedOptions[0].name === 'All') {1407 this.serviceLineOptions.map( element => ({...element, selected: element.name === 'All' ? true : false}));1408 this.callFilterByParent(this.serviceLineOptions);1409 } else {1410 this.onlyOneServiceLine = selectedOptions.length === 1 ? false : true;1411 this.callFilterByParent(selectedOptions);1412 }1413 this.loading = false;1414}1415}1416 // request1417 getIndependenceRestrictionOption() {1418 return this.permissibilityservice.getIndependenceIcons()1419 .subscribe(data => {1420 if (data.length > 0) {1421 this.iconArray = data.map(e => ({1422 icon: e.Icon,1423 value: e.Prefix,1424 class: 'material-icons mat-icon_cust',1425 color: e.Color,1426 label: e.Name1427 }));1428 }1429 });1430 }1431 getServices(type, tokens = []) {1432 this.servicesService.fetchServices(this.country).subscribe(1433 () => {1434 if (type !== 'extraterritorial') {1435 this.servicesService.fetchAllServicesByIndependenceRestrictions();1436 } else {1437 this.servicesService.fetchAllServicesByIndependenceRestrictionsToken(this.country, tokens).subscribe(e => {});1438 }1439 },1440 errorService => console.log('error endpoint', errorService.message));1441 }1442 getAllSubserviceLine() {1443 this.subserviceLineService.fetchSubServiceLine().subscribe(1444 (data: any) => {1445 this.all += 1;1446 this.allReady();1447 },1448 errorService => console.log('error endpoint', errorService.message));1449 }1450 getAllCompetency() {1451 this.competencyDomainService.fetchCompetency().subscribe(1452 (data: any) => {this.all += 1;1453 this.allReady(); },1454 errorService => console.log('error endpoint', errorService.message));1455 }1456 getAllSolutions() {1457 this.solutionsService.fetchSolutions().subscribe(1458 (data: any) => {this.FilterTree[2].children = this.solutionsService.solution;1459 this.all += 1;1460 this.allReady(); },1461 errorService => console.log('error endpoint', errorService.message));1462 }1463 getAllFieldofPlay() {1464 this.fieldofplayService.fetchFieldofplay().subscribe(1465 (data: any) => {this.FilterTree[3].children = this.fieldofplayService.fieldofplay;1466 this.all += 1;1467 this.allReady(); },1468 errorService => console.log('error endpoint', errorService.message));1469 }1470 getAllSector() {1471 this.sectorService.fetchSector().subscribe(1472 (data: any) => {this.FilterTree[4].children = this.sectorService.sector; this.all += 1;1473 this.allReady(); },1474 errorService => console.log('error endpoint', errorService.message));1475 }1476 getAllClientNeeds() {1477 this.clientNeedService.fetchClientNeeds().subscribe(1478 (data: any) => {1479 this.FilterTree[5].children = this.clientNeedService.clientNeed;1480 this.all += 1;1481 this.allReady();1482 },1483 errorService => console.log('error endpoint', errorService.message));1484 }1485 getCountryList() {1486 this.countryService.fetchCountries().subscribe(1487 () => {},1488 errorService => console.log('error endpoint', errorService.message));1489 }1490 ngOnDestroy() {1491 this.subscription.unsubscribe();1492 this.subscriptionSSL.unsubscribe();1493 this.subscriptionSolution.unsubscribe();1494 this.subscriptionCompetency.unsubscribe();1495 this.subscriptionSector.unsubscribe();1496 this.subscriptionClient.unsubscribe();1497 this.subscriptionMatch.unsubscribe();1498 this.subscriptionCountry.unsubscribe();1499 this.subscriptionFilter.unsubscribe();1500 this.subscriptionCountryList.unsubscribe();1501 this.subscriptionFieldofPlay.unsubscribe();1502 this.subscriptionPermissibility.unsubscribe();1503 this.clearAllLeftFilter();1504 }1505 setTotalServiceLineOption() {1506 const copyData = this.data.map((e: any) => {1507 if ((e.pacemodel === 'Mercury' || e.pacemodel === '') && e.mercury.length === 0) {1508 e.disable = true;1509 } else if ((e.pacemodel === 'GFIS Global' || e.pacemodel === 'PACE' || e.pacemodel === 'GFIS Local') && e.gfis.length === 0) {1510 e.disable = true;1511 } else {1512 e.disable = false;1513 }1514 return e;1515 });1516 const allitems = copyData.filter(service => !service.disable).length;1517 this.serviceLineOptions.filter(item => item.value !== 'All').map(e => {1518 e.total = 0;1519 copyData.filter(service => !service.disable).filter(item => {1520 if (item.ServiceLineCode.filter(a => a === e.value).length > 0) {1521 e.total += item.ServiceLineCode.filter(a => a === e.value).length;1522 }1523 });1524 });1525 this.serviceLineOptions[0].total = allitems;1526 }1527 checkAllSLSelectedInHome() {1528 const options = [];1529 this.enableBucketsLeftHand = [];1530 this.serviceLineOptions.map(e => {1531 const matchResult = this.filterNav.serviceLine.filter(i => i.value === e.value);1532 e.selected = matchResult.length > 0 ? true : false;1533 if (matchResult.length > 0) {1534 this.enableBucketsLeftHand = _.union(this.enableBucketsLeftHand, e.dependency);1535 }1536 options.push(e);1537 });1538 this.serviceLineOptions = options;1539 this.validateUploadedInformation();1540 }...

Full Screen

Full Screen

reuse-bucket-spec.js

Source:reuse-bucket-spec.js Github

copy

Full Screen

1/* global describe, it, expect, spyOn */2'use strict'3const underTest = require('../../lib/reuse-bucket')4let inquirer = {5 prompt: () => {}6}7describe('Reuse bucket', () => {8 it('should be a function', () => {9 spyOn(inquirer, 'prompt').and.returnValue(Promise.resolve())10 const reuseBucket = underTest('sampleBucket', inquirer).catch(() => {})11 expect(typeof underTest).toBe('function')12 expect(typeof reuseBucket.then).toBe('function')13 expect(typeof reuseBucket.catch).toBe('function')14 })15 it('should throw an error if answer is "No"', done => {16 spyOn(inquirer, 'prompt').and.returnValue(Promise.resolve({17 sameBucket: 'No'18 }))19 underTest('sampleBucket', inquirer)20 .then(done.fail)21 .catch(done)22 })23 it('should resolve if answer is "Yes"', done => {24 spyOn(inquirer, 'prompt').and.returnValue(Promise.resolve({25 sameBucket: 'Yes'26 }))27 underTest('sampleBucket', inquirer)28 .then(done)29 .catch(done.fail)30 })...

Full Screen

Full Screen

reuse-bucket.js

Source:reuse-bucket.js Github

copy

Full Screen

1'use strict'2const inquirer = require('inquirer')3function reuseBucket(bucket, promptLib) {4 promptLib = promptLib || inquirer5 return promptLib.prompt([{6 type: 'list',7 name: 'sameBucket',8 message: `"${bucket}" bucket already exist, do you want to use it?`,9 choices: ['Yes', 'No'],10 default: 'No'11 }])12 .then(result => {13 if (!result || !result.sameBucket || result.sameBucket === 'No')14 throw {15 message: 'Re-run command with a new bucket name.'16 }17 return bucket18 })19}...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1var argosy = require('argosy')2var pattern = require('argosy-pattern')3var seneca = require('seneca')()4var mesh = require('seneca-mesh')5seneca.use(mesh, {6 {pin: 'role:math,cmd:sum', model: 'consume'},7 {pin: 'role:math,cmd:product', model: 'consume'}8})9var service = argosy()10 .use(function (req, res) {11 if (sameBucket(req, {role: 'math', cmd: 'sum'})) {12 return res(null, {answer: req.left + req.right})13 }14 res()15 })16 .use(function (req, res) {17 if (sameBucket(req, {role: 'math', cmd: 'product'})) {18 return res(null, {answer: req.left * req.right})19 }20 res()21 })22 .listen()23seneca.act('role:math,cmd:sum,left:1,right:2', console.log)24seneca.act('role:math,cmd:product,left:3,right:4', console.log)25var argosy = require('argosy')26var pattern = require('argosy-pattern')27var seneca = require('seneca')()28var mesh = require('seneca-mesh')29seneca.use(mesh, {30 {pin: 'role:math,cmd:sum', model: 'consume'},31 {pin: 'role:math,cmd:product', model: 'consume'}32})33var service = argosy()34 .use(function (req, res) {35 if (any(req, {role: 'math', cmd: 'sum'})) {36 return res(null, {answer: req.left + req.right})37 }38 res()39 })40 .use(function (req, res) {41 if (any(req, {role: 'math', cmd: 'product'})) {42 return res(null, {answer: req.left * req.right})43 }

Full Screen

Using AI Code Generation

copy

Full Screen

1const argosyPattern = require('argosy-pattern')2const argosy = require('argosy')3const seneca = argosy()4seneca.accept({5 test: sameBucket('test')6}, (msg, cb) => {7 cb(null, { test: 'test' })8})9seneca.accept({10 test: sameBucket('test')11}, (msg, cb) => {12 cb(null, { test: 'test2' })13})14seneca.accept({15 test: sameBucket('test2')16}, (msg, cb) => {17 cb(null, { test: 'test3' })18})19seneca.accept({20 test: sameBucket('test2')21}, (msg, cb) => {22 cb(null, { test: 'test4' })23})24seneca.accept({25 test: sameBucket('test3')26}, (msg, cb) => {27 cb(null, { test: 'test5' })28})29seneca.accept({30 test: sameBucket('test3')31}, (msg, cb) => {32 cb(null, { test: 'test6' })33})34seneca.accept({35 test: sameBucket('test4')36}, (msg, cb) => {37 cb(null, { test: 'test7' })38})39seneca.accept({40 test: sameBucket('test4')41}, (msg, cb) => {42 cb(null, { test: 'test8' })43})44seneca.accept({45 test: sameBucket('test5')46}, (msg, cb) => {47 cb(null, { test: 'test9' })48})49seneca.accept({50 test: sameBucket('test5')51}, (msg, cb) => {52 cb(null, { test: 'test10' })53})54seneca.accept({55 test: sameBucket('test6')56}, (msg, cb) => {57 cb(null, { test: 'test11' })58})59seneca.accept({60 test: sameBucket('test6')61}, (msg, cb) => {62 cb(null, { test: 'test12' })63})64seneca.accept({65 test: sameBucket('test7')66}, (msg, cb) => {67 cb(null, { test: 'test13' })68})69seneca.accept({70 test: sameBucket('test7')71},

Full Screen

Using AI Code Generation

copy

Full Screen

1var argosy = require('argosy')2var pattern = require('argosy-pattern')3var service = argosy()4service.accept({5 test: sameBucket('a', 'b')6})7service.pipe(service)8service.on('accept', function (facade) {9 facade.test({a: 'foo', b: 'bar'}).on('data', function (data) {10 })11})12### `sameBucket(a, b, c, ...)`13var argosy = require('argosy')14var pattern = require('argosy-pattern')15var service = argosy()16service.accept({17 test: sameBucket('a', 'b')18})19service.pipe(service)20service.on('accept', function (facade) {21 facade.test({a: 'foo', b: 'bar'}).on('data', function (data) {22 })23})24### `sameBucket(a, b, c, ...)`25var argosy = require('argosy')26var pattern = require('argosy-pattern')27var service = argosy()28service.accept({29 test: sameBucket('a', 'b')30})31service.pipe(service)32service.on('accept', function (facade) {33 facade.test({a: 'foo', b: 'bar'}).on('data', function (data) {34 })35})36### `sameBucket(a, b, c, ...)`37var argosy = require('

Full Screen

Using AI Code Generation

copy

Full Screen

1var argosy = require('argosy')2var pattern = require('argosy-pattern')3var service = argosy({4 ping: pattern.match('ping'),5 pong: pattern.match('pong'),6})7service.accept({ping: 'ping'}, function (err, msg) {8 console.log('ping received')9 service.pong('pong')10})11service.on('pong', function (msg) {12 console.log('pong received')13})

Full Screen

Using AI Code Generation

copy

Full Screen

1var argosy = require('argosy')2var pattern = require('argosy-pattern')3var service = argosy()4var pattern = {5}6service.accept(pattern)7service.pipe(service)8service.on('pattern:match', function (pattern, message, respond) {9 respond(null, sameBucket(message))10})11service.listen(3000)12var argosy = require('argosy')13var pattern = require('argosy-pattern')14var service = argosy()15var pattern = {16}17service.accept(pattern)18service.pipe(service)19service.on('pattern:match', function (pattern, message, respond) {20 respond(null, sameBucket(message))21})22service.listen(3001)23var argosy = require('argosy')24var pattern = require('argosy-pattern')25var service = argosy()26var pattern = {27}28service.accept(pattern)29service.pipe(service)30service.on('pattern:match', function (pattern, message, respond) {31 respond(null, sameBucket(message))32})33service.listen(3002)34var argosy = require('argosy')35var pattern = require('argosy-pattern')36var service = argosy()37var pattern = {38}39service.accept(pattern)40service.pipe(service)41service.on('pattern:match', function (pattern, message, respond) {42 respond(null, sameBucket(message))43})44service.listen(3003)45var argosy = require('argosy')46var pattern = require('argosy-pattern')47var service = argosy()48var pattern = {49}50service.accept(pattern)51service.pipe(service)52service.on('pattern:match',

Full Screen

Using AI Code Generation

copy

Full Screen

1const sameBucket = require('argos-s3').sameBucket;2const bucketName = 'argos-test-bucket';3const key = 'test.js';4const region = 'us-east-1';5sameBucket(bucketName, key, region)6.then(data => {7 console.log(data);8})9.catch(err => {10 console.log(err);11});12const sameBucket = require('argos-s3').sameBucket;13const bucketName = 'argos-test-bucket';14const key = 'test.js';15const region = 'us-east-1';16sameBucket(bucketName, key, region)17.then(data => {18 console.log(data);19})20.catch(err => {21 console.log(err);22});23const sameBucket = require('argos-s3').sameBucket;24const bucketName = 'argos-test-bucket';25const key = 'test.js';26const region = 'us-east-1';27sameBucket(bucketName, key, region)28.then(data => {29 console.log(data);30})31.catch(err => {32 console.log(err);33});34const sameBucket = require('argos-s3').sameBucket;35const bucketName = 'argos-test-bucket';36const key = 'test.js';37const region = 'us-east-1';38sameBucket(bucketName, key, region)39.then(data => {40 console.log(data);41})42.catch(err => {43 console.log(err);44});45const sameBucket = require('argos-s3').sameBucket;46const bucketName = 'argos-test-bucket';47const key = 'test.js';48const region = 'us-east-1';49sameBucket(bucketName, key, region)50.then(data => {51 console.log(data);52})53.catch(err => {54 console.log(err);55});56const sameBucket = require('argos-s3').sameBucket;57const bucketName = 'argos-test-bucket';58const key = 'test.js';59const region = 'us-east-1';60sameBucket(bucketName, key, region)61.then(data => {62 console.log(data);63})64.catch(err

Full Screen

Using AI Code Generation

copy

Full Screen

1const argosyPattern = require('argosy-pattern')2#### `sameBucket(bucketName, bucketPath)`3const argosyPattern = require('argosy-pattern')4#### `sameBucket(bucketName, bucketPath, value)`5const argosyPattern = require('argosy-pattern')6#### `sameBucket(bucketName, bucketPath, value, valuePath)`7const argosyPattern = require('argosy-pattern')

Full Screen

Using AI Code Generation

copy

Full Screen

1const argos = require('argos-sdk');2const bucket = argos.Bucket('my-bucket');3const file = bucket.File('path/to/file');4const sameBucket = file.sameBucket('path/to/another/file');5const argos = require('argos-sdk');6const bucket = argos.Bucket('my-bucket');7bucket.getFiles()8 .then((files) => {9 console.log(files);10 });11const argos = require('argos-sdk');12const bucket = argos.Bucket('my-bucket');13bucket.getFilesByPrefix('path/to/dir')14 .then((files) => {15 console.log(files);16 });17const argos = require('argos-sdk');18const bucket = argos.Bucket('my-bucket');19bucket.getFilesBySuffix('.txt')20 .then((files) => {21 console.log(files);22 });23const argos = require('argos-sdk');24const bucket = argos.Bucket('my-bucket');25bucket.getFilesByRegex(/path\/to\/.*\.txt/)26 .then((files) => {27 console.log(files);28 });29const argos = require('argos-sdk');30const bucket = argos.Bucket('my-bucket');31bucket.getFilesByGlob('path/to/*.txt')32 .then((files) => {33 console.log(files);34 });35const argos = require('argos-sdk');36const bucket = argos.Bucket('my

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run argos automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful