Skip to content

Commit

Permalink
Remove field validation
Browse files Browse the repository at this point in the history
Co-authored-by: shamoon <[email protected]>
  • Loading branch information
fcornelius and shamoon authored Nov 19, 2024
1 parent 48d8f98 commit d08383d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/widgets/argocd/component.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ import useWidgetAPI from "utils/proxy/use-widget-api";
export default function Component({ service }) {
const { widget } = service;

// Limits fields to available statuses
const validFields = ["apps", "synced", "outOfSync", "healthy", "progressing", "degraded", "suspended", "missing"];
widget.fields = widget.fields?.filter((field) => validFields.includes(field));
if (!widget.fields) {
widget.fields = ["apps", "synced", "outOfSync", "healthy"];
}

// Limits max number of displayed fields
const MAX_ALLOWED_FIELDS = 4;
if (widget.fields?.length > MAX_ALLOWED_FIELDS) {
widget.fields = widget.fields.slice(0, MAX_ALLOWED_FIELDS);
Expand Down

0 comments on commit d08383d

Please sign in to comment.