Skip to content

Commit

Permalink
fix: sync apps panel fails with 'No App Selected' message if name con…
Browse files Browse the repository at this point in the history
…tains '.' (argoproj#2983)
  • Loading branch information
Alexander Matyushentsev authored Jan 15, 2020
1 parent ddcdbaa commit f36ea46
Showing 1 changed file with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interface Progress {
export const ApplicationsSyncPanel = ({show, apps, hide}: {show: boolean; apps: models.Application[]; hide: () => void}) => {
const [form, setForm] = React.useState<FormApi>(null);
const [progress, setProgress] = React.useState<Progress>(null);
const getSelectedApps = (params: any) => apps.filter(app => params['app/' + app.metadata.name]);
const getSelectedApps = (params: any) => apps.filter((_, i) => params['app/' + i]);
return (
<Consumer>
{ctx => (
Expand Down Expand Up @@ -83,20 +83,17 @@ export const ApplicationsSyncPanel = ({show, apps, hide}: {show: boolean; apps:
</label>
</div>
<label>
Apps (<a onClick={() => apps.forEach(app => formApi.setValue('app/' + app.metadata.name, true))}>all</a>/
<a
onClick={() =>
apps.forEach(app => formApi.setValue('app/' + app.metadata.name, app.status.sync.status === models.SyncStatuses.OutOfSync))
}>
Apps (<a onClick={() => apps.forEach((_, i) => formApi.setValue('app/' + i, true))}>all</a>/
<a onClick={() => apps.forEach((app, i) => formApi.setValue('app/' + i, app.status.sync.status === models.SyncStatuses.OutOfSync))}>
out of sync
</a>
/<a onClick={() => apps.forEach(app => formApi.setValue('app/' + app.metadata.name, false))}>none</a>
/<a onClick={() => apps.forEach((_, i) => formApi.setValue('app/' + i, false))}>none</a>
):
</label>
<div style={{paddingLeft: '1em'}}>
{apps.map(app => (
{apps.map((app, i) => (
<label key={app.metadata.name}>
<Checkbox field={`app/${app.metadata.name}`} />
<Checkbox field={`app/${i}`} />
&nbsp;
{app.metadata.name}
&nbsp;
Expand Down

0 comments on commit f36ea46

Please sign in to comment.