Skip to content

Commit 13f37e5

Browse files
authored
Merge pull request #2103 from appwrite/release-string-encryption
2 parents 60352ab + df88f5a commit 13f37e5

File tree

8 files changed

+82
-77
lines changed

8 files changed

+82
-77
lines changed

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PUBLIC_CONSOLE_MODE=self-hosted
2-
PUBLIC_CONSOLE_FEATURE_FLAGS=sites,attribute-encrypt,index-lengths
2+
PUBLIC_CONSOLE_FEATURE_FLAGS=sites,index-lengths
33
PUBLIC_APPWRITE_MULTI_REGION=false
44
PUBLIC_APPWRITE_ENDPOINT=http://localhost/v1
55
PUBLIC_STRIPE_KEY=

.github/workflows/publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ jobs:
7979
labels: ${{ steps.meta.outputs.labels }}
8080
build-args: |
8181
"PUBLIC_CONSOLE_MODE=cloud"
82-
"PUBLIC_CONSOLE_FEATURE_FLAGS=sites,attribute-encrypt,index-lengths"
82+
"PUBLIC_CONSOLE_FEATURE_FLAGS=sites,index-lengths"
8383
"PUBLIC_APPWRITE_MULTI_REGION=true"
8484
"PUBLIC_GROWTH_ENDPOINT=${{ secrets.PUBLIC_GROWTH_ENDPOINT }}"
8585
"PUBLIC_STRIPE_KEY=${{ secrets.PUBLIC_STRIPE_KEY_STAGE }}"
@@ -118,7 +118,7 @@ jobs:
118118
build-args: |
119119
"PUBLIC_CONSOLE_MODE=self-hosted"
120120
"PUBLIC_APPWRITE_MULTI_REGION=false"
121-
"PUBLIC_CONSOLE_FEATURE_FLAGS=sites,attribute-encrypt,index-lengths"
121+
"PUBLIC_CONSOLE_FEATURE_FLAGS=sites,index-lengths"
122122
"PUBLIC_GROWTH_ENDPOINT=${{ secrets.PUBLIC_GROWTH_ENDPOINT }}"
123123
124124
publish-cloud-no-regions:
@@ -156,6 +156,6 @@ jobs:
156156
build-args: |
157157
"PUBLIC_CONSOLE_MODE=cloud"
158158
"PUBLIC_APPWRITE_MULTI_REGION=false"
159-
"PUBLIC_CONSOLE_FEATURE_FLAGS=sites,attribute-encrypt,index-lengths"
159+
"PUBLIC_CONSOLE_FEATURE_FLAGS=sites,index-lengths"
160160
"PUBLIC_STRIPE_KEY=${{ secrets.PUBLIC_STRIPE_KEY_STAGE }}"
161161
"PUBLIC_GROWTH_ENDPOINT=${{ secrets.PUBLIC_GROWTH_ENDPOINT }}"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"@appwrite.io/pink-icons": "0.25.0",
2727
"@appwrite.io/pink-icons-svelte": "^2.0.0-RC.1",
2828
"@appwrite.io/pink-legacy": "^1.0.3",
29-
"@appwrite.io/pink-svelte": "https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@d521606",
29+
"@appwrite.io/pink-svelte": "https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@74cf26b",
3030
"@popperjs/core": "^2.11.8",
3131
"@sentry/sveltekit": "^8.38.0",
3232
"@stripe/stripe-js": "^3.5.0",

pnpm-lock.yaml

Lines changed: 25 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lib/flags.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,5 @@ function isFlagEnabled(name: string) {
2020

2121
export const flags = {
2222
showSites: isFlagEnabled('sites'),
23-
showAttributeEncrypt: isFlagEnabled('attribute-encrypt'),
2423
showIndexLengths: isFlagEnabled('index-lengths')
2524
};

src/lib/helpers/types.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,8 @@ export type TableRootProp = {
6060
selectedAll: boolean;
6161
selectedNone: boolean;
6262
selectedSome: boolean;
63-
// columns: Array<Column> | number;
64-
columns: Record<PinkColumn['id'], PinkColumn>;
65-
// columnsMap: Record<PinkColumn['id'], PinkColumn>;
63+
columns: Array<PinkColumn> | number;
64+
columnsMap: Record<PinkColumn['id'], PinkColumn>;
6665
toggle: (id: string) => void;
6766
toggleAll: () => void;
6867
addAvailableId: (id: string) => void;

src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/attributes/string.svelte

Lines changed: 49 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
import { ActionMenu, Selector } from '@appwrite.io/pink-svelte';
5151
import { InputNumber, InputText, InputTextarea } from '$lib/elements/forms';
5252
import { Popover, Layout, Tag, Typography, Link } from '@appwrite.io/pink-svelte';
53-
import { flags } from '$lib/flags';
5453
5554
export let data: Partial<Models.AttributeString> = {
5655
required: false,
@@ -63,8 +62,6 @@
6362
6463
let savedDefault = data.default;
6564
66-
const showEncrypt = flags.showAttributeEncrypt(page.data);
67-
6865
function handleDefaultState(hideDefault: boolean) {
6966
if (hideDefault) {
7067
savedDefault = data.default;
@@ -128,58 +125,55 @@
128125
disabled={data.required || editing}
129126
description="Indicate whether this attribute is an array. Defaults to an empty array." />
130127

131-
{#if showEncrypt}
132-
<Layout.Stack gap="xs" direction="column">
133-
<div
134-
class="popover-holder"
135-
class:cursor-not-allowed={editing}
136-
class:disabled-checkbox={!supportsStringEncryption || editing}>
137-
<Layout.Stack inline gap="s" alignItems="flex-start" direction="row">
138-
<Popover let:toggle placement="bottom-start">
139-
<Selector.Checkbox
140-
size="s"
141-
id="encrypt"
142-
bind:checked={data.encrypt}
143-
disabled={!supportsStringEncryption || editing} />
144-
145-
<Layout.Stack gap="xxs" direction="column">
146-
<button
147-
type="button"
148-
disabled={editing}
149-
class:cursor-pointer={!editing}
150-
class:cursor-not-allowed={editing}
151-
on:click={(e) => {
152-
if (!supportsStringEncryption) {
153-
toggle(e);
154-
} else {
155-
data.encrypt = !data.encrypt;
156-
}
157-
}}>
158-
<Layout.Stack inline gap="xxs" direction="row" alignItems="center">
159-
<Typography.Text variant="m-500">Encrypted</Typography.Text>
160-
{#if !supportsStringEncryption}
161-
<Tag variant="default" size="xs" on:click={toggle}>Pro</Tag>
162-
{/if}
163-
</Layout.Stack>
164-
</button>
165-
<Typography.Text color="--fgcolor-neutral-tertiary">
166-
Protect attribute against data leaks for best privacy compliance.
167-
Encrypted attributes cannot be queried.
168-
</Typography.Text>
169-
</Layout.Stack>
170-
171-
<ActionMenu.Root width="180px" slot="tooltip">
172-
<Typography.Text variant="m-500">
173-
Available on Pro plan. <Link.Anchor href={$upgradeURL}
174-
>Upgrade</Link.Anchor>
175-
to enable encrypted attributes.
176-
</Typography.Text>
177-
</ActionMenu.Root>
178-
</Popover>
179-
</Layout.Stack>
180-
</div>
181-
</Layout.Stack>
182-
{/if}
128+
<Layout.Stack gap="xs" direction="column">
129+
<div
130+
class="popover-holder"
131+
class:cursor-not-allowed={editing}
132+
class:disabled-checkbox={!supportsStringEncryption || editing}>
133+
<Layout.Stack inline gap="s" alignItems="flex-start" direction="row">
134+
<Popover let:toggle placement="bottom-start">
135+
<Selector.Checkbox
136+
size="s"
137+
id="encrypt"
138+
bind:checked={data.encrypt}
139+
disabled={!supportsStringEncryption || editing} />
140+
141+
<Layout.Stack gap="xxs" direction="column">
142+
<button
143+
type="button"
144+
disabled={editing}
145+
class:cursor-pointer={!editing}
146+
class:cursor-not-allowed={editing}
147+
on:click={(e) => {
148+
if (!supportsStringEncryption) {
149+
toggle(e);
150+
} else {
151+
data.encrypt = !data.encrypt;
152+
}
153+
}}>
154+
<Layout.Stack inline gap="xxs" direction="row" alignItems="center">
155+
<Typography.Text variant="m-500">Encrypted</Typography.Text>
156+
{#if !supportsStringEncryption}
157+
<Tag variant="default" size="xs" on:click={toggle}>Pro</Tag>
158+
{/if}
159+
</Layout.Stack>
160+
</button>
161+
<Typography.Text color="--fgcolor-neutral-tertiary">
162+
Protect attribute against data leaks for best privacy compliance. Encrypted
163+
attributes cannot be queried.
164+
</Typography.Text>
165+
</Layout.Stack>
166+
167+
<ActionMenu.Root width="180px" slot="tooltip">
168+
<Typography.Text variant="m-500">
169+
Available on Pro plan. <Link.Anchor href={$upgradeURL}>Upgrade</Link.Anchor>
170+
to enable encrypted attributes.
171+
</Typography.Text>
172+
</ActionMenu.Root>
173+
</Popover>
174+
</Layout.Stack>
175+
</div>
176+
</Layout.Stack>
183177

184178
<style lang="scss">
185179
.popover-holder {

src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/table.svelte

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
} from '@appwrite.io/pink-svelte';
3333
import { toLocaleDateTime } from '$lib/helpers/date';
3434
import DualTimeView from '$lib/components/dualTimeView.svelte';
35-
import { flags } from '$lib/flags';
3635
3736
export let data: PageData;
3837
@@ -155,8 +154,6 @@
155154
) as Models.AttributeRelationship[];
156155
157156
let checked = false;
158-
159-
const showEncrypt = flags.showAttributeEncrypt(data);
160157
</script>
161158

162159
<Table.Root
@@ -248,7 +245,7 @@
248245
<span slot="title">Timestamp</span>
249246
{toLocaleDateTime(datetime, true)}
250247
</DualTimeView>
251-
{:else if isEncryptedAttribute && showEncrypt}
248+
{:else if isEncryptedAttribute}
252249
<button on:click={(e) => e.preventDefault()}>
253250
<InteractiveText
254251
copy={false}

0 commit comments

Comments
 (0)