Skip to content

Commit 3ebc8f7

Browse files
committed
Merge branch 'main' of github.com:kyma-project/busola into ui5-migrate-v2
2 parents 2bf6dbf + 352950a commit 3ebc8f7

26 files changed

+594
-646
lines changed

.github/workflows/accessibility-tests.yml

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@ on:
1313
jobs:
1414
run-accessibility-tests:
1515
runs-on: ubuntu-latest
16+
if: github.event.pull_request.draft == false
1617
steps:
1718
- uses: actions/checkout@v4
18-
with:
19-
ref: ${{ github.event.pull_request.head.sha }}
20-
fetch-depth: 0
2119
- name: Install k3d
2220
env:
2321
K3D_URL: https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh
@@ -29,30 +27,17 @@ jobs:
2927
- uses: actions/setup-node@v4
3028
with:
3129
node-version: 20
32-
- name: setup_busola
30+
- name: Setup busola
3331
shell: bash
3432
run: |
35-
set -e
36-
npm ci
37-
npm run build
38-
npm i -g serve
39-
- name: run_tests
33+
.github/scripts/setup_local_busola.sh
34+
- name: Run tests
4035
shell: bash
4136
env:
4237
ACC_AMP_TOKEN: ${{ secrets.ACC_AMP_TOKEN }}
4338
run: |
44-
k3d kubeconfig get kyma > tests/integration/fixtures/kubeconfig.yaml
45-
export CYPRESS_DOMAIN=http://localhost:3000
46-
serve -s build > busola.log &
47-
48-
pushd backend
49-
npm start > backend.log &
50-
popd
51-
52-
echo "waiting for server to be up..."
53-
while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' "$CYPRESS_DOMAIN")" != "200" ]]; do sleep 5; done
54-
sleep 10
55-
39+
k3d kubeconfig get k3dCluster > tests/integration/fixtures/kubeconfig.yaml
40+
export CYPRESS_DOMAIN=http://localhost:3001
5641
cd tests/integration
5742
npm ci && ACC_AMP_TOKEN=$ACC_AMP_TOKEN npm run "test:accesibility"
5843
- name: Uploads artifacts

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,13 @@ For the information on how to run tests and configure them, go to the [`tests`](
180180

181181
## Deploy Busola in the Kubernetes Cluster
182182

183-
To install Busola in the Kubernetes cluster, run:
183+
To install Busola from release in the Kubernetes cluster set `VERSION` shell environment variable with desired release and run:
184+
185+
```shell
186+
kubectl apply -f https://github.com/kyma-project/busola/releases/download/${VERSION}/busola.yaml
187+
```
188+
189+
To install Busola from main branch in the Kubernetes cluster, run:
184190

185191
```shell
186192
(cd resources && kustomize build base/ | kubectl apply -f- )

docs/extensibility/100-jsonata.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Use JSONata Expressions with Resource-Based Extensions
2+
3+
## Scoping
4+
5+
The primary data source of [JSONata](https://docs.jsonata.org/overview.html) expressions changes depending on where it's used. Starting with the root, it contains the whole resource, but whenever it's in a child whose parent has a **source** (in lists and details) or **path** (in forms) parameter, the scope changes to data from that source or path.
6+
7+
Additionally, the scope in arrays changes to the array item.
8+
9+
For example, for this resource:
10+
11+
```yaml
12+
spec:
13+
name: foo
14+
description: bar
15+
items:
16+
- name: item-name
17+
details:
18+
status: ok
19+
```
20+
21+
The following definition has their scope changed as follows:
22+
23+
```yaml
24+
- source: spec.name # top level, scope is the same as a resource
25+
26+
- source: spec # top level, scope is the same as a resource
27+
children:
28+
- source: name # parent has source=spec, therefore this refers to spec.name
29+
30+
- children:
31+
- source: spec.name # As there's no parent source here, the scope is still the resource
32+
33+
- source: spec.items
34+
children:
35+
- source: name # parent data is an array, therefore scope changes to its item - this refers to spec.items[0].name
36+
- source: details.status # refers to spec.items[0].details.status (same as above)
37+
- source: details # this changes scope for its children again
38+
children:
39+
source: status # this refers to spec.items[0].details.status
40+
```
41+
42+
## Common Variables
43+
44+
Common variables are the primary means to bypass the default scoping.
45+
46+
- **\$root** - always contains the reference to the resource, so any JSONata in the example above can always be `$root.spec.name`.
47+
- **\$item** - refers to the most recent array item. When not in an array, it's equal to **\$root**.
48+
- **\$items** - contains an array of references to all parent array items (with the last item being equal to **\$item**).
49+
- **\$value** - when used in a JSONata other than **source** (for example **visibility**, but also other widget-specific formulas), contains the value returned by the source.
50+
- **\$index** - exists in array components, refers to the index of the current item of an array.
51+
52+
### Example
53+
54+
```yaml
55+
- widget: Table
56+
source: spec.rules
57+
visibility: $exists($value)
58+
collapsibleTitle: "'Rule #' & $string($index + 1)"
59+
```
60+
61+
## Data Sources
62+
63+
Whenever data sources are provided, they are available as corresponding variable names. For more information, see [Configure the dataSources Section](90-datasources.md).
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# JSONata Preset Functions for Resource-Based Extensions
2+
3+
## canI (resourceGroupAndVersion, resourceKind)
4+
5+
You can use the **canI** function to determine if a user has access rights to list a specified resource. The function comes with the following parameters:
6+
7+
- **resourceGroupAndVersion**: Determines the first part of a resource URL following the pattern: `${resource group}/${resource version}`.
8+
- **resourceKind**: Describes a resource kind.
9+
10+
### Example
11+
12+
```yaml
13+
- path: spec.gateway
14+
name: gateway
15+
visibility: $not($canI('networking.istio.io/v1beta1', 'Gateway'))
16+
```
17+
18+
## compareStrings (first, second)
19+
20+
You can use this function to sort two strings alphabetically. The function comes with the following parameters:
21+
22+
- **first**: Determines the first string to compare.
23+
- **second**: Determines the second string to compare.
24+
25+
### Example
26+
27+
Here is an example from the [ResourceList widget](./50-list-and-details-widgets.md#resourcelist):
28+
29+
```yaml
30+
- widget: ResourceList
31+
source: '$myDeployments()'
32+
name: Example ResourceList Deployments
33+
sort:
34+
- source: '$item.spec.strategy.type'
35+
compareFunction: '$compareStrings($second, $first)'
36+
default: true
37+
```
38+
39+
## matchByLabelSelector (item, selectorPath)
40+
41+
You can use this function to match Pods using a resource selector. The function comes with the following parameters:
42+
43+
- **item**: Describes a Pod to be used.
44+
- **selectorPath**: Defines a path to selector labels from `$root`.
45+
46+
### Example
47+
48+
Example from [dataSources](90-datasources.md).
49+
50+
```yaml
51+
- podSelector:
52+
resource:
53+
kind: Pod
54+
version: v1
55+
filter: '$matchByLabelSelector($item, $root.spec.selector)'
56+
```
57+
58+
## matchEvents (item, kind, name)
59+
60+
You can use this function to match Events using a resource selector. The function comes with the following parameters:
61+
62+
- **item**: Describes an Event to be checked.
63+
- **kind**: Describes the kind of the Event emitting resource.
64+
- **name**: Describes the name of the Event emitting resource.
65+
66+
### Example
67+
68+
```yaml
69+
- widget: EventList
70+
filter: '$matchEvents($item, $root.kind, $root.metadata.name)'
71+
name: events
72+
defaultType: NORMAL
73+
hideInvolvedObjects: true
74+
```
75+
76+
## readableTimestamp (timestamp)
77+
78+
You can use this function to convert time to readable time. The function comes with the following parameters:
79+
80+
- **timestamp**: Defines a timestamp to convert.
81+
82+
### Example
83+
84+
```yaml
85+
- source: '$readableTimestamp($item.lastTransitionTime)'
86+
name: status.conditions.lastTransitionTime
87+
```

docs/extensibility/110-presets.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Configure the presets Section
2+
3+
The **presets** section contains a list of objects that define which preset and template are used in the form view. If you specify a preset, it is displayed in the dropdown list along with the **Clear** option. When you select a preset, the form is filled with the values defined in the **value** property.
4+
5+
## Available Parameters
6+
7+
| Parameter | Required | Type | Description |
8+
| ----------- | -------- | ------- | ------------------------------------------------------------------------------------------------ |
9+
| **name** | **Yes** | string | A name to display on the preset's dropdown. |
10+
| **value** | **Yes** | | It contains the fields that are set when you choose the given preset from the list. |
11+
| **default** | No | boolean | If set to `true`, it prefills the form with values defined in **value**. It defaults to `false`. |
12+
13+
## Example
14+
15+
```yaml
16+
- name: template
17+
default: true
18+
value:
19+
metadata:
20+
name: my-name
21+
spec:
22+
description: A set description
23+
- name: preset
24+
value:
25+
metadata:
26+
name: second-one
27+
spec:
28+
data: regex
29+
description: A different description
30+
items:
31+
- name: item-1
32+
value: 10
33+
- name: item-2
34+
value: 11
35+
- name: item-3
36+
value: 5
37+
```

0 commit comments

Comments
 (0)