From 7bb53c64da2dcf88894bfd31503accdd81498f3d Mon Sep 17 00:00:00 2001
From: Thomas Duval <thomas.duval@orange.com>
Date: Wed, 3 Jun 2020 10:06:52 +0200
Subject: Update to new version 5.4

Signed-off-by: Thomas Duval <thomas.duval@orange.com>
Change-Id: Idcd868133d75928a1ffd74d749ce98503e0555ea
---
 dashboard/src/views/Pdps.vue | 53 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 53 insertions(+)
 create mode 100644 dashboard/src/views/Pdps.vue

(limited to 'dashboard/src/views/Pdps.vue')

diff --git a/dashboard/src/views/Pdps.vue b/dashboard/src/views/Pdps.vue
new file mode 100644
index 00000000..778f23fe
--- /dev/null
+++ b/dashboard/src/views/Pdps.vue
@@ -0,0 +1,53 @@
+<template>
+  <div>
+    <form-header
+      placeholder="Filter"
+      buttonText="Create PDP"
+      @click="creatingPdp = true"
+      v-model="filter"
+      need-button
+    ></form-header>
+    <br />
+
+    <CreatePdp v-if="creatingPdp" @close="creatingPdp = false"></CreatePdp>
+    <div class="list-group row" v-else>
+      <pdp v-for="pdp in filteredPdps" :key="pdp.id" :pdp="pdp"></pdp>
+    </div>
+  </div>
+</template>
+
+<script>
+import PdpService from "./../services/Pdp.service.js";
+import util from "./../services/Util.service.js";
+import Pdp from "./../components/pdp/Pdp.vue";
+import CreatePdp from "./../components/pdp/CreatePdp.vue";
+import FormHeader from "./../components/FormHeader.vue";
+import PolicyService from "../services/Policy.service";
+
+export default {
+  data() {
+    return {
+      filter: "",
+      creatingPdp: false,
+      pdps: []
+    };
+  },
+  mounted() {
+    PdpService.initialize();
+    PolicyService.initialize();
+    this.pdps = PdpService.pdps;
+  },
+  components: {
+    Pdp,
+    CreatePdp,
+    FormHeader
+  },
+  computed: {
+    filteredPdps() {
+      return util.filterAndSortByName(this.pdps, this.filter);
+    }
+  }
+};
+</script>
+
+
-- 
cgit 1.2.3-korg

