-
Notifications
You must be signed in to change notification settings - Fork 202
chore: hide runtime specifications select for self-hosted. #1755
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
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,15 @@ | ||
| <script lang="ts"> | ||
| import { CustomId } from '$lib/components'; | ||
| import { BillingPlan } from '$lib/constants'; | ||
| import { Pill } from '$lib/elements'; | ||
| import { FormList, InputSelect, InputText } from '$lib/elements/forms'; | ||
| import { WizardStep } from '$lib/layout'; | ||
| import { organization } from '$lib/stores/organization'; | ||
| import { runtimesList } from '$lib/stores/runtimes'; | ||
| import { specificationsList } from '$lib/stores/specifications'; | ||
| import { BillingPlan } from '$lib/constants'; | ||
| import { isCloud } from '$lib/system'; | ||
| import SpecificationsTooltip from '../components/specificationsTooltip.svelte'; | ||
| import { template, templateConfig } from '../store'; | ||
| import { organization } from '$lib/stores/organization'; | ||
| import { isCloud } from '$lib/system'; | ||
| let showCustomId = false; | ||
|
|
@@ -18,7 +18,7 @@ | |
| throw new Error('Please select a runtime.'); | ||
| } | ||
| if (!$templateConfig.specification) { | ||
| if (isCloud && !$templateConfig.specification) { | ||
| throw new Error('Please select a specification.'); | ||
| } | ||
| } | ||
|
|
@@ -86,28 +86,30 @@ | |
| {options} | ||
| bind:value={$templateConfig.runtime} /> | ||
| {/await} | ||
| {#await loadSpecifications()} | ||
| <InputSelect | ||
| label="CPU and memory" | ||
| id="specification" | ||
| placeholder="Loading specifications..." | ||
| required | ||
| disabled | ||
| options={[]} | ||
| value={null} /> | ||
| {:then specificationOptions} | ||
| <InputSelect | ||
| label="CPU and memory" | ||
| id="specification" | ||
| placeholder="Select specification" | ||
| required | ||
| disabled={specificationOptions.length < 1} | ||
| options={specificationOptions} | ||
| popover={isCloud && $organization?.billingPlan === BillingPlan.FREE | ||
| ? SpecificationsTooltip | ||
| : null} | ||
| bind:value={$templateConfig.specification} /> | ||
| {/await} | ||
| {#if isCloud} | ||
| {#await loadSpecifications()} | ||
| <InputSelect | ||
| label="CPU and memory" | ||
| id="specification" | ||
| placeholder="Loading specifications..." | ||
| required | ||
| disabled | ||
| options={[]} | ||
| value={null} /> | ||
| {:then specificationOptions} | ||
| <InputSelect | ||
| label="CPU and memory" | ||
| id="specification" | ||
| placeholder="Select specification" | ||
| required | ||
| disabled={specificationOptions.length < 1} | ||
| options={specificationOptions} | ||
| popover={$organization?.billingPlan === BillingPlan.FREE | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above on what we decide. |
||
| ? SpecificationsTooltip | ||
| : null} | ||
| bind:value={$templateConfig.specification} /> | ||
| {/await} | ||
| {/if} | ||
| </FormList> | ||
|
|
||
| <FormList class="u-margin-block-start-24"> | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,18 +5,18 @@ | |
| import { CardGrid, Heading } from '$lib/components'; | ||
| import { BillingPlan, Dependencies } from '$lib/constants'; | ||
| import { Button, Form, FormList } from '$lib/elements/forms'; | ||
| import InputSelect from '$lib/elements/forms/inputSelect.svelte'; | ||
| import { isValueOfStringEnum } from '$lib/helpers/types'; | ||
| import { addNotification } from '$lib/stores/notifications'; | ||
| import { organization } from '$lib/stores/organization'; | ||
| import { runtimesList } from '$lib/stores/runtimes'; | ||
| import { sdk } from '$lib/stores/sdk'; | ||
| import { onMount } from 'svelte'; | ||
| import { func } from '../store'; | ||
| import InputSelect from '$lib/elements/forms/inputSelect.svelte'; | ||
| import { specificationsList } from '$lib/stores/specifications'; | ||
| import { runtimesList } from '$lib/stores/runtimes'; | ||
| import { isValueOfStringEnum } from '$lib/helpers/types'; | ||
| import { Runtime } from '@appwrite.io/console'; | ||
| import { isCloud } from '$lib/system'; | ||
| import { organization } from '$lib/stores/organization'; | ||
| import SpecificationsTooltip from '$lib/wizards/functions/components/specificationsTooltip.svelte'; | ||
| import { Runtime } from '@appwrite.io/console'; | ||
| import { onMount } from 'svelte'; | ||
| import { func } from '../store'; | ||
| const functionId = $page.params.function; | ||
| let runtime: string = null; | ||
|
|
@@ -102,17 +102,19 @@ | |
| {options} | ||
| required | ||
| hideRequired /> | ||
| <InputSelect | ||
| label="CPU and memory" | ||
| id="size" | ||
| placeholder="Select runtime specification" | ||
| bind:value={specification} | ||
| options={specificationOptions} | ||
| popover={isCloud && $organization?.billingPlan === BillingPlan.FREE | ||
| ? SpecificationsTooltip | ||
| : null} | ||
| required | ||
| hideRequired /> | ||
| {#if isCloud} | ||
| <InputSelect | ||
| label="CPU and memory" | ||
| id="size" | ||
| placeholder="Select runtime specification" | ||
| bind:value={specification} | ||
| options={specificationOptions} | ||
| popover={$organization?.billingPlan === BillingPlan.FREE | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same.. |
||
| ? SpecificationsTooltip | ||
| : null} | ||
| required | ||
| hideRequired /> | ||
| {/if} | ||
| </FormList> | ||
| </svelte:fragment> | ||
|
|
||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
already
isCloudhere no?Also lets move from doing a plan check to checking if the specification list only has one item [Free only has one]. @lohanidamodar makes sense?