Compare commits
2 Commits
fd00f83585
...
35c1a861f5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
35c1a861f5 | ||
|
|
27101bbdd6 |
@@ -45,7 +45,6 @@ const bootstrapStepDefinitions: readonly BootstrapStepDefinition[] = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
const bootstrapCompletionStorageKey = "moku.bootstrap.completed";
|
const bootstrapCompletionStorageKey = "moku.bootstrap.completed";
|
||||||
const isDevelopmentEnvironment = import.meta.env.DEV;
|
|
||||||
|
|
||||||
const defaultInstanceForm = {
|
const defaultInstanceForm = {
|
||||||
protocol: "http",
|
protocol: "http",
|
||||||
@@ -58,7 +57,7 @@ const defaultModeForm = {
|
|||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
const defaultAdminForm = {
|
const defaultAdminForm = {
|
||||||
displayName: "First admin",
|
displayName: "Admin",
|
||||||
email: "admin@example.com",
|
email: "admin@example.com",
|
||||||
password: "",
|
password: "",
|
||||||
} as const;
|
} as const;
|
||||||
@@ -292,32 +291,6 @@ export const WorkspaceHome = (props: WorkspaceHomeProps): JSX.Element => {
|
|||||||
void submitCurrentStep();
|
void submitCurrentStep();
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleDevelopmentReset = async (): Promise<void> => {
|
|
||||||
const response = await fetch(`${apiBase()}/dev/bootstrap/reset`, {
|
|
||||||
method: "POST",
|
|
||||||
headers: {
|
|
||||||
Accept: "application/json",
|
|
||||||
},
|
|
||||||
});
|
|
||||||
const data = await readResponseBody(response);
|
|
||||||
|
|
||||||
if (!response.ok) {
|
|
||||||
throw new Error(
|
|
||||||
typeof data?.message === "string"
|
|
||||||
? data.message
|
|
||||||
: typeof data?.error?.message === "string"
|
|
||||||
? data.error.message
|
|
||||||
: "Failed to reset development bootstrap state.",
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
writeBootstrapCompletion(false);
|
|
||||||
setIsBootstrapComplete(false);
|
|
||||||
setIsWizardOpen(true);
|
|
||||||
resetWizardState();
|
|
||||||
await appShellData.reload();
|
|
||||||
};
|
|
||||||
|
|
||||||
const statusLabel = (state: BootstrapSubmissionState): string => {
|
const statusLabel = (state: BootstrapSubmissionState): string => {
|
||||||
switch (state.status) {
|
switch (state.status) {
|
||||||
case "submitting":
|
case "submitting":
|
||||||
@@ -379,20 +352,6 @@ export const WorkspaceHome = (props: WorkspaceHomeProps): JSX.Element => {
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</Show>
|
</Show>
|
||||||
<Show when={isDevelopmentEnvironment && isBootstrapStateResolved()}>
|
|
||||||
<div class={styles.heroActions}>
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
class={styles.secondaryButton}
|
|
||||||
data-slot="development-bootstrap-reset"
|
|
||||||
onClick={() => {
|
|
||||||
void handleDevelopmentReset();
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Reset development bootstrap state
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</Show>
|
|
||||||
</section>
|
</section>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
@@ -500,7 +459,7 @@ export const WorkspaceHome = (props: WorkspaceHomeProps): JSX.Element => {
|
|||||||
type="text"
|
type="text"
|
||||||
value={adminForm.displayName}
|
value={adminForm.displayName}
|
||||||
onInput={(event): void => setAdminForm("displayName", event.currentTarget.value)}
|
onInput={(event): void => setAdminForm("displayName", event.currentTarget.value)}
|
||||||
placeholder="First admin"
|
placeholder="Admin"
|
||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
<label class={styles.field}>
|
<label class={styles.field}>
|
||||||
|
|||||||
Reference in New Issue
Block a user