From 85f8b90aeb3d475548d9da96eb14969177a1ee5f Mon Sep 17 00:00:00 2001
From: Asaad Mahmood
Date: Tue, 30 Aug 2016 16:42:51 +0500
Subject: [PATCH] Minor UI improvements (#3904)
* PLT-3917 - Adding cross icon to remove deleted post in the RHS.
* PLT-3997 - Improving the integration confirmation screen
---
.../components/confirm_integration.jsx | 68 ++++++++++---------
webapp/components/rhs_comment.jsx | 37 +++++++++-
webapp/sass/routes/_backstage.scss | 4 ++
3 files changed, 73 insertions(+), 36 deletions(-)
diff --git a/webapp/components/integrations/components/confirm_integration.jsx b/webapp/components/integrations/components/confirm_integration.jsx
index 96e24c5750..1b95824ca5 100644
--- a/webapp/components/integrations/components/confirm_integration.jsx
+++ b/webapp/components/integrations/components/confirm_integration.jsx
@@ -74,15 +74,15 @@ export default class ConfirmIntegration extends React.Component {
/>
);
helpText = (
-
+
);
tokenText = (
-
+
);
} else if (this.state.type === Constants.Integrations.INCOMING_WEBHOOK) {
headerText = (
@@ -100,15 +100,15 @@ export default class ConfirmIntegration extends React.Component {
/>
);
helpText = (
-
+
);
tokenText = (
-
+
);
} else if (this.state.type === Constants.Integrations.OUTGOING_WEBHOOK) {
headerText = (
@@ -126,15 +126,15 @@ export default class ConfirmIntegration extends React.Component {
/>
);
helpText = (
-
+
);
tokenText = (
-
+
);
} else if (this.state.type === Constants.Integrations.OAUTH_APP) {
let oauthApp = {};
@@ -163,15 +163,15 @@ export default class ConfirmIntegration extends React.Component {
helpText = [];
helpText.push(
-
+
);
helpText.push(
-
+
);
helpText.push(
-
+
);
tokenText = (
-
+
);
}
}
@@ -223,19 +223,21 @@ export default class ConfirmIntegration extends React.Component {
defaultMessage='Add'
/>
- {helpText}
- {tokenText}
-
-
-
-
+
+ {helpText}
+ {tokenText}
+
+
+
+
+
);
diff --git a/webapp/components/rhs_comment.jsx b/webapp/components/rhs_comment.jsx
index c9588eb333..dcd5ee37f5 100644
--- a/webapp/components/rhs_comment.jsx
+++ b/webapp/components/rhs_comment.jsx
@@ -30,6 +30,7 @@ export default class RhsComment extends React.Component {
super(props);
this.handlePermalink = this.handlePermalink.bind(this);
+ this.removePost = this.removePost.bind(this);
this.flagPost = this.flagPost.bind(this);
this.unflagPost = this.unflagPost.bind(this);
@@ -41,6 +42,23 @@ export default class RhsComment extends React.Component {
GlobalActions.showGetPostLinkModal(this.props.post);
}
+ removePost() {
+ GlobalActions.emitRemovePost(this.props.post);
+ }
+
+ createRemovePostButton() {
+ return (
+
+ {'×'}
+
+ );
+ }
+
shouldComponentUpdate(nextProps) {
if (nextProps.status !== this.props.status) {
return true;
@@ -344,6 +362,21 @@ export default class RhsComment extends React.Component {
);
}
+ let options;
+ if (Utils.isPostEphemeral(post)) {
+ options = (
+
+ {this.createRemovePostButton()}
+
+ );
+ } else {
+ options = (
+
+ {dropdown}
+
+ );
+ }
+
return (
@@ -368,9 +401,7 @@ export default class RhsComment extends React.Component {
{flagTrigger}
-
- {dropdown}
-
+ {options}
diff --git a/webapp/sass/routes/_backstage.scss b/webapp/sass/routes/_backstage.scss
index 5861b778e2..871189f45b 100644
--- a/webapp/sass/routes/_backstage.scss
+++ b/webapp/sass/routes/_backstage.scss
@@ -279,6 +279,10 @@
padding: 40px 30px 30px;
position: relative;
+ &.backstage-form__confirmation {
+ padding: 30px 30px 20px;
+ }
+
label {
font-weight: normal;
}