Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CB-4070 Migrate Project form to form template #3101

Merged
merged 8 commits into from
Dec 11, 2024
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
Loading