Fixes for various prompt related ui issues

Fixes bug where Forks showed up in both default values and prompted values in launch summary

Fixes prompting IGs with defaults on launch

Make job tags and skip tags full width on workflow form

Fixes bug where we attempted to fetch instance groups for workflows

Fetch default instance groups from jt/schedule for schedule form prompt

Grab default IGs when adding a node that prompts for them

Adds support for saving labels on a new wf node

Fix linting errors

Fixes for various prompt on launch related issues

Adds support for saving instance groups on a new node

Adds support for saving instance groups when editing an existing node

Fix workflowReducer test

Updates useSelected to handle a non-empty starting state

Fixes visualizerNode tests

Fix visualizer test

Second batch of prompt related ui issues:

Fixes bug saving existing node when instance groups is not promptable

Fixes bug removing newly added label

Adds onError function to label prompt

Fixes tooltips on the other prompts step

Properly fetch all labels to show on schedule details
This commit is contained in:
mabashian
2022-09-06 14:34:40 -04:00
committed by Alan Rominger
parent e076f1ee2a
commit e05eaeccab
24 changed files with 402 additions and 109 deletions

View File

@@ -54,13 +54,14 @@ function ScheduleForm({
request: loadScheduleData,
error: contentError,
isLoading: contentLoading,
result: { zoneOptions, zoneLinks, credentials, labels },
result: { zoneOptions, zoneLinks, credentials, labels, instanceGroups },
} = useRequest(
useCallback(async () => {
const { data } = await SchedulesAPI.readZoneInfo();
let creds = [];
let allLabels;
let allLabels = [];
let allInstanceGroups = [];
if (schedule.id) {
if (
resource.type === 'job_template' &&
@@ -77,15 +78,30 @@ function ScheduleForm({
} = await SchedulesAPI.readAllLabels(schedule.id);
allLabels = results;
}
} else {
if (
resource.type === 'job_template' &&
launchConfig.ask_labels_on_launch
launchConfig.ask_instance_groups_on_launch
) {
const {
data: { results },
} = await JobTemplatesAPI.readAllLabels(resource.id);
allLabels = results;
} = await SchedulesAPI.readInstanceGroups(schedule.id);
allInstanceGroups = results;
}
} else {
if (resource.type === 'job_template') {
if (launchConfig.ask_labels_on_launch) {
const {
data: { results },
} = await JobTemplatesAPI.readAllLabels(resource.id);
allLabels = results;
}
if (launchConfig.ask_instance_groups_on_launch) {
const {
data: { results },
} = await JobTemplatesAPI.readInstanceGroups(resource.id);
allInstanceGroups = results;
}
}
if (
resource.type === 'workflow_job_template' &&
@@ -108,13 +124,15 @@ function ScheduleForm({
zoneOptions: zones,
zoneLinks: data.links,
credentials: creds,
labels: allLabels || [],
labels: allLabels,
instanceGroups: allInstanceGroups,
};
}, [
schedule,
resource.id,
resource.type,
launchConfig.ask_labels_on_launch,
launchConfig.ask_instance_groups_on_launch,
launchConfig.ask_credential_on_launch,
]),
{
@@ -123,6 +141,7 @@ function ScheduleForm({
credentials: [],
isLoading: true,
labels: [],
instanceGroups: [],
}
);
@@ -501,6 +520,7 @@ function ScheduleForm({
}}
resourceDefaultCredentials={resourceDefaultCredentials}
labels={labels}
instanceGroups={instanceGroups}
/>
)}
<FormSubmitError error={submitError} />