Skip to content

Commit abd4d58

Browse files
Merge pull request #1722 from rnc/UI
Add Repositories/toolVersion and sort
2 parents de6a24f + f5ca64a commit abd4d58

File tree

1 file changed

+118
-63
lines changed
  • java-components/management-console/src/main/webui/src/components/BuildEdit

1 file changed

+118
-63
lines changed

java-components/management-console/src/main/webui/src/components/BuildEdit/BuildEdit.tsx

Lines changed: 118 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,79 @@ export const BuildEdit: React.FunctionComponent<BuildEditModalData> = (data) =>
8585
s.version = v
8686
})}></Checkbox>
8787
</FormGroup>
88+
<FormGroup label="Additional Args">
89+
<Button variant="control" onClick={() => {
90+
stateChange((s, v) => {
91+
if (s.buildInfo.additionalArgs) {
92+
s.buildInfo.additionalArgs.push("")
93+
} else {
94+
s.buildInfo.additionalArgs = [""]
95+
}
96+
})(info.buildInfo, null)
97+
}}>Add Additional Param</Button>
98+
99+
</FormGroup>
100+
{info.buildInfo.additionalArgs?.map((s, index) =>
101+
<FormGroup
102+
label="Additional Arg"
103+
labelIcon={
104+
<Popover bodyContent={<div>An additional param</div>}><HelpIcon/></Popover>
105+
}
106+
fieldId="artifact-edit-additional-arg">
107+
<TextInput
108+
id="artifact-edit-additional-arg"
109+
name="artifact-edit-additional-arg"
110+
value={s}
111+
onChange={stateChange((s, v) => {
112+
if (s.buildInfo.additionalArgs) {
113+
s.buildInfo.additionalArgs[index] = v
114+
}
115+
})}
116+
/>
117+
</FormGroup>)}
118+
<FormGroup label="Allowed Differences to Upstream">
119+
<Button variant="control" onClick={() => {
120+
stateChange((s, v) => {
121+
if (s.buildInfo.allowedDifferences) {
122+
s.buildInfo.allowedDifferences.push("")
123+
} else {
124+
s.buildInfo.allowedDifferences = [""]
125+
}
126+
})(info.buildInfo, null)
127+
}}>Add Allowed Difference</Button>
128+
129+
</FormGroup>
130+
{info.buildInfo.allowedDifferences?.map((s, index) =>
131+
<FormGroup
132+
label="Difference"
133+
labelIcon={
134+
<Popover bodyContent={<div>A regex that matches a validation failure to ignore</div>}><HelpIcon/></Popover>
135+
}
136+
fieldId="artifact-edit-upstream-diff">
137+
<TextInput
138+
id="artifact-edit-upstream-diff"
139+
name="artifact-edit-upstream-diff"
140+
value={s}
141+
onChange={stateChange((s, v) => {
142+
if (s.buildInfo.allowedDifferences) {
143+
s.buildInfo.allowedDifferences[index] = v
144+
}
145+
})}
146+
/>
147+
</FormGroup>)}
148+
<FormGroup
149+
label="Additional Memory"
150+
labelIcon={
151+
<Popover bodyContent={<div>Additional Build Memory</div>}><HelpIcon/></Popover>
152+
}
153+
fieldId="artifact-edit-memory">
154+
<TextInput
155+
id="artifact-edit-memory"
156+
name="artifact-edit-memory"
157+
value={info.buildInfo.additionalMemory}
158+
onChange={stateChange((s, v) => {s.buildInfo.additionalMemory = v})}
159+
/>
160+
</FormGroup>
88161
<FormGroup
89162
label="Enforce Version"
90163
labelIcon={
@@ -98,16 +171,16 @@ export const BuildEdit: React.FunctionComponent<BuildEditModalData> = (data) =>
98171
})}></Checkbox>
99172
</FormGroup>
100173
<FormGroup
101-
label="Additional Memory"
174+
label="Java Version"
102175
labelIcon={
103-
<Popover bodyContent={<div>Additional Build Memory</div>}><HelpIcon/></Popover>
176+
<Popover bodyContent={<div>Override Java version detection</div>}><HelpIcon/></Popover>
104177
}
105-
fieldId="artifact-edit-memory">
178+
fieldId="artifact-edit-java-version">
106179
<TextInput
107-
id="artifact-edit-memory"
108-
name="artifact-edit-memory"
109-
value={info.buildInfo.additionalMemory}
110-
onChange={stateChange((s, v) => {s.buildInfo.additionalMemory = v})}
180+
id="artifact-edit-java-version"
181+
name="artifact-edit-java-version"
182+
value={info.buildInfo.javaVersion}
183+
onChange={stateChange((s, v) => {s.buildInfo.javaVersion = v})}
111184
/>
112185
</FormGroup>
113186
<FormGroup
@@ -138,80 +211,62 @@ export const BuildEdit: React.FunctionComponent<BuildEditModalData> = (data) =>
138211
onChange={stateChange((s, v) => {s.buildInfo.postBuildScript = v})}
139212
/>
140213
</FormGroup>
141-
<FormGroup
142-
label="Java Version"
143-
labelIcon={
144-
<Popover bodyContent={<div>Override Java version detection</div>}><HelpIcon/></Popover>
145-
}
146-
fieldId="artifact-edit-java-version">
147-
<TextInput
148-
id="artifact-edit-java-version"
149-
name="artifact-edit-java-version"
150-
value={info.buildInfo.javaVersion}
151-
onChange={stateChange((s, v) => {s.buildInfo.javaVersion = v})}
152-
/>
153-
</FormGroup>
154-
<FormGroup label="Additional Args">
214+
<FormGroup label="Repositories">
155215
<Button variant="control" onClick={() => {
156216
stateChange((s, v) => {
157-
if (s.buildInfo.additionalArgs) {
158-
s.buildInfo.additionalArgs.push("")
217+
if (s.buildInfo.repositories) {
218+
s.buildInfo.repositories.push("")
159219
} else {
160-
s.buildInfo.additionalArgs = [""]
220+
s.buildInfo.repositories = [""]
161221
}
162222
})(info.buildInfo, null)
163-
}}>Add Additional Param</Button>
223+
}}>Add Additional Repositories</Button>
164224

165225
</FormGroup>
166-
{info.buildInfo.additionalArgs?.map((s, index) =>
226+
{info.buildInfo.repositories?.map((s, index) =>
167227
<FormGroup
168-
label="Additional Arg"
228+
label="Additional Repository"
169229
labelIcon={
170-
<Popover bodyContent={<div>An additional param</div>}><HelpIcon/></Popover>
230+
<Popover bodyContent={<div>An additional repository from <a target="_blank" href="https://github.com/redhat-appstudio/jvm-build-data/tree/main/repository-info">here</a></div>}><HelpIcon/></Popover>
171231
}
172-
fieldId="artifact-edit-additional-arg">
232+
fieldId="artifact-edit-repository-arg">
173233
<TextInput
174-
id="artifact-edit-additional-arg"
175-
name="artifact-edit-additional-arg"
234+
id="artifact-edit-repository-arg"
235+
name="artifact-edit-repository-arg"
176236
value={s}
177237
onChange={stateChange((s, v) => {
178-
if (s.buildInfo.additionalArgs) {
179-
s.buildInfo.additionalArgs[index] = v
238+
if (s.buildInfo.repositories) {
239+
s.buildInfo.repositories[index] = v
180240
}
181241
})}
182242
/>
183243
</FormGroup>)}
184-
185-
<FormGroup label="Allowed Differences to Upstream">
186-
<Button variant="control" onClick={() => {
187-
stateChange((s, v) => {
188-
if (s.buildInfo.allowedDifferences) {
189-
s.buildInfo.allowedDifferences.push("")
190-
} else {
191-
s.buildInfo.allowedDifferences = [""]
192-
}
193-
})(info.buildInfo, null)
194-
}}>Add Allowed Difference</Button>
195-
244+
<FormGroup
245+
label="Tool Type"
246+
labelIcon={
247+
<Popover bodyContent={<div>Override Tool type detection</div>}><HelpIcon/></Popover>
248+
}
249+
fieldId="artifact-edit-tool">
250+
<TextInput
251+
id="artifact-edit-tool"
252+
name="artifact-edit-tool"
253+
value={info.buildInfo.tool}
254+
onChange={stateChange((s, v) => {s.buildInfo.tool = v})}
255+
/>
256+
</FormGroup>
257+
<FormGroup
258+
label="Tool Version"
259+
labelIcon={
260+
<Popover bodyContent={<div>Override Tool version detection</div>}><HelpIcon/></Popover>
261+
}
262+
fieldId="artifact-edit-tool-version">
263+
<TextInput
264+
id="artifact-edit-tool-version"
265+
name="artifact-edit-tool-version"
266+
value={info.buildInfo.toolVersion}
267+
onChange={stateChange((s, v) => {s.buildInfo.toolVersion = v})}
268+
/>
196269
</FormGroup>
197-
{info.buildInfo.allowedDifferences?.map((s, index) =>
198-
<FormGroup
199-
label="Difference"
200-
labelIcon={
201-
<Popover bodyContent={<div>A regex that matches a validation failure to ignore</div>}><HelpIcon/></Popover>
202-
}
203-
fieldId="artifact-edit-upstream-diff">
204-
<TextInput
205-
id="artifact-edit-upstream-diff"
206-
name="artifact-edit-upstream-diff"
207-
value={s}
208-
onChange={stateChange((s, v) => {
209-
if (s.buildInfo.allowedDifferences) {
210-
s.buildInfo.allowedDifferences[index] = v
211-
}
212-
})}
213-
/>
214-
</FormGroup>)}
215270
<FormGroup>
216271
<Button key="create" variant="primary" form="modal-with-form-form" onClick={save} disabled={prUrl.length > 0}>
217272
Confirm

0 commit comments

Comments
 (0)