How to use the argo-ui.getNestedField function in argo-ui

To help you get started, we’ve selected a few argo-ui examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github argoproj / argo-cd-ui / src / app / applications / components / parameters-panel / parameters-panel.tsx View on Github external
edit: (formApi: FormApi) => {
                const labelStyle = {position: 'absolute', right: 0, top: 0, zIndex: 1} as any;
                const overrideRemoved = getNestedField(formApi.values, `${param.component}.${paramNameEncode(param.name)}`) === null;

                return (
                    
                        {overrideRemoved && (
                            <span>{param.original}</span>
                        ) || }
                        {param.original &amp;&amp; !overrideRemoved &amp;&amp; <a> formApi.setValue(`${param.component}.${paramNameEncode(param.name)}`, null)} style={labelStyle}&gt;
                            Remove override</a>}
                        {overrideRemoved &amp;&amp; <a> formApi.setValue(`${param.component}.${paramNameEncode(param.name)}`, param.value)} style={labelStyle}&gt;
                            Keep override</a>}
                    
                );
            },
        }));
github argoproj / argo-cd / ui / src / app / applications / components / application-parameters / application-parameters.tsx View on Github external
onClick={() => {
                                    formApi.setValue(fieldItemPath, getNestedField(app, fieldsPath)[i]);
                                    removedOverrides[i] = false;
                                    setRemovedOverrides(removedOverrides);
                                }}
                                style={labelStyle}>
github argoproj / argo-cd / ui / src / app / applications / components / application-parameters / application-parameters.tsx View on Github external
validate={updatedApp =&gt; {
                const errors = {} as any;

                for (const fieldPath of ['spec.source.directory.jsonnet.tlas', 'spec.source.directory.jsonnet.extVars']) {
                    const invalid = ((getNestedField(updatedApp, fieldPath) || []) as Array).filter(item =&gt; !item.name &amp;&amp; !item.code);
                    errors[fieldPath] = invalid.length &gt; 0 ? 'All fields must have name' : null;
                }

                return errors;
            }}
            title={props.details.type.toLocaleUpperCase()}