Skip to content

Commit fde1e0a

Browse files
authored
fix alignment & code tidy
* Allow circular-dependency-plugin to work on Windows * Tidy * Fix typo * e2e test: bring back necessary wait * Try to fix graphiql e2e test flakiness * Revert some unwanted changes from #861 * Fix tree/table view alignment issues * Update changelog
1 parent d8362ba commit fde1e0a

File tree

15 files changed

+95
-82
lines changed

15 files changed

+95
-82
lines changed

CHANGES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ for number of tasks per page.
3232
[#1177](https://github.com/cylc/cylc-ui/pull/1177) -
3333
New tabs now open on top.
3434

35+
[#1178](https://github.com/cylc/cylc-ui/pull/1178) - Improve appearance of
36+
Table view.
37+
3538
### Fixes
3639

3740
[#1164](https://github.com/cylc/cylc-ui/pull/1164) -

src/components/cylc/Job.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export default {
4949
const DEFAULT_XY = '10'
5050
const PREVIOUS_STATE_ITEMS_XY = '25'
5151
const width = !isEmpty(context.props.previousState) ? PREVIOUS_STATE_ITEMS_SIZE : DEFAULT_SIZE
52-
const height = !isEmpty(context.props.previousState) ? PREVIOUS_STATE_ITEMS_SIZE : DEFAULT_SIZE
52+
const height = width
5353
const jobStatusIcon = createElement('rect', {
5454
attrs: {
5555
class: context.props.status,
@@ -105,8 +105,7 @@ export default {
105105
// https://github.com/vuejs/vue-loader/issues/1433
106106
const attrs = Object.assign(context.data, {
107107
attrs: {
108-
class: 'c-job',
109-
style: 'display:inline-block; vertical-align:middle'
108+
class: 'c-job'
110109
}
111110
})
112111
return createElement(

src/components/cylc/cylcObject/Menu.vue

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,26 +46,27 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
4646
<v-card-subtitle>
4747
{{ typeAndStatusText }}
4848
</v-card-subtitle>
49-
<v-divider v-if="primaryMutations.length || displayMutations.length" />
49+
<v-divider v-if="primaryMutations.length || displayMutations.length"/>
5050
<v-skeleton-loader
5151
v-if="isLoadingMutations && primaryMutations.length"
5252
type="list-item-avatar-two-line@3"
5353
min-width="400"
54-
>
55-
</v-skeleton-loader>
54+
/>
5655
<v-list
5756
v-if="displayMutations.length"
5857
class="c-mutation-menu-list"
5958
>
6059
<v-list-item
6160
v-for="{ mutation, requiresInfo, authorised } in displayMutations"
6261
:key="mutation.name"
63-
:disabled=!authorised
62+
:disabled="!authorised"
6463
@click.stop="enact(mutation, requiresInfo)"
6564
class="c-mutation"
6665
>
6766
<v-list-item-avatar>
68-
<v-icon :disabled=!authorised large>{{ mutation._icon }}</v-icon>
67+
<v-icon :disabled="!authorised" large>
68+
{{ mutation._icon }}
69+
</v-icon>
6970
</v-list-item-avatar>
7071
<v-list-item-content>
7172
<v-list-item-title>{{ mutation._title }}</v-list-item-title>
@@ -79,7 +80,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
7980
<v-list-item-action>
8081
<v-btn
8182
icon
82-
:disabled=!authorised
83+
:disabled="!authorised"
8384
x-large
8485
class="float-right"
8586
@click.stop="openDialog(mutation)"

src/components/cylc/gscan/GScan.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
104104
<!-- data -->
105105
<div
106106
v-if="!isLoading"
107-
class="c-gscan-workflows flex-grow-1"
107+
class="c-gscan-workflows flex-grow-1 pl-2"
108108
>
109109
<tree
110110
:filterable="false"

src/components/cylc/table/Table.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
3535
<v-row
3636
no-gutters
3737
class="flex-grow-1 position-relative"
38-
>
38+
>
3939
<v-col
4040
cols="12"
4141
class="mh-100 position-relative"
4242
>
4343
<v-container
4444
fluid
45-
class="ma-0 pa-0 w-100 h-100 left-0 top-0 position-absolute"
45+
class="ma-0 pa-0 w-100 h-100 left-0 top-0 position-absolute pt-2"
4646
>
4747
<v-data-table
4848
:headers="headers"
@@ -130,7 +130,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
130130
>
131131
<td>
132132
<div class="d-flex align-content-center flex-nowrap">
133-
<div class="mr-1">
133+
<div class="d-flex mr-1">
134134
<Job
135135
v-cylc-object="job"
136136
:key="`${job.id}-summary-${index}`"

src/components/cylc/tree/Tree.vue

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
1717

1818
<template>
1919
<v-container
20-
fluid
21-
class="c-table ma-0 pa-2 h-100 flex-column d-flex"
20+
class="ma-0 pa-0"
2221
>
2322
<!-- Toolbar -->
2423
<v-row
25-
class="d-flex flex-wrap table-option-bar no-gutters flex-grow-0"
24+
no-gutters
25+
class="d-flex flex-wrap"
2626
>
2727
<!-- Filters -->
2828
<v-col
@@ -70,7 +70,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
7070
</v-row>
7171
<v-row
7272
no-gutters
73-
class="flex-grow-1 position-relative"
7473
>
7574
<v-col
7675
cols="12"

src/styles/cylc/_table.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,14 @@
1616
*/
1717

1818
.c-table {
19+
th, td {
20+
white-space: nowrap;
21+
}
22+
1923
.c-task, .c-job {
24+
display: flex;
25+
align-items: center;
26+
height: 100%;
2027
font-size: 1.2em;
2128
}
2229
}

src/styles/cylc/_tree.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ $visible-outputs: 5;
8181
}
8282

8383
.c-task, .c-job {
84+
display: flex;
85+
align-items: center;
8486
font-size: 1.2em;
8587
}
8688
}

src/utils/aotf.js

Lines changed: 48 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -163,26 +163,27 @@ export const cylcObjects = Object.freeze({
163163
/**
164164
* Most important mutations for each object type.
165165
*/
166-
export const primaryMutations = {}
167-
primaryMutations[cylcObjects.Workflow] = [
168-
'play',
169-
'pause',
170-
'stop',
171-
'reload',
172-
'clean'
173-
]
174-
primaryMutations[cylcObjects.CyclePoint] = [
175-
'hold',
176-
'release',
177-
'trigger',
178-
'kill'
179-
]
180-
primaryMutations[cylcObjects.Namespace] = [
181-
'hold',
182-
'release',
183-
'trigger',
184-
'kill'
185-
]
166+
export const primaryMutations = {
167+
[cylcObjects.Workflow]: [
168+
'play',
169+
'pause',
170+
'stop',
171+
'reload',
172+
'clean'
173+
],
174+
[cylcObjects.CyclePoint]: [
175+
'hold',
176+
'release',
177+
'trigger',
178+
'kill'
179+
],
180+
[cylcObjects.Namespace]: [
181+
'hold',
182+
'release',
183+
'trigger',
184+
'kill'
185+
]
186+
}
186187
// handle families the same as tasks
187188
primaryMutations.family = primaryMutations[cylcObjects.Namespace]
188189

@@ -210,25 +211,26 @@ const identifierOrder = [
210211
*
211212
* object: [[typeName: String, impliesMultiple: Boolean]]
212213
*/
213-
export const mutationMapping = {}
214-
mutationMapping[cylcObjects.User] = []
215-
mutationMapping[cylcObjects.Workflow] = [
216-
['WorkflowID', false]
217-
]
218-
mutationMapping[cylcObjects.CyclePoint] = [
219-
['CyclePoint', false],
220-
['CyclePointGlob', true]
221-
]
222-
mutationMapping[cylcObjects.Namespace] = [
223-
['NamespaceName', false],
224-
['NamespaceIDGlob', true]
225-
]
226-
// mutationMapping[cylcObjects.Task] = [
227-
// ['TaskID', false]
228-
// ]
229-
mutationMapping[cylcObjects.Job] = [
230-
['JobID', false]
231-
]
214+
export const mutationMapping = {
215+
[cylcObjects.User]: [],
216+
[cylcObjects.Workflow]: [
217+
['WorkflowID', false]
218+
],
219+
[cylcObjects.CyclePoint]: [
220+
['CyclePoint', false],
221+
['CyclePointGlob', true]
222+
],
223+
[cylcObjects.Namespace]: [
224+
['NamespaceName', false],
225+
['NamespaceIDGlob', true]
226+
],
227+
// [cylcObjects.Task]: [
228+
// ['TaskID', false]
229+
// ],
230+
[cylcObjects.Job]: [
231+
['JobID', false]
232+
]
233+
}
232234

233235
/**
234236
* Mutation argument types which are derived from more than one token.
@@ -272,13 +274,13 @@ export const alternateFields = {
272274
*
273275
* Maps onto task status.
274276
*/
275-
export const mutationStatus = {}
276-
mutationStatus[TaskState.WAITING] = TaskState.WAITING
277-
mutationStatus[TaskState.SUBMITTED] = TaskState.SUBMITTED
278-
mutationStatus[TaskState.SUCCEEDED] = TaskState.SUCCEEDED
279-
mutationStatus[TaskState.FAILED] = TaskState.FAILED
280-
mutationStatus[TaskState.SUBMIT_FAILED] = TaskState.SUBMIT_FAILED
281-
Object.freeze(mutationStatus)
277+
export const mutationStatus = Object.freeze({
278+
[TaskState.WAITING]: TaskState.WAITING,
279+
[TaskState.SUBMITTED]: TaskState.SUBMITTED,
280+
[TaskState.SUCCEEDED]: TaskState.SUCCEEDED,
281+
[TaskState.FAILED]: TaskState.FAILED,
282+
[TaskState.SUBMIT_FAILED]: TaskState.SUBMIT_FAILED
283+
})
282284

283285
/**
284286
* List of commands to add to the mutations from the schema.

src/views/Graph.vue

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -644,10 +644,7 @@ export default {
644644
`
645645
}
646646
// update edge paths
647-
this.graphEdges.length = 0 // empty array
648-
for (const edge of json.edges || []) {
649-
this.graphEdges.push(posToPath(edge.pos))
650-
}
647+
this.graphEdges = json.edges?.map(edge => posToPath(edge.pos)) ?? []
651648
652649
if (!this.panZoomWidget) {
653650
// mount the svgPanZoom widget on first load

0 commit comments

Comments
 (0)