diff --git a/src/lib/actions/analytics.ts b/src/lib/actions/analytics.ts index d78860b15..f02f4c490 100644 --- a/src/lib/actions/analytics.ts +++ b/src/lib/actions/analytics.ts @@ -340,5 +340,5 @@ export enum Submit { SiteConnectRepo = 'submit_site_connect_repo', SiteRedeploy = 'submit_site_redeploy', SiteDisconnectRepo = 'submit_site_disconnect_repo', - SitePromoteDeployment = 'submit_site_promote_deployment' + SiteActivateDeployment = 'submit_site_activate_deployment' } diff --git a/src/lib/actions/timer.ts b/src/lib/actions/timer.ts index 1e5f9411e..1f6bff7e1 100644 --- a/src/lib/actions/timer.ts +++ b/src/lib/actions/timer.ts @@ -22,7 +22,13 @@ export const timer: Action = (node, props) => { function step() { const diffInSeconds = Math.floor((new Date().getTime() - startDate.getTime()) / 1000); - node.textContent = calculateTime(diffInSeconds); + const minutes = Math.floor(diffInSeconds / 60); + if (minutes > 0) { + const seconds = diffInSeconds % 60; + node.textContent = `${minutes}m ${seconds}s`; + } else { + node.textContent = calculateTime(diffInSeconds); + } frame = window.requestAnimationFrame(step); } diff --git a/src/lib/components/empty.svelte b/src/lib/components/empty.svelte index e967f16bb..79a0e7717 100644 --- a/src/lib/components/empty.svelte +++ b/src/lib/components/empty.svelte @@ -1,10 +1,10 @@ - -

- -

+ + - - {#if href} - - {:else} - - {/if} + + + {#if href} + + {:else} + + {/if} + -
+ diff --git a/src/routes/(console)/project-[project]/overview/platforms/createAndroid.svelte b/src/routes/(console)/project-[project]/overview/platforms/createAndroid.svelte index 928d56810..f7204f9d3 100644 --- a/src/routes/(console)/project-[project]/overview/platforms/createAndroid.svelte +++ b/src/routes/(console)/project-[project]/overview/platforms/createAndroid.svelte @@ -10,7 +10,6 @@ Typography, Fieldset, InlineCode, - Spinner } from '@appwrite.io/pink-svelte'; import { Button, Form, InputText } from '$lib/elements/forms'; import { IconAndroid, IconAppwrite } from '@appwrite.io/pink-icons-svelte'; @@ -103,7 +102,7 @@ const val APPWRITE_PUBLIC_ENDPOINT = "${sdk.forProject.client.config.endpoint}" @@ -202,35 +201,43 @@ const val APPWRITE_PUBLIC_ENDPOINT = "${sdk.forProject.client.config.endpoint}" icon={IconAppwrite} /> - - {#if !connectionSuccessful} - - Waiting for connection... - {:else} - -
- Congratulations! - + {#if isPlatformCreated} + + {#if !connectionSuccessful} You connected your app successfully. -
- {/if} -
+ >Waiting for connection... + {:else} + +
+ Congratulations! + + You connected your app successfully. +
+ {/if} + + {/if} - + {#if isPlatformCreated} + + {/if} diff --git a/src/routes/(console)/project-[project]/overview/platforms/createApple.svelte b/src/routes/(console)/project-[project]/overview/platforms/createApple.svelte index 011435d21..cb3db0bd0 100644 --- a/src/routes/(console)/project-[project]/overview/platforms/createApple.svelte +++ b/src/routes/(console)/project-[project]/overview/platforms/createApple.svelte @@ -10,7 +10,6 @@ Typography, Fieldset, InlineCode, - Spinner } from '@appwrite.io/pink-svelte'; import { Button, Form, InputText } from '$lib/elements/forms'; import { IconApple, IconAppwrite } from '@appwrite.io/pink-icons-svelte'; @@ -116,7 +115,8 @@ APPWRITE_PUBLIC_ENDPOINT: "${sdk.forProject.client.config.endpoint}" bind:group={platform} variant="primary" {value} - title={key} /> + title={key} + disabled={isPlatformCreated} /> {/each} @@ -129,7 +129,7 @@ APPWRITE_PUBLIC_ENDPOINT: "${sdk.forProject.client.config.endpoint}" @@ -226,35 +226,43 @@ APPWRITE_PUBLIC_ENDPOINT: "${sdk.forProject.client.config.endpoint}" icon={IconAppwrite} /> - - {#if !connectionSuccessful} - - Waiting for connection... - {:else} - -
- Congratulations! - + {#if isPlatformCreated} + + {#if !connectionSuccessful} You connected your app successfully. -
- {/if} -
+ >Waiting for connection... + {:else} + +
+ Congratulations! + + You connected your app successfully. +
+ {/if} + + {/if} - + {#if isPlatformCreated} + + {/if} diff --git a/src/routes/(console)/project-[project]/overview/platforms/createFlutter.svelte b/src/routes/(console)/project-[project]/overview/platforms/createFlutter.svelte index adbd189a9..afb9a9893 100644 --- a/src/routes/(console)/project-[project]/overview/platforms/createFlutter.svelte +++ b/src/routes/(console)/project-[project]/overview/platforms/createFlutter.svelte @@ -10,7 +10,6 @@ Typography, Fieldset, InlineCode, - Spinner } from '@appwrite.io/pink-svelte'; import { Button, Form, InputText } from '$lib/elements/forms'; import { IconFlutter, IconAppwrite } from '@appwrite.io/pink-icons-svelte'; @@ -65,35 +64,35 @@ static const String APPWRITE_PUBLIC_ENDPOINT = "${sdk.forProject.client.config.e > > = { [PlatformType.Flutterandroid]: { - name: 'My Android App', + name: 'My Android app', hostname: 'com.company.appname', tooltip: 'Your package name is generally the applicationId in your app-level build.gradle file.' }, [PlatformType.Flutterios]: { - name: 'My iOS App', + name: 'My iOS app', hostname: 'com.company.appname', tooltip: "You can find your Bundle Identifier in the General tab for your app's primary target in Xcode." }, [PlatformType.Flutterlinux]: { - name: 'My Linux App', + name: 'My Linux app', hostname: 'appname', tooltip: 'Your application name' }, [PlatformType.Fluttermacos]: { - name: 'My mac OS App', + name: 'My mac OS app', hostname: 'com.company.appname', tooltip: "You can find your Bundle Identifier in the General tab for your app's primary target in Xcode." }, [PlatformType.Flutterwindows]: { - name: 'My Windows App', + name: 'My Windows app', hostname: 'appname', tooltip: 'Your application name' }, [PlatformType.Flutterweb]: { - name: 'My Web App', + name: 'My Web app', hostname: 'localhost', tooltip: 'The hostname that your website will use to interact with the Appwrite APIs in production or development environments. No protocol or port number required.' @@ -101,12 +100,12 @@ static const String APPWRITE_PUBLIC_ENDPOINT = "${sdk.forProject.client.config.e }; const hostname: Partial> = { - [PlatformType.Flutterandroid]: 'Package Name', + [PlatformType.Flutterandroid]: 'Package name', [PlatformType.Flutterios]: 'Bundle ID', - [PlatformType.Flutterlinux]: 'Package Name', + [PlatformType.Flutterlinux]: 'Package name', [PlatformType.Fluttermacos]: 'Bundle ID', [PlatformType.Flutterweb]: 'Hostname', - [PlatformType.Flutterwindows]: 'Package Name' + [PlatformType.Flutterwindows]: 'Package name' }; async function createFlutterPlatform() { @@ -284,35 +283,43 @@ static const String APPWRITE_PUBLIC_ENDPOINT = "${sdk.forProject.client.config.e icon={IconAppwrite} /> - - {#if !connectionSuccessful} - - Waiting for connection... - {:else} - -
- Congratulations! - + {#if isPlatformCreated} + + {#if !connectionSuccessful} You connected your app successfully. -
- {/if} -
+ >Waiting for connection... + {:else} + +
+ Congratulations! + + You connected your app successfully. +
+ {/if} + + {/if} - + {#if isPlatformCreated} + + {/if} diff --git a/src/routes/(console)/project-[project]/overview/platforms/createReactNative.svelte b/src/routes/(console)/project-[project]/overview/platforms/createReactNative.svelte index 325b6b3c5..a7fee3fa1 100644 --- a/src/routes/(console)/project-[project]/overview/platforms/createReactNative.svelte +++ b/src/routes/(console)/project-[project]/overview/platforms/createReactNative.svelte @@ -10,7 +10,6 @@ Typography, Fieldset, InlineCode, - Spinner } from '@appwrite.io/pink-svelte'; import { Button, Form, InputText } from '$lib/elements/forms'; import { IconReact, IconAppwrite } from '@appwrite.io/pink-icons-svelte'; @@ -75,7 +74,7 @@ const APPWRITE_PUBLIC_ENDPOINT = "${sdk.forProject.client.config.endpoint}"; }; const hostname: Partial> = { - [PlatformType.Reactnativeandroid]: 'Package Name', + [PlatformType.Reactnativeandroid]: 'Package name', [PlatformType.Reactnativeios]: 'Bundle ID' }; @@ -143,7 +142,8 @@ const APPWRITE_PUBLIC_ENDPOINT = "${sdk.forProject.client.config.endpoint}"; bind:group={platform} variant="primary" {value} - title={key} /> + title={key} + disabled={isPlatformCreated} /> {/each} @@ -251,35 +251,43 @@ const APPWRITE_PUBLIC_ENDPOINT = "${sdk.forProject.client.config.endpoint}"; icon={IconAppwrite} /> - - {#if !connectionSuccessful} - - Waiting for connection... - {:else} - -
- Congratulations! - + {#if isPlatformCreated} + + {#if !connectionSuccessful} You connected your app successfully. -
- {/if} -
+ >Waiting for connection... + {:else} + +
+ Congratulations! + + You connected your app successfully. +
+ {/if} + + {/if} - + {#if isPlatformCreated} + + {/if} diff --git a/src/routes/(console)/project-[project]/sites/(components)/deploymentSource.svelte b/src/routes/(console)/project-[project]/sites/(components)/deploymentSource.svelte index caca20106..2cd0bca2c 100644 --- a/src/routes/(console)/project-[project]/sites/(components)/deploymentSource.svelte +++ b/src/routes/(console)/project-[project]/sites/(components)/deploymentSource.svelte @@ -16,13 +16,17 @@ {#if deployment.type === 'vcs'} - { - e.preventDefault(); - toggle(e); - }}> - GitHub - + + { + e.preventDefault(); + toggle(e); + }}> + + GitHub + + + - + - - Deployment logs + + + Deployment logs + + type={badgeType(status)} /> + + + {#if ['processing', 'building'].includes(status)} + + +

+ + + + {:else} + + {formatTimeDetailed(deployment.buildTime)} + + {/if} -

- - {#if ['processing', 'building'].includes(status)} - - - {:else} - {calculateTime(deployment.buildTime)} - {/if} - -
-
- - - - - {#if ['processing', 'building'].includes(status)} - - {/if} + {#key buildLogs} + + {/key} + {#if ['processing', 'building'].includes(status)} + + + + {/if}
diff --git a/src/routes/(console)/project-[project]/sites/promoteModal.svelte b/src/routes/(console)/project-[project]/sites/activateDeploymentModal.svelte similarity index 66% rename from src/routes/(console)/project-[project]/sites/promoteModal.svelte rename to src/routes/(console)/project-[project]/sites/activateDeploymentModal.svelte index 2e549fc47..4f391bda2 100644 --- a/src/routes/(console)/project-[project]/sites/promoteModal.svelte +++ b/src/routes/(console)/project-[project]/sites/activateDeploymentModal.svelte @@ -12,32 +12,32 @@ export let siteId: string; let error: string; - async function promote() { + async function activate() { try { - await sdk.forProject.sites.updateDeploymentBuild(siteId, selectedDeploymentId); + await sdk.forProject.sites.updateDeployment(siteId, selectedDeploymentId); addNotification({ type: 'success', - message: `Deployment has been promoted` + message: `Deployment has been activated` }); - trackEvent(Submit.SitePromoteDeployment); + trackEvent(Submit.SiteActivateDeployment); invalidate(Dependencies.SITE); invalidate(Dependencies.DEPLOYMENTS); show = false; } catch (e) { error = e.message; - trackError(e, Submit.SitePromoteDeployment); + trackError(e, Submit.SiteActivateDeployment); } } - +

- Are you sure you want to promote this deployment? This might affect your production code. + Are you sure you want to activate this deployment? This might affect your production code.

- +
diff --git a/src/routes/(console)/project-[project]/sites/create-site/aside.svelte b/src/routes/(console)/project-[project]/sites/create-site/aside.svelte index 7d310c96b..e05f5d371 100644 --- a/src/routes/(console)/project-[project]/sites/create-site/aside.svelte +++ b/src/routes/(console)/project-[project]/sites/create-site/aside.svelte @@ -1,5 +1,5 @@ - + - {#if framework?.name} - {@const frameworkIcon = getFrameworkIcon(framework.key)} - - Framework - - {#if frameworkIcon} - - {/if} - - {framework.name} - - - - {/if} {#if repositoryName && showAfter} Git repository - - + + {repositoryName} @@ -46,14 +32,18 @@ {#if branch && showAfter} Branch - - + + {branch} {/if} + {#if rootDir && showAfter} Root directory @@ -62,16 +52,33 @@ {/if} + {#if framework?.name} + {@const frameworkIcon = getFrameworkIcon(framework.key)} + + Framework + + {#if frameworkIcon} + + {/if} + + {framework.name} + + + + {/if} + {#if domain && showAfter} Domain - - {$consoleVariables._APP_OPTIONS_FORCE_HTTPS - ? 'https://' - : 'http://'}{domain}.{$consoleVariables._APP_DOMAIN_TARGET} + + + {#key domain} + + {$consoleVariables._APP_OPTIONS_FORCE_HTTPS + ? 'https://' + : 'http://'}{domain}.{$consoleVariables._APP_DOMAIN_TARGET} + + {/key} {/if} diff --git a/src/routes/(console)/project-[project]/sites/create-site/configuration.svelte b/src/routes/(console)/project-[project]/sites/create-site/configuration.svelte index cbd96c804..b2095ce17 100644 --- a/src/routes/(console)/project-[project]/sites/create-site/configuration.svelte +++ b/src/routes/(console)/project-[project]/sites/create-site/configuration.svelte @@ -10,7 +10,9 @@ Badge, HiddenText, ActionMenu, - Accordion + Accordion, + Tooltip, + Button as PinkButton } from '@appwrite.io/pink-svelte'; import { IconDotsHorizontal, @@ -28,6 +30,7 @@ import SecretVariableModal from './secretVariableModal.svelte'; import ImportSiteVariablesModal from './importSiteVariablesModal.svelte'; import CreateVariable from './createVariable.svelte'; + import DeleteVariableModal from './deleteVariableModal.svelte'; export let frameworks: Models.Framework[]; export let selectedFramework: Models.Framework; @@ -40,22 +43,16 @@ let showEditorModal = false; let showImportModal = false; let showSecretModal = false; + let showDelete = false; let showCreate = false; let currentVariable: Partial; let frameworkId = selectedFramework.key; - function markAsSecret() { - let variable = variables.find((v) => v.key === currentVariable.key); - if (variable) { - variable.secret = true; - } - } - $: frameworkData = frameworks.find((framework) => framework.key === selectedFramework.key); -
+
- + Set up how your project is built and where the output files are stored. - - - - - - - - - - - + + + + + + + + + + + + + @@ -112,10 +123,31 @@ Environment variables - - - Set up environment variables to securely manage keys and settings for your - project. + + Set up environment variables to securely manage keys and settings for your + project. + + + + + + + {#if variables?.length} + + {/if} + {#if variables?.length} @@ -131,7 +163,16 @@
{#if variable.secret} - + + + + This value is secret, you cannot see its + value. + + {:else}
- + + + - - { - showEditorModal = true; - }}> - Edit - + {#if !variable?.secret} { + currentVariable = variable; + showCreate = true; + }}> + Edit + + {/if} + {#if !variable?.secret} + { currentVariable = variable; showSecretModal = true; @@ -171,9 +218,11 @@ {/if} { - showImportModal = true; + currentVariable = variable; + showDelete = true; }}> Delete @@ -190,25 +239,6 @@ >Create variables to get started {/if} - - - - - - - @@ -220,7 +250,7 @@ {/if} {#if showSecretModal} - + {/if} {#if showImportModal} @@ -228,5 +258,9 @@ {/if} {#if showCreate} - + +{/if} + +{#if showDelete} + {/if} diff --git a/src/routes/(console)/project-[project]/sites/create-site/createVariable.svelte b/src/routes/(console)/project-[project]/sites/create-site/createVariable.svelte index 57c47910f..0664e9454 100644 --- a/src/routes/(console)/project-[project]/sites/create-site/createVariable.svelte +++ b/src/routes/(console)/project-[project]/sites/create-site/createVariable.svelte @@ -46,22 +46,25 @@ href={`${base}/project-${$page.params.project}/settings`}>project settings. - - - + + + + + + import { Button } from '$lib/elements/forms'; + import type { Models } from '@appwrite.io/console'; + import { Dialog, Layout } from '@appwrite.io/pink-svelte'; + + export let show = false; + + export let currentVariable: Partial = null; + export let variables: Partial[] = []; + + function deleteVariable() { + console.log(variables, currentVariable); + variables = variables.filter((v) => v.key !== currentVariable.key); + variables = [...variables]; + currentVariable = null; + show = false; + } + + $: if (!show) { + currentVariable = null; + } + + + +

Are you sure you want to delete this variable? This action is irreversible.

+ + + + + + +
diff --git a/src/routes/(console)/project-[project]/sites/create-site/deploying/+page.svelte b/src/routes/(console)/project-[project]/sites/create-site/deploying/+page.svelte index 27ee5db1d..0bce0235f 100644 --- a/src/routes/(console)/project-[project]/sites/create-site/deploying/+page.svelte +++ b/src/routes/(console)/project-[project]/sites/create-site/deploying/+page.svelte @@ -6,19 +6,29 @@ import Button from '$lib/elements/forms/button.svelte'; import Aside from '../aside.svelte'; import Logs from '../../(components)/logs.svelte'; + import { getFrameworkIcon } from '../../store'; + import { SvgIcon } from '$lib/components'; export let data; + + $: console.log(data); - + - - {data.site.name} - {data.site.$id} + + + + {data.site.name} + + {data.site.$id} @@ -30,16 +40,18 @@