Refactor root navigation to generated URL

Change-Id: If969604814d3f2e859932f8a3bc26d14d22eac73
This commit is contained in:
Kasper Nilsson
2018-08-14 12:28:11 -07:00
parent a09d962867
commit 1c831a0fb6
4 changed files with 21 additions and 4 deletions

View File

@@ -70,6 +70,9 @@ limitations under the License.
// - `repoName`, required, String: the name of the repo
// - `detail`, optional, String: the name of the repo detail view.
// Takes any value from Gerrit.Nav.RepoDetailView.
//
// - Gerrit.Nav.View.ROOT:
// - no possible parameters.
window.Gerrit = window.Gerrit || {};
@@ -96,6 +99,7 @@ limitations under the License.
GROUP: 'group',
PLUGIN_SCREEN: 'plugin-screen',
REPO: 'repo',
ROOT: 'root',
SEARCH: 'search',
SETTINGS: 'settings',
},
@@ -411,6 +415,15 @@ limitations under the License.
});
},
/**
* @return {string}
*/
getUrlForRoot() {
return this._getUrlFor({
view: Gerrit.Nav.View.ROOT,
});
},
/**
* @param {string} repo The name of the repo.
* @param {!Array} sections The sections to display in the dashboard