Skip to content

Commit 33b9cfe

Browse files
authored
Merge pull request #2128 from HarshMN2345/feat-SER-16-replace-pink1-with-pink2-doc-permissions
2 parents 59128b1 + b7009ef commit 33b9cfe

File tree

8 files changed

+79
-81
lines changed

8 files changed

+79
-81
lines changed

src/lib/components/fakeModal.svelte

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script lang="ts">
2-
import { Alert } from '$lib/components';
2+
import { Alert } from '@appwrite.io/pink-svelte';
33
import { onMount } from 'svelte';
44
import Form from '$lib/elements/forms/form.svelte';
55
import { Click, trackEvent } from '$lib/actions/analytics';
@@ -112,14 +112,14 @@
112112
<div class="modal-content">
113113
<div class="modal-content-spacer u-flex-vertical u-gap-24 u-width-full-line">
114114
{#if error}
115-
<Alert
115+
<Alert.Inline
116+
status="warning"
116117
dismissible
117-
type="warning"
118118
on:dismiss={() => {
119119
error = null;
120120
}}>
121121
{error}
122-
</Alert>
122+
</Alert.Inline>
123123
{/if}
124124
<slot />
125125
</div>

src/lib/layout/containerHeader.svelte

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<script lang="ts">
2-
import { Alert, DropList } from '$lib/components';
2+
import { DropList } from '$lib/components';
33
import { BillingPlan } from '$lib/constants';
44
import { Link, Pill } from '$lib/elements';
5+
import { Alert } from '@appwrite.io/pink-svelte';
56
import {
67
checkForProjectLimitation,
78
checkForUsageFees,
@@ -22,7 +23,7 @@
2223
export let title: string;
2324
export let serviceId = title.toLocaleLowerCase() as PlanServices;
2425
export let total: number = null;
25-
export let alertType: 'info' | 'success' | 'warning' | 'error' | 'default' = 'warning';
26+
export let alertType: 'info' | 'success' | 'warning' | 'error' = 'warning';
2627
export let showAlert = true;
2728
2829
export let buttonText: string = null;
@@ -95,24 +96,24 @@
9596
{#if services.length}
9697
<slot name="alert" {limit} {tier} {title} {upgradeMethod} {hasUsageFees} {services}>
9798
{#if $organization?.billingPlan !== BillingPlan.FREE && hasUsageFees}
98-
<Alert type="info" isStandalone>
99+
<Alert.Inline status="info">
99100
<span class="text">
100101
You've reached the {services} limit for the {tier} plan.
101102
<Link on:mousedown={() => ($showUsageRatesModal = true)}
102103
>Excess usage fees will apply</Link
103104
>.
104105
</span>
105-
</Alert>
106+
</Alert.Inline>
106107
{:else}
107-
<Alert type={alertType} isStandalone>
108+
<Alert.Inline status={alertType}>
108109
<span class="text">
109110
You've reached the {services} limit for the {tier} plan. <Link
110111
href={$upgradeURL}
111112
event="organization_upgrade"
112113
eventData={{ from: 'event', source: 'inline_alert' }}>Upgrade</Link> your
113114
organization for additional resources.
114115
</span>
115-
</Alert>
116+
</Alert.Inline>
116117
{/if}
117118
</slot>
118119
{/if}

src/routes/(console)/organization-[organization]/settings/deleteOrganizationEstimation.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
<script lang="ts">
2-
import { Alert } from '$lib/components';
2+
import { Alert } from '@appwrite.io/pink-svelte';
33
import type { EstimationDeleteOrganization } from '$lib/sdk/billing';
44
import InvoicesTable from './invoicesTable.svelte';
55
export let estimation: EstimationDeleteOrganization;
66
</script>
77

88
{#if estimation}
99
{#if estimation.unpaidInvoices?.length > 0}
10-
<Alert type="warning">
10+
<Alert.Inline status="warning">
1111
This organization has unresolved invoices that must be settled before it can be deleted.
1212
Please review and resolve these invoices to proceed.
13-
</Alert>
13+
</Alert.Inline>
1414

1515
<InvoicesTable invoices={estimation.unpaidInvoices} showActions={false} />
1616
{/if}

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

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script lang="ts">
2-
import { CardGrid, BoxAvatar, Alert } from '$lib/components';
2+
import { CardGrid, BoxAvatar } from '$lib/components';
33
import { Container } from '$lib/layout';
44
import { Button } from '$lib/elements/forms';
55
import { sdk } from '$lib/stores/sdk';
@@ -14,6 +14,7 @@
1414
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
1515
import { collection } from '../../store';
1616
import { page } from '$app/stores';
17+
import { Alert } from '@appwrite.io/pink-svelte';
1718
1819
let showDelete = false;
1920
let permissions = $doc?.$permissions;
@@ -85,27 +86,23 @@
8586
<svelte:fragment slot="aside">
8687
{#if $collection.documentSecurity}
8788
{#if showPermissionAlert}
88-
<Alert type="info" dismissible on:dismiss={() => (showPermissionAlert = false)}>
89-
<svelte:fragment slot="title">Document security is enabled</svelte:fragment>
90-
<p class="text">
91-
Users will be able to access this document if they have been granted <b
92-
>either document or collection permissions.
93-
</b>
94-
</p>
95-
</Alert>
89+
<Alert.Inline
90+
status="info"
91+
title="Document security is enabled"
92+
dismissible
93+
on:dismiss={() => (showPermissionAlert = false)}>
94+
Users will be able to access this document if they have been granted <b
95+
>either document or collection permissions.</b>
96+
</Alert.Inline>
9697
{/if}
9798
{#if permissions}
9899
<Permissions bind:permissions />
99100
{/if}
100101
{:else}
101-
<Alert type="info">
102-
<svelte:fragment slot="title">Document security is disabled</svelte:fragment>
103-
<p class="text">
104-
If you want to assign document permissions. Go to Collection settings and
105-
enable document security. Otherwise, only collection permissions will be
106-
used.
107-
</p>
108-
</Alert>
102+
<Alert.Inline status="info" title="Document security is disabled">
103+
If you want to assign document permissions. Go to Collection settings and enable
104+
document security. Otherwise, only collection permissions will be used.
105+
</Alert.Inline>
109106
{/if}
110107
</svelte:fragment>
111108

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
import { base } from '$app/paths';
44
import { page } from '$app/state';
55
import { Submit, trackError, trackEvent } from '$lib/actions/analytics';
6-
import { Alert, Confirm, Id } from '$lib/components';
6+
import { Confirm, Id } from '$lib/components';
7+
import { Alert } from '@appwrite.io/pink-svelte';
78
import { Dependencies } from '$lib/constants';
89
import { Button as ConsoleButton, InputChoice } from '$lib/elements/forms';
910
import { addNotification } from '$lib/stores/notifications';
@@ -28,7 +29,8 @@
2829
Badge,
2930
FloatingActionBar,
3031
InteractiveText,
31-
Typography
32+
Typography,
33+
Layout
3234
} from '@appwrite.io/pink-svelte';
3335
import { toLocaleDateTime } from '$lib/helpers/date';
3436
import DualTimeView from '$lib/components/dualTimeView.svelte';
@@ -342,15 +344,15 @@
342344
</Table.Row.Base>
343345
{/each}
344346
</Table.Root>
345-
<div class="u-flex u-flex-vertical u-gap-16">
346-
<Alert>To change the selection edit the relationship settings.</Alert>
347-
347+
<Layout.Stack gap="l" direction="column">
348+
<Alert.Inline status="info"
349+
>To change the selection edit the relationship settings.</Alert.Inline>
348350
<ul>
349351
<InputChoice id="delete" label="Delete" showLabel={false} bind:value={checked}>
350352
Delete document from <span data-private>{$collection.name}</span>
351353
</InputChoice>
352354
</ul>
353-
</div>
355+
</Layout.Stack>
354356
{:else}
355357
<p class="u-bold">This action is irreversible.</p>
356358
{/if}

src/routes/(console)/project-[region]-[project]/functions/function-[function]/settings/+page.svelte

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import { sdk } from '$lib/stores/sdk';
1414
import { Dependencies } from '$lib/constants';
1515
import { invalidate } from '$app/navigation';
16-
import { Alert } from '$lib/components';
16+
import { Alert } from '@appwrite.io/pink-svelte';
1717
import { Button } from '$lib/elements/forms';
1818
import { Click, trackEvent } from '$lib/actions/analytics';
1919
import UpdateRepository from './updateRepository.svelte';
@@ -22,6 +22,7 @@
2222
import { isCloud } from '$lib/system';
2323
import UpdateVariables from '$routes/(console)/project-[region]-[project]/updateVariables.svelte';
2424
import { page } from '$app/state';
25+
import { Link } from '$lib/elements';
2526
2627
export let data;
2728
let showAlert = true;
@@ -55,35 +56,33 @@
5556

5657
<Container>
5758
{#if data.function.version === 'v2' && showAlert}
58-
<Alert
59-
type="warning"
60-
dismissible
61-
class="u-margin-block-start-24"
62-
on:dismiss={() => (showAlert = false)}>
63-
<svelte:fragment slot="title">Your function is outdated</svelte:fragment>
64-
Update your function version to make use of new features including build commands and HTTP
65-
data in your executions. To update, follow the steps outlined in our
66-
<a
67-
href="https://appwrite.io/docs/products/functions/development"
68-
target="_blank"
69-
rel="noopener noreferrer"
70-
class="link">documentation</a
71-
>.
72-
<svelte:fragment slot="buttons">
73-
<Button
74-
on:click={() =>
75-
trackEvent(Click.WebsiteOpenClick, {
76-
from: 'button',
77-
source: 'function_keys_card',
78-
destination: 'docs'
79-
})}
80-
href="https://appwrite.io/docs/products/functions/development"
81-
external
82-
text>
83-
Learn more
84-
</Button>
85-
</svelte:fragment>
86-
</Alert>
59+
<div>
60+
<Alert.Inline
61+
status="warning"
62+
dismissible
63+
title="Your function is outdated"
64+
on:dismiss={() => (showAlert = false)}>
65+
Update your function version to make use of new features including build commands
66+
and HTTP data in your executions. To update, follow the steps outlined in our
67+
<Link href="https://appwrite.io/docs/products/functions/development" external
68+
>documentation</Link
69+
>.
70+
<svelte:fragment slot="actions">
71+
<Button
72+
on:click={() =>
73+
trackEvent(Click.WebsiteOpenClick, {
74+
from: 'button',
75+
source: 'function_keys_card',
76+
destination: 'docs'
77+
})}
78+
href="https://appwrite.io/docs/products/functions/development"
79+
external
80+
text>
81+
Learn more
82+
</Button>
83+
</svelte:fragment>
84+
</Alert.Inline>
85+
</div>
8786
{/if}
8887
<ExecuteFunction />
8988
<UpdateName />

src/routes/(console)/project-[region]-[project]/sites/create-site/importSiteVariablesModal.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script lang="ts">
22
import { Modal } from '$lib/components';
3-
import Alert from '$lib/components/alert.svelte';
3+
import { Alert } from '@appwrite.io/pink-svelte';
44
import { Button } from '$lib/elements/forms';
55
import type { Models } from '@appwrite.io/console';
66
import { IconInfo } from '@appwrite.io/pink-icons-svelte';
@@ -75,9 +75,9 @@
7575
</Layout.Stack>
7676
</Upload.Dropzone>
7777
{#if variables?.length > 0}
78-
<Alert type="info" dismissible>
78+
<Alert.Inline status="info" dismissible>
7979
This action can create and update variables but can not delete them.
80-
</Alert>
80+
</Alert.Inline>
8181
{/if}
8282
</Layout.Stack>
8383
<Selector.Checkbox

src/routes/(console)/project-[region]-[project]/storage/bucket-[bucket]/settings/updateMaxFileSize.svelte

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<script lang="ts">
22
import { Click, Submit, trackEvent } from '$lib/actions/analytics';
3-
import { Alert, CardGrid } from '$lib/components';
3+
import { CardGrid } from '$lib/components';
4+
import { Alert } from '@appwrite.io/pink-svelte';
45
import { BillingPlan } from '$lib/constants';
56
import { Button, Form, InputNumber, InputSelect } from '$lib/elements/forms';
67
import { humanFileSize, sizeToBytes } from '$lib/helpers/sizeConvertion';
@@ -45,16 +46,14 @@
4546
<svelte:fragment slot="aside">
4647
{#if isCloud}
4748
{@const size = humanFileSize(sizeToBytes(service, 'MB', 1000))}
48-
<Alert type="info">
49-
<p class="text">
50-
The {currentPlan.name} plan has a maximum upload file size limit of {Math.floor(
51-
parseInt(size.value)
52-
)}{size.unit}.
53-
{#if $organization?.billingPlan === BillingPlan.FREE}
54-
Upgrade to allow files of a larger size.
55-
{/if}
56-
</p>
57-
<svelte:fragment slot="action">
49+
<Alert.Inline status="info">
50+
The {currentPlan.name} plan has a maximum upload file size limit of {Math.floor(
51+
parseInt(size.value)
52+
)}{size.unit}.
53+
{#if $organization?.billingPlan === BillingPlan.FREE}
54+
Upgrade to allow files of a larger size.
55+
{/if}
56+
<svelte:fragment slot="actions">
5857
{#if $organization?.billingPlan === BillingPlan.FREE}
5958
<div class="alert-buttons u-flex">
6059
<Button
@@ -68,7 +67,7 @@
6867
</div>
6968
{/if}
7069
</svelte:fragment>
71-
</Alert>
70+
</Alert.Inline>
7271
{/if}
7372
<InputNumber
7473
required

0 commit comments

Comments
 (0)