From daf0ec95438396689def853ab1cc9f433313e47a Mon Sep 17 00:00:00 2001 From: Dmitrii Filippov Date: Tue, 17 Mar 2020 11:27:28 +0100 Subject: [PATCH] Convert polygerrit to es6-modules This change replace all HTML imports with es6-modules. The only exceptions are: * gr-app.html file, which can be deleted only after updating the gerrit/httpd/raw/PolyGerritIndexHtml.soy file. * dark-theme.html which is loaded via importHref. Must be updated manually later in a separate change. This change was produced automatically by ./es6-modules-converter.sh script. No manual changes were made. Change-Id: I0c447dd8c05757741e2c940720652d01d9fb7d67 --- .../async-foreach-behavior.js | 35 +- .../async-foreach-behavior_test.html | 68 +- .../base-url-behavior/base-url-behavior.js | 35 +- .../base-url-behavior_test.html | 70 +- .../docs-url-behavior/docs-url-behavior.js | 35 +- .../docs-url-behavior_test.html | 150 +- .../dom-util-behavior/dom-util-behavior.js | 34 +- .../dom-util-behavior_test.html | 69 +- .../behaviors/fire-behavior/fire-behavior.js | 35 +- .../gr-access-behavior/gr-access-behavior.js | 35 +- .../gr-access-behavior_test.html | 83 +- .../gr-admin-nav-behavior.js | 34 +- .../gr-admin-nav-behavior_test.html | 677 ++- .../gr-change-table-behavior.js | 34 +- .../gr-change-table-behavior_test.html | 175 +- .../gr-display-name-behavior.js | 37 +- .../gr-display-name-behavior_test.html | 139 +- .../gr-list-view-behavior.js | 38 +- .../gr-list-view-behavior_test.html | 125 +- .../gr-patch-set-behavior.js | 34 +- .../gr-patch-set-behavior_test.html | 610 +- .../gr-path-list-behavior.js | 35 +- .../gr-path-list-behavior_test.html | 162 +- .../gr-repo-plugin-config-behavior.js | 34 +- .../gr-tooltip-behavior.html | 21 - .../gr-tooltip-behavior.js | 8 +- .../gr-tooltip-behavior_test.html | 254 +- .../gr-url-encoding-behavior.js | 34 +- .../gr-url-encoding-behavior_test.html | 132 +- .../keyboard-shortcut-behavior.js | 59 +- .../keyboard-shortcut-behavior_test.html | 773 +-- .../rest-client-behavior.js | 37 +- .../rest-client-behavior_test.html | 396 +- .../safe-types-behavior.js | 34 +- .../safe-types-behavior_test.html | 192 +- .../gr-access-section/gr-access-section.js | 561 +- .../gr-access-section_html.js | 109 +- .../gr-access-section_test.html | 925 +-- .../gr-admin-group-list.js | 306 +- .../gr-admin-group-list_html.js | 87 +- .../gr-admin-group-list_test.html | 285 +- .../admin/gr-admin-view/gr-admin-view.js | 569 +- .../admin/gr-admin-view/gr-admin-view_html.js | 117 +- .../gr-admin-view/gr-admin-view_test.html | 1224 ++-- .../gr-confirm-delete-item-dialog.js | 123 +- .../gr-confirm-delete-item-dialog_html.js | 51 +- .../gr-confirm-delete-item-dialog_test.html | 115 +- .../gr-create-change-dialog.js | 278 +- .../gr-create-change-dialog_html.js | 108 +- .../gr-create-change-dialog_test.html | 263 +- .../gr-create-group-dialog.js | 124 +- .../gr-create-group-dialog_html.js | 56 +- .../gr-create-group-dialog_test.html | 131 +- .../gr-create-pointer-dialog.js | 164 +- .../gr-create-pointer-dialog_html.js | 81 +- .../gr-create-pointer-dialog_test.html | 198 +- .../gr-create-repo-dialog.js | 243 +- .../gr-create-repo-dialog_html.js | 80 +- .../gr-create-repo-dialog_test.html | 131 +- .../gr-group-audit-log/gr-group-audit-log.js | 220 +- .../gr-group-audit-log_html.js | 62 +- .../gr-group-audit-log_test.html | 171 +- .../gr-group-members/gr-group-members.js | 518 +- .../gr-group-members/gr-group-members_html.js | 114 +- .../gr-group-members_test.html | 658 +- .../app/elements/admin/gr-group/gr-group.js | 465 +- .../elements/admin/gr-group/gr-group_html.js | 115 +- .../admin/gr-group/gr-group_test.html | 443 +- .../admin/gr-permission/gr-permission.js | 571 +- .../admin/gr-permission/gr-permission_html.js | 97 +- .../gr-permission/gr-permission_test.html | 767 +-- .../gr-plugin-config-array-editor.js | 153 +- .../gr-plugin-config-array-editor_html.js | 72 +- .../gr-plugin-config-array-editor_test.html | 206 +- .../admin/gr-plugin-list/gr-plugin-list.js | 214 +- .../gr-plugin-list/gr-plugin-list_html.js | 64 +- .../gr-plugin-list/gr-plugin-list_test.html | 280 +- .../admin/gr-repo-access/gr-repo-access.js | 950 +-- .../gr-repo-access/gr-repo-access_html.js | 112 +- .../gr-repo-access/gr-repo-access_test.html | 2282 +++---- .../admin/gr-repo-command/gr-repo-command.js | 57 +- .../gr-repo-command/gr-repo-command_html.js | 49 +- .../gr-repo-command/gr-repo-command_test.html | 52 +- .../gr-repo-commands/gr-repo-commands.js | 222 +- .../gr-repo-commands/gr-repo-commands_html.js | 87 +- .../gr-repo-commands_test.html | 213 +- .../gr-repo-dashboards/gr-repo-dashboards.js | 173 +- .../gr-repo-dashboards_html.js | 53 +- .../gr-repo-dashboards_test.html | 245 +- .../gr-repo-detail-list.js | 543 +- .../gr-repo-detail-list_html.js | 159 +- .../gr-repo-detail-list_test.html | 1028 ++-- .../admin/gr-repo-list/gr-repo-list.js | 314 +- .../admin/gr-repo-list/gr-repo-list_html.js | 93 +- .../admin/gr-repo-list/gr-repo-list_test.html | 321 +- .../gr-repo-plugin-config.js | 255 +- .../gr-repo-plugin-config_html.js | 97 +- .../gr-repo-plugin-config_test.html | 283 +- .../app/elements/admin/gr-repo/gr-repo.js | 652 +- .../elements/admin/gr-repo/gr-repo_html.js | 250 +- .../elements/admin/gr-repo/gr-repo_test.html | 653 +- .../admin/gr-rule-editor/gr-rule-editor.js | 522 +- .../gr-rule-editor/gr-rule-editor_html.js | 118 +- .../gr-rule-editor/gr-rule-editor_test.html | 1160 ++-- .../gr-change-list-item.js | 394 +- .../gr-change-list-item_html.js | 125 +- .../gr-change-list-item_test.html | 479 +- .../gr-change-list-view.js | 492 +- .../gr-change-list-view_html.js | 85 +- .../gr-change-list-view_test.html | 423 +- .../gr-change-list/gr-change-list.js | 786 +-- .../gr-change-list/gr-change-list_html.js | 100 +- .../gr-change-list/gr-change-list_test.html | 1083 ++-- .../gr-create-change-help.js | 46 +- .../gr-create-change-help_html.js | 48 +- .../gr-create-change-help_test.html | 51 +- .../gr-create-commands-dialog.js | 94 +- .../gr-create-commands-dialog_html.js | 54 +- .../gr-create-commands-dialog_test.html | 55 +- .../gr-create-destination-dialog.js | 106 +- .../gr-create-destination-dialog_html.js | 57 +- .../gr-dashboard-view/gr-dashboard-view.js | 603 +- .../gr-dashboard-view_html.js | 94 +- .../gr-dashboard-view_test.html | 641 +- .../gr-embed-dashboard/gr-embed-dashboard.js | 41 +- .../gr-embed-dashboard_html.js | 51 +- .../gr-repo-header/gr-repo-header.js | 64 +- .../gr-repo-header/gr-repo-header_html.js | 53 +- .../gr-repo-header/gr-repo-header_test.html | 61 +- .../gr-user-header/gr-user-header.js | 179 +- .../gr-user-header/gr-user-header_html.js | 66 +- .../gr-user-header/gr-user-header_test.html | 95 +- .../gr-change-actions/gr-change-actions.js | 3177 +++++----- .../gr-change-actions_html.js | 215 +- .../gr-change-actions_test.html | 3640 +++++------ .../gr-change-metadata-it_test.html | 280 +- .../gr-change-metadata/gr-change-metadata.js | 975 +-- .../gr-change-metadata_html.js | 201 +- .../gr-change-metadata_test.html | 1395 ++--- .../gr-change-requirements.js | 261 +- .../gr-change-requirements_html.js | 98 +- .../gr-change-requirements_test.html | 417 +- .../change/gr-change-view/gr-change-view.js | 4121 ++++++------- .../gr-change-view/gr-change-view_html.js | 376 +- .../gr-change-view/gr-change-view_test.html | 4312 ++++++------- .../change/gr-comment-list/gr-comment-list.js | 163 +- .../gr-comment-list/gr-comment-list_html.js | 69 +- .../gr-comment-list/gr-comment-list_test.html | 206 +- .../change/gr-commit-info/gr-commit-info.js | 125 +- .../gr-commit-info/gr-commit-info_html.js | 53 +- .../gr-commit-info/gr-commit-info_test.html | 223 +- .../gr-confirm-abandon-dialog.js | 130 +- .../gr-confirm-abandon-dialog_html.js | 58 +- .../gr-confirm-abandon-dialog_test.html | 101 +- .../gr-confirm-cherrypick-conflict-dialog.js | 79 +- ...confirm-cherrypick-conflict-dialog_html.js | 50 +- ...nfirm-cherrypick-conflict-dialog_test.html | 91 +- .../gr-confirm-cherrypick-dialog.js | 221 +- .../gr-confirm-cherrypick-dialog_html.js | 80 +- .../gr-confirm-cherrypick-dialog_test.html | 165 +- .../gr-confirm-move-dialog.js | 170 +- .../gr-confirm-move-dialog_html.js | 67 +- .../gr-confirm-move-dialog_test.html | 105 +- .../gr-confirm-rebase-dialog.js | 305 +- .../gr-confirm-rebase-dialog_html.js | 93 +- .../gr-confirm-rebase-dialog_test.html | 327 +- .../gr-confirm-revert-dialog.js | 358 +- .../gr-confirm-revert-dialog_html.js | 78 +- .../gr-confirm-revert-dialog_test.html | 149 +- .../gr-confirm-revert-submission-dialog.js | 165 +- ...r-confirm-revert-submission-dialog_html.js | 59 +- ...confirm-revert-submission-dialog_test.html | 143 +- .../gr-confirm-submit-dialog.js | 121 +- .../gr-confirm-submit-dialog_html.js | 61 +- .../gr-confirm-submit-dialog_test.html | 97 +- .../gr-download-dialog/gr-download-dialog.js | 413 +- .../gr-download-dialog_html.js | 77 +- .../gr-download-dialog_test.html | 346 +- .../elements/change/gr-file-list-constants.js | 54 +- .../gr-file-list-header.js | 504 +- .../gr-file-list-header_html.js | 163 +- .../gr-file-list-header_test.html | 568 +- .../change/gr-file-list/gr-file-list.js | 2723 +++++---- .../change/gr-file-list/gr-file-list_html.js | 230 +- .../gr-file-list/gr-file-list_test.html | 3509 +++++------ .../gr-included-in-dialog.js | 187 +- .../gr-included-in-dialog_html.js | 68 +- .../gr-included-in-dialog_test.html | 117 +- .../gr-label-score-row/gr-label-score-row.js | 317 +- .../gr-label-score-row_html.js | 81 +- .../gr-label-score-row_test.html | 654 +- .../change/gr-label-scores/gr-label-scores.js | 258 +- .../gr-label-scores/gr-label-scores_html.js | 56 +- .../gr-label-scores/gr-label-scores_test.html | 322 +- .../elements/change/gr-message/gr-message.js | 741 +-- .../change/gr-message/gr-message_html.js | 103 +- .../change/gr-message/gr-message_test.html | 698 +-- .../gr-messages-list/gr-messages-list.js | 791 +-- .../gr-messages-list/gr-messages-list_html.js | 92 +- .../gr-messages-list_test.html | 1082 ++-- .../gr-related-changes-list.js | 763 +-- .../gr-related-changes-list_html.js | 98 +- .../gr-related-changes-list_test.html | 1001 +-- .../gr-reply-dialog-it_test.html | 242 +- .../change/gr-reply-dialog/gr-reply-dialog.js | 1743 +++--- .../gr-reply-dialog/gr-reply-dialog_html.js | 166 +- .../gr-reply-dialog/gr-reply-dialog_test.html | 2265 +++---- .../gr-reviewer-list/gr-reviewer-list.js | 528 +- .../gr-reviewer-list/gr-reviewer-list_html.js | 66 +- .../gr-reviewer-list_test.html | 592 +- .../change/gr-thread-list/gr-thread-list.js | 369 +- .../gr-thread-list/gr-thread-list_html.js | 76 +- .../gr-thread-list/gr-thread-list_test.html | 644 +- .../gr-upload-help-dialog.js | 241 +- .../gr-upload-help-dialog_html.js | 52 +- .../gr-upload-help-dialog_test.html | 167 +- .../gr-account-dropdown.js | 206 +- .../gr-account-dropdown_html.js | 59 +- .../gr-account-dropdown_test.html | 189 +- .../core/gr-error-dialog/gr-error-dialog.js | 79 +- .../gr-error-dialog/gr-error-dialog_html.js | 60 +- .../gr-error-dialog/gr-error-dialog_test.html | 45 +- .../core/gr-error-manager/gr-error-manager.js | 755 +-- .../gr-error-manager/gr-error-manager_html.js | 69 +- .../gr-error-manager_test.html | 858 +-- .../gr-key-binding-display.js | 48 +- .../gr-key-binding-display_html.js | 48 +- .../gr-key-binding-display_test.html | 77 +- .../gr-keyboard-shortcuts-dialog.js | 245 +- .../gr-keyboard-shortcuts-dialog_html.js | 49 +- .../gr-keyboard-shortcuts-dialog_test.html | 289 +- .../core/gr-main-header/gr-main-header.js | 641 +- .../gr-main-header/gr-main-header_html.js | 90 +- .../gr-main-header/gr-main-header_test.html | 765 +-- .../core/gr-navigation/gr-navigation.js | 1382 +++-- .../gr-navigation/gr-navigation_test.html | 121 +- .../core/gr-reporting/gr-reporting.html | 22 - .../core/gr-reporting/gr-reporting.js | 1054 ++-- .../core/gr-reporting/gr-reporting_test.html | 781 +-- .../app/elements/core/gr-router/gr-router.js | 2845 ++++----- .../elements/core/gr-router/gr-router_html.js | 50 +- .../core/gr-router/gr-router_test.html | 3055 +++++----- .../core/gr-search-bar/gr-search-bar.js | 612 +- .../core/gr-search-bar/gr-search-bar_html.js | 59 +- .../gr-search-bar/gr-search-bar_test.html | 367 +- .../core/gr-smart-search/gr-smart-search.js | 286 +- .../gr-smart-search/gr-smart-search_html.js | 53 +- .../gr-smart-search/gr-smart-search_test.html | 253 +- .../app/elements/custom-dark-theme_test.html | 143 +- .../app/elements/custom-light-theme_test.html | 143 +- .../gr-apply-fix-dialog.js | 385 +- .../gr-apply-fix-dialog_html.js | 69 +- .../gr-apply-fix-dialog_test.html | 451 +- .../diff/gr-comment-api/gr-comment-api.js | 1008 +-- .../gr-comment-api/gr-comment-api_html.js | 44 +- .../gr-comment-api/gr-comment-api_test.html | 1283 ++-- .../gr-coverage-layer/gr-coverage-layer.js | 181 +- .../gr-coverage-layer_html.js | 43 +- .../gr-coverage-layer_test.html | 201 +- .../gr-diff-builder-element.js | 781 +-- .../gr-diff-builder-element_html.js | 73 +- .../gr-diff-builder-element_test.html | 2056 +++---- .../gr-diff-builder-unified_test.html | 359 +- .../diff/gr-diff-cursor/gr-diff-cursor.js | 909 +-- .../gr-diff-cursor/gr-diff-cursor_html.js | 52 +- .../gr-diff-cursor/gr-diff-cursor_test.html | 684 ++- .../gr-diff-highlight/gr-annotation_test.html | 504 +- .../gr-diff-highlight/gr-diff-highlight.js | 954 +-- .../gr-diff-highlight_html.js | 47 +- .../gr-diff-highlight_test.html | 899 +-- .../diff/gr-diff-host/gr-diff-host.js | 2113 +++---- .../diff/gr-diff-host/gr-diff-host_html.js | 83 +- .../diff/gr-diff-host/gr-diff-host_test.html | 2956 ++++----- .../gr-diff-mode-selector.js | 123 +- .../gr-diff-mode-selector_html.js | 62 +- .../gr-diff-mode-selector_test.html | 119 +- .../gr-diff-preferences-dialog.js | 121 +- .../gr-diff-preferences-dialog_html.js | 67 +- .../gr-diff-processor/gr-diff-processor.html | 25 - .../gr-diff-processor/gr-diff-processor.js | 1271 ++-- .../gr-diff-processor_test.html | 1675 ++--- .../gr-diff-selection/gr-diff-selection.js | 658 +- .../gr-diff-selection_html.js | 45 +- .../gr-diff-selection_test.html | 573 +- .../diff/gr-diff-view/gr-diff-view.js | 2317 +++---- .../diff/gr-diff-view/gr-diff-view_html.js | 204 +- .../diff/gr-diff-view/gr-diff-view_test.html | 2577 ++++---- .../diff/gr-diff/gr-diff-group_test.html | 364 +- .../app/elements/diff/gr-diff/gr-diff.js | 1845 +++--- .../app/elements/diff/gr-diff/gr-diff_html.js | 101 +- .../elements/diff/gr-diff/gr-diff_test.html | 1934 +++--- .../gr-patch-range-select.js | 550 +- .../gr-patch-range-select_html.js | 67 +- .../gr-patch-range-select_test.html | 784 +-- .../gr-ranged-comment-layer.js | 358 +- .../gr-ranged-comment-layer_html.js | 42 +- .../gr-ranged-comment-layer_test.html | 567 +- .../gr-ranged-comment-theme.js | 45 +- .../gr-selection-action-box.js | 179 +- .../gr-selection-action-box_html.js | 51 +- .../gr-selection-action-box_test.html | 173 +- .../diff/gr-syntax-layer/gr-syntax-layer.js | 967 +-- .../gr-syntax-layer/gr-syntax-layer_html.js | 45 +- .../gr-syntax-layer/gr-syntax-layer_test.html | 951 +-- .../diff/gr-syntax-themes/gr-syntax-theme.js | 45 +- .../gr-documentation-search.js | 146 +- .../gr-documentation-search_html.js | 63 +- .../gr-documentation-search_test.html | 179 +- .../gr-default-editor/gr-default-editor.js | 54 +- .../gr-default-editor_html.js | 48 +- .../gr-default-editor_test.html | 61 +- .../app/elements/edit/gr-edit-constants.js | 58 +- .../edit/gr-edit-controls/gr-edit-controls.js | 459 +- .../gr-edit-controls/gr-edit-controls_html.js | 134 +- .../gr-edit-controls_test.html | 701 +-- .../gr-edit-file-controls.js | 103 +- .../gr-edit-file-controls_html.js | 56 +- .../gr-edit-file-controls_test.html | 167 +- .../edit/gr-editor-view/gr-editor-view.js | 508 +- .../gr-editor-view/gr-editor-view_html.js | 77 +- .../gr-editor-view/gr-editor-view_test.html | 759 +-- polygerrit-ui/app/elements/gr-app-element.js | 1021 ++-- .../app/elements/gr-app-element_html.js | 142 +- polygerrit-ui/app/elements/gr-app.html | 1 + polygerrit-ui/app/elements/gr-app.js | 45 +- polygerrit-ui/app/elements/gr-app_html.js | 55 +- polygerrit-ui/app/elements/gr-app_test.html | 141 +- .../plugins/gr-admin-api/gr-admin-api.html | 18 - .../gr-admin-api/gr-admin-api_test.html | 105 +- .../gr-attribute-helper.html | 22 - .../gr-attribute-helper.js | 10 + .../gr-attribute-helper_test.html | 143 +- .../gr-change-metadata-api.html | 22 - .../gr-change-metadata-api.js | 10 + .../plugins/gr-dom-hooks/gr-dom-hooks.html | 22 - .../plugins/gr-dom-hooks/gr-dom-hooks.js | 11 + .../gr-dom-hooks/gr-dom-hooks_test.html | 259 +- .../gr-endpoint-decorator.js | 294 +- .../gr-endpoint-decorator_html.js | 43 +- .../gr-endpoint-decorator_test.html | 276 +- .../gr-endpoint-param/gr-endpoint-param.html | 22 - .../gr-endpoint-param/gr-endpoint-param.js | 68 +- .../gr-event-helper/gr-event-helper.html | 23 - .../gr-event-helper/gr-event-helper.js | 11 + .../gr-event-helper/gr-event-helper_test.html | 212 +- .../gr-external-style/gr-external-style.js | 158 +- .../gr-external-style_html.js | 43 +- .../gr-external-style_test.html | 186 +- .../gr-plugin-host/gr-plugin-host.html | 24 - .../plugins/gr-plugin-host/gr-plugin-host.js | 106 +- .../gr-plugin-host/gr-plugin-host_test.html | 133 +- .../gr-popup-interface/gr-plugin-popup.js | 16 +- .../gr-plugin-popup_html.js | 45 +- .../gr-plugin-popup_test.html | 85 +- .../gr-popup-interface.html | 23 - .../gr-popup-interface/gr-popup-interface.js | 20 +- .../gr-popup-interface_test.html | 173 +- .../gr-repo-api/gr-plugin-repo-command.js | 64 +- .../plugins/gr-repo-api/gr-repo-api.html | 23 - .../plugins/gr-repo-api/gr-repo-api.js | 11 + .../plugins/gr-repo-api/gr-repo-api_test.html | 109 +- .../gr-settings-api/gr-settings-api.html | 25 - .../gr-settings-api/gr-settings-api.js | 13 + .../gr-settings-api/gr-settings-api_test.html | 107 +- .../plugins/gr-styles-api/gr-styles-api.html | 18 - .../gr-styles-api/gr-styles-api_test.html | 261 +- .../gr-theme-api/gr-custom-plugin-header.js | 63 +- .../plugins/gr-theme-api/gr-theme-api.html | 23 - .../plugins/gr-theme-api/gr-theme-api.js | 11 + .../gr-theme-api/gr-theme-api_test.html | 103 +- .../gr-account-info/gr-account-info.js | 363 +- .../gr-account-info/gr-account-info_html.js | 112 +- .../gr-account-info/gr-account-info_test.html | 560 +- .../gr-agreements-list/gr-agreements-list.js | 84 +- .../gr-agreements-list_html.js | 50 +- .../gr-agreements-list_test.html | 78 +- .../gr-change-table-editor.js | 139 +- .../gr-change-table-editor_html.js | 65 +- .../gr-change-table-editor_test.html | 281 +- .../settings/gr-cla-view/gr-cla-view.js | 275 +- .../settings/gr-cla-view/gr-cla-view_html.js | 73 +- .../gr-cla-view/gr-cla-view_test.html | 318 +- .../gr-edit-preferences.js | 142 +- .../gr-edit-preferences_html.js | 134 +- .../gr-edit-preferences_test.html | 179 +- .../gr-email-editor/gr-email-editor.js | 158 +- .../gr-email-editor/gr-email-editor_html.js | 69 +- .../gr-email-editor/gr-email-editor_test.html | 201 +- .../settings/gr-gpg-editor/gr-gpg-editor.js | 195 +- .../gr-gpg-editor/gr-gpg-editor_html.js | 85 +- .../gr-gpg-editor/gr-gpg-editor_test.html | 312 +- .../settings/gr-group-list/gr-group-list.js | 69 +- .../gr-group-list/gr-group-list_html.js | 48 +- .../gr-group-list/gr-group-list_test.html | 164 +- .../gr-http-password/gr-http-password.js | 111 +- .../gr-http-password/gr-http-password_html.js | 74 +- .../gr-http-password_test.html | 108 +- .../settings/gr-identities/gr-identities.js | 183 +- .../gr-identities/gr-identities_html.js | 66 +- .../gr-identities/gr-identities_test.html | 290 +- .../settings/gr-menu-editor/gr-menu-editor.js | 130 +- .../gr-menu-editor/gr-menu-editor_html.js | 95 +- .../gr-menu-editor/gr-menu-editor_test.html | 256 +- .../gr-registration-dialog.js | 277 +- .../gr-registration-dialog_html.js | 88 +- .../gr-registration-dialog_test.html | 275 +- .../gr-settings-view/gr-settings-item.js | 34 +- .../gr-settings-view/gr-settings-item_html.js | 42 +- .../gr-settings-view/gr-settings-menu-item.js | 36 +- .../gr-settings-menu-item_html.js | 45 +- .../gr-settings-view/gr-settings-view.js | 887 +-- .../gr-settings-view/gr-settings-view_html.js | 285 +- .../gr-settings-view_test.html | 878 +-- .../settings/gr-ssh-editor/gr-ssh-editor.js | 185 +- .../gr-ssh-editor/gr-ssh-editor_html.js | 88 +- .../gr-ssh-editor/gr-ssh-editor_test.html | 284 +- .../gr-watched-projects-editor.js | 332 +- .../gr-watched-projects-editor_html.js | 92 +- .../gr-watched-projects-editor_test.html | 353 +- .../shared/gr-account-chip/gr-account-chip.js | 154 +- .../gr-account-chip/gr-account-chip_html.js | 63 +- .../gr-account-entry/gr-account-entry.js | 171 +- .../gr-account-entry/gr-account-entry_html.js | 59 +- .../gr-account-entry_test.html | 161 +- .../gr-account-label/gr-account-label.js | 237 +- .../gr-account-label/gr-account-label_html.js | 59 +- .../gr-account-label_test.html | 287 +- .../shared/gr-account-link/gr-account-link.js | 72 +- .../gr-account-link/gr-account-link_html.js | 52 +- .../gr-account-link/gr-account-link_test.html | 103 +- .../shared/gr-account-list/gr-account-list.js | 629 +- .../gr-account-list/gr-account-list_html.js | 64 +- .../gr-account-list/gr-account-list_test.html | 969 +-- .../app/elements/shared/gr-alert/gr-alert.js | 164 +- .../elements/shared/gr-alert/gr-alert_html.js | 55 +- .../shared/gr-alert/gr-alert_test.html | 72 +- .../gr-autocomplete-dropdown.js | 338 +- .../gr-autocomplete-dropdown_html.js | 74 +- .../gr-autocomplete-dropdown_test.html | 244 +- .../shared/gr-autocomplete/gr-autocomplete.js | 836 +-- .../gr-autocomplete/gr-autocomplete_html.js | 78 +- .../gr-autocomplete/gr-autocomplete_test.html | 1122 ++-- .../elements/shared/gr-avatar/gr-avatar.js | 160 +- .../shared/gr-avatar/gr-avatar_html.js | 46 +- .../shared/gr-avatar/gr-avatar_test.html | 279 +- .../elements/shared/gr-button/gr-button.js | 229 +- .../shared/gr-button/gr-button_html.js | 53 +- .../shared/gr-button/gr-button_test.html | 284 +- .../shared/gr-change-star/gr-change-star.js | 89 +- .../gr-change-star/gr-change-star_html.js | 48 +- .../gr-change-star/gr-change-star_test.html | 111 +- .../gr-change-status/gr-change-status.js | 152 +- .../gr-change-status/gr-change-status_html.js | 56 +- .../gr-change-status_test.html | 215 +- .../gr-comment-thread/gr-comment-thread.js | 1017 ++-- .../gr-comment-thread_html.js | 101 +- .../gr-comment-thread_test.html | 1415 ++--- .../elements/shared/gr-comment/gr-comment.js | 1484 ++--- .../shared/gr-comment/gr-comment_html.js | 179 +- .../shared/gr-comment/gr-comment_test.html | 2322 +++---- .../gr-confirm-delete-comment-dialog.js | 100 +- .../gr-confirm-delete-comment-dialog_html.js | 58 +- .../gr-copy-clipboard/gr-copy-clipboard.js | 118 +- .../gr-copy-clipboard_html.js | 69 +- .../gr-copy-clipboard_test.html | 156 +- .../gr-count-string-formatter.js | 108 +- .../gr-count-string-formatter_test.html | 68 +- .../gr-cursor-manager/gr-cursor-manager.js | 798 +-- .../gr-cursor-manager_html.js | 40 +- .../gr-cursor-manager_test.html | 463 +- .../gr-date-formatter/gr-date-formatter.js | 454 +- .../gr-date-formatter_html.js | 47 +- .../gr-date-formatter_test.html | 827 +-- .../elements/shared/gr-dialog/gr-dialog.js | 161 +- .../shared/gr-dialog/gr-dialog_html.js | 49 +- .../shared/gr-dialog/gr-dialog_test.html | 139 +- .../gr-diff-preferences.js | 134 +- .../gr-diff-preferences_html.js | 147 +- .../gr-diff-preferences_test.html | 175 +- .../gr-download-commands.js | 145 +- .../gr-download-commands_html.js | 67 +- .../gr-download-commands_test.html | 233 +- .../gr-dropdown-list/gr-dropdown-list.js | 238 +- .../gr-dropdown-list/gr-dropdown-list_html.js | 88 +- .../gr-dropdown-list_test.html | 254 +- .../shared/gr-dropdown/gr-dropdown.js | 595 +- .../shared/gr-dropdown/gr-dropdown_html.js | 106 +- .../shared/gr-dropdown/gr-dropdown_test.html | 340 +- .../gr-editable-content.js | 293 +- .../gr-editable-content_html.js | 64 +- .../gr-editable-content_test.html | 249 +- .../gr-editable-label/gr-editable-label.js | 370 +- .../gr-editable-label_html.js | 71 +- .../gr-editable-label_test.html | 400 +- .../gr-event-interface_test.html | 219 +- .../shared/gr-fixed-panel/gr-fixed-panel.js | 422 +- .../gr-fixed-panel/gr-fixed-panel_html.js | 45 +- .../gr-fixed-panel/gr-fixed-panel_test.html | 155 +- .../gr-formatted-text/gr-formatted-text.js | 558 +- .../gr-formatted-text_html.js | 43 +- .../gr-formatted-text_test.html | 795 +-- .../shared/gr-hovercard/gr-hovercard.js | 619 +- .../shared/gr-hovercard/gr-hovercard_html.js | 45 +- .../gr-hovercard/gr-hovercard_test.html | 184 +- .../app/elements/shared/gr-icons/gr-icons.js | 132 +- .../gr-annotation-actions-context_test.html | 147 +- .../gr-annotation-actions-js-api_test.html | 308 +- .../gr-api-utils_test.html | 113 +- .../gr-change-actions-js-api_test.html | 336 +- .../gr-change-reply-js-api_test.html | 161 +- .../gr-js-api-interface/gr-gerrit_test.html | 135 +- .../gr-js-api-interface-element.html | 24 - .../gr-js-api-interface-element.js | 581 +- .../gr-js-api-interface.html | 51 - .../gr-js-api-interface.js | 58 + .../gr-js-api-interface_test.html | 1023 ++-- .../gr-plugin-action-context_test.html | 244 +- .../gr-plugin-endpoints_test.html | 239 +- .../gr-plugin-loader_test.html | 1033 ++-- .../gr-plugin-rest-api_test.html | 258 +- .../shared/gr-label-info/gr-label-info.js | 296 +- .../gr-label-info/gr-label-info_html.js | 79 +- .../gr-label-info/gr-label-info_test.html | 404 +- .../app/elements/shared/gr-label/gr-label.js | 37 +- .../elements/shared/gr-label/gr-label_html.js | 41 +- .../gr-labeled-autocomplete.js | 123 +- .../gr-labeled-autocomplete_html.js | 51 +- .../gr-labeled-autocomplete_test.html | 73 +- .../shared/gr-lib-loader/gr-lib-loader.js | 298 +- .../gr-lib-loader/gr-lib-loader_html.js | 42 +- .../gr-lib-loader/gr-lib-loader_test.html | 211 +- .../shared/gr-limited-text/gr-limited-text.js | 169 +- .../gr-limited-text/gr-limited-text_html.js | 43 +- .../gr-limited-text/gr-limited-text_test.html | 153 +- .../shared/gr-linked-chip/gr-linked-chip.js | 96 +- .../gr-linked-chip/gr-linked-chip_html.js | 64 +- .../gr-linked-chip/gr-linked-chip_test.html | 63 +- .../shared/gr-linked-text/gr-linked-text.js | 215 +- .../gr-linked-text/gr-linked-text_html.js | 47 +- .../gr-linked-text/gr-linked-text_test.html | 694 +-- .../shared/gr-list-view/gr-list-view.js | 205 +- .../shared/gr-list-view/gr-list-view_html.js | 72 +- .../gr-list-view/gr-list-view_test.html | 267 +- .../elements/shared/gr-overlay/gr-overlay.js | 193 +- .../shared/gr-overlay/gr-overlay_html.js | 45 +- .../shared/gr-overlay/gr-overlay_test.html | 115 +- .../shared/gr-page-nav/gr-page-nav.js | 113 +- .../shared/gr-page-nav/gr-page-nav_html.js | 43 +- .../shared/gr-page-nav/gr-page-nav_test.html | 117 +- .../gr-repo-branch-picker.js | 208 +- .../gr-repo-branch-picker_html.js | 62 +- .../gr-repo-branch-picker_test.html | 225 +- .../gr-rest-api-interface/gr-auth_test.html | 665 +- .../gr-etag-decorator.html | 22 - .../gr-etag-decorator.js | 10 + .../gr-etag-decorator_test.html | 148 +- .../gr-rest-api-interface.html | 37 - .../gr-rest-api-interface.js | 5407 +++++++++-------- .../gr-rest-api-interface_test.html | 2765 ++++----- .../gr-rest-apis/gr-rest-api-helper_test.html | 295 +- .../gr-reviewer-updates-parser_test.html | 547 +- .../mock-diff-response_test.js | 167 + .../elements/shared/gr-select/gr-select.html | 24 - .../elements/shared/gr-select/gr-select.js | 144 +- .../shared/gr-select/gr-select_test.html | 141 +- .../gr-shell-command/gr-shell-command.js | 43 +- .../gr-shell-command/gr-shell-command_html.js | 46 +- .../gr-shell-command_test.html | 69 +- .../shared/gr-storage/gr-storage.html | 20 - .../elements/shared/gr-storage/gr-storage.js | 260 +- .../shared/gr-storage/gr-storage_test.html | 337 +- .../shared/gr-textarea/gr-textarea.js | 626 +- .../shared/gr-textarea/gr-textarea_html.js | 72 +- .../shared/gr-textarea/gr-textarea_test.html | 643 +- .../gr-tooltip-content/gr-tooltip-content.js | 60 +- .../gr-tooltip-content_html.js | 46 +- .../gr-tooltip-content_test.html | 70 +- .../elements/shared/gr-tooltip/gr-tooltip.js | 56 +- .../shared/gr-tooltip/gr-tooltip_html.js | 43 +- .../shared/gr-tooltip/gr-tooltip_test.html | 81 +- .../shared/revision-info/revision-info.js | 159 +- .../revision-info/revision-info_test.html | 130 +- .../gr-display-name-utils_test.html | 226 +- .../gr-email-suggestions-provider_test.html | 133 +- .../gr-group-suggestions-provider_test.html | 149 +- ...gr-reviewer-suggestions-provider_test.html | 431 +- .../app/styles/dashboard-header-styles.js | 46 +- .../app/styles/gr-change-list-styles.js | 45 +- .../gr-change-metadata-shared-styles.js | 45 +- ...r-change-view-integration-shared-styles.js | 63 +- polygerrit-ui/app/styles/gr-form-styles.js | 45 +- .../app/styles/gr-menu-page-styles.js | 45 +- .../app/styles/gr-page-nav-styles.js | 45 +- polygerrit-ui/app/styles/gr-subpage-styles.js | 45 +- polygerrit-ui/app/styles/gr-table-styles.js | 46 +- polygerrit-ui/app/styles/gr-voting-styles.js | 46 +- polygerrit-ui/app/styles/shared-styles.js | 47 +- polygerrit-ui/app/styles/themes/app-theme.js | 45 +- polygerrit-ui/app/test/common-test-setup.js | 113 +- polygerrit-ui/app/test/test-router.js | 39 +- 600 files changed, 99000 insertions(+), 99742 deletions(-) delete mode 100644 polygerrit-ui/app/behaviors/gr-tooltip-behavior/gr-tooltip-behavior.html delete mode 100644 polygerrit-ui/app/elements/core/gr-reporting/gr-reporting.html delete mode 100644 polygerrit-ui/app/elements/diff/gr-diff-processor/gr-diff-processor.html create mode 100644 polygerrit-ui/app/elements/gr-app.html delete mode 100644 polygerrit-ui/app/elements/plugins/gr-admin-api/gr-admin-api.html delete mode 100644 polygerrit-ui/app/elements/plugins/gr-attribute-helper/gr-attribute-helper.html delete mode 100644 polygerrit-ui/app/elements/plugins/gr-change-metadata-api/gr-change-metadata-api.html delete mode 100644 polygerrit-ui/app/elements/plugins/gr-dom-hooks/gr-dom-hooks.html delete mode 100644 polygerrit-ui/app/elements/plugins/gr-endpoint-param/gr-endpoint-param.html delete mode 100644 polygerrit-ui/app/elements/plugins/gr-event-helper/gr-event-helper.html delete mode 100644 polygerrit-ui/app/elements/plugins/gr-plugin-host/gr-plugin-host.html delete mode 100644 polygerrit-ui/app/elements/plugins/gr-popup-interface/gr-popup-interface.html delete mode 100644 polygerrit-ui/app/elements/plugins/gr-repo-api/gr-repo-api.html delete mode 100644 polygerrit-ui/app/elements/plugins/gr-settings-api/gr-settings-api.html delete mode 100644 polygerrit-ui/app/elements/plugins/gr-styles-api/gr-styles-api.html delete mode 100644 polygerrit-ui/app/elements/plugins/gr-theme-api/gr-theme-api.html delete mode 100644 polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-js-api-interface-element.html delete mode 100644 polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-js-api-interface.html create mode 100644 polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-js-api-interface.js delete mode 100644 polygerrit-ui/app/elements/shared/gr-rest-api-interface/gr-etag-decorator.html delete mode 100644 polygerrit-ui/app/elements/shared/gr-rest-api-interface/gr-rest-api-interface.html create mode 100644 polygerrit-ui/app/elements/shared/gr-rest-api-interface/mock-diff-response_test.js delete mode 100644 polygerrit-ui/app/elements/shared/gr-select/gr-select.html delete mode 100644 polygerrit-ui/app/elements/shared/gr-storage/gr-storage.html diff --git a/polygerrit-ui/app/behaviors/async-foreach-behavior/async-foreach-behavior.js b/polygerrit-ui/app/behaviors/async-foreach-behavior/async-foreach-behavior.js index f560ea8fe0..5e6f7c6e12 100644 --- a/polygerrit-ui/app/behaviors/async-foreach-behavior/async-foreach-behavior.js +++ b/polygerrit-ui/app/behaviors/async-foreach-behavior/async-foreach-behavior.js @@ -1,21 +1,19 @@ - - - diff --git a/polygerrit-ui/app/behaviors/async-foreach-behavior/async-foreach-behavior_test.html b/polygerrit-ui/app/behaviors/async-foreach-behavior/async-foreach-behavior_test.html index f2f0e6b911..fa5409ba1b 100644 --- a/polygerrit-ui/app/behaviors/async-foreach-behavior/async-foreach-behavior_test.html +++ b/polygerrit-ui/app/behaviors/async-foreach-behavior/async-foreach-behavior_test.html @@ -19,40 +19,42 @@ limitations under the License. async-foreach-behavior - + - - - - - + + + + + - diff --git a/polygerrit-ui/app/behaviors/base-url-behavior/base-url-behavior.js b/polygerrit-ui/app/behaviors/base-url-behavior/base-url-behavior.js index 92596e0e1a..9682776400 100644 --- a/polygerrit-ui/app/behaviors/base-url-behavior/base-url-behavior.js +++ b/polygerrit-ui/app/behaviors/base-url-behavior/base-url-behavior.js @@ -1,21 +1,19 @@ - - - diff --git a/polygerrit-ui/app/behaviors/base-url-behavior/base-url-behavior_test.html b/polygerrit-ui/app/behaviors/base-url-behavior/base-url-behavior_test.html index eb6fd3f0d6..4f6f1f58fd 100644 --- a/polygerrit-ui/app/behaviors/base-url-behavior/base-url-behavior_test.html +++ b/polygerrit-ui/app/behaviors/base-url-behavior/base-url-behavior_test.html @@ -19,17 +19,20 @@ limitations under the License. base-url-behavior - + - - - - - + + + + - + - diff --git a/polygerrit-ui/app/behaviors/docs-url-behavior/docs-url-behavior.js b/polygerrit-ui/app/behaviors/docs-url-behavior/docs-url-behavior.js index 05a7a5852d..01bcc87156 100644 --- a/polygerrit-ui/app/behaviors/docs-url-behavior/docs-url-behavior.js +++ b/polygerrit-ui/app/behaviors/docs-url-behavior/docs-url-behavior.js @@ -1,21 +1,21 @@ - - - diff --git a/polygerrit-ui/app/behaviors/docs-url-behavior/docs-url-behavior_test.html b/polygerrit-ui/app/behaviors/docs-url-behavior/docs-url-behavior_test.html index e480e30df8..4b72748b52 100644 --- a/polygerrit-ui/app/behaviors/docs-url-behavior/docs-url-behavior_test.html +++ b/polygerrit-ui/app/behaviors/docs-url-behavior/docs-url-behavior_test.html @@ -15,17 +15,22 @@ See the License for the specific language governing permissions and limitations under the License. --> - - - - + + + + docs-url-behavior - + - + - + - diff --git a/polygerrit-ui/app/behaviors/dom-util-behavior/dom-util-behavior.js b/polygerrit-ui/app/behaviors/dom-util-behavior/dom-util-behavior.js index 1377627ac5..1607ba832a 100644 --- a/polygerrit-ui/app/behaviors/dom-util-behavior/dom-util-behavior.js +++ b/polygerrit-ui/app/behaviors/dom-util-behavior/dom-util-behavior.js @@ -1,20 +1,19 @@ - - diff --git a/polygerrit-ui/app/behaviors/dom-util-behavior/dom-util-behavior_test.html b/polygerrit-ui/app/behaviors/dom-util-behavior/dom-util-behavior_test.html index 9acc749ae0..09a7cc6133 100644 --- a/polygerrit-ui/app/behaviors/dom-util-behavior/dom-util-behavior_test.html +++ b/polygerrit-ui/app/behaviors/dom-util-behavior/dom-util-behavior_test.html @@ -19,13 +19,13 @@ limitations under the License. dom-util-behavior - + - - - - - + + + + + - diff --git a/polygerrit-ui/app/behaviors/fire-behavior/fire-behavior.js b/polygerrit-ui/app/behaviors/fire-behavior/fire-behavior.js index 5b3d4203b6..9e9df1d05e 100644 --- a/polygerrit-ui/app/behaviors/fire-behavior/fire-behavior.js +++ b/polygerrit-ui/app/behaviors/fire-behavior/fire-behavior.js @@ -1,21 +1,19 @@ - - - diff --git a/polygerrit-ui/app/behaviors/gr-access-behavior/gr-access-behavior.js b/polygerrit-ui/app/behaviors/gr-access-behavior/gr-access-behavior.js index 7f017897f7..18cd35684b 100644 --- a/polygerrit-ui/app/behaviors/gr-access-behavior/gr-access-behavior.js +++ b/polygerrit-ui/app/behaviors/gr-access-behavior/gr-access-behavior.js @@ -1,21 +1,19 @@ - - - diff --git a/polygerrit-ui/app/behaviors/gr-access-behavior/gr-access-behavior_test.html b/polygerrit-ui/app/behaviors/gr-access-behavior/gr-access-behavior_test.html index f4b3ab003a..e989a7408d 100644 --- a/polygerrit-ui/app/behaviors/gr-access-behavior/gr-access-behavior_test.html +++ b/polygerrit-ui/app/behaviors/gr-access-behavior/gr-access-behavior_test.html @@ -19,13 +19,13 @@ limitations under the License. keyboard-shortcut-behavior - + - - - - - + + + + + - diff --git a/polygerrit-ui/app/behaviors/gr-admin-nav-behavior/gr-admin-nav-behavior.js b/polygerrit-ui/app/behaviors/gr-admin-nav-behavior/gr-admin-nav-behavior.js index 49160daf25..90800a37d6 100644 --- a/polygerrit-ui/app/behaviors/gr-admin-nav-behavior/gr-admin-nav-behavior.js +++ b/polygerrit-ui/app/behaviors/gr-admin-nav-behavior/gr-admin-nav-behavior.js @@ -1,20 +1,19 @@ - - diff --git a/polygerrit-ui/app/behaviors/gr-admin-nav-behavior/gr-admin-nav-behavior_test.html b/polygerrit-ui/app/behaviors/gr-admin-nav-behavior/gr-admin-nav-behavior_test.html index 7c179b8392..c2659bbd66 100644 --- a/polygerrit-ui/app/behaviors/gr-admin-nav-behavior/gr-admin-nav-behavior_test.html +++ b/polygerrit-ui/app/behaviors/gr-admin-nav-behavior/gr-admin-nav-behavior_test.html @@ -19,13 +19,13 @@ limitations under the License. keyboard-shortcut-behavior - + - - - - - + + + + + - diff --git a/polygerrit-ui/app/behaviors/gr-change-table-behavior/gr-change-table-behavior.js b/polygerrit-ui/app/behaviors/gr-change-table-behavior/gr-change-table-behavior.js index d03316abed..d12b2791c2 100644 --- a/polygerrit-ui/app/behaviors/gr-change-table-behavior/gr-change-table-behavior.js +++ b/polygerrit-ui/app/behaviors/gr-change-table-behavior/gr-change-table-behavior.js @@ -1,20 +1,19 @@ - - diff --git a/polygerrit-ui/app/behaviors/gr-change-table-behavior/gr-change-table-behavior_test.html b/polygerrit-ui/app/behaviors/gr-change-table-behavior/gr-change-table-behavior_test.html index a8d40410dc..c314c185a3 100644 --- a/polygerrit-ui/app/behaviors/gr-change-table-behavior/gr-change-table-behavior_test.html +++ b/polygerrit-ui/app/behaviors/gr-change-table-behavior/gr-change-table-behavior_test.html @@ -19,13 +19,13 @@ limitations under the License. keyboard-shortcut-behavior - + - - - - - + + + + + - diff --git a/polygerrit-ui/app/behaviors/gr-display-name-behavior/gr-display-name-behavior.js b/polygerrit-ui/app/behaviors/gr-display-name-behavior/gr-display-name-behavior.js index e5ded0eafd..1ba8fd997f 100644 --- a/polygerrit-ui/app/behaviors/gr-display-name-behavior/gr-display-name-behavior.js +++ b/polygerrit-ui/app/behaviors/gr-display-name-behavior/gr-display-name-behavior.js @@ -1,23 +1,21 @@ - - - - - diff --git a/polygerrit-ui/app/behaviors/gr-display-name-behavior/gr-display-name-behavior_test.html b/polygerrit-ui/app/behaviors/gr-display-name-behavior/gr-display-name-behavior_test.html index 931f6fab99..863f708cd1 100644 --- a/polygerrit-ui/app/behaviors/gr-display-name-behavior/gr-display-name-behavior_test.html +++ b/polygerrit-ui/app/behaviors/gr-display-name-behavior/gr-display-name-behavior_test.html @@ -19,13 +19,13 @@ limitations under the License. gr-display-name-behavior - + - - - - - + + + + + - diff --git a/polygerrit-ui/app/behaviors/gr-list-view-behavior/gr-list-view-behavior.js b/polygerrit-ui/app/behaviors/gr-list-view-behavior/gr-list-view-behavior.js index 06912d5d7c..6e64a4d602 100644 --- a/polygerrit-ui/app/behaviors/gr-list-view-behavior/gr-list-view-behavior.js +++ b/polygerrit-ui/app/behaviors/gr-list-view-behavior/gr-list-view-behavior.js @@ -1,22 +1,22 @@ - - - - diff --git a/polygerrit-ui/app/behaviors/gr-list-view-behavior/gr-list-view-behavior_test.html b/polygerrit-ui/app/behaviors/gr-list-view-behavior/gr-list-view-behavior_test.html index c2cb0738a6..37577df816 100644 --- a/polygerrit-ui/app/behaviors/gr-list-view-behavior/gr-list-view-behavior_test.html +++ b/polygerrit-ui/app/behaviors/gr-list-view-behavior/gr-list-view-behavior_test.html @@ -19,13 +19,13 @@ limitations under the License. keyboard-shortcut-behavior - + - - - - - + + + + + - diff --git a/polygerrit-ui/app/behaviors/gr-patch-set-behavior/gr-patch-set-behavior.js b/polygerrit-ui/app/behaviors/gr-patch-set-behavior/gr-patch-set-behavior.js index 61e6b0a86b..b36375e68b 100644 --- a/polygerrit-ui/app/behaviors/gr-patch-set-behavior/gr-patch-set-behavior.js +++ b/polygerrit-ui/app/behaviors/gr-patch-set-behavior/gr-patch-set-behavior.js @@ -1,20 +1,19 @@ - - diff --git a/polygerrit-ui/app/behaviors/gr-patch-set-behavior/gr-patch-set-behavior_test.html b/polygerrit-ui/app/behaviors/gr-patch-set-behavior/gr-patch-set-behavior_test.html index d9adb8bcd9..8e05228c1a 100644 --- a/polygerrit-ui/app/behaviors/gr-patch-set-behavior/gr-patch-set-behavior_test.html +++ b/polygerrit-ui/app/behaviors/gr-patch-set-behavior/gr-patch-set-behavior_test.html @@ -15,313 +15,315 @@ See the License for the specific language governing permissions and limitations under the License. --> - - - - + + + + gr-patch-set-behavior - + - + - diff --git a/polygerrit-ui/app/behaviors/gr-path-list-behavior/gr-path-list-behavior.js b/polygerrit-ui/app/behaviors/gr-path-list-behavior/gr-path-list-behavior.js index 67e4ca6d99..9ec7c8e59d 100644 --- a/polygerrit-ui/app/behaviors/gr-path-list-behavior/gr-path-list-behavior.js +++ b/polygerrit-ui/app/behaviors/gr-path-list-behavior/gr-path-list-behavior.js @@ -1,21 +1,21 @@ - - - diff --git a/polygerrit-ui/app/behaviors/gr-path-list-behavior/gr-path-list-behavior_test.html b/polygerrit-ui/app/behaviors/gr-path-list-behavior/gr-path-list-behavior_test.html index 740a8c8f0b..8395ce90fe 100644 --- a/polygerrit-ui/app/behaviors/gr-path-list-behavior/gr-path-list-behavior_test.html +++ b/polygerrit-ui/app/behaviors/gr-path-list-behavior/gr-path-list-behavior_test.html @@ -15,89 +15,91 @@ See the License for the specific language governing permissions and limitations under the License. --> - - - - + + + + gr-path-list-behavior - + - + - diff --git a/polygerrit-ui/app/behaviors/gr-repo-plugin-config-behavior/gr-repo-plugin-config-behavior.js b/polygerrit-ui/app/behaviors/gr-repo-plugin-config-behavior/gr-repo-plugin-config-behavior.js index 69ebf23371..3758b79902 100644 --- a/polygerrit-ui/app/behaviors/gr-repo-plugin-config-behavior/gr-repo-plugin-config-behavior.js +++ b/polygerrit-ui/app/behaviors/gr-repo-plugin-config-behavior/gr-repo-plugin-config-behavior.js @@ -1,20 +1,19 @@ - - diff --git a/polygerrit-ui/app/behaviors/gr-tooltip-behavior/gr-tooltip-behavior.html b/polygerrit-ui/app/behaviors/gr-tooltip-behavior/gr-tooltip-behavior.html deleted file mode 100644 index 0e2e99fdca..0000000000 --- a/polygerrit-ui/app/behaviors/gr-tooltip-behavior/gr-tooltip-behavior.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - diff --git a/polygerrit-ui/app/behaviors/gr-tooltip-behavior/gr-tooltip-behavior.js b/polygerrit-ui/app/behaviors/gr-tooltip-behavior/gr-tooltip-behavior.js index b65c63bb34..481642b596 100644 --- a/polygerrit-ui/app/behaviors/gr-tooltip-behavior/gr-tooltip-behavior.js +++ b/polygerrit-ui/app/behaviors/gr-tooltip-behavior/gr-tooltip-behavior.js @@ -14,6 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import '../../scripts/bundled-polymer.js'; + +import '../../elements/shared/gr-tooltip/gr-tooltip.js'; +import '../../scripts/rootElement.js'; +import {flush} from '@polymer/polymer/lib/legacy/polymer.dom.js'; + (function(window) { 'use strict'; @@ -135,7 +141,7 @@ _positionTooltip(tooltip) { // This flush is needed for tooltips to be positioned correctly in Firefox // and Safari. - Polymer.dom.flush(); + flush(); const rect = this.getBoundingClientRect(); const boxRect = tooltip.getBoundingClientRect(); const parentRect = tooltip.parentElement.getBoundingClientRect(); diff --git a/polygerrit-ui/app/behaviors/gr-tooltip-behavior/gr-tooltip-behavior_test.html b/polygerrit-ui/app/behaviors/gr-tooltip-behavior/gr-tooltip-behavior_test.html index e0218ad4eb..7387a176d7 100644 --- a/polygerrit-ui/app/behaviors/gr-tooltip-behavior/gr-tooltip-behavior_test.html +++ b/polygerrit-ui/app/behaviors/gr-tooltip-behavior/gr-tooltip-behavior_test.html @@ -18,15 +18,20 @@ limitations under the License. tooltip-behavior - + - - - - - + + + + + - + - diff --git a/polygerrit-ui/app/behaviors/gr-url-encoding-behavior/gr-url-encoding-behavior.js b/polygerrit-ui/app/behaviors/gr-url-encoding-behavior/gr-url-encoding-behavior.js index 0396c4ffe2..8b139dada0 100644 --- a/polygerrit-ui/app/behaviors/gr-url-encoding-behavior/gr-url-encoding-behavior.js +++ b/polygerrit-ui/app/behaviors/gr-url-encoding-behavior/gr-url-encoding-behavior.js @@ -1,20 +1,19 @@ - - diff --git a/polygerrit-ui/app/behaviors/gr-url-encoding-behavior/gr-url-encoding-behavior_test.html b/polygerrit-ui/app/behaviors/gr-url-encoding-behavior/gr-url-encoding-behavior_test.html index b7a1d92f30..94d6c12d0e 100644 --- a/polygerrit-ui/app/behaviors/gr-url-encoding-behavior/gr-url-encoding-behavior_test.html +++ b/polygerrit-ui/app/behaviors/gr-url-encoding-behavior/gr-url-encoding-behavior_test.html @@ -18,15 +18,20 @@ limitations under the License. gr-url-encoding-behavior - + - - - - - + + + + + - + - diff --git a/polygerrit-ui/app/behaviors/keyboard-shortcut-behavior/keyboard-shortcut-behavior.js b/polygerrit-ui/app/behaviors/keyboard-shortcut-behavior/keyboard-shortcut-behavior.js index a22c3ba495..360a85b5f7 100644 --- a/polygerrit-ui/app/behaviors/keyboard-shortcut-behavior/keyboard-shortcut-behavior.js +++ b/polygerrit-ui/app/behaviors/keyboard-shortcut-behavior/keyboard-shortcut-behavior.js @@ -1,21 +1,20 @@ - - - - - - +*/ +/* + FIXME(polymer-modulizer): the above comments were extracted + from HTML and may be out of place here. Review them and + then delete this comment! +*/ +import '../../scripts/bundled-polymer.js'; - diff --git a/polygerrit-ui/app/behaviors/keyboard-shortcut-behavior/keyboard-shortcut-behavior_test.html b/polygerrit-ui/app/behaviors/keyboard-shortcut-behavior/keyboard-shortcut-behavior_test.html index e7407f7d65..f7231fbb35 100644 --- a/polygerrit-ui/app/behaviors/keyboard-shortcut-behavior/keyboard-shortcut-behavior_test.html +++ b/polygerrit-ui/app/behaviors/keyboard-shortcut-behavior/keyboard-shortcut-behavior_test.html @@ -19,13 +19,13 @@ limitations under the License. keyboard-shortcut-behavior - + - - - - - + + + + + - diff --git a/polygerrit-ui/app/behaviors/rest-client-behavior/rest-client-behavior.js b/polygerrit-ui/app/behaviors/rest-client-behavior/rest-client-behavior.js index 709cc8a59b..d52ffbf610 100644 --- a/polygerrit-ui/app/behaviors/rest-client-behavior/rest-client-behavior.js +++ b/polygerrit-ui/app/behaviors/rest-client-behavior/rest-client-behavior.js @@ -1,22 +1,22 @@ - - - - diff --git a/polygerrit-ui/app/behaviors/rest-client-behavior/rest-client-behavior_test.html b/polygerrit-ui/app/behaviors/rest-client-behavior/rest-client-behavior_test.html index 4bcd9289c2..af078e5e18 100644 --- a/polygerrit-ui/app/behaviors/rest-client-behavior/rest-client-behavior_test.html +++ b/polygerrit-ui/app/behaviors/rest-client-behavior/rest-client-behavior_test.html @@ -19,19 +19,23 @@ limitations under the License. keyboard-shortcut-behavior - + - - - - - + + + + - - + + - diff --git a/polygerrit-ui/app/behaviors/safe-types-behavior/safe-types-behavior.js b/polygerrit-ui/app/behaviors/safe-types-behavior/safe-types-behavior.js index 8f08f0caba..23f2290ac5 100644 --- a/polygerrit-ui/app/behaviors/safe-types-behavior/safe-types-behavior.js +++ b/polygerrit-ui/app/behaviors/safe-types-behavior/safe-types-behavior.js @@ -1,20 +1,19 @@ - - diff --git a/polygerrit-ui/app/behaviors/safe-types-behavior/safe-types-behavior_test.html b/polygerrit-ui/app/behaviors/safe-types-behavior/safe-types-behavior_test.html index e123c964ac..fc1224f0a0 100644 --- a/polygerrit-ui/app/behaviors/safe-types-behavior/safe-types-behavior_test.html +++ b/polygerrit-ui/app/behaviors/safe-types-behavior/safe-types-behavior_test.html @@ -18,15 +18,20 @@ limitations under the License. safe-types-behavior - + - - - - - + + + + + - + - diff --git a/polygerrit-ui/app/elements/admin/gr-access-section/gr-access-section.js b/polygerrit-ui/app/elements/admin/gr-access-section/gr-access-section.js index a421043a52..cfb28bbbd6 100644 --- a/polygerrit-ui/app/elements/admin/gr-access-section/gr-access-section.js +++ b/polygerrit-ui/app/elements/admin/gr-access-section/gr-access-section.js @@ -14,291 +14,308 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -(function() { - 'use strict'; +import '../../../scripts/bundled-polymer.js'; +import '../../../behaviors/fire-behavior/fire-behavior.js'; +import '../../../behaviors/gr-access-behavior/gr-access-behavior.js'; +import '@polymer/iron-input/iron-input.js'; +import '../../../styles/gr-form-styles.js'; +import '../../../styles/shared-styles.js'; +import '../../shared/gr-button/gr-button.js'; +import '../../shared/gr-icons/gr-icons.js'; +import '../../shared/gr-rest-api-interface/gr-rest-api-interface.js'; +import '../gr-permission/gr-permission.js'; +import '../../../scripts/util.js'; +import {dom} from '@polymer/polymer/lib/legacy/polymer.dom.js'; +import {PolymerElement} from '@polymer/polymer/polymer-element.js'; +import {mixinBehaviors} from '@polymer/polymer/lib/legacy/class.js'; +import {GestureEventListeners} from '@polymer/polymer/lib/mixins/gesture-event-listeners.js'; +import {LegacyElementMixin} from '@polymer/polymer/lib/legacy/legacy-element-mixin.js'; +import {htmlTemplate} from './gr-access-section_html.js'; + +/** + * Fired when the section has been modified or removed. + * + * @event access-modified + */ + +/** + * Fired when a section that was previously added was removed. + * + * @event added-section-removed + */ + +const GLOBAL_NAME = 'GLOBAL_CAPABILITIES'; + +// The name that gets automatically input when a new reference is added. +const NEW_NAME = 'refs/heads/*'; +const REFS_NAME = 'refs/'; +const ON_BEHALF_OF = '(On Behalf Of)'; +const LABEL = 'Label'; + +/** + * @appliesMixin Gerrit.AccessMixin + * @appliesMixin Gerrit.FireMixin + * @extends Polymer.Element + */ +class GrAccessSection extends mixinBehaviors( [ + Gerrit.AccessBehavior, /** - * Fired when the section has been modified or removed. - * - * @event access-modified + * Unused in this element, but called by other elements in tests + * e.g gr-repo-access_test. */ + Gerrit.FireBehavior, +], GestureEventListeners( + LegacyElementMixin( + PolymerElement))) { + static get template() { return htmlTemplate; } - /** - * Fired when a section that was previously added was removed. - * - * @event added-section-removed - */ + static get is() { return 'gr-access-section'; } - const GLOBAL_NAME = 'GLOBAL_CAPABILITIES'; + static get properties() { + return { + capabilities: Object, + /** @type {?} */ + section: { + type: Object, + notify: true, + observer: '_updateSection', + }, + groups: Object, + labels: Object, + editing: { + type: Boolean, + value: false, + observer: '_handleEditingChanged', + }, + canUpload: Boolean, + ownerOf: Array, + _originalId: String, + _editingRef: { + type: Boolean, + value: false, + }, + _deleted: { + type: Boolean, + value: false, + }, + _permissions: Array, + }; + } - // The name that gets automatically input when a new reference is added. - const NEW_NAME = 'refs/heads/*'; - const REFS_NAME = 'refs/'; - const ON_BEHALF_OF = '(On Behalf Of)'; - const LABEL = 'Label'; + /** @override */ + created() { + super.created(); + this.addEventListener('access-saved', + () => this._handleAccessSaved()); + } - /** - * @appliesMixin Gerrit.AccessMixin - * @appliesMixin Gerrit.FireMixin - * @extends Polymer.Element - */ - class GrAccessSection extends Polymer.mixinBehaviors( [ - Gerrit.AccessBehavior, - /** - * Unused in this element, but called by other elements in tests - * e.g gr-repo-access_test. - */ - Gerrit.FireBehavior, - ], Polymer.GestureEventListeners( - Polymer.LegacyElementMixin( - Polymer.Element))) { - static get is() { return 'gr-access-section'; } + _updateSection(section) { + this._permissions = this.toSortedArray(section.value.permissions); + this._originalId = section.id; + } - static get properties() { - return { - capabilities: Object, - /** @type {?} */ - section: { - type: Object, - notify: true, - observer: '_updateSection', - }, - groups: Object, - labels: Object, - editing: { - type: Boolean, - value: false, - observer: '_handleEditingChanged', - }, - canUpload: Boolean, - ownerOf: Array, - _originalId: String, - _editingRef: { - type: Boolean, - value: false, - }, - _deleted: { - type: Boolean, - value: false, - }, - _permissions: Array, - }; + _handleAccessSaved() { + // Set a new 'original' value to keep track of after the value has been + // saved. + this._updateSection(this.section); + } + + _handleValueChange() { + if (!this.section.value.added) { + this.section.value.modified = this.section.id !== this._originalId; + // Allows overall access page to know a change has been made. + // For a new section, this is not fired because new permissions and + // rules have to be added in order to save, modifying the ref is not + // enough. + this.dispatchEvent(new CustomEvent( + 'access-modified', {bubbles: true, composed: true})); } + this.section.value.updatedId = this.section.id; + } - /** @override */ - created() { - super.created(); - this.addEventListener('access-saved', - () => this._handleAccessSaved()); - } - - _updateSection(section) { - this._permissions = this.toSortedArray(section.value.permissions); - this._originalId = section.id; - } - - _handleAccessSaved() { - // Set a new 'original' value to keep track of after the value has been - // saved. - this._updateSection(this.section); - } - - _handleValueChange() { - if (!this.section.value.added) { - this.section.value.modified = this.section.id !== this._originalId; - // Allows overall access page to know a change has been made. - // For a new section, this is not fired because new permissions and - // rules have to be added in order to save, modifying the ref is not - // enough. - this.dispatchEvent(new CustomEvent( - 'access-modified', {bubbles: true, composed: true})); - } - this.section.value.updatedId = this.section.id; - } - - _handleEditingChanged(editing, editingOld) { - // Ignore when editing gets set initially. - if (!editingOld) { return; } - // Restore original values if no longer editing. - if (!editing) { - this._editingRef = false; - this._deleted = false; - delete this.section.value.deleted; - // Restore section ref. - this.set(['section', 'id'], this._originalId); - // Remove any unsaved but added permissions. - this._permissions = this._permissions.filter(p => !p.value.added); - for (const key of Object.keys(this.section.value.permissions)) { - if (this.section.value.permissions[key].added) { - delete this.section.value.permissions[key]; - } - } - } - } - - _computePermissions(name, capabilities, labels) { - let allPermissions; - if (!this.section || !this.section.value) { - return []; - } - if (name === GLOBAL_NAME) { - allPermissions = this.toSortedArray(capabilities); - } else { - const labelOptions = this._computeLabelOptions(labels); - allPermissions = labelOptions.concat( - this.toSortedArray(this.permissionValues)); - } - return allPermissions - .filter(permission => !this.section.value.permissions[permission.id]); - } - - _computeHideEditClass(section) { - return section.id === 'GLOBAL_CAPABILITIES' ? 'hide' : ''; - } - - _handleAddedPermissionRemoved(e) { - const index = e.model.index; - this._permissions = this._permissions.slice(0, index).concat( - this._permissions.slice(index + 1, this._permissions.length)); - } - - _computeLabelOptions(labels) { - const labelOptions = []; - if (!labels) { return []; } - for (const labelName of Object.keys(labels)) { - labelOptions.push({ - id: 'label-' + labelName, - value: { - name: `${LABEL} ${labelName}`, - id: 'label-' + labelName, - }, - }); - labelOptions.push({ - id: 'labelAs-' + labelName, - value: { - name: `${LABEL} ${labelName} ${ON_BEHALF_OF}`, - id: 'labelAs-' + labelName, - }, - }); - } - return labelOptions; - } - - _computePermissionName(name, permission, permissionValues, capabilities) { - if (name === GLOBAL_NAME) { - return capabilities[permission.id].name; - } else if (permissionValues[permission.id]) { - return permissionValues[permission.id].name; - } else if (permission.value.label) { - let behalfOf = ''; - if (permission.id.startsWith('labelAs-')) { - behalfOf = ON_BEHALF_OF; - } - return `${LABEL} ${permission.value.label}${behalfOf}`; - } - } - - _computeSectionName(name) { - // When a new section is created, it doesn't yet have a ref. Set into - // edit mode so that the user can input one. - if (!name) { - this._editingRef = true; - // Needed for the title value. This is the same default as GWT. - name = NEW_NAME; - // Needed for the input field value. - this.set('section.id', name); - } - if (name === GLOBAL_NAME) { - return 'Global Capabilities'; - } else if (name.startsWith(REFS_NAME)) { - return `Reference: ${name}`; - } - return name; - } - - _handleRemoveReference() { - if (this.section.value.added) { - this.dispatchEvent(new CustomEvent( - 'added-section-removed', {bubbles: true, composed: true})); - } - this._deleted = true; - this.section.value.deleted = true; - this.dispatchEvent( - new CustomEvent('access-modified', {bubbles: true, composed: true})); - } - - _handleUndoRemove() { + _handleEditingChanged(editing, editingOld) { + // Ignore when editing gets set initially. + if (!editingOld) { return; } + // Restore original values if no longer editing. + if (!editing) { + this._editingRef = false; this._deleted = false; delete this.section.value.deleted; - } - - editRefInput() { - return Polymer.dom(this.root).querySelector(Polymer.Element ? - 'iron-input.editRefInput' : - 'input[is=iron-input].editRefInput'); - } - - editReference() { - this._editingRef = true; - this.editRefInput().focus(); - } - - _isEditEnabled(canUpload, ownerOf, sectionId) { - return canUpload || (ownerOf && ownerOf.indexOf(sectionId) >= 0); - } - - _computeSectionClass(editing, canUpload, ownerOf, editingRef, deleted) { - const classList = []; - if (editing - && this._isEditEnabled(canUpload, ownerOf, this.section.id)) { - classList.push('editing'); + // Restore section ref. + this.set(['section', 'id'], this._originalId); + // Remove any unsaved but added permissions. + this._permissions = this._permissions.filter(p => !p.value.added); + for (const key of Object.keys(this.section.value.permissions)) { + if (this.section.value.permissions[key].added) { + delete this.section.value.permissions[key]; + } } - if (editingRef) { - classList.push('editingRef'); - } - if (deleted) { - classList.push('deleted'); - } - return classList.join(' '); - } - - _computeEditBtnClass(name) { - return name === GLOBAL_NAME ? 'global' : ''; - } - - _handleAddPermission() { - const value = this.$.permissionSelect.value; - const permission = { - id: value, - value: {rules: {}, added: true}, - }; - - // This is needed to update the 'label' property of the - // 'label-' permission. - // - // The value from the add permission dropdown will either be - // label- or labelAs-. - // But, the format of the API response is as such: - // "permissions": { - // "label-Code-Review": { - // "label": "Code-Review", - // "rules": {...} - // } - // } - // } - // When we add a new item, we have to push the new permission in the same - // format as the ones that have been returned by the API. - if (value.startsWith('label')) { - permission.value.label = - value.replace('label-', '').replace('labelAs-', ''); - } - // Add to the end of the array (used in dom-repeat) and also to the - // section object that is two way bound with its parent element. - this.push('_permissions', permission); - this.set(['section.value.permissions', permission.id], - permission.value); } } - customElements.define(GrAccessSection.is, GrAccessSection); -})(); + _computePermissions(name, capabilities, labels) { + let allPermissions; + if (!this.section || !this.section.value) { + return []; + } + if (name === GLOBAL_NAME) { + allPermissions = this.toSortedArray(capabilities); + } else { + const labelOptions = this._computeLabelOptions(labels); + allPermissions = labelOptions.concat( + this.toSortedArray(this.permissionValues)); + } + return allPermissions + .filter(permission => !this.section.value.permissions[permission.id]); + } + + _computeHideEditClass(section) { + return section.id === 'GLOBAL_CAPABILITIES' ? 'hide' : ''; + } + + _handleAddedPermissionRemoved(e) { + const index = e.model.index; + this._permissions = this._permissions.slice(0, index).concat( + this._permissions.slice(index + 1, this._permissions.length)); + } + + _computeLabelOptions(labels) { + const labelOptions = []; + if (!labels) { return []; } + for (const labelName of Object.keys(labels)) { + labelOptions.push({ + id: 'label-' + labelName, + value: { + name: `${LABEL} ${labelName}`, + id: 'label-' + labelName, + }, + }); + labelOptions.push({ + id: 'labelAs-' + labelName, + value: { + name: `${LABEL} ${labelName} ${ON_BEHALF_OF}`, + id: 'labelAs-' + labelName, + }, + }); + } + return labelOptions; + } + + _computePermissionName(name, permission, permissionValues, capabilities) { + if (name === GLOBAL_NAME) { + return capabilities[permission.id].name; + } else if (permissionValues[permission.id]) { + return permissionValues[permission.id].name; + } else if (permission.value.label) { + let behalfOf = ''; + if (permission.id.startsWith('labelAs-')) { + behalfOf = ON_BEHALF_OF; + } + return `${LABEL} ${permission.value.label}${behalfOf}`; + } + } + + _computeSectionName(name) { + // When a new section is created, it doesn't yet have a ref. Set into + // edit mode so that the user can input one. + if (!name) { + this._editingRef = true; + // Needed for the title value. This is the same default as GWT. + name = NEW_NAME; + // Needed for the input field value. + this.set('section.id', name); + } + if (name === GLOBAL_NAME) { + return 'Global Capabilities'; + } else if (name.startsWith(REFS_NAME)) { + return `Reference: ${name}`; + } + return name; + } + + _handleRemoveReference() { + if (this.section.value.added) { + this.dispatchEvent(new CustomEvent( + 'added-section-removed', {bubbles: true, composed: true})); + } + this._deleted = true; + this.section.value.deleted = true; + this.dispatchEvent( + new CustomEvent('access-modified', {bubbles: true, composed: true})); + } + + _handleUndoRemove() { + this._deleted = false; + delete this.section.value.deleted; + } + + editRefInput() { + return dom(this.root).querySelector(PolymerElement ? + 'iron-input.editRefInput' : + 'input[is=iron-input].editRefInput'); + } + + editReference() { + this._editingRef = true; + this.editRefInput().focus(); + } + + _isEditEnabled(canUpload, ownerOf, sectionId) { + return canUpload || (ownerOf && ownerOf.indexOf(sectionId) >= 0); + } + + _computeSectionClass(editing, canUpload, ownerOf, editingRef, deleted) { + const classList = []; + if (editing + && this._isEditEnabled(canUpload, ownerOf, this.section.id)) { + classList.push('editing'); + } + if (editingRef) { + classList.push('editingRef'); + } + if (deleted) { + classList.push('deleted'); + } + return classList.join(' '); + } + + _computeEditBtnClass(name) { + return name === GLOBAL_NAME ? 'global' : ''; + } + + _handleAddPermission() { + const value = this.$.permissionSelect.value; + const permission = { + id: value, + value: {rules: {}, added: true}, + }; + + // This is needed to update the 'label' property of the + // 'label-' permission. + // + // The value from the add permission dropdown will either be + // label- or labelAs-. + // But, the format of the API response is as such: + // "permissions": { + // "label-Code-Review": { + // "label": "Code-Review", + // "rules": {...} + // } + // } + // } + // When we add a new item, we have to push the new permission in the same + // format as the ones that have been returned by the API. + if (value.startsWith('label')) { + permission.value.label = + value.replace('label-', '').replace('labelAs-', ''); + } + // Add to the end of the array (used in dom-repeat) and also to the + // section object that is two way bound with its parent element. + this.push('_permissions', permission); + this.set(['section.value.permissions', permission.id], + permission.value); + } +} + +customElements.define(GrAccessSection.is, GrAccessSection); diff --git a/polygerrit-ui/app/elements/admin/gr-access-section/gr-access-section_html.js b/polygerrit-ui/app/elements/admin/gr-access-section/gr-access-section_html.js index a52cb1a36d..5f35f55e3f 100644 --- a/polygerrit-ui/app/elements/admin/gr-access-section/gr-access-section_html.js +++ b/polygerrit-ui/app/elements/admin/gr-access-section/gr-access-section_html.js @@ -1,36 +1,22 @@ - - - - - - - - - - - - - - - - - -