From e89745178b0c6c862d44c88b55004935f766dfbe Mon Sep 17 00:00:00 2001
From: claire bontempo <68122737+hellobontempo@users.noreply.github.com>
Date: Mon, 19 Sep 2022 14:03:50 -0700
Subject: [PATCH] UI: Add 'disable' to CRL config (#17153)
* add disable to crl attrs
* add changelog
* change styling per design
* update tests and fix default setting of buildCrl
* cleanup + refactor
---
changelog/17153.txt | 2 +
ui/app/components/pki/config-pki.js | 4 +
ui/app/models/pki/pki-config.js | 8 +-
.../templates/components/pki/config-pki.hbs | 20 ++-
.../components/pki/config-pki-test.js | 139 ++++++++++++------
5 files changed, 115 insertions(+), 58 deletions(-)
create mode 100644 changelog/17153.txt
diff --git a/changelog/17153.txt b/changelog/17153.txt
new file mode 100644
index 000000000..00fe70790
--- /dev/null
+++ b/changelog/17153.txt
@@ -0,0 +1,2 @@
+```release-note:improvement
+ui: add 'disable' param to pki crl configuration
\ No newline at end of file
diff --git a/ui/app/components/pki/config-pki.js b/ui/app/components/pki/config-pki.js
index a3ac4f76b..d528cb0af 100644
--- a/ui/app/components/pki/config-pki.js
+++ b/ui/app/components/pki/config-pki.js
@@ -37,6 +37,10 @@ export default Component.extend({
loading: false,
actions: {
+ handleCrlTtl({ enabled, goSafeTimeString }) {
+ this.config.disable = !enabled; // when TTL enabled, config disable=false
+ this.config.expiry = goSafeTimeString;
+ },
save(section) {
this.set('loading', true);
const config = this.config;
diff --git a/ui/app/models/pki/pki-config.js b/ui/app/models/pki/pki-config.js
index 9d8a88cef..91770fca6 100644
--- a/ui/app/models/pki/pki-config.js
+++ b/ui/app/models/pki/pki-config.js
@@ -47,12 +47,10 @@ export default Model.extend({
}),
crlAttrs: computed(function () {
- let keys = ['expiry'];
+ let keys = ['expiry', 'disable'];
return this.attrList(keys);
}),
//crl
- expiry: attr({
- defaultValue: '72h',
- editType: 'ttl',
- }),
+ expiry: attr('string', { defaultValue: '72h' }),
+ disable: attr('boolean', { defaultValue: false }),
});
diff --git a/ui/app/templates/components/pki/config-pki.hbs b/ui/app/templates/components/pki/config-pki.hbs
index c59031de7..f2078abc1 100644
--- a/ui/app/templates/components/pki/config-pki.hbs
+++ b/ui/app/templates/components/pki/config-pki.hbs
@@ -16,10 +16,22 @@