Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
alfa
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OZG-Cloud
app
alfa
Commits
446ef8db
Commit
446ef8db
authored
7 months ago
by
OZGCloud
Browse files
Options
Downloads
Patches
Plain Diff
OZG-6731 OZG 6763 sort users
parent
98506728
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
alfa-client/libs/admin/settings/src/lib/user/user.util.spec.ts
+17
-18
17 additions, 18 deletions
...client/libs/admin/settings/src/lib/user/user.util.spec.ts
alfa-client/libs/admin/settings/src/lib/user/user.util.ts
+0
-1
0 additions, 1 deletion
alfa-client/libs/admin/settings/src/lib/user/user.util.ts
with
17 additions
and
19 deletions
alfa-client/libs/admin/settings/src/lib/user/user.util.spec.ts
+
17
−
18
View file @
446ef8db
...
...
@@ -4,8 +4,8 @@ import { OrganisationseinheitError, OrganisationseinheitErrorType } from './user
import
{
KEYCLOAK_ERROR_MESSAGES
,
UserNamePipe
,
sortUsersByLastName
,
getOrganisationseinheitErrorMessage
,
sortUsersByLastName
,
}
from
'
./user.util
'
;
describe
(
'
user util
'
,
()
=>
{
...
...
@@ -28,23 +28,6 @@ describe('user util', () => {
});
});
describe
(
'
sort users by last name
'
,
()
=>
{
const
users
:
UserRepresentation
[]
=
[
{
id
:
'
1
'
,
lastName
:
'
Müller
'
},
{
id
:
'
2
'
,
lastName
:
'
Schmidt
'
},
{
id
:
'
3
'
,
lastName
:
'
Anders
'
},
];
it
(
'
shoud sort users by last name alphabetically
'
,
()
=>
{
const
sortedUsers
=
sortUsersByLastName
(
users
);
expect
(
sortedUsers
[
0
].
lastName
).
toBe
(
'
Anders
'
);
expect
(
sortedUsers
[
1
].
lastName
).
toBe
(
'
Müller
'
);
expect
(
sortedUsers
[
2
].
lastName
).
toBe
(
'
Schmidt
'
);
});
});
});
describe
(
'
UserNamePipe
'
,
()
=>
{
it
(
'
should return user name
'
,
()
=>
{
const
user
:
UserRepresentation
=
{
firstName
:
'
Max
'
,
lastName
:
'
Mustermann
'
};
...
...
@@ -62,4 +45,20 @@ describe('user util', () => {
expect
(
result
).
toBe
(
'
Unbekannter Benutzer
'
);
});
});
describe
(
'
sort users by last name
'
,
()
=>
{
const
users
:
UserRepresentation
[]
=
[
{
id
:
'
1
'
,
lastName
:
'
Müller
'
},
{
id
:
'
2
'
,
lastName
:
'
Schmidt
'
},
{
id
:
'
3
'
,
lastName
:
'
Anders
'
},
];
it
(
'
shoud sort users by last name alphabetically
'
,
()
=>
{
const
sortedUsers
=
sortUsersByLastName
(
users
);
expect
(
sortedUsers
[
0
].
lastName
).
toBe
(
'
Anders
'
);
expect
(
sortedUsers
[
1
].
lastName
).
toBe
(
'
Müller
'
);
expect
(
sortedUsers
[
2
].
lastName
).
toBe
(
'
Schmidt
'
);
});
});
});
This diff is collapsed.
Click to expand it.
alfa-client/libs/admin/settings/src/lib/user/user.util.ts
+
0
−
1
View file @
446ef8db
import
UserRepresentation
from
'
@keycloak/keycloak-admin-client/lib/defs/userRepresentation
'
;
import
{
Pipe
,
PipeTransform
}
from
'
@angular/core
'
;
import
UserRepresentation
from
'
@keycloak/keycloak-admin-client/lib/defs/userRepresentation
'
;
import
{
OrganisationseinheitError
,
OrganisationseinheitErrorType
}
from
'
./user.model
'
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment