Skip to content

Commit 02e93a5

Browse files
committed
feat: Adding schema coverage
Signed-off-by: Ilya Buziuk <ibuziuk@redhat.com>
1 parent 0ab063d commit 02e93a5

3 files changed

Lines changed: 166 additions & 1 deletion

File tree

SCHEMA_COVERAGE.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Devfile 2.3.0 Schema Coverage
2+
3+
This document tracks what's implemented vs what's missing from the devfile 2.3.0 schema.
4+
5+
## ✅ Currently Implemented
6+
7+
### Metadata
8+
- ✅ name (required)
9+
- ✅ version
10+
- ✅ displayName
11+
- ✅ description
12+
- ✅ language
13+
- ✅ projectType
14+
- ✅ provider
15+
- ✅ tags
16+
- ✅ website
17+
- ✅ supportUrl
18+
19+
### Projects
20+
- ✅ name (required)
21+
- ✅ clonePath
22+
- ✅ git.remotes
23+
- ✅ git.checkoutFrom.revision
24+
- ✅ git.checkoutFrom.remote
25+
- ✅ zip.location
26+
- ❌ attributes
27+
28+
### Components
29+
- ✅ container (basic)
30+
- ✅ name (required)
31+
- ✅ image (required)
32+
- ✅ mountSources
33+
- ✅ memoryLimit
34+
- ✅ cpuLimit
35+
- ❌ env
36+
- ❌ volumeMounts
37+
- ❌ endpoints
38+
- ❌ sourceMapping
39+
- ❌ dedicatedPod
40+
- ❌ deployByDefault
41+
- ❌ args
42+
- ❌ commands
43+
- ✅ volume (basic)
44+
- ✅ name (required)
45+
- ✅ size
46+
- ❌ ephemeral
47+
- ❌ kubernetes component type
48+
- ❌ openshift component type
49+
- ❌ image component type
50+
51+
### Commands
52+
- ✅ exec (basic)
53+
- ✅ id (required)
54+
- ✅ component (required)
55+
- ✅ commandLine (required)
56+
- ✅ workingDir
57+
- ❌ env
58+
- ❌ group
59+
- ❌ label
60+
- ❌ hotReloadCapable
61+
- ❌ apply command type
62+
- ❌ composite command type
63+
64+
### Events
65+
- ✅ preStart
66+
- ✅ postStart
67+
- ✅ preStop
68+
- ✅ postStop
69+
70+
### Variables
71+
- ✅ Basic key-value pairs
72+
73+
### Other
74+
- ❌ starterProjects (not implemented)
75+
- ❌ parent (not implemented)
76+
- ❌ top-level attributes (in state but no UI)
77+
78+
## 🔄 In Progress
79+
80+
See TODO list for current implementation status.
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
import { useState } from 'react'
2+
import Button from '../common/Button'
3+
import FormInput from './FormInput'
4+
5+
export default function KeyValueArrayManager({
6+
items = [],
7+
onUpdate,
8+
keyLabel = 'Key',
9+
valueLabel = 'Value',
10+
keyPlaceholder = 'key',
11+
valuePlaceholder = 'value',
12+
addButtonText = 'Add Item',
13+
emptyMessage = 'No items added yet.'
14+
}) {
15+
const handleAdd = () => {
16+
const newItems = [...items, { name: '', value: '' }]
17+
onUpdate(newItems)
18+
}
19+
20+
const handleRemove = (index) => {
21+
const newItems = items.filter((_, i) => i !== index)
22+
onUpdate(newItems)
23+
}
24+
25+
const handleUpdate = (index, field, value) => {
26+
const newItems = items.map((item, i) =>
27+
i === index ? { ...item, [field]: value } : item
28+
)
29+
onUpdate(newItems)
30+
}
31+
32+
return (
33+
<div className="space-y-3">
34+
{items.length === 0 ? (
35+
<div className="text-center py-4 bg-gray-50 rounded-lg border border-dashed border-gray-300">
36+
<p className="text-sm text-gray-500">{emptyMessage}</p>
37+
</div>
38+
) : (
39+
<div className="space-y-3">
40+
{items.map((item, index) => (
41+
<div key={index} className="flex gap-3 items-start">
42+
<div className="flex-1">
43+
<FormInput
44+
name={`key-${index}`}
45+
label={keyLabel}
46+
value={item.name || ''}
47+
onChange={(e) => handleUpdate(index, 'name', e.target.value)}
48+
placeholder={keyPlaceholder}
49+
/>
50+
</div>
51+
<div className="flex-1">
52+
<FormInput
53+
name={`value-${index}`}
54+
label={valueLabel}
55+
value={item.value || ''}
56+
onChange={(e) => handleUpdate(index, 'value', e.target.value)}
57+
placeholder={valuePlaceholder}
58+
/>
59+
</div>
60+
<div className="pt-7">
61+
<Button
62+
variant="danger"
63+
onClick={() => handleRemove(index)}
64+
className="text-xs px-2 py-1"
65+
>
66+
Remove
67+
</Button>
68+
</div>
69+
</div>
70+
))}
71+
</div>
72+
)}
73+
<Button
74+
variant="outline"
75+
onClick={handleAdd}
76+
className="w-full text-sm"
77+
>
78+
{addButtonText}
79+
</Button>
80+
</div>
81+
)
82+
}

src/components/steps/ComponentsStep.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import { useWizard } from '../../hooks/useWizardState'
2-
import { COMPONENT_TYPES } from '../../utils/constants'
2+
import { COMPONENT_TYPES, ENDPOINT_PROTOCOLS } from '../../utils/constants'
33
import FormInput from '../forms/FormInput'
44
import FormSelect from '../forms/FormSelect'
55
import FormCheckbox from '../forms/FormCheckbox'
6+
import FormTextarea from '../forms/FormTextarea'
7+
import FormSection from '../forms/FormSection'
68
import ArrayFieldManager from '../forms/ArrayFieldManager'
9+
import KeyValueArrayManager from '../forms/KeyValueArrayManager'
710
import WizardNavigation from '../wizard/WizardNavigation'
811

912
export default function ComponentsStep() {

0 commit comments

Comments
 (0)