Skip to content

Commit 3ecaba5

Browse files
authored
Merge pull request #2023 from appwrite/fix-pro-1919
Fix multiple platform creation
2 parents 891c580 + c97074b commit 3ecaba5

File tree

6 files changed

+513
-510
lines changed

6 files changed

+513
-510
lines changed

src/routes/(console)/project-[region]-[project]/overview/platforms/[platform]/+page@project-[region]-[project].svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
<div class="u-flex u-gap-16">
9999
<div class="u-cross-child-center u-line-height-1-5">
100100
<h6 class="u-bold">{$platform.name}</h6>
101-
<p>{$platform.hostname}</p>
101+
<p>{$platform.hostname || $platform.key}</p>
102102
</div>
103103
</div>
104104
</Box>

src/routes/(console)/project-[region]-[project]/overview/platforms/createAndroid.svelte

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,11 @@ const val APPWRITE_PUBLIC_ENDPOINT = "${sdk.forProject(page.params.region, page.
9191
});
9292
</script>
9393

94-
<Wizard title="Add Android platform" bind:showExitModal confirmExit>
95-
<Form onSubmit={createAndroidPlatform}>
96-
<Layout.Stack gap="xxl">
97-
<!-- Step One -->
98-
{#if !isPlatformCreated}
94+
<Wizard title="Add Android platform" bind:showExitModal confirmExit={!isPlatformCreated}>
95+
<Layout.Stack gap="xxl">
96+
<!-- Step One -->
97+
{#if !isPlatformCreated}
98+
<Form onSubmit={createAndroidPlatform}>
9999
<Fieldset legend="Details">
100100
<Layout.Stack gap="l" alignItems="flex-end">
101101
<Layout.Stack gap="s">
@@ -136,59 +136,59 @@ const val APPWRITE_PUBLIC_ENDPOINT = "${sdk.forProject(page.params.region, page.
136136
</Button>
137137
</Layout.Stack>
138138
</Fieldset>
139-
{:else}
140-
<Layout.Stack gap="xxl">
141-
<Card padding="s" radius="s">
142-
<Layout.Stack
143-
direction="row"
144-
justifyContent="space-between"
145-
alignItems="center"
146-
gap="xs">
147-
<Layout.Stack direction="row" alignItems="center" gap="s">
148-
<Icon size="m" icon={IconAndroid} />
149-
<Typography.Text variant="m-400" color="--fgcolor-neutral-primary">
150-
{$createPlatform.name} ({$createPlatform.key})
151-
</Typography.Text>
152-
</Layout.Stack>
139+
</Form>
140+
{:else}
141+
<Layout.Stack gap="xxl">
142+
<Card padding="s" radius="s">
143+
<Layout.Stack
144+
direction="row"
145+
justifyContent="space-between"
146+
alignItems="center"
147+
gap="xs">
148+
<Layout.Stack direction="row" alignItems="center" gap="s">
149+
<Icon size="m" icon={IconAndroid} />
150+
<Typography.Text variant="m-400" color="--fgcolor-neutral-primary">
151+
{$createPlatform.name} ({$createPlatform.key})
152+
</Typography.Text>
153153
</Layout.Stack>
154-
</Card>
155-
</Layout.Stack>
156-
{/if}
154+
</Layout.Stack>
155+
</Card>
156+
</Layout.Stack>
157+
{/if}
157158

158-
<!-- Step Two -->
159-
{#if isPlatformCreated}
160-
<Fieldset legend="Clone starter">
161-
<Layout.Stack gap="l">
162-
<Typography.Text variant="m-500">
163-
1. Clone the starter kit from GitHub using the terminal or Android
164-
Studio.
165-
</Typography.Text>
159+
<!-- Step Two -->
160+
{#if isPlatformCreated}
161+
<Fieldset legend="Clone starter">
162+
<Layout.Stack gap="l">
163+
<Typography.Text variant="m-500">
164+
1. Clone the starter kit from GitHub using the terminal or Android Studio.
165+
</Typography.Text>
166166

167-
<!-- Temporary fix: Remove this div once Code splitting issue with stack spacing is resolved -->
168-
<div class="pink2-code-margin-fix">
169-
<Code lang="bash" lineNumbers code={gitCloneCode} />
170-
</div>
167+
<!-- Temporary fix: Remove this div once Code splitting issue with stack spacing is resolved -->
168+
<div class="pink2-code-margin-fix">
169+
<Code lang="bash" lineNumbers code={gitCloneCode} />
170+
</div>
171171

172-
<Typography.Text variant="m-500"
173-
>2. Open the file <InlineCode
174-
size="s"
175-
code="data/repository/AppwriteRepository.kt" /> and update the configuration
176-
settings.</Typography.Text>
172+
<Typography.Text variant="m-500"
173+
>2. Open the file <InlineCode
174+
size="s"
175+
code="data/repository/AppwriteRepository.kt" /> and update the configuration
176+
settings.</Typography.Text>
177177

178-
<!-- Temporary fix: Remove this div once Code splitting issue with stack spacing is resolved -->
179-
<div class="pink2-code-margin-fix">
180-
<Code lang="kotlin" lineNumbers code={updateConfigCode} />
181-
</div>
178+
<!-- Temporary fix: Remove this div once Code splitting issue with stack spacing is resolved -->
179+
<div class="pink2-code-margin-fix">
180+
<Code lang="kotlin" lineNumbers code={updateConfigCode} />
181+
</div>
182+
183+
<Typography.Text variant="m-500"
184+
>3. Run the app on a connected device or emulator, then click the <InlineCode
185+
size="s"
186+
code="Send a ping" /> button to verify the setup.</Typography.Text>
187+
</Layout.Stack>
188+
</Fieldset>
189+
{/if}
190+
</Layout.Stack>
182191

183-
<Typography.Text variant="m-500"
184-
>3. Run the app on a connected device or emulator, then click the <InlineCode
185-
size="s"
186-
code="Send a ping" /> button to verify the setup.</Typography.Text>
187-
</Layout.Stack>
188-
</Fieldset>
189-
{/if}
190-
</Layout.Stack>
191-
</Form>
192192
<svelte:fragment slot="aside">
193193
<Card padding="l" class="responsive-padding">
194194
<Layout.Stack gap="xxl">

src/routes/(console)/project-[region]-[project]/overview/platforms/createApple.svelte

Lines changed: 105 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -102,116 +102,120 @@ APPWRITE_PUBLIC_ENDPOINT: "${sdk.forProject(page.params.region, page.params.proj
102102
});
103103
</script>
104104

105-
<Wizard title="Add Apple platform" bind:showExitModal confirmExit>
106-
<Form onSubmit={createApplePlatform}>
107-
<Layout.Stack gap="xxl">
108-
<!-- Step One -->
109-
<Layout.Grid gap="l" rowGap="l" columns={4} columnsXS={2}>
110-
{#each Object.entries(platforms) as [key, value]}
111-
<Pink2Card.Selector
112-
{value}
113-
id={key}
114-
title={key}
115-
imageRadius="s"
116-
name="framework"
117-
bind:group={platform}
118-
disabled={isCreatingPlatform || isPlatformCreated} />
119-
{/each}
120-
</Layout.Grid>
121-
122-
<!-- Step Two -->
123-
{#if !isPlatformCreated}
124-
<Fieldset legend="Details">
125-
<Layout.Stack gap="l" alignItems="flex-end">
126-
<Layout.Stack gap="s">
127-
<InputText
128-
id="name"
129-
label="Name"
130-
placeholder="My Apple App"
131-
required
132-
bind:value={$createPlatform.name} />
105+
<Wizard title="Add Apple platform" bind:showExitModal confirmExit={!isPlatformCreated}>
106+
<Layout.Stack gap="xxl">
107+
<Form onSubmit={createApplePlatform}>
108+
<Layout.Stack gap="xxl">
109+
<!-- Step One -->
110+
<Layout.Grid gap="l" rowGap="l" columns={4} columnsXS={2}>
111+
{#each Object.entries(platforms) as [key, value]}
112+
<Pink2Card.Selector
113+
{value}
114+
id={key}
115+
title={key}
116+
imageRadius="s"
117+
name="framework"
118+
bind:group={platform}
119+
disabled={isCreatingPlatform || isPlatformCreated} />
120+
{/each}
121+
</Layout.Grid>
133122

134-
<!-- Tooltips on InputText don't work as of now -->
135-
<InputText
136-
id="hostname"
137-
label="Bundle ID"
138-
placeholder="com.company.appname"
139-
required
140-
bind:value={$createPlatform.key}>
141-
<Tooltip slot="info" maxWidth="15rem">
142-
<Icon icon={IconInfo} size="s" />
143-
<Typography.Caption variant="400" slot="tooltip">
144-
You can find your Bundle Identifier in the General tab for
145-
your app's primary target in Xcode.
146-
</Typography.Caption>
147-
</Tooltip>
148-
</InputText>
149-
</Layout.Stack>
123+
<!-- Step Two -->
124+
{#if !isPlatformCreated}
125+
<Fieldset legend="Details">
126+
<Layout.Stack gap="l" alignItems="flex-end">
127+
<Layout.Stack gap="s">
128+
<InputText
129+
id="name"
130+
label="Name"
131+
placeholder="My Apple App"
132+
required
133+
bind:value={$createPlatform.name} />
150134

151-
<Button
152-
fullWidthMobile
153-
size="s"
154-
submit
155-
forceShowLoader
156-
submissionLoader={isCreatingPlatform}
157-
disabled={!platform ||
158-
!$createPlatform.name ||
159-
!$createPlatform.key ||
160-
isCreatingPlatform}>
161-
Create platform
162-
</Button>
163-
</Layout.Stack>
164-
</Fieldset>
165-
{:else}
166-
<Layout.Stack gap="xxl">
167-
<Card padding="s" radius="s">
168-
<Layout.Stack
169-
direction="row"
170-
justifyContent="space-between"
171-
alignItems="center"
172-
gap="xs">
173-
<Layout.Stack direction="row" alignItems="center" gap="s">
174-
<Icon size="m" icon={IconApple} />
175-
<Typography.Text variant="m-400" color="--fgcolor-neutral-primary">
176-
{$createPlatform.name} ({$createPlatform.key})
177-
</Typography.Text>
135+
<!-- Tooltips on InputText don't work as of now -->
136+
<InputText
137+
id="hostname"
138+
label="Bundle ID"
139+
placeholder="com.company.appname"
140+
required
141+
bind:value={$createPlatform.key}>
142+
<Tooltip slot="info" maxWidth="15rem">
143+
<Icon icon={IconInfo} size="s" />
144+
<Typography.Caption variant="400" slot="tooltip">
145+
You can find your Bundle Identifier in the General tab
146+
for your app's primary target in Xcode.
147+
</Typography.Caption>
148+
</Tooltip>
149+
</InputText>
178150
</Layout.Stack>
151+
152+
<Button
153+
fullWidthMobile
154+
size="s"
155+
submit
156+
forceShowLoader
157+
submissionLoader={isCreatingPlatform}
158+
disabled={!platform ||
159+
!$createPlatform.name ||
160+
!$createPlatform.key ||
161+
isCreatingPlatform}>
162+
Create platform
163+
</Button>
179164
</Layout.Stack>
180-
</Card>
181-
</Layout.Stack>
182-
{/if}
165+
</Fieldset>
166+
{:else}
167+
<Layout.Stack gap="xxl">
168+
<Card padding="s" radius="s">
169+
<Layout.Stack
170+
direction="row"
171+
justifyContent="space-between"
172+
alignItems="center"
173+
gap="xs">
174+
<Layout.Stack direction="row" alignItems="center" gap="s">
175+
<Icon size="m" icon={IconApple} />
176+
<Typography.Text
177+
variant="m-400"
178+
color="--fgcolor-neutral-primary">
179+
{$createPlatform.name} ({$createPlatform.key})
180+
</Typography.Text>
181+
</Layout.Stack>
182+
</Layout.Stack>
183+
</Card>
184+
</Layout.Stack>
185+
{/if}
186+
</Layout.Stack>
187+
</Form>
183188

184-
<!-- Step Three -->
185-
{#if isPlatformCreated}
186-
<Fieldset legend="Clone starter">
187-
<Layout.Stack gap="l">
188-
<Typography.Text variant="m-500">
189-
1. Clone the starter kit from GitHub using the terminal or XCode.
190-
</Typography.Text>
189+
<!-- Step Three -->
190+
{#if isPlatformCreated}
191+
<Fieldset legend="Clone starter">
192+
<Layout.Stack gap="l">
193+
<Typography.Text variant="m-500">
194+
1. Clone the starter kit from GitHub using the terminal or XCode.
195+
</Typography.Text>
191196

192-
<!-- Temporary fix: Remove this div once Code splitting issue with stack spacing is resolved -->
193-
<div class="pink2-code-margin-fix">
194-
<Code lang="bash" lineNumbers code={gitCloneCode} />
195-
</div>
197+
<!-- Temporary fix: Remove this div once Code splitting issue with stack spacing is resolved -->
198+
<div class="pink2-code-margin-fix">
199+
<Code lang="bash" lineNumbers code={gitCloneCode} />
200+
</div>
196201

197-
<Typography.Text variant="m-500"
198-
>2. Open the file <InlineCode size="s" code="Sources/Config.plist" /> and
199-
update the configuration settings.</Typography.Text>
202+
<Typography.Text variant="m-500"
203+
>2. Open the file <InlineCode size="s" code="Sources/Config.plist" /> and update
204+
the configuration settings.</Typography.Text>
200205

201-
<!-- Temporary fix: Remove this div once Code splitting issue with stack spacing is resolved -->
202-
<div class="pink2-code-margin-fix">
203-
<Code lang="plaintext" lineNumbers code={updateConfigCode} />
204-
</div>
206+
<!-- Temporary fix: Remove this div once Code splitting issue with stack spacing is resolved -->
207+
<div class="pink2-code-margin-fix">
208+
<Code lang="plaintext" lineNumbers code={updateConfigCode} />
209+
</div>
205210

206-
<Typography.Text variant="m-500"
207-
>3. Run the app on a connected device or simulator, then click the <InlineCode
208-
size="s"
209-
code="Send a ping" /> button to verify the setup.</Typography.Text>
210-
</Layout.Stack>
211-
</Fieldset>
212-
{/if}
213-
</Layout.Stack>
214-
</Form>
211+
<Typography.Text variant="m-500"
212+
>3. Run the app on a connected device or simulator, then click the <InlineCode
213+
size="s"
214+
code="Send a ping" /> button to verify the setup.</Typography.Text>
215+
</Layout.Stack>
216+
</Fieldset>
217+
{/if}
218+
</Layout.Stack>
215219
<svelte:fragment slot="aside">
216220
<Card padding="l" class="responsive-padding">
217221
<Layout.Stack gap="xxl">

0 commit comments

Comments
 (0)