Skip to content

Commit

Permalink
#2474 Modify display of user information, modify tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dwalizer committed Nov 21, 2023
1 parent e52fc99 commit dd1af4e
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 100 deletions.
21 changes: 8 additions & 13 deletions dashboard/src/components/access/RevokeUserAccess.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,7 @@ limitations under the License.
fields: [
{
key: 'userId',
label: 'User Id',
sortable: true,
},
{
key: 'firstName',
label: 'First Name',
sortable: true,
},
{
key: 'lastName',
label: 'Last Name',
label: 'User',
sortable: true,
},
],
Expand Down Expand Up @@ -179,16 +169,21 @@ limitations under the License.
getUserDisplay(props) {
const userDisplay = props.userIdForDisplay ? props.userIdForDisplay : props.userId;
const { oAuthProviders } = this.$store.getters.config;
let userName = '';
console.log(props);

Check failure on line 173 in dashboard/src/components/access/RevokeUserAccess.vue

View workflow job for this annotation

GitHub Actions / service-against-postgresql (2)

Unexpected console statement

Check failure on line 173 in dashboard/src/components/access/RevokeUserAccess.vue

View workflow job for this annotation

GitHub Actions / service-against-postgresql (2)

Unexpected console statement
if (props.firstName && props.lastName) {
userName = `(${props.lastName}, ${props.firstName})`;
}
if (oAuthProviders) {
const indexOfDash = userDisplay.lastIndexOf('-');
if (indexOfDash > 0) {
const provider = userDisplay.substr(indexOfDash + 1);
if (oAuthProviders.includes(provider)) {
return userDisplay.substr(0, indexOfDash);
return `${userDisplay.substr(0, indexOfDash)} ${userName}`;
}
}
}
return userDisplay;
return `${userDisplay} ${userName}`;
},
},
};
Expand Down
9 changes: 7 additions & 2 deletions dashboard/src/components/users/UserIdForDisplayMixin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,23 @@ limitations under the License.
name: 'UserIdForDisplayMixin',
methods: {
getUserDisplay(props) {
console.log(props);

Check failure on line 21 in dashboard/src/components/users/UserIdForDisplayMixin.vue

View workflow job for this annotation

GitHub Actions / service-against-postgresql (2)

Unexpected console statement

Check failure on line 21 in dashboard/src/components/users/UserIdForDisplayMixin.vue

View workflow job for this annotation

GitHub Actions / service-against-postgresql (2)

Unexpected console statement
const userDisplay = props.userIdForDisplay ? props.userIdForDisplay : props.userId;
const { oAuthProviders } = this.$store.getters.config;
let userName = '';
if (props.firstName && props.lastName) {
userName = `(${props.lastName}, ${props.firstName})`;
}
if (oAuthProviders) {
const indexOfDash = userDisplay.lastIndexOf('-');
if (indexOfDash > 0) {
const provider = userDisplay.substr(indexOfDash + 1);
if (oAuthProviders.includes(provider)) {
return userDisplay.substr(0, indexOfDash);
return `${userDisplay.substr(0, indexOfDash)} ${userName}`;
}
}
}
return userDisplay;
return `${userDisplay} ${userName}`;
},
},
};
Expand Down
12 changes: 1 addition & 11 deletions dashboard/src/components/users/UsersTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -156,17 +156,7 @@ limitations under the License.
fields: [
{
key: 'userId',
label: 'User Id',
sortable: true,
},
{
key: 'firstName',
label: 'First Name',
sortable: true,
},
{
key: 'lastName',
label: 'Last Name',
label: 'User',
sortable: true,
},
{
Expand Down
10 changes: 5 additions & 5 deletions e2e-tests/cypress/e2e/selfReport_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1068,35 +1068,35 @@ describe('Self Report Skills Management Tests', () => {
colIndex: 0,
value: 'user0'
}, {
colIndex: 4,
colIndex: 2,
value: '100'
}],
[{
colIndex: 0,
value: 'user1'
}, {
colIndex: 4,
colIndex: 2,
value: '100'
}],
[{
colIndex: 0,
value: 'user2'
}, {
colIndex: 4,
colIndex: 2,
value: '100'
}],
[{
colIndex: 0,
value: 'user3'
}, {
colIndex: 4,
colIndex: 2,
value: '100'
}],
[{
colIndex: 0,
value: 'user4'
}, {
colIndex: 4,
colIndex: 2,
value: '100'
}],
]);
Expand Down
Loading

0 comments on commit dd1af4e

Please sign in to comment.