aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web
diff options
context:
space:
mode:
authorssjenka <ssjenka@ops-slave-centos7-1.internal.sonarsource.com>2016-07-21 08:02:12 +0200
committerssjenka <ssjenka@ops-slave-centos7-1.internal.sonarsource.com>2016-07-21 08:02:12 +0200
commitbb0547afd86d2549c62f2774e4d11526d1e1481c (patch)
treeece16302be9ca9c8b8db294aa6711fc6d1e5762c /server/sonar-web
parentca4b66297fe5350b67c3baa9cebf75841fda9dcd (diff)
parentf17516585b4a09b68e8165f3a186d9550c945259 (diff)
downloadsonarqube-bb0547afd86d2549c62f2774e4d11526d1e1481c.tar.gz
sonarqube-bb0547afd86d2549c62f2774e4d11526d1e1481c.zip
Automatic merge from branch-6.0
* origin/branch-6.0: open permission template after its creation
Diffstat (limited to 'server/sonar-web')
-rw-r--r--server/sonar-web/src/main/js/apps/permission-templates/components/Header.js17
-rw-r--r--server/sonar-web/src/main/js/apps/permission-templates/views/CreateView.js4
2 files changed, 16 insertions, 5 deletions
diff --git a/server/sonar-web/src/main/js/apps/permission-templates/components/Header.js b/server/sonar-web/src/main/js/apps/permission-templates/components/Header.js
index b22b9387f3e..97590dc0ce3 100644
--- a/server/sonar-web/src/main/js/apps/permission-templates/components/Header.js
+++ b/server/sonar-web/src/main/js/apps/permission-templates/components/Header.js
@@ -28,6 +28,10 @@ export default class Header extends React.Component {
refresh: CallbackType
};
+ static contextTypes = {
+ router: React.PropTypes.object
+ };
+
componentWillMount () {
this.handleCreateClick = this.handleCreateClick.bind(this);
}
@@ -35,9 +39,16 @@ export default class Header extends React.Component {
handleCreateClick (e) {
e.preventDefault();
- new CreateView({
- refresh: this.props.refresh
- }).render();
+ new CreateView()
+ .on('done', r => {
+ this.props.refresh().then(() => {
+ this.context.router.push({
+ pathname: '/',
+ query: { id: r.permissionTemplate.id }
+ })
+ });
+ })
+ .render();
}
render () {
diff --git a/server/sonar-web/src/main/js/apps/permission-templates/views/CreateView.js b/server/sonar-web/src/main/js/apps/permission-templates/views/CreateView.js
index 516373a0aa9..bd6ad52409f 100644
--- a/server/sonar-web/src/main/js/apps/permission-templates/views/CreateView.js
+++ b/server/sonar-web/src/main/js/apps/permission-templates/views/CreateView.js
@@ -34,8 +34,8 @@ export default FormView.extend({
// do not show global error
400: null
}
- }).done(function () {
- that.options.refresh();
+ }).done(function (r) {
+ that.trigger('done', r);
that.destroy();
}).fail(function (jqXHR) {
that.enableForm();