Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: function version check #1170

Merged
merged 2 commits into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions src/lib/components/filters/content.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,6 @@
apply: { applied: number };
}>();
dispatch('apply', { applied: $tags.length });

// $: if (column?.type === 'datetime' && !value) {
// const today = new Date();
// console.log(today.toISOString());
// value = today.toISOString();
// console.log('value', value);
// }
</script>

<div>
Expand Down Expand Up @@ -101,10 +94,10 @@
name="value"
bind:tags={arrayValues}
placeholder="Select value"
options={column?.elements?.map((value) => ({
label: value,
value,
checked: arrayValues.includes(value)
options={column?.elements?.map((e) => ({
label: e?.label ?? e,
value: e?.value ?? e,
checked: arrayValues.includes(e?.value ?? e)
}))}>
</InputSelectCheckbox>
{:else}
Expand All @@ -123,7 +116,10 @@
id="value"
bind:value
placeholder="Select value"
options={column?.elements?.map((value) => ({ label: value, value }))}
options={column?.elements?.map((e) => ({
label: e?.label ?? e,
value: e?.value ?? e
}))}
label="Value"
showLabel={false} />
{:else if column.type === 'integer' || column.type === 'double'}
Expand Down
8 changes: 7 additions & 1 deletion src/lib/components/filters/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,13 @@ const operatorsDefault = new Map<
ValidOperators.NotEqual,
{
query: Query.notEqual,
types: [ValidTypes.String, ValidTypes.Integer, ValidTypes.Double, ValidTypes.Boolean]
types: [
ValidTypes.String,
ValidTypes.Integer,
ValidTypes.Double,
ValidTypes.Boolean,
ValidTypes.Enum
]
}
],
[
Expand Down
2 changes: 1 addition & 1 deletion src/lib/helpers/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export type Column = {
filter?: boolean;
array?: boolean;
format?: string;
elements?: string[];
elements?: string[] | { value: string; label: string }[];
};

export function isValueOfStringEnum<T extends Record<string, string>>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@
width: 110,
array: true,
format: 'enum',
elements: ['ready', 'processing', 'building', 'cancelled', 'failed']
// processing", "building", "waiting", "ready","failed
elements: ['ready', 'processing', 'building', 'waiting', 'cancelled', 'failed']
},
{
id: 'type',
Expand All @@ -60,7 +59,11 @@
width: 90,
array: true,
format: 'enum',
elements: ['manual', 'cli', 'vcs']
elements: [
{ value: 'manual', label: 'Manual' },
{ value: 'cli', label: 'CLI' },
{ value: 'vcs', label: 'Git' }
]
},
{
id: '$updatedAt',
Expand All @@ -74,18 +77,16 @@
{
id: 'buildTime',
title: 'Build time',
type: 'string',
type: 'integer',
show: true,
width: 80,
format: 'string'
width: 80
},
{
id: 'size',
title: 'Size',
type: 'integer',
show: true,
width: 80,
format: 'integer'
width: 80
}
]);
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
placeholder="Entrypoint"
bind:value={entrypoint}
required />
{#if $func.version !== 'v3'}
{#if $func.version === 'v2'}
<Alert type="info">
<svelte:fragment slot="title">
Build commands now available for functions v3.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
</p>

<FormList>
{#if $execute?.version !== 'v3'}
{#if $execute?.version === 'v2'}
<Alert type="info">
<svelte:fragment slot="title">
Customizable execution data now available for functions v3.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,9 @@
{
id: 'responseStatusCode',
title: 'Status code',
type: 'string',
type: 'integer',
show: true,
width: 100,
array: true,
format: 'integer'
},
{
Expand All @@ -85,7 +84,7 @@
{
id: 'duration',
title: 'Duration',
type: 'string',
type: 'integer',
show: true,
width: 80,
format: 'integer'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
<WizardSecondaryContent>
<Form bind:this={formComponent} onSubmit={handleSubmit} bind:isSubmitting>
<FormList>
{#if func?.version !== 'v3'}
{#if func?.version === 'v2'}
<Alert type="info">
<svelte:fragment slot="title">
Customizable execution data now available for functions v3.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

<Container>
<Heading tag="h2" size="5">Settings</Heading>
{#if $func.version !== 'v3' && showAlert}
{#if $func.version === 'v2' && showAlert}
<Alert
type="warning"
dismissible
Expand Down
Loading