-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Service provider] 'Адміністрування' tab - fix table sorting (#1045)
* check isloading cabinet * fix: table sorting * change template name * fix: replace bydlo-coding with pipe * fix: test * fix: test * remove comments
- Loading branch information
1 parent
028d8bd
commit cc2b8bd
Showing
6 changed files
with
92 additions
and
57 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { ProviderAdminsFilterPipe } from './provider-admins-filter.pipe'; | ||
|
||
describe('ProviderAdminsFilterPipe', () => { | ||
it('create an instance', () => { | ||
const pipe = new ProviderAdminsFilterPipe(); | ||
expect(pipe).toBeTruthy(); | ||
}); | ||
}); |
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 { Pipe, PipeTransform } from '@angular/core'; | ||
import { providerAdminRole } from '../enum/provider-admin'; | ||
import { ProviderAdminTable } from '../models/providerAdmin.model'; | ||
|
||
@Pipe({ | ||
name: 'providerAdminsFilter' | ||
}) | ||
export class ProviderAdminsFilterPipe implements PipeTransform { | ||
|
||
transform(users: ProviderAdminTable[], userType: string): ProviderAdminTable[] { | ||
const isDeputy = userType === providerAdminRole.deputy; | ||
return users.filter((user) => (user.isDeputy === isDeputy)); | ||
} | ||
|
||
} |
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