From 5f04dc4f45b9657d46380499f92ae6e5c1bf5506 Mon Sep 17 00:00:00 2001
From: enahum <nahumhbl@gmail.com>
Date: Tue, 5 Jul 2016 15:49:00 -0400
Subject: SAML support (#3494)

* PLT-3073: Implement SAML/Okta Server side (EE) (#3422)

* PLT-3137 Support for SAML configuration

* PLT-3410 SAML Database Store

* PLT-3411 CLI to add Identity Provider Certificate and Service Provider Private Key

* PLT-3409 SAML Interface for EE

* PLT-3139 Handle SAML authentication server side

* Add localization messages

* PLT-3443 SAML Obtain SP metadata

* PLT-3142 Login & Switch to/from SAML

* Remove Certs for Database & Clean SAML Request

* Make required Username, FirstName and LastName

* PLT-3140 Add SAML to System Console (#3476)

* PLT-3140 Add SAML to System Console

* Move web_client functions to client.jsx

* Fix issues found by PM

* update package.json mattermost driver

* Fix text messages for SAML
---
 .../admin_console/remove_file_setting.jsx          | 72 ++++++++++++++++++++++
 1 file changed, 72 insertions(+)
 create mode 100644 webapp/components/admin_console/remove_file_setting.jsx

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

diff --git a/webapp/components/admin_console/remove_file_setting.jsx b/webapp/components/admin_console/remove_file_setting.jsx
new file mode 100644
index 000000000..5a76faae2
--- /dev/null
+++ b/webapp/components/admin_console/remove_file_setting.jsx
@@ -0,0 +1,72 @@
+// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
+// See License.txt for license information.
+
+import $ from 'jquery';
+import React from 'react';
+
+import Setting from './setting.jsx';
+
+export default class RemoveFileSetting extends Setting {
+    static get propTypes() {
+        return {
+            id: React.PropTypes.string.isRequired,
+            label: React.PropTypes.node.isRequired,
+            helpText: React.PropTypes.node,
+            removeButtonText: React.PropTypes.node.isRequired,
+            removingText: React.PropTypes.node,
+            fileName: React.PropTypes.string.isRequired,
+            onSubmit: React.PropTypes.func.isRequired,
+            disabled: React.PropTypes.bool
+        };
+    }
+
+    constructor(props) {
+        super(props);
+        this.handleRemove = this.handleRemove.bind(this);
+
+        this.state = {
+            serverError: null
+        };
+    }
+
+    handleRemove(e) {
+        e.preventDefault();
+
+        $(this.refs.remove_button).button('loading');
+        this.props.onSubmit(this.props.id, (error) => {
+            $(this.refs.remove_button).button('reset');
+            this.setState({serverError: error});
+        });
+    }
+
+    render() {
+        let serverError;
+        if (this.state.serverError) {
+            serverError = <div className='form-group has-error'><label className='control-label'>{this.state.serverError}</label></div>;
+        }
+
+        return (
+            <Setting
+                label={this.props.label}
+                helpText={this.props.helpText}
+                inputId={this.props.id}
+            >
+                <div>
+                    <div className='help-text remove-filename'>
+                        {this.props.fileName}
+                    </div>
+                    <button
+                        className='btn btn-danger'
+                        onClick={this.handleRemove}
+                        ref='remove_button'
+                        disabled={this.props.disabled}
+                        data-loading-text={`<span class='glyphicon glyphicon-refresh glyphicon-refresh-animate'></span> ${this.props.removingText}`}
+                    >
+                        {this.props.removeButtonText}
+                    </button>
+                    {serverError}
+                </div>
+            </Setting>
+        );
+    }
+}
\ No newline at end of file
-- 
cgit v1.2.3-1-g7c22

