1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-02 04:15:28 +02:00

fix(app templates): load app template for deployment [BE-11382] (#141)

This commit is contained in:
Ali 2024-11-25 17:41:09 +13:00 committed by GitHub
parent 20e3d3a15b
commit c0c7144539
23 changed files with 453 additions and 60 deletions

View file

@ -16,10 +16,12 @@ export function TemplateFieldset({
values,
setValues,
errors,
isLoadingValues,
}: {
errors?: FormikErrors<Values>;
values: Values;
setValues: (values: SetStateAction<Values>) => void;
isLoadingValues?: boolean;
}) {
return (
<>
@ -27,8 +29,9 @@ export function TemplateFieldset({
error={errors?.templateId}
value={values}
onChange={handleChangeTemplate}
isLoadingValues={isLoadingValues}
/>
{values.templateId && (
{values.templateId && !isLoadingValues && (
<>
{values.type === 'custom' && (
<CustomTemplateFieldset

View file

@ -9,6 +9,7 @@ import { CustomTemplate } from '@/react/portainer/templates/custom-templates/typ
import { FormControl } from '@@/form-components/FormControl';
import { Select as ReactSelect } from '@@/form-components/ReactSelect';
import { InlineLoader } from '@@/InlineLoader';
import { SelectedTemplateValue } from './types';
@ -16,6 +17,7 @@ export function TemplateSelector({
value,
onChange,
error,
isLoadingValues,
}: {
value: SelectedTemplateValue;
onChange: (
@ -23,6 +25,7 @@ export function TemplateSelector({
type: 'app' | 'custom' | undefined
) => void;
error?: string;
isLoadingValues?: boolean;
}) {
const { options, getTemplate, selectedValue } = useOptions(value);
@ -48,6 +51,9 @@ export function TemplateSelector({
}}
data-cy="edge-stacks-create-template-selector"
/>
{isLoadingValues && (
<InlineLoader>Loading template values...</InlineLoader>
)}
</FormControl>
);
}