Skip to content

Commit

Permalink
chore(supernova): add embedded property to README and fix typos (#677)
Browse files Browse the repository at this point in the history
* chore(supernova): adds embedded prop to the readme and some typos

* chore(heureka): removes prop from the template since it points to a default value
  • Loading branch information
ArtieReus authored Dec 11, 2024
1 parent 9e4ffbc commit d1e3960
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 32 deletions.
3 changes: 1 addition & 2 deletions apps/heureka/appProps.template.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"theme": "theme-dark",
"apiEndpoint": "https://api.example.com/v1",
"embedded": false
"apiEndpoint": "https://api.example.com/v1"
}
86 changes: 57 additions & 29 deletions apps/supernova/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ To set the endpoint:

- Configured via app prop `endpoint`, which is used during the setup of the script tag.

Example:
Example value:

```json
"https://myalertmanager.com/api/v2"
Expand All @@ -196,21 +196,25 @@ Example value:

InitialFilters are the filters that are applied when the app is loaded. The filters must be an object where the key is the label and the value are the values to filter on.

Example:
To set the inital Filters:

- Configured via app prop `initialFilters`

Example value:

```json
{ "cluster": ["prod-1", "prod-2"], "status": ["critical"] }
```

To set the inital Filters:

- Configured via app prop `initialFilters`

### Predefined Filters (**optional**)

PredefinedFilters are groups of filters comprised of a list of filter labels and a regex that is used to filter on the values of that label. They can be thought of as filter categories where the filter logic can be more complex than simple label+values pairs. Predefined filters are defined as an array of objects, where each object is a predefined filter which contains the display name for the UI as well as a list of filter label + value regex pairs which are AND concatenated when they are being evaluated.

Example:
To set the predefined Filter:

- Configured via app prop `predefinedFilters`

Example value:

```json
[
Expand All @@ -224,10 +228,6 @@ Example:
]
```

To set the predefined Filter:

- Configured via app prop `predefinedFilters`

### Silence excluded alert labels (**optional**)

Excluded labels are a collection of labels that are automatically excluded by default when configuring silence matchers. These labels, such as `pod`, `pod_name` or `instance`, often undergo frequent value changes, causing new alerts to be triggered that are not covered by the existing silence.
Expand Down Expand Up @@ -262,7 +262,7 @@ To set the excluded alert labels:

- Configured via app prop `silenceExcludedLabels`

Example:
Example value:

```json
["pod", "pod_name", "instance"]
Expand All @@ -272,26 +272,24 @@ Example:

Defines pre-configured silences available in the schedule silence modal for scheduling future silences. For example when setting up maintenance windows where it is known that certain alerts will fire. The format consists of a list of objects including description, editable_labels (array of strings specifying the labels that users can modify), fixed_labels (map containing fixed labels and their corresponding values), status, and title.

Example:

```json
"silenceTemplates": [
{
"description": "Description of the silence template",
"editable_labels": ["region"],
"fixed_labels": {
"name": "Marvin",
},
"status": "active",
"title": "Silence"
}
]
```

To set the silence templates:

- Configured via app prop `silenceTemplates`, which is used during the setup of the script tag.

Example value:

```json
{
"description": "Description of the silence template",
"editable_labels": ["region"],
"fixed_labels": {
"name": "Marvin"
},
"status": "active",
"title": "Silence"
}
```

### Theme (**optional**)

Set this attribute to specify a custom theme for your application. Possible values are `"theme-light"` or `"theme-dark"` (default)
Expand All @@ -300,6 +298,36 @@ To set the theme:

- Configured via app prop `theme`

Example value:

```json
"theme-dark"
```

### Username (**optional**)

Username used for forms and API requests
Default username for setting silences. If not provided, the field will remain empty, requiring the user to enter the username manually.

To set the username:

- Configured via app prop `username`

Example value:

```json
"John Doe"
```

### Embedded (**optional**)

Set to `true` if the app will be embedded within another app or page. When `true`, the app will not display the header or footer, rendering only the content. Default is `false`.

To set the embedded mode:

- Configured via app prop `embedded`

Example value:

```json
false
```
2 changes: 1 addition & 1 deletion apps/supernova/src/components/silences/SilenceNew.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const SilenceNew = ({ alert, size, variant }) => {
setFormState({
...formState,
...DEFAULT_FORM_VALUES,
createdBy: user || "", // empty sting to prevent undefined for TextInput
createdBy: user || "", // empty string to prevent undefined for TextInput
matchers: setupMatchers(alert?.labels, excludedLabels, enrichedLabels),
})

Expand Down

0 comments on commit d1e3960

Please sign in to comment.