|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
import { StackId } from '@/react/common/stacks/types';
|
|
|
|
|
import { useGitRefs } from '@/react/portainer/gitops/queries/useGitRefs';
|
|
|
|
|
|
|
|
|
|
import { Select } from '@@/form-components/Input';
|
|
|
|
|
import { PortainerSelect } from '@@/form-components/PortainerSelect';
|
|
|
|
|
|
|
|
|
|
import { getAuthentication } from '../utils';
|
|
|
|
|
|
|
|
|
@ -43,6 +43,11 @@ export function RefSelector({
|
|
|
|
|
refs.unshift('refs/heads/main');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (refs.includes('refs/heads/master')) {
|
|
|
|
|
refs.splice(refs.indexOf('refs/heads/master'), 1);
|
|
|
|
|
refs.unshift('refs/heads/master');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return refs.map((t: string) => ({
|
|
|
|
|
value: t,
|
|
|
|
|
label: t,
|
|
|
|
@ -58,12 +63,11 @@ export function RefSelector({
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Select
|
|
|
|
|
<PortainerSelect
|
|
|
|
|
value={value}
|
|
|
|
|
options={refs || [{ value: 'refs/heads/main', label: 'refs/heads/main' }]}
|
|
|
|
|
onChange={(e) => onChange(e.target.value)}
|
|
|
|
|
onChange={(e) => e && onChange(e)}
|
|
|
|
|
data-cy="component-gitRefInput"
|
|
|
|
|
required
|
|
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|