Skip to content

Commit

Permalink
Add test configuring functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
maccelf committed Sep 6, 2023
1 parent b086700 commit 1305d2a
Show file tree
Hide file tree
Showing 7 changed files with 570 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"arrowParens": "always",
"bracketSameLine": false,
"bracketSpacing": false,
"embeddedLanguageFormatting": "off",
"embeddedLanguageFormatting": "auto",
"htmlWhitespaceSensitivity": "css",
"insertPragma": false,
"jsxSingleQuote": true,
Expand Down
25 changes: 21 additions & 4 deletions src/components/ProjectSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,21 @@
<div class="justify-center">
<q-scroll-area style="height: 36vw" class="row">
<div class="row justify-center">
<table class="q-table">
<table class="q-table" style="border-collapse: collapse">
<thead>
<tr style="height: auto">
<th />
<th />
<th class="no-padding" />
<th class="no-padding" />
</tr>
</thead>
<tbody>
<tr v-for="(buildItem, index) in buildItems" :key="buildItem.uid">
<tr
v-for="(buildItem, index) in buildItems"
:key="buildItem.uid"
style="border-top: 1pt solid rgba(0, 0, 0, 0.12)"
>
<td class="no-padding">
<q-btn
@click="onMoveBuildItemUp(buildItem)"
Expand Down Expand Up @@ -81,7 +93,7 @@
<td v-else>
<build-ref :buildRef="buildItem" />
</td>
<td class="text-tertiary">
<td class="text-tertiary text-center">
<q-icon
v-if="buildItem.modules_yaml && depsWithoutStream(buildItem)"
name="warning"
Expand Down Expand Up @@ -138,7 +150,12 @@
</q-scroll-area>

<div class="group row justify-end">
<q-btn @click="onAddProject" icon="add" color="secondary" id="pse-qb-add-project">
<q-btn
@click="onAddProject"
icon="add"
color="secondary"
id="pse-qb-add-project"
>
Add project
</q-btn>
</div>
Expand Down
144 changes: 144 additions & 0 deletions src/components/TestConfigurator.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
<template>
<div class="justify-center">
<q-scroll-area style="height: 36vw" class="row">
<div class="row justify-center">
<q-table
style="width: 100%"
:rows="buildItems"
:columns="columns"
row-key="name"
flat
dense
:rows-per-page-options="[0]"
hide-pagination
>
<template v-slot:header="props">
<q-tr :props="props">
<q-th v-for="col in props.cols" :key="col.name" :props="props">
{{ col.label }}
</q-th>
<q-th auto-width />
</q-tr>
</template>
<template v-slot:body="props">
<template v-if="props.row.modules_yaml">
<q-tr v-for="ref in props.row.refs" :key="ref.git_ref">
<q-td key="ref">
<build-ref :buildRef="ref" />
</q-td>
<q-td key="env" class="text-center">
<div v-if="!ref.test_env">
<span class="text-overline">-</span>
</div>
<div v-for="(value, key) in ref.test_env" :key="key">
<span class="text-weight-regular"> {{ key }}: </span>
<span class="text-weight-light"> {{ value }} </span>
</div>
</q-td>
<q-td class="text-center" key="tests">
<div v-if="!ref.tests || ref.tests === 0">
<span class="text-overline">-</span>
</div>
<div v-for="test in ref.tests" :key="test">
<a :href="test.url" target="_blank">
{{ test.package_name }}
</a>
</div>
</q-td>
<q-td auto-width>
<q-btn flat round icon="edit" @click="onEditTest(ref)">
<q-tooltip> Configure test</q-tooltip>
</q-btn>
</q-td>
</q-tr>
</template>
<q-tr v-else :props="props">
<q-td key="ref" :props="props">
<build-ref :buildRef="props.row" />
</q-td>
<q-td key="env" :props="props">
<div v-if="!props.row.test_env">
<span class="text-overline">-</span>
</div>
<div v-for="(value, key) in props.row.test_env" :key="key">
<span class="text-weight-regular"> {{ key }}: </span>
<span class="text-weight-light"> {{ value }} </span>
</div>
</q-td>
<q-td key="tests" :props="props">
<div v-if="!props.row.tests || props.row.tests === 0">
<span class="text-overline">-</span>
</div>
<div v-for="test in props.row.tests" :key="test">
<a :href="test.url" target="_blank">
{{ test.package_name }}
</a>
</div>
</q-td>
<q-td auto-width>
<q-btn flat round icon="edit" @click="onEditTest(props.row)">
<q-tooltip> Configure test</q-tooltip>
</q-btn>
</q-td>
</q-tr>
</template>
</q-table>
</div>
</q-scroll-area>
</div>

<test-editor ref="editTest" />
</template>

<script>
import {defineComponent} from 'vue'
import BuildRef from 'components/BuildRef.vue'
import TestEditor from './TestEditor.vue'
export default defineComponent({
model: {
prop: 'buildItems',
},
props: {
buildItems: Array,
},
data() {
return {
columns: [
{
name: 'ref',
required: true,
align: 'left',
label: 'Project',
field: 'ref',
},
{
name: 'env',
required: true,
label: 'ENV',
align: 'center',
field: 'env',
},
{
name: 'tests',
required: true,
label: 'Tests',
align: 'center',
field: 'tests',
},
],
}
},
methods: {
onEditTest(project) {
this.$refs.editTest.open(project)
},
},
components: {
BuildRef,
TestEditor,
},
})
</script>

<style scoped></style>
Loading

0 comments on commit 1305d2a

Please sign in to comment.