-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enhancement: add outdated node url state for removed proposals (#6034)
* chore: add UI for outdated node * chore: add tooltip * chore: add event if is an error * feat: add the stuff * chore: fix type check * fix: pr comments * fix: disable voting if proposal has error * chore: pass one object to Svelte component * feat: remove proposals if in error state * fix: add optional chaining * chore: simplify logic * feat: reactively update participation event status * fix: fix removing proposals --------- Co-authored-by: Mark Nardi <mark.nardi@iota.org> Co-authored-by: Tuditi <45079109+Tuditi@users.noreply.github.com> Co-authored-by: Tuditi <daviddetroch@pm.me>
- Loading branch information
1 parent
88d1b6f
commit 4a81abd
Showing
23 changed files
with
209 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
const governanceFeatures = { | ||
enabled: true, | ||
removeProposals: { | ||
enabled: false, | ||
enabled: true, | ||
}, | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<script lang="ts"> | ||
import { FontWeight, Text, Tooltip } from 'shared/components' | ||
import { Position } from './enums' | ||
import { localize } from '@core/i18n' | ||
export let anchor: HTMLElement | ||
export let position: Position = Position.Right | ||
</script> | ||
|
||
<Tooltip {anchor} {position}> | ||
<div class="flex flex-col text-left"> | ||
<Text fontWeight={FontWeight.semibold} fontSize="16" classes="mb-2"> | ||
{localize('tooltips.governance.outdatedNode.title')} | ||
</Text> | ||
<Text fontWeight={FontWeight.normal}> | ||
{localize('tooltips.governance.outdatedNode.body')} | ||
</Text> | ||
</div> | ||
</Tooltip> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
packages/shared/components/ResultsNotAvailableTooltip.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<script lang="ts"> | ||
import { FontWeight, Text, Tooltip } from 'shared/components' | ||
import { Position } from './enums' | ||
import { localize } from '@core/i18n' | ||
export let anchor: HTMLElement | ||
export let position: Position = Position.Right | ||
</script> | ||
|
||
<Tooltip {anchor} {position}> | ||
<div class="flex flex-col text-left"> | ||
<Text fontWeight={FontWeight.semibold} fontSize="16" classes="mb-2"> | ||
{localize('tooltips.governance.resultsNotAvailable.title')} | ||
</Text> | ||
<Text fontWeight={FontWeight.normal}> | ||
{localize('tooltips.governance.resultsNotAvailable.body')} | ||
</Text> | ||
</div> | ||
</Tooltip> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ | |
" | ||
> | ||
{#if data} | ||
<slot /> | ||
{data} | ||
{:else} | ||
<slot /> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 0 additions & 12 deletions
12
packages/shared/lib/contexts/governance/actions/deregisterParticipationEvent.ts
This file was deleted.
Oops, something went wrong.
13 changes: 5 additions & 8 deletions
13
...ges/shared/lib/contexts/governance/actions/getAccountsParticipationEventStatusForEvent.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,13 @@ | ||
import { get } from 'svelte/store' | ||
|
||
import type { ParticipationEventId, ParticipationEventStatus } from '@iota/wallet' | ||
|
||
import { IAccount } from '@core/account/interfaces' | ||
import { selectedAccount } from '@core/account/stores' | ||
import { IAccount } from '@core/account' | ||
|
||
export async function getAccountsParticipationEventStatusForEvent( | ||
export function getAccountsParticipationEventStatusForEvent( | ||
eventId: ParticipationEventId, | ||
account: IAccount = get(selectedAccount) | ||
): Promise<ParticipationEventStatus> { | ||
try { | ||
const status = await account?.getParticipationEventStatus(eventId) | ||
return status | ||
} catch (err) { | ||
return undefined | ||
} | ||
return account?.getParticipationEventStatus(eventId) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from './proposal-error.enum' | ||
export * from './proposal-order-option.enum' | ||
export * from './proposal-status.enum' | ||
export * from './proposal-type.enum' |
4 changes: 4 additions & 0 deletions
4
packages/shared/lib/contexts/governance/enums/proposal-error.enum.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export enum ProposalError { | ||
NodeOutdated = 'nodeOutdated', | ||
ResultsNotAvailable = 'resultsNotAvailable', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.