Skip to content

Commit e65a4f7

Browse files
authored
Merge pull request #1882 from appwrite/dat-534-string-encryption
string encryption in create attribute
2 parents 3bbf311 + 0875889 commit e65a4f7

File tree

16 files changed

+177
-102
lines changed

16 files changed

+177
-102
lines changed

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,10 @@
2323
"dependencies": {
2424
"@ai-sdk/svelte": "^1.1.24",
2525
"@appwrite.io/console": "https://pkg.pr.new/appwrite-labs/cloud/@appwrite.io/console@e190a19",
26-
"@appwrite.io/pink": "0.25.0",
2726
"@appwrite.io/pink-icons": "0.25.0",
2827
"@appwrite.io/pink-icons-svelte": "^2.0.0-RC.1",
2928
"@appwrite.io/pink-legacy": "^1.0.3",
30-
"@appwrite.io/pink-svelte": "https://try-module.cloud/module/@appwrite/@appwrite.io/pink-svelte@0cc439f",
29+
"@appwrite.io/pink-svelte": "https://try-module.cloud/-/@appwrite/@appwrite.io/pink-svelte@063404f",
3130
"@popperjs/core": "^2.11.8",
3231
"@sentry/sveltekit": "^8.38.0",
3332
"@stripe/stripe-js": "^3.5.0",

pnpm-lock.yaml

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

src/lib/helpers/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export type Column = PinkColumn & {
4444
format?: string;
4545
exclude?: boolean;
4646
elements?: string[] | { value: string | number; label: string }[];
47+
encrypt?: boolean;
4748
};
4849

4950
export function isValueOfStringEnum<T extends Record<string, string>>(

src/lib/sdk/billing.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,7 @@ export type Plan = {
338338
backupPolicies: number;
339339
emailBranding: boolean;
340340
supportsCredits: boolean;
341+
databasesAllowEncrypt: boolean;
341342
buildSize: number; // in MB
342343
deploymentSize: number; // in MB
343344
};

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

Lines changed: 35 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@
1313
Link,
1414
Popover,
1515
Table,
16+
Tooltip,
1617
Typography
1718
} from '@appwrite.io/pink-svelte';
1819
import Create from '../createAttribute.svelte';
19-
import { isRelationship } from '../document-[document]/attributes/store';
20+
import { isRelationship, isString } from '../document-[document]/attributes/store';
2021
import FailedModal from '../failedModal.svelte';
2122
import CreateIndex from '../indexes/createIndex.svelte';
2223
import { attributes, type Attributes, isCsvImportInProgress } from '../store';
@@ -33,7 +34,8 @@
3334
IconPlus,
3435
IconSwitchHorizontal,
3536
IconTrash,
36-
IconViewList
37+
IconViewList,
38+
IconLockClosed
3739
} from '@appwrite.io/pink-icons-svelte';
3840
import type { ComponentProps } from 'svelte';
3941
import { Click, trackEvent } from '$lib/actions/analytics';
@@ -112,25 +114,38 @@
112114
{:else}
113115
<Icon icon={option.icon} size="s" />
114116
{/if}
115-
<span class="text u-trim-1" data-private>{attribute.key}</span>
116-
{#if attribute.status !== 'available'}
117-
<Badge
118-
size="s"
119-
variant="secondary"
120-
content={attribute.status}
121-
type={getAttributeStatusBadge(attribute.status)} />
122-
{#if attribute.error}
123-
<Link.Button
124-
variant="muted"
125-
on:click={(e) => {
126-
e.preventDefault();
127-
error = attribute.error;
128-
showFailed = true;
129-
}}>Details</Link.Button>
117+
<Layout.Stack direction="row" alignItems="center" gap="s">
118+
<Layout.Stack inline direction="row" alignItems="center" gap="xxs">
119+
<span class="text u-trim-1" data-private>{attribute.key}</span>
120+
{#if isString(attribute) && !attribute.encrypt}
121+
<Tooltip>
122+
<Icon
123+
size="s"
124+
icon={IconLockClosed}
125+
color="--fgcolor-neutral-tertiary" />
126+
<div slot="tooltip">Encrypted</div>
127+
</Tooltip>
128+
{/if}
129+
</Layout.Stack>
130+
{#if attribute.status !== 'available'}
131+
<Badge
132+
size="s"
133+
variant="secondary"
134+
content={attribute.status}
135+
type={getAttributeStatusBadge(attribute.status)} />
136+
{#if attribute.error}
137+
<Link.Button
138+
variant="muted"
139+
on:click={(e) => {
140+
e.preventDefault();
141+
error = attribute.error;
142+
showFailed = true;
143+
}}>Details</Link.Button>
144+
{/if}
145+
{:else if attribute.required}
146+
<Badge size="xs" variant="secondary" content="required" />
130147
{/if}
131-
{:else if attribute.required}
132-
<Badge size="s" variant="secondary" content="required" />
133-
{/if}
148+
</Layout.Stack>
134149
</Layout.Stack>
135150
</Table.Cell>
136151
<Table.Cell column="type" {root}>

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,5 +100,4 @@
100100
label="Array"
101101
bind:checked={data.array}
102102
disabled={data.required || editing}
103-
description="Indicate whether this attribute should act as an array, with the default value set as an empty
104-
array." />
103+
description="Indicate whether this attribute is an array. Defaults to an empty array." />

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,5 +92,4 @@
9292
label="Array"
9393
bind:checked={data.array}
9494
disabled={data.required || editing}
95-
description="Indicate whether this attribute should act as an array, with the default value set as an empty
96-
array." />
95+
description="Indicate whether this attribute is an array. Defaults to an empty array." />

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,5 +93,4 @@
9393
label="Array"
9494
bind:checked={data.array}
9595
disabled={data.required || editing}
96-
description="Indicate whether this attribute should act as an array, with the default value set as an empty
97-
array." />
96+
description="Indicate whether this attribute is an array. Defaults to an empty array." />

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,5 +124,4 @@
124124
label="Array"
125125
bind:checked={data.array}
126126
disabled={data.required || editing}
127-
description="Indicate whether this attribute should act as an array, with the default value set as an empty
128-
array." />
127+
description="Indicate whether this attribute is an array. Defaults to an empty array." />

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,5 +122,4 @@
122122
label="Array"
123123
bind:checked={data.array}
124124
disabled={data.required || editing}
125-
description="Indicate whether this attribute should act as an array, with the default value set as an empty
126-
array." />
125+
description="Indicate whether this attribute is an array. Defaults to an empty array." />

0 commit comments

Comments
 (0)