mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
fix: platform notification
This commit is contained in:
1 parent
8340cf5631
commit
14095baf0c
5 files changed
+94
-26
No files matched your search
@@ -1,6 +1,8 @@
|
||||
<script lang="ts" context="module">
|
||||
import { wizard } from '$lib/stores/wizard';
|
||||
import { versions } from './wizard/store';
|
||||
import SearchLight from '$lib/images/search-light.svg';
|
||||
import SearchDark from '$lib/images/search-dark.svg';
|
||||
import CreateAndroid from './createAndroid.svelte';
|
||||
import CreateApple from './createApple.svelte';
|
||||
import CreateFlutter from './createFlutter.svelte';
|
||||
@@ -28,7 +30,7 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { page } from '$app/stores';
|
||||
import { DropList, DropListItem, Heading } from '$lib/components';
|
||||
import { DropList, DropListItem, Empty, Heading } from '$lib/components';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { toLocaleDateTime } from '$lib/helpers/date';
|
||||
import { base } from '$app/paths';
|
||||
@@ -38,6 +40,7 @@
|
||||
export let data: PageData;
|
||||
|
||||
let showDropdown = false;
|
||||
let showDropdownEmpty = false;
|
||||
const path = `/console/project-${$page.params.project}/overview/platforms`;
|
||||
|
||||
const getPlatformInfo = (platform: string) => {
|
||||
@@ -77,32 +80,77 @@
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="grid-box u-margin-block-start-32" style="--grid-gap:1.5rem; --grid-item-size:20rem;">
|
||||
{#each data.platforms.platforms as platform}
|
||||
<a class="card" href={`${path}/${platform.$id}`}>
|
||||
<div class="grid-item-1" style="min-block-size: calc(182 / 16 * 1rem)">
|
||||
<div class="grid-item-1-start-start">
|
||||
<div class="u-flex u-gap-8 u-cross-center">
|
||||
<div class="avatar is-medium" aria-hidden="true">
|
||||
<img
|
||||
src={`${base}/icons/${$app.themeInUse}/${getPlatformInfo(
|
||||
platform.type.toLowerCase()
|
||||
)}.svg`}
|
||||
alt="technology" />
|
||||
{#if data.platforms.platforms.length}
|
||||
<div
|
||||
class="grid-box u-margin-block-start-32"
|
||||
style="--grid-gap:1.5rem; --grid-item-size:20rem;">
|
||||
{#each data.platforms.platforms as platform}
|
||||
<a class="card" href={`${path}/${platform.$id}`}>
|
||||
<div class="grid-item-1" style="min-block-size: calc(182 / 16 * 1rem)">
|
||||
<div class="grid-item-1-start-start">
|
||||
<div class="u-flex u-gap-8 u-cross-center">
|
||||
<div class="avatar is-medium" aria-hidden="true">
|
||||
<img
|
||||
src={`${base}/icons/${$app.themeInUse}/${getPlatformInfo(
|
||||
platform.type.toLowerCase()
|
||||
)}.svg`}
|
||||
alt="technology" />
|
||||
</div>
|
||||
<span class="text">{platform.name}</span>
|
||||
</div>
|
||||
<span class="text">{platform.name}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid-item-1-end-start">
|
||||
<div class="u-flex u-gap-16 u-flex-wrap">
|
||||
<div class="grid-item-1-end-start">
|
||||
<p class="eyebrow-heading-3">Last Updated</p>
|
||||
<p>{toLocaleDateTime(platform.$updatedAt)}</p>
|
||||
<div class="grid-item-1-end-start">
|
||||
<div class="u-flex u-gap-16 u-flex-wrap">
|
||||
<div class="grid-item-1-end-start">
|
||||
<p class="eyebrow-heading-3">Last Updated</p>
|
||||
<p>{toLocaleDateTime(platform.$updatedAt)}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
{/each}
|
||||
</div>
|
||||
</a>
|
||||
{/each}
|
||||
</div>
|
||||
{:else}
|
||||
<article class="card u-grid u-cross-center u-width-full-line common-section">
|
||||
<div class="u-flex u-flex-vertical u-cross-center u-gap-24">
|
||||
{#if $app.themeInUse === 'dark'}
|
||||
<img src={SearchDark} alt="empty" aria-hidden="true" />
|
||||
{:else}
|
||||
<img src={SearchLight} alt="empty" aria-hidden="true" />
|
||||
{/if}
|
||||
<slot>
|
||||
<div class="u-text-center">
|
||||
<Heading size="7" tag="h4">Create your first platform to get started.</Heading>
|
||||
<p class="body-text-2 u-margin-block-start-4">
|
||||
Need a hand? Check out our documentation.
|
||||
</p>
|
||||
</div>
|
||||
<div class="u-flex u-gap-16 u-main-center">
|
||||
<Button external href="https://appwrite.io/docs/sdks" text>
|
||||
Documentation
|
||||
</Button>
|
||||
<DropList bind:show={showDropdownEmpty} placement="bottom-start">
|
||||
<Button secondary on:click={() => (showDropdownEmpty = !showDropdownEmpty)}>
|
||||
<span class="text">Add platform</span>
|
||||
</Button>
|
||||
<svelte:fragment slot="list">
|
||||
<DropListItem on:click={() => addPlatform(Platform.Web)}>
|
||||
Web App</DropListItem>
|
||||
<DropListItem on:click={() => addPlatform(Platform.Flutter)}>
|
||||
Flutter App
|
||||
</DropListItem>
|
||||
<DropListItem on:click={() => addPlatform(Platform.Android)}>
|
||||
Android App
|
||||
</DropListItem>
|
||||
<DropListItem on:click={() => addPlatform(Platform.Apple)}>
|
||||
Apple App
|
||||
</DropListItem>
|
||||
</svelte:fragment>
|
||||
</DropList>
|
||||
</div>
|
||||
</slot>
|
||||
</div>
|
||||
</article>
|
||||
{/if}
|
||||
@@ -3,19 +3,24 @@
|
||||
import { beforeNavigate, invalidate } from '$app/navigation';
|
||||
import { wizard } from '$lib/stores/wizard';
|
||||
import { createPlatform } from './wizard/store';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { onboarding } from '../../store';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import type { WizardStepsType } from '$lib/layout/wizard.svelte';
|
||||
import Step1 from './wizard/android/step1.svelte';
|
||||
import Step2 from './wizard/android/step2.svelte';
|
||||
import Step3 from './wizard/android/step3.svelte';
|
||||
import Step4 from './wizard/step4.svelte';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { onboarding } from '../../store';
|
||||
|
||||
async function onFinish() {
|
||||
if ($onboarding) {
|
||||
invalidate(Dependencies.PROJECT);
|
||||
}
|
||||
invalidate(Dependencies.PLATFORMS);
|
||||
addNotification({
|
||||
type: 'success',
|
||||
message: `${$createPlatform.name} platform has been created.`
|
||||
});
|
||||
createPlatform.reset();
|
||||
wizard.hide();
|
||||
}
|
||||
|
||||
@@ -10,12 +10,17 @@
|
||||
import Step4 from './wizard/step4.svelte';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { onboarding } from '../../store';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
|
||||
async function onFinish() {
|
||||
if ($onboarding) {
|
||||
invalidate(Dependencies.PROJECT);
|
||||
}
|
||||
invalidate(Dependencies.PLATFORMS);
|
||||
addNotification({
|
||||
type: 'success',
|
||||
message: `${$createPlatform.name} platform has been created.`
|
||||
});
|
||||
createPlatform.reset();
|
||||
wizard.hide();
|
||||
}
|
||||
|
||||
@@ -10,12 +10,17 @@
|
||||
import Step4 from './wizard/step4.svelte';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { onboarding } from '../../store';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
|
||||
async function onFinish() {
|
||||
if ($onboarding) {
|
||||
invalidate(Dependencies.PROJECT);
|
||||
}
|
||||
invalidate(Dependencies.PLATFORMS);
|
||||
addNotification({
|
||||
type: 'success',
|
||||
message: `${$createPlatform.name} platform has been created.`
|
||||
});
|
||||
createPlatform.reset();
|
||||
wizard.hide();
|
||||
}
|
||||
|
||||
@@ -10,12 +10,17 @@
|
||||
import Step4 from './wizard/step4.svelte';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { onboarding } from '../../store';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
|
||||
async function onFinish() {
|
||||
if ($onboarding) {
|
||||
invalidate(Dependencies.PROJECT);
|
||||
}
|
||||
invalidate(Dependencies.PLATFORMS);
|
||||
addNotification({
|
||||
type: 'success',
|
||||
message: `${$createPlatform.name} platform has been created.`
|
||||
});
|
||||
createPlatform.reset();
|
||||
wizard.hide();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user