Chore: change hoarder widget to karakeep (#5143)
Some checks failed
Crowdin Action / Crowdin Sync (push) Has been cancelled
Docker CI / Linting Checks (push) Has been cancelled
Docker CI / Docker Build & Push (push) Has been cancelled
Repository Maintenance / Stale (push) Has been cancelled
Repository Maintenance / Lock Old Threads (push) Has been cancelled
Repository Maintenance / Close Answered Discussions (push) Has been cancelled
Repository Maintenance / Close Outdated Discussions (push) Has been cancelled
Repository Maintenance / Close Unsupported Feature Requests (push) Has been cancelled

This commit is contained in:
shamoon
2025-04-05 23:54:48 -07:00
committed by GitHub
parent 6597ec566b
commit ae9fbdcb8b
12 changed files with 91 additions and 73 deletions

View File

@@ -3,6 +3,11 @@ import { SettingsContext } from "utils/contexts/settings";
import Error from "./error";
const ALIASED_WIDGETS = {
pialert: "netalertx",
hoarder: "karakeep",
};
export default function Container({ error = false, children, service }) {
const { settings } = useContext(SettingsContext);
@@ -32,7 +37,17 @@ export default function Container({ error = false, children, service }) {
if (!field.includes(".")) {
fullField = `${type}.${field}`;
}
return fullField === child?.props?.label;
let matches = fullField === child?.props?.label;
// check if the field is an 'alias'
if (matches) {
return true;
} else if (ALIASED_WIDGETS[type]) {
matches = fullField.replace(type, ALIASED_WIDGETS[type]) === child?.props?.label;
return matches;
}
// no match
return false;
}),
);
}