diff --git a/webapp/actions/team_actions.jsx b/webapp/actions/team_actions.jsx
index 2408e55fdc..2cff86b4a6 100644
--- a/webapp/actions/team_actions.jsx
+++ b/webapp/actions/team_actions.jsx
@@ -8,7 +8,7 @@ const ActionTypes = Constants.ActionTypes;
import * as AsyncClient from 'utils/async_client.jsx';
import Client from 'utils/web_client.jsx';
-import AppDispatcher from '../dispatcher/app_dispatcher.jsx';
+import AppDispatcher from 'dispatcher/app_dispatcher.jsx';
import {browserHistory} from 'react-router';
diff --git a/webapp/components/admin_console/banner.jsx b/webapp/components/admin_console/banner.jsx
new file mode 100644
index 0000000000..2071fff930
--- /dev/null
+++ b/webapp/components/admin_console/banner.jsx
@@ -0,0 +1,40 @@
+// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
+// See License.txt for license information.
+
+import React from 'react';
+import {FormattedMessage} from 'react-intl';
+
+export default class Banner extends React.Component {
+ render() {
+ let title = (
+
+ {this.props.description} +
+
-
Your email has been verified! Click here to log in.
", "email_verify.verifyFailed": "Failed to verify your email.", + "error_bar.expiring": "The Enterprise license is expiring on {date}. To renew your license, please contact commercial@mattermost.com", + "error_bar.expired": "Enterprise license has expired; you have 15 days from expiry to renew the license, please contact commercial@mattermost.com for details", + "error_bar.past_grace": "Enterprise license has expired, please contact your System Administrator for details", "error_bar.preview_mode": "Preview Mode: Email notifications have not been configured", "file_attachment.download": "Download", "file_info_preview.size": "Size ", diff --git a/webapp/sass/routes/_admin-console.scss b/webapp/sass/routes/_admin-console.scss index c8af724721..06db93ec51 100644 --- a/webapp/sass/routes/_admin-console.scss +++ b/webapp/sass/routes/_admin-console.scss @@ -145,6 +145,7 @@ .banner__heading { font-size: 1.5em; + margin-bottom: 0.5em; } .banner__content { @@ -374,4 +375,4 @@ .recycle-db { margin-top: 50px !important; -} \ No newline at end of file +} diff --git a/webapp/stores/error_store.jsx b/webapp/stores/error_store.jsx index 4a357472d5..e37de40ac7 100644 --- a/webapp/stores/error_store.jsx +++ b/webapp/stores/error_store.jsx @@ -20,12 +20,12 @@ class ErrorStoreClass extends EventEmitter { this.removeChangeListener = this.removeChangeListener.bind(this); this.getLastError = this.getLastError.bind(this); this.storeLastError = this.storeLastError.bind(this); - this.getIgnoreEmailPreview = this.getIgnoreEmailPreview.bind(this); - this.ignore_email_preview = false; + this.getIgnoreNotification = this.getIgnoreNotification.bind(this); + this.ignore_notification = false; } - getIgnoreEmailPreview() { - return this.ignore_email_preview; + getIgnoreNotification() { + return this.ignore_notification; } emitChange() { @@ -65,8 +65,8 @@ class ErrorStoreClass extends EventEmitter { clearLastError() { var lastError = this.getLastError(); - // preview message can only be cleared by clearPreviewError - if (lastError && lastError.email_preview) { + // preview message can only be cleared by clearNotificationError + if (lastError && lastError.notification) { return; } @@ -77,8 +77,8 @@ class ErrorStoreClass extends EventEmitter { } } - clearPreviewError() { - this.ignore_email_preview = true; + clearNotificationError() { + this.ignore_notification = true; this.storeLastError(''); this.clearLastError(); } diff --git a/webapp/utils/constants.jsx b/webapp/utils/constants.jsx index f1af112a99..b7ed97162f 100644 --- a/webapp/utils/constants.jsx +++ b/webapp/utils/constants.jsx @@ -750,5 +750,7 @@ export default { MHPNS: 'https://push.mattermost.com', MTPNS: 'http://push-test.mattermost.com', BOT_NAME: 'BOT', - POST_COLLAPSE_TIMEOUT: 1000 * 60 * 5 // five minutes + POST_COLLAPSE_TIMEOUT: 1000 * 60 * 5, // five minutes + LICENSE_EXPIRY_NOTIFICATION: 1000 * 60 * 60 * 24 * 15, // 15 days + LICENSE_GRACE_PERIOD: 1000 * 60 * 60 * 24 * 15 // 15 days }; diff --git a/webapp/utils/license_utils.jsx b/webapp/utils/license_utils.jsx new file mode 100644 index 0000000000..0ee8b75de3 --- /dev/null +++ b/webapp/utils/license_utils.jsx @@ -0,0 +1,45 @@ +// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved. +// See License.txt for license information. + +import Constants from 'utils/constants.jsx'; + +import React from 'react'; +import {FormattedDate} from 'react-intl'; + +export function isLicenseExpiring() { + if (window.mm_license.IsLicensed !== 'true') { + return false; + } + + const timeDiff = parseInt(global.window.mm_license.ExpiresAt, 10) - Date.now(); + return timeDiff <= Constants.LICENSE_EXPIRY_NOTIFICATION; +} + +export function isLicenseExpired() { + if (window.mm_license.IsLicensed !== 'true') { + return false; + } + + const timeDiff = parseInt(global.window.mm_license.ExpiresAt, 10) - Date.now(); + return timeDiff < 0; +} + +export function isLicensePastGracePeriod() { + if (window.mm_license.IsLicensed !== 'true') { + return false; + } + + const timeDiff = Date.now() - parseInt(global.window.mm_license.ExpiresAt, 10); + return timeDiff > Constants.LICENSE_GRACE_PERIOD; +} + +export function displayExpiryDate() { + return ( +