From 764f070b86a113579704bbb207d97a25020a9989 Mon Sep 17 00:00:00 2001 From: Josh Krawczyk Date: Mon, 18 May 2020 09:17:38 -0400 Subject: [PATCH] Automation UI Improvements and Relations View --- .../automation/AutomationManager.vue | 59 +++++---- src/components/automation/PolicyChecksTab.vue | 2 +- src/components/automation/PolicyOverview.vue | 11 +- .../automation/modals/PolicyForm.vue | 116 ++++++++++-------- .../automation/modals/RelationsView.vue | 97 +++++++++++++++ src/mixins/dropdown_formatter.js | 29 ++--- src/store/automation.js | 7 +- 7 files changed, 222 insertions(+), 99 deletions(-) create mode 100644 src/components/automation/modals/RelationsView.vue diff --git a/src/components/automation/AutomationManager.vue b/src/components/automation/AutomationManager.vue index 072dbe8..e2c5027 100644 --- a/src/components/automation/AutomationManager.vue +++ b/src/components/automation/AutomationManager.vue @@ -19,7 +19,7 @@ unelevated no-caps icon="add" - @click="showPolicyFormModal = true;" + @click="showAddPolicyModal" /> {{ props.row.name }} {{ props.row.desc }} {{ props.row.active }} - {{ props.row.clients.length }} - {{ props.row.sites.length }} - {{ props.row.agents.length }} + + + @@ -100,6 +109,9 @@ + + + @@ -109,15 +121,18 @@ import { mapState } from "vuex"; import PolicyForm from "@/components/automation/modals/PolicyForm"; import PolicyOverview from "@/components/automation/PolicyOverview"; import PolicySubTableTabs from "@/components/automation/PolicySubTableTabs"; +import RelationsView from "@/components/automation/modals/RelationsView"; export default { name: "AutomationManager", - components: { PolicyForm, PolicyOverview, PolicySubTableTabs }, + components: { PolicyForm, PolicyOverview, PolicySubTableTabs, RelationsView }, mixins: [mixins], data() { return { showPolicyFormModal: false, showPolicyOverviewModal: false, + showRelationsViewModal: false, + policy: null, selected: [], pagination: { rowsPerPage: 0, @@ -148,28 +163,14 @@ export default { sortable: true }, { - name: "clients", - label: "Clients", - field: "clients", - align: "left", - sortable: false - }, - { - name: "sites", - label: "Sites", - field: "sites", - align: "left", - sortable: false - }, - { - name: "agents", - label: "Agents", - field: "agents", + name: "actions", + label: "Actions", + field: "actions", align: "left", sortable: false } ], - visibleColumns: ["name", "desc", "active", "clients", "sites", "agents"] + visibleColumns: ["name", "desc", "active", "actions"] }; }, methods: { @@ -205,6 +206,18 @@ export default { this.notifyError(`An Error occured while deleting policy`); }); }); + }, + showRelationsModal(policy) { + this.policy = policy; + this.showRelationsViewModal = true; + }, + closeRelationsModal() { + this.policy = null; + this.showRelationsViewModal = false; + }, + showAddPolicyModal() { + this.clearRow(); + this.showPolicyFormModal = true; } }, computed: { diff --git a/src/components/automation/PolicyChecksTab.vue b/src/components/automation/PolicyChecksTab.vue index d5f1a2f..0d0223c 100644 --- a/src/components/automation/PolicyChecksTab.vue +++ b/src/components/automation/PolicyChecksTab.vue @@ -1,5 +1,5 @@