Skip to content

Commit

Permalink
fix(web): Try to not crash in unattended installation because of the …
Browse files Browse the repository at this point in the history
…storage section (#1739). (#1793)

## Problem

The **UI** is not ready for the new storage configuration loaded from
the profile.

- #1739
- https://trello.com/c/3BVQ3zl5

## Solution

Adapted the installation finished page using the storage config instead
of the proposal settings as it could not exist.

As the problem is reported just for unattended installation and the
finished page we will provide a fix only for the reporeted issue as the
whole UI should be ready when the new storage features
[branch](https://github.com/agama-project/agama/tree/storage-config-ui)
is merged

## Testing

- *Tested manually*
  • Loading branch information
teclator authored Dec 2, 2024
2 parents 1376214 + f382cf8 commit 20ca77b
Show file tree
Hide file tree
Showing 7 changed files with 507 additions and 33 deletions.
7 changes: 7 additions & 0 deletions web/package/agama-web-ui.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Sun Dec 1 17:14:04 UTC 2024 - Knut Anderssen <[email protected]>

- Do not crash in the InstallationFinished page when running an
unattended installation with an storage section defined in the
profile (gh#agama-project/agama#1793).

-------------------------------------------------------------------
Thu Nov 28 14:34:49 UTC 2024 - David Diaz <[email protected]>

Expand Down
6 changes: 5 additions & 1 deletion web/src/api/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import { get, post } from "~/api/http";
import { Job } from "~/types/job";
import { calculate, fetchSettings } from "~/api/storage/proposal";
import { config } from "~/api/storage/types";

/**
* Starts the storage probing process.
Expand All @@ -33,6 +34,9 @@ const probe = (): Promise<any> => post("/api/storage/probe");

export { probe };

const fetchConfig = (): Promise<config.Config | undefined> =>
get("/api/storage/config").then((config) => config.storage);

/**
* Returns the list of jobs
*/
Expand All @@ -57,4 +61,4 @@ const refresh = async (): Promise<void> => {
await calculate(settings);
};

export { fetchStorageJobs, findStorageJob, refresh };
export { fetchConfig, fetchStorageJobs, findStorageJob, refresh };
4 changes: 4 additions & 0 deletions web/src/api/storage/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -436,3 +436,7 @@ export type SetProposalSettingsResponse = boolean;
export type UsableDevicesResponse = Array<DeviceSid>;

export type PingResponse2 = PingResponse;

import * as config from "./types/config";

export { config };
Loading

0 comments on commit 20ca77b

Please sign in to comment.