Skip to content

Commit d062d58

Browse files
committed
remove user commonname on front end
1 parent aaa5e4a commit d062d58

File tree

7 files changed

+10
-26
lines changed

7 files changed

+10
-26
lines changed

colab-webapp/src/main/node/app/src/components/common/element/Avatar.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ export default function Avatar({ currentUser }: AvatarProps): JSX.Element {
3737
currentUser.firstname && currentUser.lastname
3838
? { first: currentUser.firstname, last: currentUser.lastname }
3939
: undefined;
40-
const uncompleteName =
41-
currentUser.commonname || currentUser.lastname || currentUser.firstname || '?';
40+
const uncompleteName = currentUser.firstname || currentUser.lastname || '?';
4241
const letters = fullName
4342
? `${fullName.first[0]}${fullName.last[0]}`.toUpperCase()
4443
: uncompleteName.slice(0, 2);

colab-webapp/src/main/node/app/src/components/settings/UserProfile.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,6 @@ export default function UserProfile({ user }: UserProfileProps): JSX.Element {
2929
isMandatory: false,
3030
readOnly: true,
3131
},
32-
{
33-
key: 'commonname',
34-
label: i18n.user.model.commonName,
35-
type: 'text',
36-
isMandatory: false,
37-
},
3832
{
3933
key: 'firstname',
4034
label: i18n.user.model.firstname,

colab-webapp/src/main/node/app/src/components/team/InstanceMakersList.tsx

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@
55
* Licensed under the MIT License
66
*/
77

8+
import { css, cx } from '@emotion/css';
9+
import { InstanceMaker } from 'colab-rest-client/dist/ColabClient';
810
import React from 'react';
11+
import * as API from '../../API/api';
912
import useTranslations from '../../i18n/I18nContext';
13+
import { useAppDispatch, useLoadingState } from '../../store/hooks';
1014
import {
1115
useInstanceMakers,
1216
useUserByInstanceMaker,
1317
} from '../../store/selectors/instanceMakerSelector';
14-
import AvailabilityStatusIndicator from '../common/element/AvailabilityStatusIndicator';
15-
import { css, cx } from '@emotion/css';
18+
import { useIsCurrentTeamMemberOwner } from '../../store/selectors/teamMemberSelector';
1619
import { space_xs, text_xs, th_sm } from '../../styling/style';
17-
import { InstanceMaker } from 'colab-rest-client/dist/ColabClient';
18-
import { useAppDispatch, useLoadingState } from '../../store/hooks';
19-
import * as API from '../../API/api';
20-
import { PendingUserName } from './UserName';
20+
import AvailabilityStatusIndicator from '../common/element/AvailabilityStatusIndicator';
2121
import IconButton from '../common/element/IconButton';
2222
import { ConfirmDeleteModal } from '../common/layout/ConfirmDeleteModal';
23-
import { useIsCurrentTeamMemberOwner } from '../../store/selectors/teamMemberSelector';
23+
import { PendingUserName } from './UserName';
2424

2525
interface InstanceMakerRowProps {
2626
instanceMaker: InstanceMaker;
@@ -83,7 +83,6 @@ function InstanceMakerRow({ instanceMaker }: InstanceMakerRowProps): React.React
8383
{user ? (
8484
<>
8585
<>
86-
<td>{user.commonname}</td>
8786
<td>{user.firstname}</td>
8887
<td>{user.lastname}</td>
8988
<td>{user.affiliation}</td>
@@ -96,7 +95,6 @@ function InstanceMakerRow({ instanceMaker }: InstanceMakerRowProps): React.React
9695
</td>
9796
<td />
9897
<td />
99-
<td />
10098
</>
10199
)}
102100
<td className={css({ display: 'flex', alignItems: 'center', justifyContent: 'flex-end' })}>
@@ -168,7 +166,6 @@ export default function InstanceMakersPanel(): React.ReactElement {
168166
})}
169167
>
170168
<tr>
171-
<th className={th_sm}>{i18n.user.model.commonName}</th>
172169
<th className={th_sm}>{i18n.user.model.firstname}</th>
173170
<th className={th_sm}>{i18n.user.model.lastname}</th>
174171
<th className={th_sm}>{i18n.user.model.affiliation}</th>

colab-webapp/src/main/node/app/src/components/team/MembersList.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ export default function TeamMembersPanel(): JSX.Element {
109109
<thead className={teamTableHeaderStyle}>
110110
{/* titles header row */}
111111
<tr className={team1stHeaderRowStyle}>
112-
<th className={teamThStyle}>{i18n.user.model.commonName}</th>
113112
<th className={teamThStyle}>{i18n.user.model.firstname}</th>
114113
<th className={teamThStyle}>{i18n.user.model.lastname}</th>
115114
<th className={teamThStyle}>{i18n.user.model.affiliation}</th>
@@ -200,7 +199,6 @@ function MemberRow({ member }: MemberRowProps): JSX.Element {
200199
)}
201200
{user ? (
202201
<>
203-
<td className={dataStyle(isCurrentUser)}>{user.commonname}</td>
204202
<td className={dataStyle(isCurrentUser)}>{user.firstname}</td>
205203
<td className={dataStyle(isCurrentUser)}>{user.lastname}</td>
206204
<td className={dataStyle(isCurrentUser)}>{user.affiliation}</td>
@@ -212,7 +210,6 @@ function MemberRow({ member }: MemberRowProps): JSX.Element {
212210
</td>
213211
<td />
214212
<td />
215-
<td />
216213
</>
217214
)}
218215

colab-webapp/src/main/node/app/src/components/team/UserName.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,8 @@ export const getDisplayName = (
4646
): string => {
4747
return (
4848
(user != null &&
49-
(((user.firstname || user.lastname) &&
50-
`${user.firstname || ''} ${user.lastname || ''}`.trim()) ||
51-
user.commonname)) ||
49+
(user.firstname || user.lastname) &&
50+
`${user.firstname || ''} ${user.lastname || ''}`.trim()) ||
5251
participant?.displayName ||
5352
i18n.user.anonymous
5453
);

colab-webapp/src/main/node/app/src/i18n/en.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,6 @@ export const en = {
205205
user: {
206206
model: {
207207
username: 'Username',
208-
commonName: 'Common name',
209208
firstname: 'First name',
210209
lastname: 'Last name',
211210
affiliation: 'Affiliation',

colab-webapp/src/main/node/app/src/i18n/fr.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,6 @@ export const fr: ColabTranslations = {
210210
user: {
211211
model: {
212212
username: "Nom d'utilisateur",
213-
commonName: 'Surnom',
214213
firstname: 'Prénom',
215214
lastname: 'Nom',
216215
affiliation: 'Affiliation',

0 commit comments

Comments
 (0)