From 2bd5c217d0cd677ceb67112ebe655444e94bf1d4 Mon Sep 17 00:00:00 2001 From: Paladox none Date: Thu, 16 Nov 2017 18:54:02 +0000 Subject: [PATCH] Rename projects admin interface to repo This also includes backwards compatibility with the old /projects/ url. This only renames it for the admin interface. It does not rename it for changes or anything else. Bug: Issue 7754 Change-Id: Ia31d3f26871556729fb3c5b5b28ceca12da1ec7c --- Documentation/pg-plugin-dev.txt | 8 +- Documentation/pg-plugin-project-api.txt | 36 ----- Documentation/pg-plugin-repo-api.txt | 36 +++++ .../admin/gr-admin-view/gr-admin-view.html | 36 ++--- .../admin/gr-admin-view/gr-admin-view.js | 74 +++++------ .../gr-admin-view/gr-admin-view_test.html | 60 ++++----- .../gr-create-change-dialog.html | 2 +- .../gr-create-change-dialog.js | 18 +-- .../gr-create-change-dialog_test.html | 20 ++- .../gr-create-pointer-dialog.js | 14 +- .../gr-create-pointer-dialog_test.html | 6 +- .../gr-create-repo-dialog.html} | 20 +-- .../gr-create-repo-dialog.js} | 42 +++--- .../gr-create-repo-dialog_test.html} | 32 ++--- .../gr-repo-access.html} | 4 +- .../gr-repo-access.js} | 20 +-- .../gr-repo-access_test.html} | 74 +++++------ .../gr-repo-command.html} | 4 +- .../gr-repo-command.js} | 2 +- .../gr-repo-command_test.html} | 8 +- .../gr-repo-commands.html} | 26 ++-- .../gr-repo-commands.js} | 20 +-- .../gr-repo-commands_test.html} | 8 +- .../gr-repo-detail-list.html} | 8 +- .../gr-repo-detail-list.js} | 52 ++++---- .../gr-repo-detail-list_test.html} | 54 ++++---- .../gr-repo-list.html} | 31 +++-- .../gr-repo-list.js} | 56 ++++---- .../gr-repo-list_test.html} | 54 ++++---- .../gr-project.html => gr-repo/gr-repo.html} | 76 +++++------ .../gr-project.js => gr-repo/gr-repo.js} | 40 +++--- .../gr-repo_test.html} | 56 ++++---- .../gr-confirm-cherrypick-dialog.js | 2 +- .../gr-confirm-cherrypick-dialog_test.html | 2 +- .../gr-confirm-move-dialog.js | 2 +- .../gr-confirm-move-dialog_test.html | 2 +- .../core/gr-main-header/gr-main-header.html | 2 +- .../app/elements/core/gr-router/gr-router.js | 125 ++++++++++-------- .../core/gr-router/gr-router_test.html | 111 ++++++++-------- .../gr-plugin-repo-command.html} | 12 +- .../gr-repo-api.html} | 6 +- .../gr-repo-api.js} | 18 +-- .../gr-repo-api_test.html} | 22 +-- .../gr-js-api-interface.html | 2 +- .../gr-js-api-interface/gr-public-js-api.js | 2 +- .../gr-rest-api-interface.js | 122 ++++++++++------- .../gr-rest-api-interface_test.html | 20 +-- ...project-command.html => repo-command.html} | 22 +-- polygerrit-ui/app/test/index.html | 16 +-- 49 files changed, 758 insertions(+), 727 deletions(-) delete mode 100644 Documentation/pg-plugin-project-api.txt create mode 100644 Documentation/pg-plugin-repo-api.txt rename polygerrit-ui/app/elements/admin/{gr-create-project-dialog/gr-create-project-dialog.html => gr-create-repo-dialog/gr-create-repo-dialog.html} (85%) rename polygerrit-ui/app/elements/admin/{gr-create-project-dialog/gr-create-project-dialog.js => gr-create-repo-dialog/gr-create-repo-dialog.js} (65%) rename polygerrit-ui/app/elements/admin/{gr-create-project-dialog/gr-create-project-dialog_test.html => gr-create-repo-dialog/gr-create-repo-dialog_test.html} (74%) rename polygerrit-ui/app/elements/admin/{gr-project-access/gr-project-access.html => gr-repo-access/gr-repo-access.html} (97%) rename polygerrit-ui/app/elements/admin/{gr-project-access/gr-project-access.js => gr-repo-access/gr-repo-access.js} (94%) rename polygerrit-ui/app/elements/admin/{gr-project-access/gr-project-access_test.html => gr-repo-access/gr-repo-access_test.html} (82%) rename polygerrit-ui/app/elements/admin/{gr-project-command/gr-project-command.html => gr-repo-command/gr-repo-command.html} (92%) rename polygerrit-ui/app/elements/admin/{gr-project-command/gr-project-command.js => gr-repo-command/gr-repo-command.js} (96%) rename polygerrit-ui/app/elements/admin/{gr-project-command/gr-project-command_test.html => gr-repo-command/gr-repo-command_test.html} (88%) rename polygerrit-ui/app/elements/admin/{gr-project-commands/gr-project-commands.html => gr-repo-commands/gr-repo-commands.html} (82%) rename polygerrit-ui/app/elements/admin/{gr-project-commands/gr-project-commands.js => gr-repo-commands/gr-repo-commands.js} (79%) rename polygerrit-ui/app/elements/admin/{gr-project-commands/gr-project-commands_test.html => gr-repo-commands/gr-repo-commands_test.html} (92%) rename polygerrit-ui/app/elements/admin/{gr-project-detail-list/gr-project-detail-list.html => gr-repo-detail-list/gr-repo-detail-list.html} (97%) rename polygerrit-ui/app/elements/admin/{gr-project-detail-list/gr-project-detail-list.js => gr-repo-detail-list/gr-repo-detail-list.js} (80%) rename polygerrit-ui/app/elements/admin/{gr-project-detail-list/gr-project-detail-list_test.html => gr-repo-detail-list/gr-repo-detail-list_test.html} (90%) rename polygerrit-ui/app/elements/admin/{gr-project-list/gr-project-list.html => gr-repo-list/gr-repo-list.html} (80%) rename polygerrit-ui/app/elements/admin/{gr-project-list/gr-project-list.js => gr-repo-list/gr-repo-list.js} (72%) rename polygerrit-ui/app/elements/admin/{gr-project-list/gr-project-list_test.html => gr-repo-list/gr-repo-list_test.html} (76%) rename polygerrit-ui/app/elements/admin/{gr-project/gr-project.html => gr-repo/gr-repo.html} (77%) rename polygerrit-ui/app/elements/admin/{gr-project/gr-project.js => gr-repo/gr-repo.js} (85%) rename polygerrit-ui/app/elements/admin/{gr-project/gr-project_test.html => gr-repo/gr-repo_test.html} (87%) rename polygerrit-ui/app/elements/plugins/{gr-project-api/gr-plugin-project-command.html => gr-repo-api/gr-plugin-repo-command.html} (75%) rename polygerrit-ui/app/elements/plugins/{gr-project-api/gr-project-api.html => gr-repo-api/gr-repo-api.html} (84%) rename polygerrit-ui/app/elements/plugins/{gr-project-api/gr-project-api.js => gr-repo-api/gr-repo-api.js} (72%) rename polygerrit-ui/app/elements/plugins/{gr-project-api/gr-project-api_test.html => gr-repo-api/gr-repo-api_test.html} (82%) rename polygerrit-ui/app/samples/{project-command.html => repo-command.html} (55%) diff --git a/Documentation/pg-plugin-dev.txt b/Documentation/pg-plugin-dev.txt index dbcbe49bd4..3405808f6f 100644 --- a/Documentation/pg-plugin-dev.txt +++ b/Documentation/pg-plugin-dev.txt @@ -224,15 +224,15 @@ Note: TODO Note: TODO -[plugin-project] -=== project -`plugin.project()` +[plugin-repo] +=== repo +`plugin.repo()` .Params: - none .Returns: -- Instance of link:pg-plugin-project-api.html[GrProjectApi]. +- Instance of link:pg-plugin-repo-api.html[GrRepoApi]. === put `plugin.put(url, payload, opt_callback)` diff --git a/Documentation/pg-plugin-project-api.txt b/Documentation/pg-plugin-project-api.txt deleted file mode 100644 index df0a6f4aa0..0000000000 --- a/Documentation/pg-plugin-project-api.txt +++ /dev/null @@ -1,36 +0,0 @@ -= Gerrit Code Review - Project admin customization API - -This API is provided by link:pg-plugin-dev.html#plugin-project[plugin.project()] -and provides customization to admin page. - -== createCommand -`projectApi.createCommand(title, checkVisibleCallback)` - -Create a project command in the admin panel. - -.Params -- *title* String title. -- *checkVisibleCallback* function to configure command visibility. - -.Returns -- GrProjectApi for chaining. - -`checkVisibleCallback(projectName, projectConfig)` - -.Params -- *projectName* String project name. -- *projectConfig* Object REST API response for project config. - -.Returns -- `false` to hide the command for the specific project. - -== onTap -`projectApi.onTap(tapCalback)` - -Add a command tap callback. - -.Params -- *tapCallback* function that's excuted on command tap. - -.Returns -- Nothing diff --git a/Documentation/pg-plugin-repo-api.txt b/Documentation/pg-plugin-repo-api.txt new file mode 100644 index 0000000000..1272ea6869 --- /dev/null +++ b/Documentation/pg-plugin-repo-api.txt @@ -0,0 +1,36 @@ += Gerrit Code Review - Repo admin customization API + +This API is provided by link:pg-plugin-dev.html#plugin-repo[plugin.repo()] +and provides customization to admin page. + +== createCommand +`repoApi.createCommand(title, checkVisibleCallback)` + +Create a repo command in the admin panel. + +.Params +- *title* String title. +- *checkVisibleCallback* function to configure command visibility. + +.Returns +- GrRepoApi for chaining. + +`checkVisibleCallback(repoName, repoConfig)` + +.Params +- *repoName* String project name. +- *repoConfig* Object REST API response for repo config. + +.Returns +- `false` to hide the command for the specific project. + +== onTap +`repoApi.onTap(tapCalback)` + +Add a command tap callback. + +.Params +- *tapCallback* function that's excuted on command tap. + +.Returns +- Nothing diff --git a/polygerrit-ui/app/elements/admin/gr-admin-view/gr-admin-view.html b/polygerrit-ui/app/elements/admin/gr-admin-view/gr-admin-view.html index 3850894e9d..e298d8dd7d 100644 --- a/polygerrit-ui/app/elements/admin/gr-admin-view/gr-admin-view.html +++ b/polygerrit-ui/app/elements/admin/gr-admin-view/gr-admin-view.html @@ -29,11 +29,11 @@ limitations under the License. - - - - - + + + + + -