Skip to content

Commit

Permalink
problem: not clear how to add new problem
Browse files Browse the repository at this point in the history
  • Loading branch information
gsovereignty committed Feb 11, 2024
1 parent 2c82236 commit b8ab49b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
10 changes: 4 additions & 6 deletions src/components/novoproblems/AddNewSubProblem.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,22 @@
export let problem: Problem;
export let publish: (pr:Problem) => void;
export let value:string = "";
export let required = false;
$:{value = newProblem.Title}
let newProblem: Problem = new Problem();
</script>

<Row
><Column lg={10} noGutterRight
><TextInput
<TextInput light
invalid={required && value.length == 0}
helperText={newProblem.Title.length > 0
? "Describe the problem you face or have observed"
: ""}
maxlength={100}
placeholder="Start typing to add a new problem here..."
bind:value={newProblem.Title}
/></Column
><Column noGutterLeft />
</Row>
/>
{#if newProblem.Title.length > 0}
<Row>
<Column><ChildProblemTile preview problem={newProblem} /></Column>
Expand Down
10 changes: 8 additions & 2 deletions src/components/novoproblems/ProblemView.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@
return $page.url.searchParams.get("tab") ?? "problem";
});
let extraSearchParams = derived(page, ($page)=>{
return $page.url.searchParams.get("extra") ?? "";
})
$:{console.log($page.url.searchParams)}
let selectedTabIndex = derived(selectedTab, ($selectedTab) => {
switch ($selectedTab) {
case "problem":
Expand Down Expand Up @@ -241,7 +247,7 @@
goto(
`${base}/nr/${getRocket(problem)?.Name}/problems/${
problem.UID
}?tab=sub-problems`
}?tab=sub-problems&extra=newproblem`
);
}}
kind="primary"
Expand Down Expand Up @@ -358,7 +364,7 @@
/>
{/if}
{#if $selectedTab == "sub-problems"}
<AddNewSubProblem
<AddNewSubProblem required={$extraSearchParams == "newproblem"}
bind:value={childProblemFilter}
publish={PublishModification}
{problem}
Expand Down

0 comments on commit b8ab49b

Please sign in to comment.