Skip to content

Commit 1a4c5a6

Browse files
Merge branch 'main' into installation-state-manager-resource-check
2 parents f04a0f6 + d057aa1 commit 1a4c5a6

File tree

30 files changed

+6930
-13457
lines changed

30 files changed

+6930
-13457
lines changed

backend/package-lock.json

Lines changed: 2555 additions & 5335 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"author": "",
1414
"license": "ISC",
1515
"dependencies": {
16-
"@babel/runtime": "^7.13.10",
16+
"@babel/runtime": "^7.26.10",
1717
"compression": "^1.8.0",
1818
"cors": "^2.8.5",
1919
"express": "^4.21.2",
@@ -27,17 +27,17 @@
2727
"uuid": "^11.1.0"
2828
},
2929
"devDependencies": {
30-
"@babel/cli": "^7.12.1",
31-
"@babel/node": "^7.12.10",
32-
"@babel/preset-env": "^7.16.11",
33-
"@babel/register": "^7.12.10",
34-
"babel-loader": "^8.2.2",
30+
"@babel/cli": "^7.27.0",
31+
"@babel/node": "^7.26.0",
32+
"@babel/preset-env": "^7.26.9",
33+
"@babel/register": "^7.25.9",
34+
"babel-loader": "^10.0.0",
3535
"core-js": "^3.41.0",
3636
"jest": "^29.7.0",
3737
"nodemon": "^2.0.7",
38-
"webpack": "^5.10.1",
39-
"webpack-cli": "^4.2.0",
40-
"webpack-node-externals": "^2.5.2"
38+
"webpack": "^5.99.5",
39+
"webpack-cli": "6.0.1",
40+
"webpack-node-externals": "^3.0.0"
4141
},
4242
"node": {
4343
"child_process": false

docs/extensibility/50-list-and-details-widgets.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,10 @@ This is an exaple of kind only:
9898

9999
The `ConditionList` widget renders the conditions as an expandable list with condition details. This widget is primarily designed for the overview section **data.details.status** or **data.details.status.body**
100100

101-
| Parameter | Required | Type | Description |
102-
| -------------- | -------- | ---- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
103-
| **highlights** | No | | A map of highlight rules that will only be applied to the `condition` matching `type`. Key refers to the type of highlight, while the rule can be a plain array of values ​​or a string containing the [JSONata](100-jsonata.md) rule. Allowed keys are `informative`, `positive`, `negative`, `critical`, and `type`. <br><br> With the `type` key (required), you can specify which condition the highlighting must be applied to. It must contain one of the `types` of the source condition. <br><br> If no highlighting is provided, the following values ​​are automatically supported: <br> - rendered as informational: `Unknown`. <br> - rendered as positive: `True`. <br> - rendered as critical: `False`. |
101+
| Parameter | Required | Type | Description |
102+
| ----------------- | -------- | ---- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
103+
| **highlights** | No | | A map of highlight rules that will only be applied to the `condition` matching `type`. Key refers to the type of highlight, while the rule can be a plain array of values ​​or a string containing the [JSONata](100-jsonata.md) rule. Allowed keys are `informative`, `positive`, `negative`, `critical`, and `type`. <br><br> With the `type` key (required), you can specify which condition the highlighting must be applied to. It must contain one of the `types` of the source condition. <br><br> If no highlighting is provided, the following values ​​are automatically supported: <br> - rendered as informational: `Unknown`. <br> - rendered as positive: `True`. <br> - rendered as critical: `False`. |
104+
| **customContent** | No | | Allows adding custom content to specific condition types. Each object contains: <br> - `type` (required): The condition type to match <br> - `value` (required): A string, JSONata expression, or a widget definition to render custom content <br> - `header`: Optional header text for the custom content section <br><br> The custom content is rendered above the condition's default message. |
104105

105106
See the following example of the standard `ConditionList`:
106107

@@ -141,6 +142,24 @@ status:
141142

142143
<img src="./assets/display-widgets/ConditionListHighlights.png" alt="Example of a condition list widget with overriden statuses">
143144

145+
This is an example of `ConditionList` with added custom content:
146+
147+
```yaml
148+
status:
149+
body:
150+
- name: Condition details
151+
widget: ConditionList
152+
source: status.conditions
153+
customContent:
154+
- value:
155+
widget: Badge
156+
source: $filter(status.conditions, function($c){$c.type = 'AbleToScale'}).reason
157+
type: AbleToScale
158+
header: Reason
159+
```
160+
161+
<img src="./assets/display-widgets/ConditionListContent.png" alt="Example of a condition list widget with custom content" width="30%">
162+
144163
### `ExternalLink`
145164

146165
The `ExternalLink` widgets render the link to an external page.
112 KB
Loading

kyma/gulpfile.js

Lines changed: 40 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
const fetch = require('node-fetch');
2-
const URL = require('url').URL;
3-
const fs = require('fs');
4-
const jsyaml = require('js-yaml');
1+
import fetch from 'node-fetch';
2+
import { URL } from 'url';
3+
import { readFile, lstatSync, readdirSync } from 'fs';
4+
import { load, dump } from 'js-yaml';
55

6-
const gulp = require('gulp');
7-
const through2 = require('through2');
8-
const concat = require('gulp-concat');
9-
const clean = require('gulp-clean');
6+
import { task, src, dest } from 'gulp';
7+
import { obj as _obj } from 'through2';
8+
import concat from 'gulp-concat';
9+
import clean from 'gulp-clean';
1010

1111
const mapValues = (obj, fn) =>
1212
Object.fromEntries(
@@ -21,12 +21,12 @@ const isUrl = str => {
2121
}
2222
};
2323

24-
const loadExtensions = through2.obj(async function(extensionsFile, _, cb) {
24+
const loadExtensions = _obj(async function(extensionsFile, _, cb) {
2525
const list = JSON.parse(extensionsFile.contents.toString());
2626

2727
const readLocalFile = filePath =>
2828
new Promise((resolve, reject) =>
29-
fs.readFile(filePath, (err, data) => {
29+
readFile(filePath, (err, data) => {
3030
if (err) {
3131
reject(err);
3232
} else {
@@ -50,9 +50,8 @@ const loadExtensions = through2.obj(async function(extensionsFile, _, cb) {
5050
if (isUrl(source)) {
5151
return readExternalFile(source);
5252
} else {
53-
if (fs.lstatSync(source).isDirectory()) {
54-
return fs
55-
.readdirSync(source)
53+
if (lstatSync(source).isDirectory()) {
54+
return readdirSync(source)
5655
.map(name => readLocalFile(source + '/' + name));
5756
} else {
5857
return readLocalFile(source);
@@ -71,9 +70,9 @@ const loadExtensions = through2.obj(async function(extensionsFile, _, cb) {
7170
cb();
7271
});
7372

74-
const loadPreparedExtensions = through2.obj((file, _, cb) => {
73+
const loadPreparedExtensions = _obj((file, _, cb) => {
7574
const convertYamlToObject = yamlString => {
76-
return jsyaml.load(yamlString, { json: true });
75+
return load(yamlString, { json: true });
7776
};
7877

7978
const checkExtensionVersion = metadata => {
@@ -87,102 +86,93 @@ const loadPreparedExtensions = through2.obj((file, _, cb) => {
8786
}
8887
};
8988

90-
const { data, metadata } = jsyaml.load(file.contents.toString());
89+
const { data, metadata } = load(file.contents.toString());
9190

9291
checkExtensionVersion(metadata);
9392

9493
file.contents = Buffer.from(
95-
jsyaml.dump(mapValues(data, convertYamlToObject)),
94+
dump(mapValues(data, convertYamlToObject)),
9695
);
9796
cb(null, file);
9897
});
9998

100-
gulp.task('clean-extensions', () => {
99+
task('clean-extensions', () => {
101100
const env = process.env.ENV;
102-
return gulp
103-
.src(`environments/temp/${env}/extensions-local`, {
101+
return src(`environments/temp/${env}/extensions-local`, {
104102
read: false,
105103
allowEmpty: true,
106104
})
107105
.pipe(clean({ force: true }));
108106
});
109107

110-
gulp.task('get-extensions', () => {
111-
return gulp
112-
.src(`environments/${process.env.ENV}/extensions.json`)
108+
task('get-extensions', () => {
109+
return src(`environments/${process.env.ENV}/extensions.json`)
113110
.pipe(loadExtensions)
114-
.pipe(gulp.dest(`temp/${process.env.ENV}/extensions-local/-/-`)); // gulp strips the 2 last path components?
111+
.pipe(dest(`temp/${process.env.ENV}/extensions-local/-/-`)); // gulp strips the 2 last path components?
115112
});
116113

117-
gulp.task('pack-extensions', () => {
114+
task('pack-extensions', () => {
118115
const env = process.env.ENV;
119-
return gulp
120-
.src(`temp/${env}/extensions-local/**/*.yaml`)
116+
return src(`temp/${env}/extensions-local/**/*.yaml`)
121117
.pipe(loadPreparedExtensions)
122118
.pipe(
123119
concat('extensions.yaml', {
124120
newLine: '---\n',
125121
}),
126122
)
127-
.pipe(gulp.dest(`build/${env}/extensions`));
123+
.pipe(dest(`build/${env}/extensions`));
128124
});
129125

130-
gulp.task('clean-statics', () => {
126+
task('clean-statics', () => {
131127
const env = process.env.ENV;
132-
return gulp
133-
.src(`environments/temp/${env}/extensions/statics-local`, {
128+
return src(`environments/temp/${env}/extensions/statics-local`, {
134129
read: false,
135130
allowEmpty: true,
136131
})
137132
.pipe(clean());
138133
});
139134

140-
gulp.task('get-statics', () => {
141-
return gulp
142-
.src(`environments/${process.env.ENV}/statics.json`)
135+
task('get-statics', () => {
136+
return src(`environments/${process.env.ENV}/statics.json`)
143137
.pipe(loadExtensions)
144-
.pipe(gulp.dest(`temp/${process.env.ENV}/statics-local/-/-`)); // gulp strips the 2 last path components?
138+
.pipe(dest(`temp/${process.env.ENV}/statics-local/-/-`)); // gulp strips the 2 last path components?
145139
});
146140

147-
gulp.task('pack-statics', () => {
141+
task('pack-statics', () => {
148142
const env = process.env.ENV;
149-
return gulp
150-
.src(`temp/${env}/statics-local/**/*.yaml`)
143+
return src(`temp/${env}/statics-local/**/*.yaml`)
151144
.pipe(loadPreparedExtensions)
152145
.pipe(
153146
concat('statics.yaml', {
154147
newLine: '---\n',
155148
}),
156149
)
157-
.pipe(gulp.dest(`build${env}/extensions`));
150+
.pipe(dest(`build${env}/extensions`));
158151
});
159152

160-
gulp.task('clean-wizards', () => {
153+
task('clean-wizards', () => {
161154
const env = process.env.ENV;
162-
return gulp
163-
.src(`environments/temp/${env}/extensions/wizards-local`, {
155+
return src(`environments/temp/${env}/extensions/wizards-local`, {
164156
read: false,
165157
allowEmpty: true,
166158
})
167159
.pipe(clean());
168160
});
169161

170-
gulp.task('get-wizards', () => {
171-
return gulp
172-
.src(`environments/${process.env.ENV}/wizards.json`)
162+
task('get-wizards', () => {
163+
return src(`environments/${process.env.ENV}/wizards.json`)
173164
.pipe(loadExtensions)
174-
.pipe(gulp.dest(`temp/${process.env.ENV}/wizards-local/-/-`)); // gulp strips the 2 last path components?
165+
.pipe(dest(`temp/${process.env.ENV}/wizards-local/-/-`)); // gulp strips the 2 last path components?
175166
});
176167

177-
gulp.task('pack-wizards', () => {
168+
task('pack-wizards', () => {
178169
const env = process.env.ENV;
179-
return gulp
180-
.src(`temp/${env}/wizards-local/**/*.yaml`)
170+
return src(`temp/${env}/wizards-local/**/*.yaml`)
181171
.pipe(loadPreparedExtensions)
182172
.pipe(
183173
concat('wizards.yaml', {
184174
newLine: '---\n',
185175
}),
186176
)
187-
.pipe(gulp.dest(`build/${env}/extensions`));
177+
.pipe(dest(`build/${env}/extensions`));
188178
});

0 commit comments

Comments
 (0)