Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-10-06 23:18:50 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-10-06 23:18:50 +0300
commit49d6ca6267034149a63b8648215ed0a73126de3f (patch)
tree1e130732cb7b46a6591363f635eaba096166a761 /app/assets/javascripts
parent6c405b951ead1bd58a64dd4f5e713abaada6dffc (diff)
parentb356c7ddad1ada1d78136386536f6676ca8b1df4 (diff)
Merge branch 'dz-root-url' into 'master'
Move user#show and group#show routing under root url ## What does this MR do? Changes routing so user#show and group#show routing is under root url ## Are there points in the code the reviewer needs to double check? no ## Why was this MR needed? For nice and consistent routing for user/group show pages: | before | after| |---|---| | `/u/dzaporozhets` | `/dzaporozhets`| | `/dzaporozhets/gitlab-ce` |`/dzaporozhets/gitlab-ce`| | `/u/dzaporozhets/snippets` |`/u/dzaporozhets/snippets`| | `/groups/gitlab-org`| `/gitlab-org`| | `/gitlab-org/gitlab-ce`| `/gitlab-org/gitlab-ce`| | `/groups/gitlab-org/issues `| `/groups/gitlab-org/issues `| So show page for user and group shown as `/:name` which is much nicer than before. At same time all nested pages like group issues stays under REST `/groups/:name/issues` so we don't need to introduce extra name restrictions ( ex. case when group has project with name "issues") ## Screenshots (if relevant) ## Does this MR meet the acceptance criteria? - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - [ ] ~~[Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)~~ - [ ] ~~API support added~~ - Tests - [x] Added for this feature/bug - [x] All builds are passing - [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html) - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if you do - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) ## What are the relevant issue numbers? Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/3620 See merge request !6686
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r--app/assets/javascripts/user_tabs.js.es611
-rw-r--r--app/assets/javascripts/users_select.js4
2 files changed, 5 insertions, 10 deletions
diff --git a/app/assets/javascripts/user_tabs.js.es6 b/app/assets/javascripts/user_tabs.js.es6
index 63bce0a6f6f..dfdfa1e7f75 100644
--- a/app/assets/javascripts/user_tabs.js.es6
+++ b/app/assets/javascripts/user_tabs.js.es6
@@ -89,7 +89,7 @@ content on the Users#show page.
const action = $target.data('action');
const source = $target.attr('href');
this.setTab(source, action);
- return this.setCurrentAction(action);
+ return this.setCurrentAction(source, action);
}
activateTab(action) {
@@ -142,14 +142,9 @@ content on the Users#show page.
.toggle(status);
}
- setCurrentAction(action) {
- const regExp = new RegExp(`\/(${this.actions.join('|')})(\.html)?\/?$`);
- let new_state = this._location.pathname;
+ setCurrentAction(source, action) {
+ let new_state = source
new_state = new_state.replace(/\/+$/, '');
- new_state = new_state.replace(regExp, '');
- if (action !== this.defaultAction) {
- new_state += `/${action}`;
- }
new_state += this._location.search + this._location.hash;
history.replaceState({
turbolinks: true,
diff --git a/app/assets/javascripts/users_select.js b/app/assets/javascripts/users_select.js
index 05056a73aaf..bcabda3ceb2 100644
--- a/app/assets/javascripts/users_select.js
+++ b/app/assets/javascripts/users_select.js
@@ -71,8 +71,8 @@
return $collapsedSidebar.html(collapsedAssigneeTemplate(user));
});
};
- collapsedAssigneeTemplate = _.template('<% if( avatar ) { %> <a class="author_link" href="/u/<%- username %>"> <img width="24" class="avatar avatar-inline s24" alt="" src="<%- avatar %>"> </a> <% } else { %> <i class="fa fa-user"></i> <% } %>');
- assigneeTemplate = _.template('<% if (username) { %> <a class="author_link bold" href="/u/<%- username %>"> <% if( avatar ) { %> <img width="32" class="avatar avatar-inline s32" alt="" src="<%- avatar %>"> <% } %> <span class="author"><%- name %></span> <span class="username"> @<%- username %> </span> </a> <% } else { %> <span class="no-value assign-yourself"> No assignee - <a href="#" class="js-assign-yourself"> assign yourself </a> </span> <% } %>');
+ collapsedAssigneeTemplate = _.template('<% if( avatar ) { %> <a class="author_link" href="/<%- username %>"> <img width="24" class="avatar avatar-inline s24" alt="" src="<%- avatar %>"> </a> <% } else { %> <i class="fa fa-user"></i> <% } %>');
+ assigneeTemplate = _.template('<% if (username) { %> <a class="author_link bold" href="/<%- username %>"> <% if( avatar ) { %> <img width="32" class="avatar avatar-inline s32" alt="" src="<%- avatar %>"> <% } %> <span class="author"><%- name %></span> <span class="username"> @<%- username %> </span> </a> <% } else { %> <span class="no-value assign-yourself"> No assignee - <a href="#" class="js-assign-yourself"> assign yourself </a> </span> <% } %>');
return $dropdown.glDropdown({
showMenuAbove: showMenuAbove,
data: function(term, callback) {