From c95d9e828358fc16bcfce239591fcae850c240c2 Mon Sep 17 00:00:00 2001 From: "Daryn St. Pierre" Date: Thu, 23 Jul 2020 10:26:47 -0400 Subject: [PATCH 1/5] added and implemented a helper function to strip creationTime and modificationTime from all Dataplane views. Signed-off-by: Daryn St. Pierre --- src/helpers.js | 15 ++++++++++++++- src/views/Entities/Dataplanes.vue | 5 +++-- src/views/Entities/GatewayDataplanes.vue | 5 +++-- src/views/Entities/IngressDataplanes.vue | 5 +++-- 4 files changed, 23 insertions(+), 7 deletions(-) diff --git a/src/helpers.js b/src/helpers.js index bf026c2fa..c400d0233 100644 --- a/src/helpers.js +++ b/src/helpers.js @@ -343,6 +343,18 @@ export function getOffset (url) { return match } +/** + * stripTimes + * + * Strips the time values from the objects returned from + * various endpoints, in a non-destructive manner. + */ +export function stripTimes (content) { + const { creationTime, modificationTime, ...noTimes } = content + + return noTimes +} + export default { forEach, decodeJWT, @@ -361,5 +373,6 @@ export default { humanReadableDate, getSome, stripUrl, - getOffset + getOffset, + stripTimes } diff --git a/src/views/Entities/Dataplanes.vue b/src/views/Entities/Dataplanes.vue index 1465990ef..8f1a0c4b0 100644 --- a/src/views/Entities/Dataplanes.vue +++ b/src/views/Entities/Dataplanes.vue @@ -155,7 +155,7 @@