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

fix(web): drop software client leftovers #1496

Merged
merged 2 commits into from
Jul 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 1 addition & 53 deletions web/src/client/software.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,6 @@ import { WithProgress, WithStatus } from "./mixins";

const SOFTWARE_SERVICE = "org.opensuse.Agama.Software1";

/**
* Enum for the reasons to select a pattern
*
* @readonly
* @enum { number }
*/
const SelectedBy = Object.freeze({
/** Selected by the user */
USER: 0,
/** Automatically selected as a dependency of another package */
AUTO: 1,
/** No selected */
NONE: 2,
});

/**
* @typedef {object} Product
* @property {string} id - Product ID (e.g., "Leap")
Expand Down Expand Up @@ -91,43 +76,6 @@ class SoftwareBaseClient {
constructor(client) {
this.client = client;
}

/**
* Asks the service to reload the repositories metadata
*
* @return {Promise<Response>}
*/
probe() {
return this.client.post("/software/probe", {});
}

/**
* @return {Promise<SoftwareConfig>}
*/
config() {
return this.client.get("/software/config");
}

/**
* @param {Object.<string, boolean>} patterns - An object where the keys are the pattern names
* and the values whether to install them or not.
* @return {Promise<Response>}
*/
selectPatterns(patterns) {
return this.client.put("/software/config", { patterns });
}

/**
* Registers a callback to run when the select product changes.
*
* @param {(changes: object) => void} handler - Callback function.
* @return {import ("./http").RemoveFn} Function to remove the callback.
*/
onSelectedPatternsChanged(handler) {
return this.client.onEvent("SoftwareProposalChanged", ({ patterns }) => {
handler(patterns);
});
}
}

/**
Expand Down Expand Up @@ -280,4 +228,4 @@ class ProductClient {
}
}

export { ProductClient, SelectedBy, SoftwareClient };
export { ProductClient, SoftwareClient };
Loading