Skip to content

Commit adf369e

Browse files
hmacrHarshMN2345
andauthored
Show warning when VCS integration is not authorized for auto-deployments (#2887)
* Show warning when VCS integration is not authorized for auto-deployments * another version * types * skeleton * popover * fix flatted * fix project pausing modal svelte errors * lint --------- Co-authored-by: Harsh Mahajan <harshmahajan2345@gmail.com>
1 parent c255723 commit adf369e

24 files changed

Lines changed: 284 additions & 254 deletions

File tree

bun.lock

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

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
"overrides": {
9191
"vite": "npm:rolldown-vite@latest",
9292
"minimatch": "10.2.3",
93-
"immutable": "^5.1.5"
93+
"immutable": "^5.1.5",
94+
"flatted": "^3.4.0"
9495
}
9596
}

src/lib/components/domains/recordTable.svelte

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,16 +140,14 @@
140140
{#if variant === 'cname' && !subdomain}
141141
{#if isCloud}
142142
<Alert.Inline>
143-
Since <Badge variant="secondary" size="s" content={domain} /> is an apex domain,
144-
CNAME record is only supported by certain providers. If yours doesn't, please verify
145-
using
143+
Since <Badge variant="secondary" size="s" content={domain} /> is an apex domain, CNAME
144+
record is only supported by certain providers. If yours doesn't, please verify using
146145
<Link variant="muted" on:click={onNavigateToNameservers}>nameservers</Link> instead.
147146
</Alert.Inline>
148147
{:else if aTabVisible || aaaaTabVisible}
149148
<Alert.Inline>
150-
Since <Badge variant="secondary" size="s" content={domain} /> is an apex domain,
151-
CNAME record is only supported by certain providers. If yours doesn't, please verify
152-
using
149+
Since <Badge variant="secondary" size="s" content={domain} /> is an apex domain, CNAME
150+
record is only supported by certain providers. If yours doesn't, please verify using
153151
{#if aTabVisible}
154152
<Link variant="muted" on:click={onNavigateToA}>A record</Link>
155153
{#if aaaaTabVisible}

src/lib/components/git/deploymentSource.svelte

Lines changed: 71 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,96 @@
11
<script lang="ts">
22
import { Trim } from '$lib/components';
33
import { Link } from '$lib/elements';
4-
import type { Models } from '@appwrite.io/console';
4+
import { sdk } from '$lib/stores/sdk';
5+
import { type Models } from '@appwrite.io/console';
56
import {
67
IconCode,
8+
IconExclamation,
79
IconGitBranch,
810
IconGitCommit,
911
IconGithub,
1012
IconTerminal
1113
} from '@appwrite.io/pink-icons-svelte';
12-
import { ActionMenu, Layout, Popover, Icon } from '@appwrite.io/pink-svelte';
14+
import {
15+
ActionMenu,
16+
Layout,
17+
Popover,
18+
Icon,
19+
Skeleton,
20+
Typography
21+
} from '@appwrite.io/pink-svelte';
22+
import Button from '$lib/elements/forms/button.svelte';
1323
1424
let {
15-
deployment
25+
deployment,
26+
resource,
27+
region,
28+
project
1629
}: {
1730
deployment: Models.Deployment;
31+
resource?: Models.Site | Models.Function;
32+
region?: string;
33+
project?: string;
1834
} = $props();
35+
36+
let repository = $state<Models.ProviderRepository | null>(null);
37+
38+
async function loadRepository() {
39+
if (!resource?.installationId || !resource?.providerRepositoryId || !region || !project) {
40+
return;
41+
}
42+
43+
try {
44+
repository = await sdk.forProject(region, project).vcs.getRepository({
45+
installationId: resource.installationId,
46+
providerRepositoryId: resource.providerRepositoryId
47+
});
48+
} catch (err) {
49+
console.warn(err);
50+
}
51+
}
1952
</script>
2053

2154
{#if deployment.type === 'vcs'}
2255
<Popover padding="none" let:toggle>
2356
<div>
24-
<Link
25-
on:click={(e) => {
26-
e.preventDefault();
27-
toggle(e);
28-
}}>
57+
{#await loadRepository()}
58+
<Layout.Stack direction="row" gap="xs" alignItems="center">
59+
<Skeleton variant="line" width={100} height={20} />
60+
</Layout.Stack>
61+
{:then}
2962
<Layout.Stack direction="row" gap="xs" alignItems="center">
30-
<Icon icon={IconGithub} size="s" /> GitHub
63+
<Link
64+
on:click={(e) => {
65+
e.preventDefault();
66+
toggle(e);
67+
}}>
68+
<Layout.Stack direction="row" gap="xs" alignItems="center">
69+
<Icon icon={IconGithub} size="s" /> GitHub
70+
</Layout.Stack>
71+
</Link>
72+
{#if repository?.authorized === false}
73+
<Popover let:toggle placement="bottom-start">
74+
<Button extraCompact on:click={toggle}>
75+
<Icon icon={IconExclamation} size="s" color="--bgcolor-warning" />
76+
</Button>
77+
<svelte:fragment slot="tooltip">
78+
<Typography.Text
79+
variant="m-400"
80+
color="--fgcolor-neutral-secondary">
81+
Integration not authorized for auto deployments.<br />
82+
To enable, add the repository to the installation settings on <Link
83+
variant="muted"
84+
external
85+
href={`https://github.com/settings/installations/${repository.providerInstallationId}`}>
86+
GitHub
87+
</Link>.
88+
</Typography.Text>
89+
</svelte:fragment>
90+
</Popover>
91+
{/if}
3192
</Layout.Stack>
32-
</Link>
93+
{/await}
3394
</div>
3495
<svelte:fragment slot="tooltip">
3596
<ActionMenu.Root>

src/routes/(console)/organization-[organization]/billing/budgetCap.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@
4949
<Form onSubmit={updateBudget}>
5050
<CardGrid>
5151
<svelte:fragment slot="title">Budget cap</svelte:fragment>
52-
Restrict your resource usage by setting a budget cap. Cap usage is reset at the beginning of
53-
each billing cycle.
52+
Restrict your resource usage by setting a budget cap. Cap usage is reset at the beginning of each
53+
billing cycle.
5454
<svelte:fragment slot="aside">
5555
{#if !currentPlan.budgeting}
5656
<Alert.Inline status="info" title="Budget caps are a Pro plan feature">

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@
8181

8282
<CardGrid>
8383
<svelte:fragment slot="title">Delete organization</svelte:fragment>
84-
The organization will be permanently deleted, including all projects and data associated
85-
with this organization. This action is irreversible.
84+
The organization will be permanently deleted, including all projects and data associated with
85+
this organization. This action is irreversible.
8686
<svelte:fragment slot="aside">
8787
<BoxAvatar>
8888
<svelte:fragment slot="image">

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
<CardGrid>
1818
<svelte:fragment slot="title">DPA</svelte:fragment>
19-
After downloading, have the DPA signed by your organization's compliance authority, such as your
20-
CEO or Compliance Manager, and submit it to
19+
After downloading, have the DPA signed by your organization's compliance authority, such as your CEO
20+
or Compliance Manager, and submit it to
2121
<a class="link" href="mailto:privacy@appwrite.io">privacy@appwrite.io</a>.
2222
<svelte:fragment slot="aside">
2323
<Box>

src/routes/(console)/project-[region]-[project]/auth/(providers)/appleOAuth.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444

4545
<Modal {error} onSubmit={update} bind:show on:close title={`${provider.name} OAuth2 settings`}>
4646
<p slot="description">
47-
To use {provider.name} authentication in your application, first fill in this form. For more
48-
info you can
47+
To use {provider.name} authentication in your application, first fill in this form. For more info
48+
you can
4949
<Link.Anchor
5050
class="link"
5151
href={oAuthProvider?.docs}

src/routes/(console)/project-[region]-[project]/auth/(providers)/auth0OAuth.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545

4646
<Modal {error} bind:show onSubmit={update} on:close title={`${provider.name} OAuth2 settings`}>
4747
<svelte:fragment slot="description">
48-
To use {provider.name} authentication in your application, first fill in this form. For more
49-
info you can
48+
To use {provider.name} authentication in your application, first fill in this form. For more info
49+
you can
5050
<Link.Anchor href={oAuthProvider?.docs} target="_blank" rel="noopener noreferrer"
5151
>visit the docs.</Link.Anchor>
5252
</svelte:fragment>

src/routes/(console)/project-[region]-[project]/auth/(providers)/authentikOAuth.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646

4747
<Modal {error} bind:show onSubmit={update} on:close title={`${provider.name} OAuth2 settings`}>
4848
<p slot="description">
49-
To use {provider.name} authentication in your application, first fill in this form. For more
50-
info you can
49+
To use {provider.name} authentication in your application, first fill in this form. For more info
50+
you can
5151
<Link.Anchor
5252
class="link"
5353
href={oAuthProvider?.docs}

0 commit comments

Comments
 (0)