From d09bfde3caab3ba6e575810fba6146190827c20b Mon Sep 17 00:00:00 2001
From: Rodiel Martinez <10471758+Rodielm@users.noreply.github.com>
Date: Mon, 30 Oct 2023 13:25:54 +0100
Subject: [PATCH] wc: fix refresh job button in job browser
---
src/webcomponents/commons/opencb-grid-toolbar.js | 7 +++++++
src/webcomponents/job/job-grid.js | 8 +++++++-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/src/webcomponents/commons/opencb-grid-toolbar.js b/src/webcomponents/commons/opencb-grid-toolbar.js
index f756a12934..602f229d9f 100644
--- a/src/webcomponents/commons/opencb-grid-toolbar.js
+++ b/src/webcomponents/commons/opencb-grid-toolbar.js
@@ -148,6 +148,13 @@ export default class OpencbGridToolbar extends LitElement {
`) : nothing}
+ ${this._settings.showRefresh ? html`
+
+ ` :nothing}
+
+
${this._config?.create && (this._settings.showCreate || this._settings.showNew) ? html`
diff --git a/src/webcomponents/job/job-grid.js b/src/webcomponents/job/job-grid.js
index 4df45ee5a3..17a11dda33 100644
--- a/src/webcomponents/job/job-grid.js
+++ b/src/webcomponents/job/job-grid.js
@@ -88,7 +88,7 @@ export default class JobGrid extends LitElement {
this.gridCommons = new GridCommons(this.gridId, this, this._config);
this.toolbarSetting = {
- ...this.config,
+ ...this._config,
// columns: this._getDefaultColumns().filter(col => col.field)
};
@@ -319,6 +319,10 @@ export default class JobGrid extends LitElement {
this.gridCommons.onColumnChange(e);
}
+ onRefresh() {
+ this.table.bootstrapTable("refresh");
+ }
+
detailFormatter(value, row) {
let result = "
";
let detailHtml = "";
@@ -588,6 +592,7 @@ export default class JobGrid extends LitElement {
@columnChange="${this.onColumnChange}"
@download="${this.onDownload}"
@export="${this.onDownload}"
+ @refresh="${this.onRefresh}"
@actionClick="${e => this.onActionClick(e)}"
@jobCreate="${this.renderRemoteTable}">
` : nothing
@@ -626,6 +631,7 @@ export default class JobGrid extends LitElement {
showCreate: true,
showExport: true,
showSettings: true,
+ showRefresh: true,
showActions: true,
detailView: true,
detailFormatter: this.detailFormatter,