Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parametric editor implementation. #73

Merged
merged 18 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
298c3a6
Working implementation of editing of simple text fields using paramet…
kamilmadejek Sep 12, 2024
85c45cb
Many fixes, added description generation, naming refactoring.
kamilmadejek Sep 13, 2024
9f1845f
Different editor behavior for required parameters, some fixes and imp…
kamilmadejek Sep 13, 2024
61e67dc
Refactoring of configuration and label generation.
kamilmadejek Sep 15, 2024
287ffd9
Implemented grouping of rendered editor entries in order to take adva…
kamilmadejek Sep 27, 2024
c4cdda8
WIP - implementation of editable rosters of items.
kamilmadejek Oct 3, 2024
451b6e0
WIP - implementation of editable rosters of items.
kamilmadejek Oct 3, 2024
dc97238
First semi-working version of parametric editor.
kamilmadejek Oct 4, 2024
11fa7ac
Full configuration for parametric WorkloadCluster editor.
kamilmadejek Oct 4, 2024
4391038
Rework of configuration for parametric WorkloadCluster editor using h…
kamilmadejek Oct 4, 2024
8e43e2c
Introduces parametric editors for Nephio Capacity and Token. SelectVa…
kamilmadejek Oct 8, 2024
756150a
Disabled '@typescript-eslint/no-use-before-define' rule. Refactoring.
kamilmadejek Oct 8, 2024
7adf9ba
Refactoring of value descriptors.
kamilmadejek Oct 10, 2024
cd155a2
Added input text filters for text fields. cAdded missing JSDoc.
kamilmadejek Oct 17, 2024
6c15eab
Refactoring.
kamilmadejek Oct 17, 2024
e8f2c19
Refactoring - node list rendering moved to a separate component.
kamilmadejek Oct 17, 2024
d578068
Added support for custom display names in label generation functions.
kamilmadejek Oct 17, 2024
3d31db1
Removed unused first-class editor components. Small refactoring.
kamilmadejek Oct 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion plugins/cad/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,9 @@
* limitations under the License.
*/

module.exports = require('@backstage/cli/config/eslint-factory')(__dirname);
module.exports = require('@backstage/cli/config/eslint-factory')(__dirname, {
rules: {
'@typescript-eslint/no-use-before-define': 'off',
'no-else-return': 'off',
},
});
2 changes: 2 additions & 0 deletions plugins/cad/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@
"@material-ui/lab": "4.0.0-alpha.57",
"@monaco-editor/loader": "1.3.0",
"@monaco-editor/react": "4.4.2",
"change-case": "^5.4.4",
"diff": "^5.0.0",
"js-yaml": "^4.0.0",
"lodash": "^4.17.21",
"moment": "^2.29.1",
"monaco-editor": "^0.33.0",
"nanoid": "^5.0.7",
"react-use": "^17.2.4"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion plugins/cad/src/components/Controls/Tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const Tabs = (props: TabsProps) => {
))}
</MUITabs>
{props.tabs.map(({ content }, index) => (
<div className={classes.content} hidden={value !== index}>
<div className={classes.content} key={index} hidden={value !== index}>
{content}
</div>
))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import {
DeploymentEditor,
StatefulSetEditor,
} from './FirstClassEditors/DeploymentEditor';
import { CapacityEditor } from './FirstClassEditors/CapacityEditor';
import { IngressEditor } from './FirstClassEditors/IngressEditor';
import { KptfileEditor } from './FirstClassEditors/KptfileEditor';
import { NamespaceEditor } from './FirstClassEditors/NamespaceEditor';
Expand All @@ -34,8 +33,9 @@ import { ServiceAccountEditor } from './FirstClassEditors/ServiceAccountEditor';
import { ServiceEditor } from './FirstClassEditors/ServiceEditor';
import { SetLabelsEditor } from './FirstClassEditors/SetLabelsEditor';
import { PackageVariantSetEditor } from './FirstClassEditors/PackageVariantSetEditor';
import { NephioTokenEditor } from './FirstClassEditors/NephioTokenEditor';
import { WorkloadClusterEditor } from './FirstClassEditors/WorkloadClusterEditor';
import { NephioCapacityParametricEditor } from './ParametricFirstClassEditors/NephioCapacityParametricEditor';
import { NephioTokenParametricEditor } from './ParametricFirstClassEditors/NephioTokenParametricEditor';
import { NephioWorkloadClusterParametricEditor } from './ParametricFirstClassEditors/NephioWorkloadClusterParametricEditor';

type OnUpdatedYamlFn = (yaml: string) => void;
type OnNoNamedEditorFn = () => void;
Expand Down Expand Up @@ -114,11 +114,19 @@ export const FirstClassEditorSelector = ({
return <SetLabelsEditor yaml={yaml} onUpdatedYaml={onUpdatedYaml} />;

case 'infra.nephio.org/v1alpha1/Token':
return <NephioTokenEditor yaml={yaml} onUpdatedYaml={onUpdatedYaml} />;
return (
<NephioTokenParametricEditor
yamlText={yaml}
onResourceChange={onUpdatedYaml}
/>
);

case 'infra.nephio.org/v1alpha1/WorkloadCluster':
return (
<WorkloadClusterEditor yaml={yaml} onUpdatedYaml={onUpdatedYaml} />
<NephioWorkloadClusterParametricEditor
yamlText={yaml}
onResourceChange={onUpdatedYaml}
/>
);

case 'kpt.dev/v1/Kptfile':
Expand Down Expand Up @@ -152,7 +160,12 @@ export const FirstClassEditorSelector = ({
);

case 'req.nephio.org/v1alpha1/Capacity':
return <CapacityEditor yaml={yaml} onUpdatedYaml={onUpdatedYaml} />;
return (
<NephioCapacityParametricEditor
yamlText={yaml}
onResourceChange={onUpdatedYaml}
/>
);

case 'v1/ConfigMap':
return <ConfigMapEditor yaml={yaml} onUpdatedYaml={onUpdatedYaml} />;
Expand Down

This file was deleted.

This file was deleted.

Loading