Skip to content

Commit

Permalink
CB-4070 Migrate Project form to form template (#3101)
Browse files Browse the repository at this point in the history
* CB-4070 small layout issues problems from the ticket comments

* CB-4070 ux fixes for project create/edit behavior

* CB-4070 pr fixes

---------

Co-authored-by: mr-anton-t <[email protected]>
Co-authored-by: Daria Marutkina <[email protected]>
  • Loading branch information
3 people authored Dec 11, 2024
1 parent c2523a6 commit d09bb9b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
15 changes: 10 additions & 5 deletions webapp/packages/core-blocks/src/StatusMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,18 @@ export const StatusMessage = observer<Props>(function StatusMessage({
const errorDetails = useErrorDetails(exception);
const isError = type === ENotificationType.Error || exception !== null;

if (Array.isArray(message)) {
message = message.map(m => translate(m)).join(', ');
} else if (message !== null) {
message = translate(message);
function translateMessage(message: string | string[] | null | undefined) {
if (Array.isArray(message)) {
message = message.map(m => translate(m)).join(', ');
} else if (message !== null) {
message = translate(message);
}

return message;
}

message = message ?? errorDetails.message;
message = translateMessage(message) || translateMessage(errorDetails.message);

let icon = '/icons/info_icon.svg';

if (isError) {
Expand Down
1 change: 1 addition & 0 deletions webapp/packages/core-ui/src/Form/FormPart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export abstract class FormPart<TPartState, TFormState = any> implements IFormPar
if (this.loading) {
return;
}

this.loading = true;

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const GrantedUsersTableInnerHeader = observer<Props>(function GrantedUser
<TableColumnHeader min />
<TableColumnHeader>{translate('administration_teams_team_granted_users_user_id')}</TableColumnHeader>
{showUserTeamRole && (
<TableColumnHeader title={translate('plugin_authentication_administration_team_user_team_role_supervisor_description')}>
<TableColumnHeader title={translate('plugin_authentication_administration_team_user_team_role_supervisor_description')} flex centerContent>
{translate('plugin_authentication_administration_team_user_team_role_supervisor')}
</TableColumnHeader>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const GrantedUsersTableItem = observer<Props>(function GrantedUsersTableI
</TableColumnValue>
<TableColumnValue>{name}</TableColumnValue>
{teamRoles.length > 0 && (
<TableColumnValue title={translate('plugin_authentication_administration_team_user_team_role_supervisor_description')}>
<TableColumnValue title={translate('plugin_authentication_administration_team_user_team_role_supervisor_description')} centerContent flex>
<Checkbox
checked={teamRole === USER_TEAM_ROLE_SUPERVISOR}
onChange={value => onTeamRoleAssign(id, value ? USER_TEAM_ROLE_SUPERVISOR : null)}
Expand Down

0 comments on commit d09bb9b

Please sign in to comment.