diff --git a/.env.example b/.env.example index 0e8699fc9f..bf090442b2 100644 --- a/.env.example +++ b/.env.example @@ -1,5 +1,5 @@ PUBLIC_CONSOLE_MODE=self-hosted -PUBLIC_CONSOLE_FEATURE_FLAGS=sites,csv-import,attribute-encrypt +PUBLIC_CONSOLE_FEATURE_FLAGS=sites,csv-import,attribute-encrypt,index-lengths PUBLIC_APPWRITE_MULTI_REGION=false PUBLIC_APPWRITE_ENDPOINT=http://localhost/v1 PUBLIC_STRIPE_KEY= diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7073e19f16..137c750f7a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -79,7 +79,7 @@ jobs: labels: ${{ steps.meta.outputs.labels }} build-args: | "PUBLIC_CONSOLE_MODE=cloud" - "PUBLIC_CONSOLE_FEATURE_FLAGS=sites,csv-import,attribute-encrypt" + "PUBLIC_CONSOLE_FEATURE_FLAGS=sites,csv-import,attribute-encrypt,index-lengths" "PUBLIC_APPWRITE_MULTI_REGION=true" "PUBLIC_GROWTH_ENDPOINT=${{ secrets.PUBLIC_GROWTH_ENDPOINT }}" "PUBLIC_STRIPE_KEY=${{ secrets.PUBLIC_STRIPE_KEY_STAGE }}" @@ -118,7 +118,7 @@ jobs: build-args: | "PUBLIC_CONSOLE_MODE=self-hosted" "PUBLIC_APPWRITE_MULTI_REGION=false" - "PUBLIC_CONSOLE_FEATURE_FLAGS=sites,csv-import,attribute-encrypt" + "PUBLIC_CONSOLE_FEATURE_FLAGS=sites,csv-import,attribute-encrypt,index-lengths" "PUBLIC_GROWTH_ENDPOINT=${{ secrets.PUBLIC_GROWTH_ENDPOINT }}" publish-cloud-no-regions: @@ -156,6 +156,6 @@ jobs: build-args: | "PUBLIC_CONSOLE_MODE=cloud" "PUBLIC_APPWRITE_MULTI_REGION=false" - "PUBLIC_CONSOLE_FEATURE_FLAGS=sites,csv-import,attribute-encrypt" + "PUBLIC_CONSOLE_FEATURE_FLAGS=sites,csv-import,attribute-encrypt,index-lengths" "PUBLIC_STRIPE_KEY=${{ secrets.PUBLIC_STRIPE_KEY_STAGE }}" "PUBLIC_GROWTH_ENDPOINT=${{ secrets.PUBLIC_GROWTH_ENDPOINT }}" diff --git a/src/lib/flags.ts b/src/lib/flags.ts index 3c00ee6dce..db2417b839 100644 --- a/src/lib/flags.ts +++ b/src/lib/flags.ts @@ -21,5 +21,6 @@ function isFlagEnabled(name: string) { export const flags = { showSites: isFlagEnabled('sites'), showCsvImport: isFlagEnabled('csv-import'), - showAttributeEncrypt: isFlagEnabled('attribute-encrypt') + showAttributeEncrypt: isFlagEnabled('attribute-encrypt'), + showIndexLengths: isFlagEnabled('index-lengths') }; diff --git a/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/attributes/string.svelte b/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/attributes/string.svelte index 3b4a60eb41..aff1747df7 100644 --- a/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/attributes/string.svelte +++ b/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/attributes/string.svelte @@ -63,7 +63,7 @@ let savedDefault = data.default; - let showEncrypt = flags.showAttributeEncrypt(page.data); + const showEncrypt = flags.showAttributeEncrypt(page.data); function handleDefaultState(hideDefault: boolean) { if (hideDefault) { diff --git a/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/indexes/createIndex.svelte b/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/indexes/createIndex.svelte index ea4b38c505..1d6858eac2 100644 --- a/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/indexes/createIndex.svelte +++ b/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/indexes/createIndex.svelte @@ -14,6 +14,7 @@ import { type Attributes, collection, indexes } from '../store'; import { Icon, Layout } from '@appwrite.io/pink-svelte'; import { IconPlus } from '@appwrite.io/pink-icons-svelte'; + import { flags } from '$lib/flags'; export let showCreateIndex = false; export let externalAttribute: Attributes = null; @@ -38,6 +39,8 @@ let attributeList = [{ value: '', order: '', length: null }]; + const showLengths = flags.showIndexLengths(page.data); + function generateIndexKey() { let indexKeys = $indexes.map((index) => index.key); @@ -149,7 +152,7 @@ placeholder="Select Order" /> - {#if selectedType === IndexType.Key} + {#if selectedType === IndexType.Key && showLengths} @@ -39,12 +43,14 @@ id={`value-${selectedIndex.orders[i]}`} value={selectedIndex.orders[i]} readonly /> - + {#if showLengths} + + {/if} {/each} {/if} diff --git a/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/table.svelte b/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/table.svelte index 5c5b947e51..432ce3e277 100644 --- a/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/table.svelte +++ b/src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/table.svelte @@ -169,7 +169,7 @@ let checked = false; - let showEncrypt = flags.showAttributeEncrypt(data); + const showEncrypt = flags.showAttributeEncrypt(data);