Skip to content

Commit

Permalink
problem: can't see who claimed a problem
Browse files Browse the repository at this point in the history
  • Loading branch information
gsovereignty committed Nov 11, 2023
1 parent ee8b97c commit 766117d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 25 deletions.
2 changes: 1 addition & 1 deletion src/components/problems/LogNewProblemModal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
<Button size="small" icon={DataEnrichmentAdd}
on:click={() => {
formOpen = true;
}}>{#if parent?.UID.length == 64}Create a sub-Problem{:else}New Problem Now{/if} </Button>
}}>{#if parent?.UID.length == 64}Log a sub-problem{:else}New Problem Now{/if} </Button>

<Modal
bind:open={formOpen}
Expand Down
3 changes: 0 additions & 3 deletions src/lib/stores/nostrocket_state/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,11 @@ export class Problem {
Title: string;
Summary: string;
FullText: string;
Closed: boolean;
ClaimedAt: bigint;
ClaimedBy: Account;
CreatedBy: Account;
Rocket: RocketID;
Status: string;
LastHeadHeight: number;
LastHeadHash: string;
LastUpdateHeight: number;
LastUpdateHash: string;
LastUpdateUnix: number;
Expand Down
37 changes: 16 additions & 21 deletions src/routes/problems/[id]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import type {Problem} from "$lib/stores/nostrocket_state/types";
import {page} from "$app/stores";
import {Button, Column, InlineNotification, OverflowMenu, OverflowMenuItem, Row, SkeletonText, Tag, Tile} from "carbon-components-svelte";
import {Chat, Unlocked, ManageProtection, PlayFilledAlt } from "carbon-icons-svelte";
import {Chat, Unlocked, ManageProtection, PlayFilledAlt, Locked, Time, DeliveryParcel, Close, Stop, InProgress, InProgressWarning } from "carbon-icons-svelte";
import {ndk} from "$lib/stores/event_sources/relays/ndk";
import type {NDKUserProfile} from "@nostr-dev-kit/ndk";
import {makeHtml} from "$lib/helpers/mundane";
Expand Down Expand Up @@ -96,15 +96,7 @@ function updateStatus(newStatus:string):Promise<string> {
{problem?.Title}
</h3>
<p style="color: #94a3b8">Logged by <span style="color: #fb923c">{createdBy?.name}</span></p>
</Column>
<Column md={4} class="problem-item-actions">
<LogNewProblemModal parent={problem}/>
<OverflowMenu size="sm" flipped light icon={ManageProtection} style="border: 2px solid white; margin-left: 1rem">
<OverflowMenuItem text="Edit" hasDivider />
<OverflowMenuItem text="Tag" hasDivider />
<OverflowMenuItem text="Print" hasDivider />
<OverflowMenuItem text="Share" hasDivider />
</OverflowMenu>

</Column>
</Row>

Expand All @@ -130,9 +122,11 @@ function updateStatus(newStatus:string):Promise<string> {
<Row>
<Column style="padding-bottom: 5px">
<p style="display: flex; align-items: center; text-transform: capitalize">
<Unlocked style={`color: ${problem?.Closed ? 'red' : 'green'}`}/>
&nbsp;&nbsp;
<span style={`color: ${problem?.Closed ? 'red' : 'green'}`}>{problem?.Closed ? 'Closed' : 'Open'}</span>
{#if problem?.Status == "open" && problem.Children.size > 0}<span style="color:blueviolet"><InProgressWarning /> HAS OPEN CHILDREN</span> {/if}
{#if problem?.Status == "open" && problem.Children.size == 0}<span style="color:green"><Unlocked /> OPEN AND CAN BE CLAIMED</span> {/if}
{#if problem?.Status == "claimed"}<span style="color:orange"><Time /> CLAIMED AND IN PROGRESS</span> {/if}
{#if problem?.Status == "patched"}<span style="color:orange"><DeliveryParcel /> PATCHED AND WAITING FOR VALIDATION</span> {/if}
{#if problem?.Status == "patched"}<span style="color:red"><Close /> PATCHED AND WAITING FOR VALIDATION</span> {/if}
</p>
</Column>
</Row>
Expand All @@ -144,26 +138,27 @@ function updateStatus(newStatus:string):Promise<string> {
</Column>
</Row>

<Row padding={5}>
<Row>
<Column>
<div style="border-bottom: 1px solid #262626; height: 5px"></div>
<p style="color: #94a3b8">Logged by <span style="color: #fb923c">{createdBy?.name}</span></p>
{#if problem?.Status == "claimed"}<p style="color: #94a3b8">Claimed by <span style="color: #fb923c">{claimedBy?.name}</span></p>{/if}
</Column>
</Row>

<Row>
<Column><h5>Comments</h5></Column>
</Row>

<Row padding>
<Column>
[TODO]
<div style="border-bottom: 1px solid #262626; height: 5px"></div>
</Column>
</Row>

<Row padding>
<Column><h5>Take Action</h5></Column>
<Column>
<LogNewProblemModal parent={problem}/>
</Column>
</Row>



<Row>
<Column>
<Button disabled={!claimable} icon={PlayFilledAlt} size="small" kind="primary" on:click={()=>{updateStatus("claimed").then((response)=>{console.log(response)}).catch((response)=>{console.log(response);statusErrorText = response})}}>Claim this problem and work on it now</Button>
Expand Down

0 comments on commit 766117d

Please sign in to comment.