Skip to content

Commit d6581e2

Browse files
feat(frontend): option to skip mission control in attach (#2785)
* feat(frontend): option to skip mission control in attach * chore: fmt
1 parent 610122c commit d6581e2

4 files changed

Lines changed: 20 additions & 4 deletions

File tree

src/frontend/src/lib/components/modules/attach-detach/AttachSegment.svelte

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
<script lang="ts">
2+
import { nonNullish } from '@dfinity/utils';
23
import { Principal } from '@icp-sdk/core/principal';
34
import InputCanisterId from '$lib/components/app/core/InputCanisterId.svelte';
45
import IconLink from '$lib/components/icons/IconLink.svelte';
6+
import CheckboxInline from '$lib/components/ui/CheckboxInline.svelte';
7+
import Html from '$lib/components/ui/Html.svelte';
58
import Popover from '$lib/components/ui/Popover.svelte';
69
import Value from '$lib/components/ui/Value.svelte';
710
import { isBusy } from '$lib/derived/app/busy.derived';
@@ -36,7 +39,8 @@
3639
const { result } = await attachSegment({
3740
segmentId: Principal.fromText(canisterId),
3841
segment,
39-
missionControlId: $missionControlId,
42+
missionControlId:
43+
nonNullish($missionControlId) && attachToMissionControl ? $missionControlId : null,
4044
identity: $authIdentity
4145
});
4246
@@ -59,6 +63,8 @@
5963
)
6064
});
6165
};
66+
67+
let attachToMissionControl = $state(true);
6268
</script>
6369

6470
<button class="primary" aria-label={$i18n.core.attach} onclick={() => (visible = true)}
@@ -91,6 +97,12 @@
9197
{/snippet}
9298
</InputCanisterId>
9399

100+
{#if nonNullish($missionControlId)}
101+
<CheckboxInline bind:checked={attachToMissionControl}>
102+
<span>{$i18n.launchpad.attach_to_mission_control}</span>
103+
</CheckboxInline>
104+
{/if}
105+
94106
<button class="submit" disabled={$isBusy || !validConfirm} type="submit">
95107
{$i18n.core.submit}
96108
</button>
@@ -106,7 +118,8 @@
106118
margin: var(--padding-1_5x) 0 0;
107119
}
108120
109-
p {
121+
p,
122+
span {
110123
font-size: var(--font-size-small);
111124
}
112125
</style>

src/frontend/src/lib/i18n/en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,8 @@
322322
"getting_started_credits": "Welcome to Juno! Reach out on <a href=\"https://discord.gg/wHZ57Z2RAG\" rel=\"external noopener noreferrer\" target=\"_blank\"><strong>Discord</strong></a> and we'll get you started for free.",
323323
"attach_title": "Attach Module",
324324
"attach_description": "Connect an existing Satellite, Orbiter, or UFO to your Console.",
325-
"attach_id": "Enter ID"
325+
"attach_id": "Enter ID",
326+
"attach_to_mission_control": "Attach to Mission Control as well"
326327
},
327328
"satellites": {
328329
"title": "Satellites",

src/frontend/src/lib/i18n/zh-cn.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,8 @@
323323
"getting_started_credits": "欢迎来到 Juno!在 <a href=\"https://discord.gg/wHZ57Z2RAG\" rel=\"external noopener noreferrer\" target=\"_blank\"><strong>Discord</strong></a> 上联系我们,免费开始您的旅程。",
324324
"attach_title": "附加模块",
325325
"attach_description": "将现有的卫星、轨道器或 UFO 连接到您的控制台。",
326-
"attach_id": "输入 ID"
326+
"attach_id": "输入 ID",
327+
"attach_to_mission_control": "同时附加到任务控制"
327328
},
328329
"satellites": {
329330
"title": "所有卫星",

src/frontend/src/lib/types/i18n.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ interface I18nLaunchpad {
330330
attach_title: string;
331331
attach_description: string;
332332
attach_id: string;
333+
attach_to_mission_control: string;
333334
}
334335

335336
interface I18nSatellites {

0 commit comments

Comments
 (0)