Skip to content

Commit d606e82

Browse files
committed
client: refactor help, Gselect
1 parent c57e3d9 commit d606e82

69 files changed

Lines changed: 636 additions & 922 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

client/StyleTemplate.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,19 @@
55
- https://vuejs.org/guide/typescript/composition-api.html -->
66

77
<!-- Attribute order: v-for/v-if; id; ref/key; v-model; others...; @click/@etc. -->
8-
<button v-if="visible" class="btn" @click="handleClick">Button</button>
8+
<button v-if="visible" v-model="foo" class="btn" @click="handleClick">Button</button>
99
</template>
1010

1111
<script setup lang="ts">
1212
// -- libraries --
1313
// --- stores ---
1414
// --- api ---
15+
// --- views ---
1516
// --- types ---
17+
// --- model ---
18+
const model = defineModel<string>()
1619
// --- props ---
17-
const {foo = "bar"} = defineProps<{
20+
const { foo = "bar" } = defineProps<{
1821
foo?: string
1922
}>()
2023
// --- emits ---

client/components.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,12 @@ declare module 'vue' {
3232
GInput: typeof import('./src/components/input/GInput.vue')['default']
3333
GModal: typeof import('./src/components/modals/GModal.vue')['default']
3434
GNav: typeof import('./src/components/links/GNav.vue')['default']
35+
GSelect: typeof import('./src/components/input/GSelect.vue')['default']
3536
GSpinner: typeof import('./src/components/GSpinner.vue')['default']
3637
GTable: typeof import('./src/components/tables/GTable.vue')['default']
3738
GTabs: typeof import('./src/components/GTabs.vue')['default']
3839
HelpLink: typeof import('./src/components/links/HelpLink.vue')['default']
40+
InlineTextButton: typeof import('./src/components/input/InlineTextButton.vue')['default']
3941
InspectButton: typeof import('./src/components/input/InspectButton.vue')['default']
4042
JobModal: typeof import('./src/components/modals/jobs/JobModal.vue')['default']
4143
JobProgress: typeof import('./src/components/modals/jobs/JobProgress.vue')['default']

client/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"name": "galahad",
3-
"version": "0.0.0",
43
"private": true,
54
"type": "module",
65
"scripts": {

client/src/assets/main.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ ul, ol {
3131
padding: revert;
3232
}
3333

34-
a:link {
34+
a {
3535
color: #000;
3636
text-decoration: underline;
3737

client/src/components/EvaluationInfoBox.vue

Lines changed: 0 additions & 64 deletions
This file was deleted.

client/src/components/GCard.vue

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
</hgroup>
1212
<GInfo v-if="expand && $slots.help">
1313
<slot name="help"></slot>
14-
<template v-if="helpSubject" #footer>
15-
<HelpLink :subject="helpSubject" />
14+
<template v-if="helpLink" #footer>
15+
<HelpLink :helpLink />
1616
</template>
1717
</GInfo>
1818
</header>
@@ -26,9 +26,11 @@
2626
</template>
2727

2828
<script setup lang="ts">
29+
import type { HelpLink } from '@/types/ui/help';
30+
2931
// --- props ---
30-
const { helpSubject, title } = defineProps<{
31-
helpSubject?: string
32+
const { helpLink, title } = defineProps<{
33+
helpLink?: HelpLink | string
3234
title?: string
3335
article?: boolean
3436
}>()
@@ -38,19 +40,24 @@ const expand = ref(false)
3840
</script>
3941

4042
<style scoped lang="scss">
43+
.view>.g-card,
44+
.view.g-card,
45+
.modal .g-card {
46+
padding: 1rem;
47+
}
48+
49+
.view.g-card>.content,
50+
{
51+
flex: 1;
52+
}
53+
4154
.g-card {
4255
background-color: var(--white);
43-
padding: 1em;
44-
min-width: 250px;
4556
max-width: 100%;
4657
display: flex;
4758
flex-direction: column;
4859
gap: 1rem;
49-
50-
.g-card {
51-
// Don't double up on padding
52-
padding: 0;
53-
}
60+
align-items: stretch !important;
5461
5562
.header {
5663
display: flex;
@@ -59,40 +66,36 @@ const expand = ref(false)
5966
align-items: center;
6067
6168
.title {
62-
text-align: center;
63-
64-
.h3 {
65-
display: inline-block;
66-
}
69+
display: flex;
70+
align-items: center;
71+
gap: 0.5rem;
6772
6873
.help-btn.plain {
6974
border: 1px solid var(--int-grey);
70-
padding: 0 0.6em;
71-
font-size: 1.5em;
72-
cursor: help;
73-
width: 28px;
74-
justify-content: center;
7575
font-weight: bold;
76-
margin-left: 0.5em;
76+
cursor: help;
77+
font-size: 1.5rem;
78+
width: 2rem;
79+
height: 2rem;
7780
}
7881
}
7982
}
8083
8184
.content {
8285
display: flex;
8386
flex-direction: column;
84-
align-items: center;
87+
align-items: safe center;
8588
gap: 1rem;
8689
max-width: 100%;
87-
overflow: scroll;
90+
overflow-x: auto;
8891
8992
&.article {
9093
max-width: 800px;
9194
align-items: start;
9295
align-self: center;
9396
9497
:deep(h1) {
95-
font-size: 2em;
98+
font-size: 2rem;
9699
}
97100
}
98101
}

client/src/components/GInfo.vue

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<aside class="info" :class="classes">
2+
<aside class="info" :class="{ error: error }">
33
<GSpinner class="spinner" :error :still="!spinner" />
44
<slot></slot>
55
<template v-if="$slots.footer">
@@ -11,14 +11,10 @@
1111
</template>
1212

1313
<script setup lang="ts">
14-
const props = defineProps<{
14+
const { error, spinner } = defineProps<{
1515
error?: boolean
1616
spinner?: boolean
1717
}>()
18-
19-
const classes = computed(() => ({
20-
error: props.error,
21-
}))
2218
</script>
2319

2420
<style scoped lang="scss">

client/src/components/GSpinner.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ const props = defineProps<{
1212
small?: boolean
1313
still?: boolean
1414
}>()
15-
const classes = computed(() => ({
15+
const classes = {
1616
error: props.error,
1717
small: props.small,
1818
still: props.still,
19-
}))
19+
}
2020
</script>
2121

2222
<style scoped lang="scss">

client/src/components/GTabs.vue

Lines changed: 6 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<slot name="banner"></slot>
77
</template>
88
<nav class="nav">
9-
<div v-for="tab in tabs" :key="tab.id">
9+
<template v-for="tab in tabs" :key="tab.id">
1010
<a v-if="!tab.disabled && !tab.stub" :href="urlForTab(tab.id)"
1111
:class="'textcolor ' + navLinkClass(tab.id)" @click.prevent="navigateTo(tab.id)">
1212
<slot :name="`${tab.id}-title`" :isActive="currentTab == tab.id">{{ tab.title || tab.id }}
@@ -15,7 +15,7 @@
1515
<span :class="`nav-link ${tab.disabled ? 'disabled' : ''}`" v-else>
1616
<slot :name="`${tab.id}-title`">{{ tab.title || tab.id }}</slot>
1717
</span>
18-
</div>
18+
</template>
1919
</nav>
2020
</header>
2121

@@ -110,7 +110,6 @@ function urlForTab(tabId: string) {
110110
111111
.nav {
112112
display: inline-flex;
113-
flex-wrap: wrap;
114113
line-height: 45px;
115114
background-color: var(--int-theme);
116115
@@ -168,6 +167,10 @@ function urlForTab(tabId: string) {
168167
border: var(--int-light-grey) 1px solid;
169168
}
170169
}
170+
171+
&.level-3 {
172+
flex: 1;
173+
}
171174
}
172175
173176
@media (max-width: 730px) {
@@ -178,59 +181,4 @@ function urlForTab(tabId: string) {
178181
}
179182
}
180183
}
181-
182-
183-
// // Header nav for all tabs
184-
185-
186-
// // tabs level 1
187-
// .tabs.level-1 {
188-
// display: flex;
189-
// flex-direction: column;
190-
// height: 100%;
191-
192-
// > .header {
193-
// background-color: var(--int-theme);
194-
// z-index: 1;
195-
// top: 0;
196-
// box-shadow: 0px 4px 5px 1px #ccc;
197-
198-
// .top {
199-
// height: 70px;
200-
// }
201-
202-
// .nav {
203-
// line-height: 52px;
204-
// font-size: 18px;
205-
// }
206-
// }
207-
// }
208-
209-
// /* It's nice to read with a bit more space at the bottom*/
210-
// :deep(.tabs.level-2) > .content {
211-
// padding-bottom: 2em !important;
212-
// }
213-
214-
// .tabs.level-2,
215-
// .tabs.level-3 {
216-
// .content {
217-
// background-color: white;
218-
// border: var(--int-light-grey) 1px solid;
219-
// }
220-
221-
// .nav {
222-
// border-top: var(--int-light-grey) 1px solid;
223-
// border-left: var(--int-light-grey) 1px solid;
224-
// border-right: var(--int-light-grey) 1px solid;
225-
// }
226-
// }
227-
228-
// .tabs.level-2 {
229-
// display: flex;
230-
// flex-direction: column;
231-
232-
// .content {
233-
// overflow-y: auto;
234-
// }
235-
// }
236184
</style>

client/src/components/KeyValues.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<table class="key-values">
33
<tbody>
4-
<tr v-for="key in keys" :key="key">
4+
<tr v-for="key in keys" :key>
55
<td class="key">{{ key }}</td>
66
<td>
77
{{ data[key] }}
@@ -21,8 +21,9 @@ const keys = Object.keys(data)
2121
<style scoped lang="scss">
2222
.key-values {
2323
font-family: monospace;
24+
2425
.key {
25-
padding-right: 2em;
26+
padding-right: 2rem;
2627
}
2728
}
2829
</style>

0 commit comments

Comments
 (0)