From 86d496c9b72c97b905bfc23d26556032c6fa1d05 Mon Sep 17 00:00:00 2001
From: enahum <nahumhbl@gmail.com>
Date: Wed, 20 Jul 2016 17:01:10 -0400
Subject: PLT-3629 fix uploading certificates if the files in the config do not
 exists (#3634)

---
 webapp/components/admin_console/saml_settings.jsx | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

(limited to 'webapp/components/admin_console/saml_settings.jsx')

diff --git a/webapp/components/admin_console/saml_settings.jsx b/webapp/components/admin_console/saml_settings.jsx
index ae6f3e169..9fb78f472 100644
--- a/webapp/components/admin_console/saml_settings.jsx
+++ b/webapp/components/admin_console/saml_settings.jsx
@@ -70,6 +70,26 @@ export default class SamlSettings extends AdminSettings {
         };
     }
 
+    componentWillMount() {
+        Client.samlCertificateStatus(
+            (data) => {
+                const files = {};
+                if (!data.IdpCertificateFile) {
+                    files.idpCertificateFile = '';
+                }
+
+                if (!data.PublicCertificateFile) {
+                    files.publicCertificateFile = '';
+                }
+
+                if (!data.PrivateKeyFile) {
+                    files.privateKeyFile = '';
+                }
+                this.setState(files);
+            }
+        );
+    }
+
     uploadCertificate(id, file, callback) {
         Client.uploadCertificateFile(
             file,
-- 
cgit v1.2.3-1-g7c22

