mirror of
https://github.com/coder/coder.git
synced 2025-07-13 21:36:50 +00:00
fix: correctly display loading spinner (#16167)
Update the usages of the new spinner component to correctly set the loading prop
This commit is contained in:
@ -48,7 +48,7 @@ export const DialogActionButtons: FC<DialogActionButtonsProps> = ({
|
||||
data-testid="confirm-button"
|
||||
type="submit"
|
||||
>
|
||||
{confirmLoading && <Spinner loading />}
|
||||
<Spinner loading={confirmLoading} />
|
||||
{confirmText}
|
||||
</Button>
|
||||
)}
|
||||
|
@ -357,7 +357,7 @@ export const CreateTemplateForm: FC<CreateTemplateFormProps> = (props) => {
|
||||
Cancel
|
||||
</Button>
|
||||
<Button type="submit" disabled={isSubmitting}>
|
||||
{isSubmitting && <Spinner />}
|
||||
<Spinner loading={isSubmitting} />
|
||||
{jobError ? "Retry" : "Save"}
|
||||
</Button>
|
||||
{logs && (
|
||||
|
@ -152,7 +152,7 @@ export const CreateTokenForm: FC<CreateTokenFormProps> = ({
|
||||
Cancel
|
||||
</Button>
|
||||
<Button type="submit" disabled={isCreating}>
|
||||
{isCreating && <Spinner />}
|
||||
<Spinner loading={isCreating} />
|
||||
{creationFailed ? "Retry" : "Create token"}
|
||||
</Button>
|
||||
</FormFooter>
|
||||
|
@ -210,7 +210,7 @@ export const CreateUserForm: FC<
|
||||
Cancel
|
||||
</Button>
|
||||
<Button type="submit" disabled={isLoading}>
|
||||
{isLoading && <Spinner />}
|
||||
<Spinner loading={isLoading} />
|
||||
Save
|
||||
</Button>
|
||||
</FormFooter>
|
||||
|
@ -322,7 +322,7 @@ export const CreateWorkspacePageView: FC<CreateWorkspacePageViewProps> = ({
|
||||
type="submit"
|
||||
disabled={creatingWorkspace || !hasAllRequiredExternalAuth}
|
||||
>
|
||||
{creatingWorkspace && <Spinner />}
|
||||
<Spinner loading={creatingWorkspace} />
|
||||
Create workspace
|
||||
</Button>
|
||||
</FormFooter>
|
||||
|
@ -113,7 +113,7 @@ const UpdateGroupForm: FC<UpdateGroupFormProps> = ({
|
||||
</Button>
|
||||
|
||||
<Button type="submit" disabled={isLoading}>
|
||||
{isLoading && <Spinner />}
|
||||
<Spinner loading={isLoading} />
|
||||
Save
|
||||
</Button>
|
||||
</FormFooter>
|
||||
|
@ -99,6 +99,7 @@ export const CreateEditRolePageView: FC<CreateEditRolePageViewProps> = ({
|
||||
form.handleSubmit();
|
||||
}}
|
||||
>
|
||||
<Spinner loading={isLoading} />
|
||||
{role !== undefined ? "Save" : "Create Role"}
|
||||
</Button>
|
||||
</div>
|
||||
@ -141,7 +142,7 @@ export const CreateEditRolePageView: FC<CreateEditRolePageViewProps> = ({
|
||||
</Button>
|
||||
|
||||
<Button type="submit" disabled={isLoading}>
|
||||
{isLoading && <Spinner />}
|
||||
<Spinner loading={isLoading} />
|
||||
{role ? "Save role" : "Create Role"}
|
||||
</Button>
|
||||
</FormFooter>
|
||||
|
@ -100,7 +100,7 @@ export const CreateGroupPageView: FC<CreateGroupPageViewProps> = ({
|
||||
</Button>
|
||||
|
||||
<Button type="submit" disabled={isLoading}>
|
||||
{isLoading && <Spinner />}
|
||||
<Spinner loading={isLoading} />
|
||||
Save
|
||||
</Button>
|
||||
</FormFooter>
|
||||
|
@ -124,7 +124,7 @@ const UpdateGroupForm: FC<UpdateGroupFormProps> = ({
|
||||
</Button>
|
||||
|
||||
<Button type="submit" disabled={isLoading}>
|
||||
{isLoading && <Spinner />}
|
||||
<Spinner loading={isLoading} />
|
||||
Save
|
||||
</Button>
|
||||
</FormFooter>
|
||||
|
@ -1,5 +1,4 @@
|
||||
import type { Interpolation, Theme } from "@emotion/react";
|
||||
import Button from "@mui/material/Button";
|
||||
import TextField from "@mui/material/TextField";
|
||||
import { isApiValidationError } from "api/errors";
|
||||
import type {
|
||||
@ -7,6 +6,7 @@ import type {
|
||||
UpdateOrganizationRequest,
|
||||
} from "api/typesGenerated";
|
||||
import { ErrorAlert } from "components/Alert/ErrorAlert";
|
||||
import { Button } from "components/Button/Button";
|
||||
import { DeleteDialog } from "components/Dialogs/DeleteDialog/DeleteDialog";
|
||||
import {
|
||||
FormFields,
|
||||
@ -119,7 +119,7 @@ export const OrganizationSettingsPageView: FC<
|
||||
|
||||
<FormFooter>
|
||||
<Button type="submit" disabled={form.isSubmitting}>
|
||||
{form.isSubmitting && <Spinner />}
|
||||
<Spinner loading={form.isSubmitting} />
|
||||
Save
|
||||
</Button>
|
||||
</FormFooter>
|
||||
@ -133,11 +133,7 @@ export const OrganizationSettingsPageView: FC<
|
||||
>
|
||||
<div css={styles.dangerSettings}>
|
||||
<span>Deleting an organization is irreversible.</span>
|
||||
<Button
|
||||
css={styles.dangerButton}
|
||||
color="warning"
|
||||
onClick={() => setIsDeleting(true)}
|
||||
>
|
||||
<Button variant="destructive" onClick={() => setIsDeleting(true)}>
|
||||
Delete this organization
|
||||
</Button>
|
||||
</div>
|
||||
|
@ -298,7 +298,7 @@ export const TemplateSettingsForm: FC<TemplateSettingsForm> = ({
|
||||
</Button>
|
||||
|
||||
<Button type="submit" disabled={isSubmitting}>
|
||||
{isSubmitting && <Spinner />}
|
||||
<Spinner loading={isSubmitting} />
|
||||
Save
|
||||
</Button>
|
||||
</FormFooter>
|
||||
|
@ -639,7 +639,7 @@ export const TemplateScheduleForm: FC<TemplateScheduleForm> = ({
|
||||
type="submit"
|
||||
disabled={isSubmitting || !form.isValid || !form.dirty}
|
||||
>
|
||||
{isSubmitting && <Spinner />}
|
||||
<Spinner loading={isSubmitting} />
|
||||
Save
|
||||
</Button>
|
||||
</FormFooter>
|
||||
|
@ -114,7 +114,7 @@ export const TemplateVariablesForm: FC<TemplateVariablesForm> = ({
|
||||
</Button>
|
||||
|
||||
<Button type="submit" disabled={isSubmitting}>
|
||||
{isSubmitting && <Spinner />}
|
||||
<Spinner loading={isSubmitting} />
|
||||
Save
|
||||
</Button>
|
||||
</FormFooter>
|
||||
|
@ -165,7 +165,7 @@ export const WorkspaceParametersForm: FC<WorkspaceParameterFormProps> = ({
|
||||
type="submit"
|
||||
disabled={isSubmitting || disabled || !form.dirty}
|
||||
>
|
||||
{isSubmitting && <Spinner />}
|
||||
<Spinner loading={isSubmitting} />
|
||||
Submit and restart
|
||||
</Button>
|
||||
</FormFooter>
|
||||
|
@ -456,7 +456,7 @@ export const WorkspaceScheduleForm: FC<WorkspaceScheduleFormProps> = ({
|
||||
(!template.allow_user_autostart && !template.allow_user_autostop)
|
||||
}
|
||||
>
|
||||
{isLoading && <Spinner />}
|
||||
<Spinner loading={isLoading} />
|
||||
Save
|
||||
</Button>
|
||||
</FormFooter>
|
||||
|
@ -123,7 +123,7 @@ export const WorkspaceSettingsForm: FC<WorkspaceSettingsFormProps> = ({
|
||||
</Button>
|
||||
|
||||
<Button type="submit" disabled={form.isSubmitting}>
|
||||
{form.isSubmitting && <Spinner />}
|
||||
<Spinner loading={form.isSubmitting} />
|
||||
Save
|
||||
</Button>
|
||||
</FormFooter>
|
||||
|
Reference in New Issue
Block a user