-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
'Select all' behaviour has been changed for tables. Now selecting wil…
…l be applied only to active page. (#120) * unified bulk delete message applied 2-ways-binding to selectAll added onPageChange to paginator selectAll will be applied only to active page added collections utilities * updated version of protractor to latest added using hash for routing module * added fix for getting resolutions on new opened tab * changed logic to get baseurl for opening the links * increased time for loading attachment * added fixes to tests for routing * increased jasmine timeout * updated changelog Co-authored-by: d.bogatko <[email protected]>
- Loading branch information
1 parent
f4bf3cc
commit 28bebed
Showing
16 changed files
with
81 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
import { Component, Input, Output, EventEmitter, ViewChild, OnInit, AfterViewInit, OnDestroy, OnChanges } from '@angular/core'; | ||
import { ActivatedRoute, Router } from '@angular/router'; | ||
import { ListToCsvService } from '../../services/listToCsv.service'; | ||
import { CollectionsService } from '../../services/utilities/collections/collections.service'; | ||
import { ChunkedData } from '../../services/utilities/collections/chunked.data'; | ||
import { TransformationsService } from '../../services/transformations.service'; | ||
import { Filter, FilterHelper } from './filter.helper'; | ||
import { NotificationsService } from 'angular2-notifications'; | ||
|
@@ -63,6 +65,7 @@ export class TableFilterComponent implements OnInit, AfterViewInit, OnDestroy, O | |
emailFieldError = 'Email should be equal to this pattern: [email protected]'; | ||
activePage = 1; | ||
filteredData: any[]; | ||
chunkedData: ChunkedData; | ||
showCreation = false; | ||
appliedFilters: Filter[] = []; | ||
newEntity: {} = {}; | ||
|
@@ -217,7 +220,14 @@ export class TableFilterComponent implements OnInit, AfterViewInit, OnDestroy, O | |
} | ||
|
||
toggleSelectAll(isSelected: boolean) { | ||
this.filteredData.forEach(entity => entity.ft_select = isSelected); | ||
if(this.chunkedData === undefined || (this.chunkedData.chunkSize != this.rowsOnPage)){ | ||
this.chunkedData = CollectionsService.chunk(this.filteredData, this.rowsOnPage) | ||
} | ||
this.chunkedData.data[this.activePage - 1].forEach(entity => entity.ft_select = isSelected); | ||
} | ||
|
||
displayActivePage(){ | ||
this.selectAll = false; | ||
} | ||
|
||
hasSelectedRows() { | ||
|
@@ -666,7 +676,8 @@ export class TableFilterComponent implements OnInit, AfterViewInit, OnDestroy, O | |
} | ||
|
||
openlink(link: string) { | ||
window.open(link); | ||
let baseUrl = window.location.href.replace(this.router.url, '') | ||
window.open(baseUrl + link); | ||
} | ||
|
||
rowClicked(entity: any, col: any, $event: any) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export class ChunkedData { | ||
data: any[]; | ||
chunkSize: number; | ||
|
||
constructor(data: any[], chunkSize: number) { | ||
this.data = data; | ||
this.chunkSize = chunkSize; | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/app/services/utilities/collections/collections.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { ChunkedData } from './chunked.data'; | ||
|
||
|
||
export class CollectionsService { | ||
constructor() { } | ||
|
||
static chunk(data: any[], size: number) : ChunkedData { | ||
let result = [] | ||
for (let i = 0; i < data.length; i += size) { | ||
let chunk = data.slice(i, i + size) | ||
result.push(chunk) | ||
} | ||
return new ChunkedData(result, size); | ||
} | ||
} |