Skip to content

Commit

Permalink
fix: wizard modal opening glitch (#2325)
Browse files Browse the repository at this point in the history
# Motivation

Fix wizard modal opening glitch by integrating gix-cmp PR
dfinity/gix-components#198

# ⚠️ PRs

The related PR is a tricky PR!

- [x] dfinity/gix-components#198

# Changes

- bump gix-cmp
  • Loading branch information
peterpeterparker committed Apr 17, 2023
1 parent 1a72e67 commit 9ed9814
Show file tree
Hide file tree
Showing 18 changed files with 36 additions and 36 deletions.
12 changes: 6 additions & 6 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
let bitcoinEstimatedFee: bigint | undefined | null = undefined;
let kytEstimatedFee: bigint | undefined | null = undefined;
let currentStep: WizardStep;
let currentStep: WizardStep | undefined;
let title: string;
$: title =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
sourceAccount: selectedAccount,
};
let currentStep: WizardStep;
let currentStep: WizardStep | undefined;
$: title =
currentStep?.name === "Form"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
sourceAccount: selectedAccount,
};
let currentStep: WizardStep;
let currentStep: WizardStep | undefined;
$: title =
currentStep?.name === "Form"
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/lib/modals/neurons/DisburseNnsNeuronModal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
},
];
let currentStep: WizardStep;
let currentStep: WizardStep | undefined;
let modal: WizardModal;
let loading = false;
let amount: TokenAmount;
Expand Down Expand Up @@ -100,10 +100,10 @@
><span data-tid="disburse-neuron-modal">{currentStep?.title}</span
></svelte:fragment
>
{#if currentStep.name === "SelectDestination"}
{#if currentStep?.name === "SelectDestination"}
<DestinationAddress on:nnsAddress={onSelectAddress} />
{/if}
{#if currentStep.name === "ConfirmDisburse" && destinationAddress !== undefined}
{#if currentStep?.name === "ConfirmDisburse" && destinationAddress !== undefined}
<ConfirmDisburseNeuron
on:nnsClose
on:nnsConfirm={executeTransaction}
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/lib/modals/neurons/DisburseSnsNeuronModal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
},
];
let currentStep: WizardStep;
let currentStep: WizardStep | undefined;
let loading = false;
let destinationAddress: string | undefined;
Expand Down Expand Up @@ -113,7 +113,7 @@
><span data-tid="disburse-sns-neuron-modal">{currentStep?.title}</span
></svelte:fragment
>
{#if currentStep.name === "ConfirmDisburse" && destinationAddress !== undefined}
{#if currentStep?.name === "ConfirmDisburse" && destinationAddress !== undefined}
<ConfirmDisburseNeuron
on:nnsClose
on:nnsBack={() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
];
let currentStep: WizardStep;
let currentStep: WizardStep | undefined;
let modal: WizardModal;
let delayInSeconds = Number(neuron.dissolveDelaySeconds);
Expand All @@ -39,7 +39,7 @@

<WizardModal {steps} bind:currentStep bind:this={modal} on:nnsClose>
<svelte:fragment slot="title">{currentStep?.title}</svelte:fragment>
{#if currentStep.name === "SetDissolveDelay"}
{#if currentStep?.name === "SetDissolveDelay"}
<SetNnsDissolveDelay
{neuron}
on:nnsCancel={closeModal}
Expand All @@ -52,7 +52,7 @@
>
</SetNnsDissolveDelay>
{/if}
{#if currentStep.name === "ConfirmDissolveDelay"}
{#if currentStep?.name === "ConfirmDissolveDelay"}
<ConfirmDissolveDelay
confirmButtonText={$i18n.neurons.confirm_update_delay}
{neuron}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
pollAccounts();
});
let currentStep: WizardStep;
let currentStep: WizardStep | undefined;
let title: string;
$: title =
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/lib/modals/neurons/SpawnNeuronModal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
? hardwareWalletSteps
: nnsDappAccountSteps;
let currentStep: WizardStep;
let currentStep: WizardStep | undefined;
let percentageToSpawn = 0;
Expand Down Expand Up @@ -96,7 +96,7 @@
<svelte:fragment slot="title"
>{currentStep?.title ?? steps[0].title}</svelte:fragment
>
{#if currentStep.name === "SelectPercentage"}
{#if currentStep?.name === "SelectPercentage"}
<NeuronSelectPercentage
formattedMaturity={formattedMaturity(neuron)}
buttonText={$i18n.neuron_detail.spawn}
Expand All @@ -117,7 +117,7 @@
</p>
</svelte:fragment>
</NeuronSelectPercentage>
{:else if currentStep.name === "ConfirmSpawn"}
{:else if currentStep?.name === "ConfirmSpawn"}
<ConfirmSpawnHW {neuron} on:nnsConfirm={spawnNeuronFromMaturity} />
{/if}
</WizardModal>
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/lib/modals/neurons/StakeMaturityModal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
},
];
let currentStep: WizardStep;
let currentStep: WizardStep | undefined;
let modal: WizardModal;
let percentageToStake = 0;
Expand All @@ -43,7 +43,7 @@
>{currentStep?.title ?? steps[0].title}</svelte:fragment
>

{#if currentStep.name === "SelectPercentage"}
{#if currentStep?.name === "SelectPercentage"}
<NeuronSelectPercentage
{formattedMaturity}
buttonText={$i18n.neuron_detail.stake}
Expand All @@ -56,7 +56,7 @@
{$i18n.neuron_detail.stake_maturity_modal_description}
</svelte:fragment>
</NeuronSelectPercentage>
{:else if currentStep.name === "ConfirmStake"}
{:else if currentStep?.name === "ConfirmStake"}
<NeuronConfirmActionScreen
on:nnsConfirm={stakeNeuronMaturity}
on:nnsCancel={modal.back}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
},
];
let currentStep: WizardStep;
let currentStep: WizardStep | undefined;
let modal: WizardModal;
let principal: Principal | undefined = undefined;
Expand Down Expand Up @@ -82,7 +82,7 @@
>{`${currentStep?.title} - TESTNET ONLY`}</svelte:fragment
>

{#if currentStep.name === "AddPrincipal"}
{#if currentStep?.name === "AddPrincipal"}
<AddPrincipal
bind:principal
on:nnsSelectPrincipal={() => modal.next()}
Expand All @@ -93,7 +93,7 @@
</AddPrincipal>
{/if}

{#if currentStep.name === "AddPermissions"}
{#if currentStep?.name === "AddPermissions"}
<p>{`Select permissions for ${principal?.toText()}`}</p>
{#each selectablePermissions as { checked, permission }}
<Checkbox
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
},
];
let currentStep: WizardStep;
let currentStep: WizardStep | undefined;
let modal: WizardModal;
let delayInSeconds = Number(getSnsLockedTimeInSeconds(neuron) ?? 0n);
Expand Down Expand Up @@ -80,7 +80,7 @@

<WizardModal {steps} bind:currentStep bind:this={modal} on:nnsClose>
<svelte:fragment slot="title">{currentStep?.title}</svelte:fragment>
{#if currentStep.name === "SetSnsDissolveDelay"}
{#if currentStep?.name === "SetSnsDissolveDelay"}
<SetSnsDissolveDelay
{rootCanisterId}
{neuron}
Expand All @@ -95,7 +95,7 @@
>
</SetSnsDissolveDelay>
{/if}
{#if currentStep.name === "ConfirmSnsDissolveDelay"}
{#if currentStep?.name === "ConfirmSnsDissolveDelay"}
<ConfirmSnsDissolveDelay
{rootCanisterId}
{neuron}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
export let rootCanisterId: Principal;
export let reloadNeuron: () => Promise<void>;
let currentStep: WizardStep;
let currentStep: WizardStep | undefined;
let title: string;
$: title =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
export let governanceCanisterId: Principal;
export let transactionFee: TokenAmount;
let currentStep: WizardStep;
let currentStep: WizardStep | undefined;
let stakeNeuronText = replacePlaceholders(
$i18n.sns_neurons.stake_sns_neuron,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
export let rootCanisterId: Principal;
export let governanceCanisterId: Principal;
export let transactionFee: TokenAmount;
export let currentStep: WizardStep;
export let currentStep: WizardStep | undefined;
export let validateAmount: ValidateAmountFn = () => undefined;
let transactionInit: TransactionInit = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
swap: { params },
} = summary);
let currentStep: WizardStep;
let currentStep: WizardStep | undefined;
let title: string | undefined;
$: title =
currentStep?.name === "Form"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe("NnsNeurons", () => {
const spawningNeuron = {
...mockNeuron,
state: NeuronState.Spawning,
neuronId: BigInt(223),
neuronId: BigInt(456),
fullNeuron: {
...mockFullNeuron,
spawnAtTimesSeconds: BigInt(12312313),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import { OWN_CANISTER_ID } from "$lib/constants/canister-ids.constants";
import { DEFAULT_TRANSACTION_FEE_E8S } from "$lib/constants/icp.constants";
export let currentStep: WizardStep;
export let currentStep: WizardStep | undefined;
let modal: TransactionModal;
Expand Down

0 comments on commit 9ed9814

Please sign in to comment.