From 796a3001ccf7dd2729ff06f4dfd0e8614ae5de3a Mon Sep 17 00:00:00 2001 From: Asaad Mahmood Date: Fri, 21 Aug 2015 00:54:35 +0500 Subject: MM-1696 - Improvements for Slack Import --- web/react/components/setting_upload.jsx | 28 +++++++++++++++++++++++----- web/react/components/team_import_tab.jsx | 8 ++++---- web/sass-files/sass/partials/_settings.scss | 10 ++++++++++ 3 files changed, 37 insertions(+), 9 deletions(-) diff --git a/web/react/components/setting_upload.jsx b/web/react/components/setting_upload.jsx index 870710850..02789f5dd 100644 --- a/web/react/components/setting_upload.jsx +++ b/web/react/components/setting_upload.jsx @@ -46,17 +46,25 @@ module.exports = React.createClass({ serverError: '' }); }, + onFileSelect: function(e) { + var filename = $(e.target).val(); + if (filename.substring(3, 11) === 'fakepath') { + filename = filename.substring(12); + } + $(e.target).closest('li').find('.file-status').addClass('hide'); + $(e.target).closest('li').find('.file-name').removeClass('hide').html(filename); + }, render: function() { var clientError = null; if (this.state.clientError) { clientError = ( -
+
{this.state.clientError}
); } var serverError = null; if (this.state.serverError) { serverError = ( -
+
{this.state.serverError}
); } return ( @@ -65,11 +73,21 @@ module.exports = React.createClass({
  • diff --git a/web/react/components/team_import_tab.jsx b/web/react/components/team_import_tab.jsx index 131add999..c21701c0e 100644 --- a/web/react/components/team_import_tab.jsx +++ b/web/react/components/team_import_tab.jsx @@ -34,17 +34,17 @@ module.exports = React.createClass({ break; case 'in-progress': messageSection = ( -

    Importing...

    +

    Importing...

    ); break; case 'done': messageSection = ( -

    Import sucessfull: View Summery

    +

    Import sucessfull: View Summery

    ); break; case 'fail': messageSection = ( -

    Import failure: View Summery

    +

    Import failure: View Summery

    ); break; } @@ -59,8 +59,8 @@ module.exports = React.createClass({

    Import

    {uploadSection} - {messageSection}
    + {messageSection}
    ); diff --git a/web/sass-files/sass/partials/_settings.scss b/web/sass-files/sass/partials/_settings.scss index 0262ef60c..99a7eb7bc 100644 --- a/web/sass-files/sass/partials/_settings.scss +++ b/web/sass-files/sass/partials/_settings.scss @@ -111,6 +111,16 @@ } } + .file-status { + font-size: 13px; + margin-top: 8px; + color: #555; + } + + .confirm-import { + padding: 4px 10px; + margin: 10px 0; + } } } -- cgit v1.2.3-1-g7c22 From afb09a1b9dd83e480a8c4f5744bd79cafb88a682 Mon Sep 17 00:00:00 2001 From: Asaad Mahmood Date: Fri, 21 Aug 2015 00:54:35 +0500 Subject: MM-1696 - Improvements for Slack Import --- web/react/components/setting_upload.jsx | 28 +++++++++++++++++++++++----- web/react/components/team_import_tab.jsx | 8 ++++---- web/sass-files/sass/partials/_settings.scss | 10 ++++++++++ 3 files changed, 37 insertions(+), 9 deletions(-) diff --git a/web/react/components/setting_upload.jsx b/web/react/components/setting_upload.jsx index 870710850..02789f5dd 100644 --- a/web/react/components/setting_upload.jsx +++ b/web/react/components/setting_upload.jsx @@ -46,17 +46,25 @@ module.exports = React.createClass({ serverError: '' }); }, + onFileSelect: function(e) { + var filename = $(e.target).val(); + if (filename.substring(3, 11) === 'fakepath') { + filename = filename.substring(12); + } + $(e.target).closest('li').find('.file-status').addClass('hide'); + $(e.target).closest('li').find('.file-name').removeClass('hide').html(filename); + }, render: function() { var clientError = null; if (this.state.clientError) { clientError = ( -
    +
    {this.state.clientError}
    ); } var serverError = null; if (this.state.serverError) { serverError = ( -
    +
    {this.state.serverError}
    ); } return ( @@ -65,11 +73,21 @@ module.exports = React.createClass({
  • diff --git a/web/react/components/team_import_tab.jsx b/web/react/components/team_import_tab.jsx index 131add999..c21701c0e 100644 --- a/web/react/components/team_import_tab.jsx +++ b/web/react/components/team_import_tab.jsx @@ -34,17 +34,17 @@ module.exports = React.createClass({ break; case 'in-progress': messageSection = ( -

    Importing...

    +

    Importing...

    ); break; case 'done': messageSection = ( -

    Import sucessfull: View Summery

    +

    Import sucessfull: View Summery

    ); break; case 'fail': messageSection = ( -

    Import failure: View Summery

    +

    Import failure: View Summery

    ); break; } @@ -59,8 +59,8 @@ module.exports = React.createClass({

    Import

    {uploadSection} - {messageSection}
    + {messageSection}
    ); diff --git a/web/sass-files/sass/partials/_settings.scss b/web/sass-files/sass/partials/_settings.scss index 0262ef60c..99a7eb7bc 100644 --- a/web/sass-files/sass/partials/_settings.scss +++ b/web/sass-files/sass/partials/_settings.scss @@ -111,6 +111,16 @@ } } + .file-status { + font-size: 13px; + margin-top: 8px; + color: #555; + } + + .confirm-import { + padding: 4px 10px; + margin: 10px 0; + } } } -- cgit v1.2.3-1-g7c22 From 06b2adbcf40e8af49307bf0616888e48c638cc59 Mon Sep 17 00:00:00 2001 From: Asaad Mahmood Date: Fri, 21 Aug 2015 18:21:04 +0500 Subject: Updating setting_upload --- web/react/components/setting_upload.jsx | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/web/react/components/setting_upload.jsx b/web/react/components/setting_upload.jsx index 9f3b399b8..02789f5dd 100644 --- a/web/react/components/setting_upload.jsx +++ b/web/react/components/setting_upload.jsx @@ -88,18 +88,6 @@ module.exports = React.createClass({
    {serverError} {clientError} - Select File - - Import - - - Cancel - -- cgit v1.2.3-1-g7c22