-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add filter button to simulation list and plan snapshot list
add snapshot control bar to plan page
- Loading branch information
Showing
8 changed files
with
235 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -101,6 +101,6 @@ | |
|
||
<style> | ||
.description { | ||
padding: 0px 16px 0; | ||
padding: 0px 16px; | ||
} | ||
</style> |
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 |
---|---|---|
|
@@ -74,6 +74,7 @@ | |
<style> | ||
.message { | ||
font-weight: 500; | ||
padding: 0px 16px; | ||
} | ||
input[type='checkbox'], | ||
|
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,51 @@ | ||
<svelte:options immutable={true} /> | ||
|
||
<script lang="ts"> | ||
import { createEventDispatcher } from 'svelte'; | ||
import type { PlanSnapshot } from '../../types/plan-snapshot'; | ||
export let snapshot: PlanSnapshot; | ||
export let numOfDirectives: number; | ||
const dispatch = createEventDispatcher(); | ||
</script> | ||
|
||
<div class="snapshot-bar"> | ||
<div class="info"> | ||
<div>Preview of plan snapshot</div> | ||
<div class="snapshot-name">{snapshot.snapshot_name}</div> | ||
<div>{numOfDirectives} directive{numOfDirectives !== 1 ? 's' : ''}</div> | ||
</div> | ||
|
||
<div class="buttons"> | ||
<button class="st-button" on:click|stopPropagation={() => dispatch('restore', snapshot)}>Restore Snapshot</button> | ||
<button class="st-button secondary" on:click={() => dispatch('close')}>Close Preview</button> | ||
</div> | ||
</div> | ||
|
||
<style> | ||
.snapshot-bar { | ||
align-items: center; | ||
background-color: var(--st-primary-10, #e6e6ff); | ||
border-bottom: 1px solid var(--st-primary-30, #a1a4fc); | ||
display: flex; | ||
justify-content: space-between; | ||
padding: 10px 16px; | ||
} | ||
.snapshot-bar .info { | ||
align-items: center; | ||
color: var(--st-primary-90, #1a237e); | ||
column-gap: 10px; | ||
display: flex; | ||
display: flex; | ||
font-weight: 500; | ||
} | ||
.snapshot-bar .info .snapshot-name { | ||
background-color: #fff; | ||
border: 1px solid var(--st-primary-30, #a1a4fc); | ||
border-radius: 16px; | ||
padding: 4px 12px; | ||
} | ||
</style> |
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,73 @@ | ||
<svelte:options immutable={true} /> | ||
|
||
<script lang="ts"> | ||
import CloseIcon from '@nasa-jpl/stellar/icons/close.svg?component'; | ||
import FilterIcon from '@nasa-jpl/stellar/icons/filter.svg?component'; | ||
import { createEventDispatcher } from 'svelte'; | ||
import { tooltip } from '../../utilities/tooltip'; | ||
export let isOn: boolean = false; | ||
export let label: string = ''; | ||
export let offTooltipContent: string = ''; | ||
export let onTooltipContent: string = ''; | ||
export let tooltipPlacement: string = 'top'; | ||
const dispatch = createEventDispatcher(); | ||
function onClick() { | ||
dispatch('toggle'); | ||
} | ||
</script> | ||
|
||
<button | ||
class="st-button filter-button" | ||
class:toggled={isOn} | ||
on:click|stopPropagation={onClick} | ||
use:tooltip={{ content: isOn ? onTooltipContent : offTooltipContent, placement: tooltipPlacement }} | ||
> | ||
<div class="icons"> | ||
<FilterIcon /> | ||
<div class="hovered"><CloseIcon /></div> | ||
</div> | ||
<span>{label}</span> | ||
</button> | ||
|
||
<style> | ||
.filter-button { | ||
align-content: center; | ||
background-color: var(--st-gray-15, #f1f2f3); | ||
border-radius: 8px; | ||
color: var(--st-gray-60, #545f64); | ||
column-gap: 4px; | ||
display: grid; | ||
grid-template-columns: auto auto; | ||
padding: 4px; | ||
vertical-align: middle; | ||
} | ||
.filter-button .icons :global(*) { | ||
align-self: center; | ||
display: flex; | ||
} | ||
.filter-button .icons .hovered { | ||
display: none; | ||
} | ||
.toggled { | ||
background-color: var(--st-primary-10, #e6e6ff); | ||
color: var(--st-primary-90, #1d0ebe); | ||
} | ||
.toggled:hover { | ||
background-color: var(--st-primary-20, #c4c6ff); | ||
} | ||
.toggled:hover .icons > :global(svg) { | ||
display: none; | ||
} | ||
.toggled:hover .icons .hovered { | ||
display: inline; | ||
} | ||
</style> |
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.