|
| 1 | +<script> |
| 2 | +// Copyright (c) 2021 Uber Technologies Inc. |
| 3 | +// |
| 4 | +// |
| 5 | +// Permission is hereby granted, free of charge, to any person obtaining a copy |
| 6 | +// of this software and associated documentation files (the "Software"), to deal |
| 7 | +// in the Software without restriction, including without limitation the rights |
| 8 | +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 9 | +// copies of the Software, and to permit persons to whom the Software is |
| 10 | +// furnished to do so, subject to the following conditions: |
| 11 | +// |
| 12 | +// The above copyright notice and this permission notice shall be included in |
| 13 | +// all copies or substantial portions of the Software. |
| 14 | +// |
| 15 | +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 16 | +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 17 | +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 18 | +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 19 | +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 20 | +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 21 | +// THE SOFTWARE. |
| 22 | +
|
| 23 | +import { DynamicScroller, DynamicScrollerItem } from 'vue-virtual-scroller'; |
| 24 | +import { PendingTaskListItem } from './components'; |
| 25 | +import { ButtonGroup, NoResults } from '~components'; |
| 26 | +
|
| 27 | +export default { |
| 28 | + name: 'workflow-pending', |
| 29 | + props: { |
| 30 | + filter: { |
| 31 | + type: String, |
| 32 | + default: 'all', |
| 33 | + }, |
| 34 | + emptyMessage: { |
| 35 | + type: String, |
| 36 | + default: 'No results', |
| 37 | + }, |
| 38 | + isLoading: { |
| 39 | + type: Boolean, |
| 40 | + default: false, |
| 41 | + }, |
| 42 | + pendingTaskList: { |
| 43 | + type: Array, |
| 44 | + default: () => [], |
| 45 | + }, |
| 46 | + }, |
| 47 | + components: { |
| 48 | + 'button-group': ButtonGroup, |
| 49 | + DynamicScroller, |
| 50 | + DynamicScrollerItem, |
| 51 | + 'no-results': NoResults, |
| 52 | + 'pending-task-list-item': PendingTaskListItem, |
| 53 | + }, |
| 54 | +}; |
| 55 | +</script> |
| 56 | + |
| 57 | +<template> |
| 58 | + <div class="workflow-pending"> |
| 59 | + <div class="top-navigation"> |
| 60 | + <button-group |
| 61 | + :items="['all', 'activities', 'children']" |
| 62 | + label="Filters" |
| 63 | + uppercase |
| 64 | + :value="filter" |
| 65 | + @change="$emit('filterChanged', $event)" |
| 66 | + /> |
| 67 | + </div> |
| 68 | + <no-results |
| 69 | + :is-loading="isLoading" |
| 70 | + :message="emptyMessage" |
| 71 | + :results="pendingTaskList" |
| 72 | + /> |
| 73 | + <div class="pending-task-list" v-if="pendingTaskList.length"> |
| 74 | + <DynamicScroller |
| 75 | + key-field="pendingTaskId" |
| 76 | + :items="pendingTaskList" |
| 77 | + :min-item-size="38" |
| 78 | + > |
| 79 | + <template v-slot="{ item, index, active }"> |
| 80 | + <DynamicScrollerItem |
| 81 | + class="scroller-item" |
| 82 | + :active="active" |
| 83 | + :data-active="active" |
| 84 | + :data-index="index" |
| 85 | + :item="item" |
| 86 | + > |
| 87 | + <pending-task-list-item :index="index" :item="item" /> |
| 88 | + </DynamicScrollerItem> |
| 89 | + </template> |
| 90 | + </DynamicScroller> |
| 91 | + </div> |
| 92 | + </div> |
| 93 | +</template> |
| 94 | + |
| 95 | +<style lang="stylus"> |
| 96 | +.workflow-pending { |
| 97 | + .top-navigation { |
| 98 | + border-bottom: 1px solid #c6c6c6; |
| 99 | + box-shadow: 0 2px 2px rgba(0,0,0,0.2); |
| 100 | + padding: 24px; |
| 101 | + } |
| 102 | +
|
| 103 | + .pending-task-list { |
| 104 | + max-height: calc(100vh - 191px); |
| 105 | + overflow-y: auto; |
| 106 | + } |
| 107 | +} |
| 108 | +</style> |
0 commit comments