Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat/move-bottom-bar-widgets-to-top #1861

Merged
merged 3 commits into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
235 changes: 127 additions & 108 deletions ui/src/components/executions/Executions.vue

Large diffs are not rendered by default.

232 changes: 121 additions & 111 deletions ui/src/components/flows/Flows.vue

Large diffs are not rendered by default.

37 changes: 0 additions & 37 deletions ui/src/components/layout/BottomLineCounter.vue

This file was deleted.

69 changes: 69 additions & 0 deletions ui/src/components/layout/BulkSelect.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<template>
<div class="bulk-select">
<el-checkbox
:model-value="selections.length > 0"
@change="toggle"
:indeterminate="partialCheck"
>
<span v-html="$t('selection.selected', {count: selectAll ? total : selections.length})" />
</el-checkbox>
<el-button-group>
<el-button
:type="selectAll ? 'primary' : 'default'"
@click="toggleAll"
v-if="selections.length < total"
v-html="$t('selection.all', {count: total})"
/>
<slot />
</el-button-group>
</div>
</template>
<script>
export default {
props: {
total: {type: Number, required: true},
selections: {type: Array, required: true},
selectAll: {type: Boolean, required: true},
},
emits: ["update:selectAll", "unselect"],
methods: {
toggle(value) {
if (!value) {
this.$emit("unselect");
}
},
toggleAll(value) {
this.$emit("update:selectAll", !this.selectAll);
}
},
computed: {
partialCheck() {
return !this.selectAll && this.selections.length < this.total;
},
}
}
</script>

<style lang="scss" scoped>
.bulk-select {
height: 100%;
display: flex;
align-items: center;

.el-checkbox {
height: 100%;

span {
padding-left: calc(var(--spacer) * 1.5);
}
}

> * {
padding: 0 8px;
}
}

span {
font-weight: bold;
}
</style>
63 changes: 63 additions & 0 deletions ui/src/components/layout/SelectTable.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<script>
export default {
data() {
return {
hasSelection: false
}
},
methods: {
selectionChanged(selection) {
this.hasSelection = selection.length > 0;
this.$emit("selection-change", selection);
},
computeHeaderSize() {
const tableHead = this.$refs.table.$el.querySelector('thead');
this.$el.style.setProperty("--table-header-width", `${tableHead.clientWidth}px`);
this.$el.style.setProperty("--table-header-height", `${tableHead.clientHeight}px`);
}
},
props: {
selectable: {
type: Boolean,
default: true
},
data: {
type: Array
}
},
mounted() {
window.onresize = this.computeHeaderSize;
},
updated() {
this.computeHeaderSize();
}
}
</script>

<template>
<div class="position-relative">
<div v-if="hasSelection" class="bulk-select-header">
<slot name="select-actions" />
</div>
<el-table ref="table" v-bind="$attrs" :data="data" @selection-change="selectionChanged">
<el-table-column type="selection" v-if="selectable" />
<slot name="default" />
</el-table>
</div>
</template>

<style scoped lang="scss">
.bulk-select-header {
z-index: 1;
position: absolute;
height: var(--table-header-height);
width: var(--table-header-width);
background-color: var(--bs-gray-100-darken-3);
border-radius: var(--bs-border-radius-lg) var(--bs-border-radius-lg) 0 0;
border-bottom: 1px solid var(--bs-border-color);

& ~ .el-table {
z-index: 0;
}
}
</style>
Loading