Add support for Buefy 0.9.x

or: add hacks to continue supporting Buefy 0.8.x

..depending on your perspective
This commit is contained in:
Lance Edgar 2022-12-22 20:49:20 -06:00
parent 7ccd9ad896
commit 6fbc79fe5e
17 changed files with 753 additions and 119 deletions

View file

@ -26,6 +26,8 @@ Rattail config extension for Tailbone
from __future__ import unicode_literals, absolute_import
from pkg_resources import parse_version
from rattail.config import ConfigExtension as BaseExtension
from rattail.db.config import configure_session
@ -61,6 +63,16 @@ def csrf_header_name(config):
return config.get('tailbone', 'csrf_header_name', default='X-CSRF-TOKEN')
def get_buefy_version(config):
return config.get('tailbone', 'buefy_version') or '0.8.17'
def get_buefy_0_8(config, version=None):
if not version:
version = get_buefy_version(config)
return parse_version(version) < parse_version('0.9')
def global_help_url(config):
return config.get('tailbone', 'global_help_url')

View file

@ -40,7 +40,8 @@ from webhelpers2.html import tags
import tailbone
from tailbone import helpers
from tailbone.db import Session
from tailbone.config import csrf_header_name, should_expose_websockets
from tailbone.config import (csrf_header_name, should_expose_websockets,
get_buefy_version, get_buefy_0_8)
from tailbone.menus import make_simple_menus
from tailbone.util import should_use_buefy
@ -164,8 +165,10 @@ def before_render(event):
# perhaps too much so, but at least they should work fine.
renderer_globals['vue_version'] = request.rattail_config.get(
'tailbone', 'vue_version') or '2.6.10'
renderer_globals['buefy_version'] = request.rattail_config.get(
'tailbone', 'buefy_version') or '0.8.13'
version = get_buefy_version(rattail_config)
renderer_globals['buefy_version'] = version
renderer_globals['buefy_0_8'] = get_buefy_0_8(rattail_config,
version=version)
# maybe set custom stylesheet
css = None

View file

@ -866,16 +866,24 @@
paginated
per-page="5"
:debounce-search="1000">
% if buefy_0_8:
<template slot-scope="props">
% endif
<b-table-column :label="productKeyLabel"
field="key"
% if not buefy_0_8:
v-slot="props"
% endif
sortable>
{{ props.row.key }}
</b-table-column>
<b-table-column label="Brand"
field="brand_name"
% if not buefy_0_8:
v-slot="props"
% endif
sortable
searchable>
{{ props.row.brand_name }}
@ -883,6 +891,9 @@
<b-table-column label="Description"
field="description"
% if not buefy_0_8:
v-slot="props"
% endif
sortable
searchable>
{{ props.row.description }}
@ -891,12 +902,18 @@
<b-table-column label="Unit Price"
field="unit_price"
% if not buefy_0_8:
v-slot="props"
% endif
sortable>
{{ props.row.unit_price_display }}
</b-table-column>
<b-table-column label="Sale Price"
field="sale_price"
% if not buefy_0_8:
v-slot="props"
% endif
sortable>
<span class="has-background-warning">
{{ props.row.sale_price_display }}
@ -905,6 +922,9 @@
<b-table-column label="Sale Ends"
field="sale_ends"
% if not buefy_0_8:
v-slot="props"
% endif
sortable>
<span class="has-background-warning">
{{ props.row.sale_ends_display }}
@ -913,6 +933,9 @@
<b-table-column label="Department"
field="department_name"
% if not buefy_0_8:
v-slot="props"
% endif
sortable
searchable>
{{ props.row.department_name }}
@ -920,12 +943,17 @@
<b-table-column label="Vendor"
field="vendor_name"
% if not buefy_0_8:
v-slot="props"
% endif
sortable
searchable>
{{ props.row.vendor_name }}
</b-table-column>
% if buefy_0_8:
</template>
% endif
<template slot="empty">
<div class="content has-text-grey has-text-centered">
<p>
@ -961,33 +989,63 @@
<b-table v-if="items.length"
:data="items"
:row-class="(row, i) => row.product_uuid ? null : 'has-text-success'">
% if buefy_0_8:
<template slot-scope="props">
% endif
<b-table-column :label="productKeyLabel">
<b-table-column :label="productKeyLabel"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.product_key }}
</b-table-column>
<b-table-column label="Brand">
<b-table-column label="Brand"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.product_brand }}
</b-table-column>
<b-table-column label="Description">
<b-table-column label="Description"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.product_description }}
</b-table-column>
<b-table-column label="Size">
<b-table-column label="Size"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.product_size }}
</b-table-column>
<b-table-column label="Department">
<b-table-column label="Department"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.department_display }}
</b-table-column>
<b-table-column label="Quantity">
<b-table-column label="Quantity"
% if not buefy_0_8:
v-slot="props"
% endif
>
<span v-html="props.row.order_quantity_display"></span>
</b-table-column>
<b-table-column label="Unit Price">
<b-table-column label="Unit Price"
% if not buefy_0_8:
v-slot="props"
% endif
>
<span
% if product_price_may_be_questionable:
:class="props.row.price_needs_confirmation ? 'has-background-warning' : ''"
@ -1000,12 +1058,20 @@
</b-table-column>
% if allow_item_discounts:
<b-table-column label="Discount">
<b-table-column label="Discount"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.discount_percent }}{{ props.row.discount_percent ? " %" : "" }}
</b-table-column>
% endif
<b-table-column label="Total">
<b-table-column label="Total"
% if not buefy_0_8:
v-slot="props"
% endif
>
<span
% if product_price_may_be_questionable:
:class="props.row.price_needs_confirmation ? 'has-background-warning' : ''"
@ -1017,11 +1083,20 @@
</span>
</b-table-column>
<b-table-column label="Vendor">
<b-table-column label="Vendor"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.vendor_display }}
</b-table-column>
<b-table-column field="actions" label="Actions">
<b-table-column field="actions"
label="Actions"
% if not buefy_0_8:
v-slot="props"
% endif
>
<a href="#" class="grid-action"
@click.prevent="showEditItemDialog(props.row)">
<i class="fas fa-edit"></i>
@ -1037,7 +1112,9 @@
&nbsp;
</b-table-column>
% if buefy_0_8:
</template>
% endif
</b-table>
</div>
</div>

View file

@ -106,47 +106,95 @@
:checked-rows.sync="changeStatusCheckedRows"
narrowed
class="is-size-7">
% if buefy_0_8:
<template slot-scope="props">
<b-table-column field="product_brand" label="Brand">
% endif
<b-table-column field="product_brand" label="Brand"
% if not buefy_0_8:
v-slot="props"
% endif
>
<span v-html="props.row.product_brand"></span>
</b-table-column>
<b-table-column field="product_description" label="Product">
<b-table-column field="product_description" label="Product"
% if not buefy_0_8:
v-slot="props"
% endif
>
<span v-html="props.row.product_description"></span>
</b-table-column>
<!-- <b-table-column field="quantity" label="Quantity"> -->
<!-- <span v-html="props.row.quantity"></span> -->
<!-- </b-table-column> -->
<b-table-column field="product_case_quantity" label="cPack">
<b-table-column field="product_case_quantity" label="cPack"
% if not buefy_0_8:
v-slot="props"
% endif
>
<span v-html="props.row.product_case_quantity"></span>
</b-table-column>
<b-table-column field="order_quantity" label="oQty">
<b-table-column field="order_quantity" label="oQty"
% if not buefy_0_8:
v-slot="props"
% endif
>
<span v-html="props.row.order_quantity"></span>
</b-table-column>
<b-table-column field="order_uom" label="UOM">
<b-table-column field="order_uom" label="UOM"
% if not buefy_0_8:
v-slot="props"
% endif
>
<span v-html="props.row.order_uom"></span>
</b-table-column>
<b-table-column field="department_name" label="Department">
<b-table-column field="department_name" label="Department"
% if not buefy_0_8:
v-slot="props"
% endif
>
<span v-html="props.row.department_name"></span>
</b-table-column>
<b-table-column field="product_barcode" label="Product Barcode">
<b-table-column field="product_barcode" label="Product Barcode"
% if not buefy_0_8:
v-slot="props"
% endif
>
<span v-html="props.row.product_barcode"></span>
</b-table-column>
<b-table-column field="unit_price" label="Unit $">
<b-table-column field="unit_price" label="Unit $"
% if not buefy_0_8:
v-slot="props"
% endif
>
<span v-html="props.row.unit_price"></span>
</b-table-column>
<b-table-column field="total_price" label="Total $">
<b-table-column field="total_price" label="Total $"
% if not buefy_0_8:
v-slot="props"
% endif
>
<span v-html="props.row.total_price"></span>
</b-table-column>
<b-table-column field="order_date" label="Order Date">
<b-table-column field="order_date" label="Order Date"
% if not buefy_0_8:
v-slot="props"
% endif
>
<span v-html="props.row.order_date"></span>
</b-table-column>
<b-table-column field="status_code" label="Status">
<b-table-column field="status_code" label="Status"
% if not buefy_0_8:
v-slot="props"
% endif
>
<span v-html="props.row.status_code"></span>
</b-table-column>
<!-- <b-table-column field="flagged" label="Flagged"> -->
<!-- <span v-html="props.row.flagged"></span> -->
<!-- </b-table-column> -->
% if buefy_0_8:
</template>
% endif
</b-table>
<br />

View file

@ -103,36 +103,80 @@
<b-table :data="filteredProfilesData"
:row-class="(row, i) => row.enabled ? null : 'has-background-warning'">
% if buefy_0_8:
<template slot-scope="props">
<b-table-column field="key" label="Watcher Key">
% endif
<b-table-column field="key"
label="Watcher Key"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.key }}
</b-table-column>
<b-table-column field="watcher_spec" label="Watcher Spec">
<b-table-column field="watcher_spec"
label="Watcher Spec"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.watcher_spec }}
</b-table-column>
<b-table-column field="watcher_dbkey" label="DB Key">
<b-table-column field="watcher_dbkey"
label="DB Key"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.watcher_dbkey }}
</b-table-column>
<b-table-column field="watcher_delay" label="Loop Delay">
<b-table-column field="watcher_delay"
label="Loop Delay"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.watcher_delay }} sec
</b-table-column>
<b-table-column field="watcher_retry_attempts" label="Attempts / Delay">
<b-table-column field="watcher_retry_attempts"
label="Attempts / Delay"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.watcher_retry_attempts }} / {{ props.row.watcher_retry_delay }} sec
</b-table-column>
<b-table-column field="watcher_default_runas" label="Default Runas">
<b-table-column field="watcher_default_runas"
label="Default Runas"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.watcher_default_runas }}
</b-table-column>
<b-table-column label="Consumers">
<b-table-column label="Consumers"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ consumerShortList(props.row) }}
</b-table-column>
## <b-table-column field="notes" label="Notes">
## TODO
## ## {{ props.row.notes }}
## </b-table-column>
<b-table-column field="enabled" label="Enabled">
<b-table-column field="enabled"
label="Enabled"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.enabled ? "Yes" : "No" }}
</b-table-column>
<b-table-column label="Actions"
% if not buefy_0_8:
v-slot="props"
% endif
v-if="useProfileSettings">
<a href="#"
class="grid-action"
@ -148,7 +192,9 @@
Delete
</a>
</b-table-column>
% if buefy_0_8:
</template>
% endif
<template slot="empty">
<section class="section">
<div class="content has-text-grey has-text-centered">
@ -281,14 +327,30 @@
<b-table :data="editingProfilePendingWatcherKwargs"
style="margin-left: 1rem;">
% if buefy_0_8:
<template slot-scope="props">
<b-table-column field="key" label="Key">
% endif
<b-table-column field="key"
label="Key"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.key }}
</b-table-column>
<b-table-column field="value" label="Value">
<b-table-column field="value"
label="Value"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.value }}
</b-table-column>
<b-table-column label="Actions">
<b-table-column label="Actions"
% if not buefy_0_8:
v-slot="props"
% endif
>
<a href="#"
@click.prevent="editProfileWatcherKwarg(props.row)">
<i class="fas fa-edit"></i>
@ -302,7 +364,9 @@
Delete
</a>
</b-table-column>
% if buefy_0_8:
</template>
% endif
<template slot="empty">
<section class="section">
<div class="content has-text-grey has-text-centered">
@ -336,14 +400,29 @@
<b-table :data="editingProfilePendingConsumers"
v-if="!editingProfileWatcherConsumesSelf"
:row-class="(row, i) => row.enabled ? null : 'has-background-warning'">
% if buefy_0_8:
<template slot-scope="props">
<b-table-column field="key" label="Consumer">
% endif
<b-table-column field="key"
label="Consumer"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.key }}
</b-table-column>
<b-table-column style="white-space: nowrap;">
<b-table-column style="white-space: nowrap;"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.consumer_delay }} / {{ props.row.consumer_retry_attempts }} / {{ props.row.consumer_retry_delay }}
</b-table-column>
<b-table-column label="Actions">
<b-table-column label="Actions"
% if not buefy_0_8:
v-slot="props"
% endif
>
<a href="#"
class="grid-action"
@click.prevent="editProfileConsumer(props.row)">
@ -358,7 +437,9 @@
Delete
</a>
</b-table-column>
% if buefy_0_8:
</template>
% endif
<template slot="empty">
<section class="section">
<div class="content has-text-grey has-text-centered">

View file

@ -49,65 +49,123 @@
<b-field label="Watcher Status">
<b-table :data="watchers">
% if buefy_0_8:
<template slot-scope="props">
% endif
<b-table-column field="key"
label="Watcher">
label="Watcher"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.key }}
</b-table-column>
<b-table-column field="spec"
label="Spec">
label="Spec"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.spec }}
</b-table-column>
<b-table-column field="dbkey"
label="DB Key">
label="DB Key"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.dbkey }}
</b-table-column>
<b-table-column field="delay"
label="Delay">
label="Delay"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.delay }} second(s)
</b-table-column>
<b-table-column field="lastrun"
label="Last Watched">
label="Last Watched"
% if not buefy_0_8:
v-slot="props"
% endif
>
<span v-html="props.row.lastrun"></span>
</b-table-column>
<b-table-column field="status"
label="Status"
:class="props.row.status == 'okay' ? 'has-background-success' : 'has-background-warning'">
{{ props.row.status }}
% if not buefy_0_8:
v-slot="props"
% endif
>
<span :class="props.row.status == 'okay' ? 'has-background-success' : 'has-background-warning'">
{{ props.row.status }}
</span>
</b-table-column>
% if buefy_0_8:
</template>
% endif
</b-table>
</b-field>
<b-field label="Consumer Status">
<b-table :data="consumers">
% if buefy_0_8:
<template slot-scope="props">
% endif
<b-table-column field="key"
label="Consumer">
label="Consumer"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.key }}
</b-table-column>
<b-table-column field="spec"
label="Spec">
label="Spec"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.spec }}
</b-table-column>
<b-table-column field="dbkey"
label="DB Key">
label="DB Key"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.dbkey }}
</b-table-column>
<b-table-column field="delay"
label="Delay">
label="Delay"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.delay }} second(s)
</b-table-column>
<b-table-column field="changes"
label="Pending Changes">
label="Pending Changes"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.changes }}
</b-table-column>
<b-table-column field="status"
label="Status"
:class="props.row.status == 'okay' ? 'has-background-success' : 'has-background-warning'">
{{ props.row.status }}
% if not buefy_0_8:
v-slot="props"
% endif
>
<span :class="props.row.status == 'okay' ? 'has-background-success' : 'has-background-warning'">
{{ props.row.status }}
</span>
</b-table-column>
% if buefy_0_8:
</template>
% endif
</b-table>
</b-field>
</%def>

View file

@ -123,25 +123,52 @@
<b-table
:data="new_table.columns">
% if buefy_0_8:
<template slot-scope="props">
% endif
<b-table-column field="name" label="Name">
<b-table-column field="name"
label="Name"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.name }}
</b-table-column>
<b-table-column field="data_type" label="Data Type">
<b-table-column field="data_type"
label="Data Type"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.data_type }}
</b-table-column>
<b-table-column field="nullable" label="Nullable">
<b-table-column field="nullable"
label="Nullable"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.nullable }}
</b-table-column>
<b-table-column field="description" label="Description">
<b-table-column field="description"
label="Description"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.description }}
</b-table-column>
<b-table-column field="actions" label="Actions">
<b-table-column field="actions"
label="Actions"
% if not buefy_0_8:
v-slot="props"
% endif
>
<a href="#" class="grid-action"
@click.prevent="editColumnRow(props.row)">
<i class="fas fa-edit"></i>
@ -157,7 +184,9 @@
&nbsp;
</b-table-column>
% if buefy_0_8:
</template>
% endif
</b-table>
<b-modal has-modal-card

View file

@ -20,7 +20,9 @@
% endif
>
% if buefy_0_8:
<template slot-scope="props">
% endif
% for i, column in enumerate(grid_columns):
<b-table-column field="${column['field']}"
% if not empty_labels:
@ -28,6 +30,9 @@
% elif i > 0:
label=" "
% endif
% if not buefy_0_8:
v-slot="props"
% endif
${'sortable' if column['sortable'] else ''}>
% if empty_labels and i == 0:
<template slot="header" slot-scope="{ column }"></template>
@ -54,7 +59,12 @@
% endfor
% if grid.main_actions or grid.more_actions:
<b-table-column field="actions" label="Actions">
<b-table-column field="actions"
label="Actions"
% if not buefy_0_8:
v-slot="props"
% endif
>
% for action in grid.main_actions:
<a :href="props.row._action_url_${action.key}"
% if action.link_class:
@ -73,7 +83,9 @@
% endfor
</b-table-column>
% endif
% if buefy_0_8:
</template>
% endif
<template slot="empty">
<div class="content has-text-grey has-text-centered">

View file

@ -218,10 +218,15 @@
:hoverable="true"
:narrowed="true">
% if buefy_0_8:
<template slot-scope="props">
% endif
% for column in grid_columns:
<b-table-column field="${column['field']}"
label="${column['label']}"
% if not buefy_0_8:
v-slot="props"
% endif
:sortable="${json.dumps(column['sortable'])}"
% if grid.is_searchable(column['field']):
searchable
@ -242,7 +247,12 @@
% endfor
% if grid.main_actions or grid.more_actions:
<b-table-column field="actions" label="Actions">
<b-table-column field="actions"
label="Actions"
% if not buefy_0_8:
v-slot="props"
% endif
>
## TODO: we do not currently differentiate for "main vs. more"
## here, but ideally we would tuck "more" away in a drawer etc.
% for action in grid.main_actions + grid.more_actions:
@ -260,7 +270,9 @@
% endfor
</b-table-column>
% endif
% if buefy_0_8:
</template>
% endif
<template #empty>
<section class="section">

View file

@ -10,33 +10,71 @@
narrowed
icon-pack="fas"
:default-sort="['host_title', 'asc']">
% if buefy_0_8:
<template slot-scope="props">
<b-table-column field="host_title" label="Data Source" sortable>
% endif
<b-table-column field="host_title"
label="Data Source"
% if not buefy_0_8:
v-slot="props"
% endif
sortable>
{{ props.row.host_title }}
</b-table-column>
<b-table-column field="local_title" label="Data Target" sortable>
<b-table-column field="local_title"
label="Data Target"
% if not buefy_0_8:
v-slot="props"
% endif
sortable>
{{ props.row.local_title }}
</b-table-column>
<b-table-column field="direction" label="Direction" sortable>
<b-table-column field="direction"
label="Direction"
% if not buefy_0_8:
v-slot="props"
% endif
sortable>
{{ props.row.direction_display }}
</b-table-column>
<b-table-column field="handler_spec" label="Handler Spec" sortable>
<b-table-column field="handler_spec"
label="Handler Spec"
% if not buefy_0_8:
v-slot="props"
% endif
sortable>
{{ props.row.handler_spec }}
</b-table-column>
<b-table-column field="cmd" label="Command" sortable>
<b-table-column field="cmd"
label="Command"
% if not buefy_0_8:
v-slot="props"
% endif
sortable>
{{ props.row.command }} {{ props.row.subcommand }}
</b-table-column>
<b-table-column field="runas" label="Default Runas" sortable>
<b-table-column field="runas"
label="Default Runas"
% if not buefy_0_8:
v-slot="props"
% endif
sortable>
{{ props.row.default_runas }}
</b-table-column>
<b-table-column label="Actions">
<b-table-column label="Actions"
% if not buefy_0_8:
v-slot="props"
% endif
>
<a href="#" class="grid-action"
@click.prevent="editHandler(props.row)">
<i class="fas fa-edit"></i>
Edit
</a>
</b-table-column>
% if buefy_0_8:
</template>
% endif
<template slot="empty">
<section class="section">
<div class="content has-text-grey has-text-centered">

View file

@ -23,29 +23,51 @@
<div class="block" style="padding-left: 2rem; display: flex;">
<b-table :data="overnightTasks">
% if buefy_0_8:
<template slot-scope="props">
% endif
<!-- <b-table-column field="key" -->
<!-- label="Key" -->
<!-- sortable> -->
<!-- {{ props.row.key }} -->
<!-- </b-table-column> -->
<b-table-column field="key"
label="Key">
label="Key"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.key }}
</b-table-column>
<b-table-column field="description"
label="Description">
label="Description"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.description }}
</b-table-column>
<b-table-column field="class_name"
label="Class Name">
label="Class Name"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.class_name }}
</b-table-column>
<b-table-column field="script"
label="Script">
label="Script"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.script }}
</b-table-column>
<b-table-column label="Actions">
<b-table-column label="Actions"
% if not buefy_0_8:
v-slot="props"
% endif
>
<a href="#"
@click.prevent="overnightTaskEdit(props.row)">
<i class="fas fa-edit"></i>
@ -59,7 +81,9 @@
Delete
</a>
</b-table-column>
% if buefy_0_8:
</template>
% endif
</b-table>
<b-modal has-modal-card
@ -137,28 +161,54 @@
<div class="block" style="padding-left: 2rem; display: flex;">
<b-table :data="backfillTasks">
% if buefy_0_8:
<template slot-scope="props">
% endif
<b-table-column field="key"
label="Key">
label="Key"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.key }}
</b-table-column>
<b-table-column field="description"
label="Description">
label="Description"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.description }}
</b-table-column>
<b-table-column field="script"
label="Script">
label="Script"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.script }}
</b-table-column>
<b-table-column field="forward"
label="Orientation">
label="Orientation"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.forward ? "Forward" : "Backward" }}
</b-table-column>
<b-table-column field="target_date"
label="Target Date">
label="Target Date"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.target_date }}
</b-table-column>
<b-table-column label="Actions">
<b-table-column label="Actions"
% if not buefy_0_8:
v-slot="props"
% endif
>
<a href="#"
@click.prevent="backfillTaskEdit(props.row)">
<i class="fas fa-edit"></i>
@ -172,7 +222,9 @@
Delete
</a>
</b-table-column>
% if buefy_0_8:
</template>
% endif
</b-table>
<b-modal has-modal-card

View file

@ -49,26 +49,45 @@
% endif
</div>
% if master.has_perm('launch_overnight'):
% if master.has_perm('launch_overnight'):
<h3 class="block is-size-3">Overnight Tasks</h3>
<b-table :data="overnightTasks" hoverable>
% if buefy_0_8:
<template slot-scope="props">
% endif
<b-table-column field="description"
label="Description">
label="Description"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.description }}
</b-table-column>
<b-table-column field="script"
label="Command">
label="Command"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.script || props.row.class_name }}
</b-table-column>
<b-table-column field="last_date"
label="Last Date"
:class="overnightTextClass(props.row)">
{{ props.row.last_date || "never!" }}
% if not buefy_0_8:
v-slot="props"
% endif
>
<span :class="overnightTextClass(props.row)">
{{ props.row.last_date || "never!" }}
</span>
</b-table-column>
<b-table-column label="Actions">
<b-table-column label="Actions"
% if not buefy_0_8:
v-slot="props"
% endif
>
<b-button type="is-primary"
icon-pack="fas"
icon-left="arrow-circle-right"
@ -125,7 +144,9 @@
</div>
</b-modal>
</b-table-column>
% if buefy_0_8:
</template>
% endif
<template #empty>
<p class="block">No tasks defined.</p>
</template>
@ -138,29 +159,56 @@
<h3 class="block is-size-3">Backfill Tasks</h3>
<b-table :data="backfillTasks" hoverable>
% if buefy_0_8:
<template slot-scope="props">
% endif
<b-table-column field="description"
label="Description">
label="Description"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.description }}
</b-table-column>
<b-table-column field="script"
label="Script">
label="Script"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.script }}
</b-table-column>
<b-table-column field="forward"
label="Orientation">
label="Orientation"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.forward ? "Forward" : "Backward" }}
</b-table-column>
<b-table-column field="last_date"
label="Last Date"
:class="backfillTextClass(props.row)">
{{ props.row.last_date }}
% if not buefy_0_8:
v-slot="props"
% endif
>
<span :class="backfillTextClass(props.row)">
{{ props.row.last_date }}
</span>
</b-table-column>
<b-table-column field="target_date"
label="Target Date">
label="Target Date"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.target_date }}
</b-table-column>
<b-table-column label="Actions">
<b-table-column label="Actions"
% if not buefy_0_8:
v-slot="props"
% endif
>
<b-button type="is-primary"
icon-pack="fas"
icon-left="arrow-circle-right"
@ -168,7 +216,9 @@
Launch
</b-button>
</b-table-column>
% if buefy_0_8:
</template>
% endif
<template #empty>
<p class="block">No tasks defined.</p>
</template>

View file

@ -22,20 +22,36 @@
<section class="modal-card-body">
<b-table :data="mergeRequestRows"
striped hoverable>
% if buefy_0_8:
<template slot-scope="props">
% endif
<b-table-column field="customer_number"
label="Customer #">
label="Customer #"
% if not buefy_0_8:
v-slot="props"
% endif
>
<span v-html="props.row.customer_number"></span>
</b-table-column>
<b-table-column field="first_name"
label="First Name">
label="First Name"
% if not buefy_0_8:
v-slot="props"
% endif
>
<span v-html="props.row.first_name"></span>
</b-table-column>
<b-table-column field="last_name"
label="Last Name">
label="Last Name"
% if not buefy_0_8:
v-slot="props"
% endif
>
<span v-html="props.row.last_name"></span>
</b-table-column>
% if buefy_0_8:
</template>
% endif
</b-table>
</section>

View file

@ -296,22 +296,43 @@
% endif
<b-table :data="person.phones">
% if buefy_0_8:
<template slot-scope="props">
% endif
<b-table-column field="preference" label="Preferred">
<b-table-column field="preference"
label="Preferred"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.preferred ? "Yes" : "" }}
</b-table-column>
<b-table-column field="type" label="Type">
<b-table-column field="type"
label="Type"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.type }}
</b-table-column>
<b-table-column field="number" label="Number">
<b-table-column field="number"
label="Number"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.number }}
</b-table-column>
% if request.has_perm('people_profile.edit_person'):
<b-table-column label="Actions">
<b-table-column label="Actions"
% if not buefy_0_8:
v-slot="props"
% endif
>
<a href="#" @click.prevent="editPhoneInit(props.row)">
<i class="fas fa-edit"></i>
Edit
@ -329,7 +350,9 @@
</b-table-column>
% endif
% if buefy_0_8:
</template>
% endif
</b-table>
</div>
@ -417,26 +440,52 @@
% endif
<b-table :data="person.emails">
% if buefy_0_8:
<template slot-scope="props">
% endif
<b-table-column field="preference" label="Preferred">
<b-table-column field="preference"
label="Preferred"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.preferred ? "Yes" : "" }}
</b-table-column>
<b-table-column field="type" label="Type">
<b-table-column field="type"
label="Type"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.type }}
</b-table-column>
<b-table-column field="address" label="Address">
<b-table-column field="address"
label="Address"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.address }}
</b-table-column>
<b-table-column field="invalid" label="Invalid">
<b-table-column field="invalid"
label="Invalid"
% if not buefy_0_8:
v-slot="props"
% endif
>
<span v-if="props.row.invalid" class="has-text-danger">Yes</span>
</b-table-column>
% if request.has_perm('people_profile.edit_person'):
<b-table-column label="Actions">
<b-table-column label="Actions"
% if not buefy_0_8:
v-slot="props"
% endif
>
<a href="#" @click.prevent="editEmailInit(props.row)">
<i class="fas fa-edit"></i>
Edit
@ -454,7 +503,9 @@
</b-table-column>
% endif
% if buefy_0_8:
</template>
% endif
</b-table>
</div>
@ -752,18 +803,35 @@
<br />
<b-table :data="employeeHistory">
% if buefy_0_8:
<template slot-scope="props">
% endif
<b-table-column field="start_date" label="Start Date">
<b-table-column field="start_date"
label="Start Date"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.start_date }}
</b-table-column>
<b-table-column field="end_date" label="End Date">
<b-table-column field="end_date"
label="End Date"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.end_date }}
</b-table-column>
% if request.has_perm('people_profile.edit_employee_history'):
<b-table-column field="actions" label="Actions">
<b-table-column field="actions"
label="Actions"
% if not buefy_0_8:
v-slot="props"
% endif
>
<a href="#" @click.prevent="editEmployeeHistory(props.row)">
<i class="fas fa-edit"></i>
Edit
@ -771,7 +839,9 @@
</b-table-column>
% endif
% if buefy_0_8:
</template>
% endif
</b-table>
</div>

View file

@ -52,54 +52,92 @@
icon-pack="fas"
:loading="searchResultsLoading"
:selected.sync="searchResultSelected">
% if buefy_0_8:
<template slot-scope="props">
% endif
<b-table-column label="${request.rattail_config.product_key_title()}"
field="product_key">
field="product_key"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.product_key }}
</b-table-column>
<b-table-column label="Brand"
field="brand_name">
field="brand_name"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.brand_name }}
</b-table-column>
<b-table-column label="Description"
field="description">
field="description"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.description }}
{{ props.row.size }}
</b-table-column>
<b-table-column label="Unit Price"
field="unit_price">
field="unit_price"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.unit_price_display }}
</b-table-column>
<b-table-column label="Sale Price"
field="sale_price">
field="sale_price"
% if not buefy_0_8:
v-slot="props"
% endif
>
<span class="has-background-warning">
{{ props.row.sale_price_display }}
</span>
</b-table-column>
<b-table-column label="Sale Ends"
field="sale_ends">
field="sale_ends"
% if not buefy_0_8:
v-slot="props"
% endif
>
<span class="has-background-warning">
{{ props.row.sale_ends_display }}
</span>
</b-table-column>
<b-table-column label="Department"
field="department_name">
field="department_name"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.department_name }}
</b-table-column>
<b-table-column label="Vendor"
field="vendor_name">
field="vendor_name"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.vendor_name }}
</b-table-column>
<b-table-column label="Actions">
<b-table-column label="Actions"
% if not buefy_0_8:
v-slot="props"
% endif
>
<a :href="props.row.url"
target="_blank"
class="grid-action">
@ -108,7 +146,9 @@
</a>
</b-table-column>
% if buefy_0_8:
</template>
% endif
<template slot="empty">
<div class="content has-text-grey has-text-centered">
<p>

View file

@ -20,11 +20,23 @@
</p>
<b-table :data="engines">
% if buefy_0_8:
<template slot-scope="props">
<b-table-column field="key" label="DB Key">
% endif
<b-table-column field="key"
label="DB Key"
% if not buefy_0_8:
v-slot="props"
% endif
>
{{ props.row.key }}
</b-table-column>
<b-table-column field="oldest_date" label="Oldest Date">
<b-table-column field="oldest_date"
label="Oldest Date"
% if not buefy_0_8:
v-slot="props"
% endif
>
<span v-if="props.row.error" class="has-text-danger">
error
</span>
@ -32,7 +44,12 @@
{{ props.row.oldest_date }}
</span>
</b-table-column>
<b-table-column field="newest_date" label="Newest Date">
<b-table-column field="newest_date"
label="Newest Date"
% if not buefy_0_8:
v-slot="props"
% endif
>
<span v-if="props.row.error" class="has-text-danger">
error
</span>
@ -40,7 +57,9 @@
{{ props.row.newest_date }}
</span>
</b-table-column>
% if buefy_0_8:
</template>
% endif
</b-table>
</%def>

View file

@ -9,23 +9,38 @@
<b-table :data="upgradeSystems"
sortable>
% if buefy_0_8:
<template slot-scope="props">
% endif
<b-table-column field="key"
label="Key"
% if not buefy_0_8:
v-slot="props"
% endif
sortable>
{{ props.row.key }}
</b-table-column>
<b-table-column field="label"
label="Label"
% if not buefy_0_8:
v-slot="props"
% endif
sortable>
{{ props.row.label }}
</b-table-column>
<b-table-column field="command"
label="Command"
% if not buefy_0_8:
v-slot="props"
% endif
sortable>
{{ props.row.command }}
</b-table-column>
<b-table-column label="Actions">
<b-table-column label="Actions"
% if not buefy_0_8:
v-slot="props"
% endif
>
<a href="#"
@click.prevent="upgradeSystemEdit(props.row)">
<i class="fas fa-edit"></i>
@ -40,7 +55,9 @@
Delete
</a>
</b-table-column>
% if buefy_0_8:
</template>
% endif
</b-table>
<div style="margin-left: 1rem;">