Add readonly to restApiService property
From TSLint prefer-readonly-rule
"Class fields should be marked as readonly if possible, to communicate
that their value is never changed and prevent later accidental
modification"
Change-Id: Ib6444a230716d2106349f8413a398ae0c1a0a5fe
diff --git a/polygerrit-ui/app/elements/admin/gr-admin-group-list/gr-admin-group-list.ts b/polygerrit-ui/app/elements/admin/gr-admin-group-list/gr-admin-group-list.ts
index e77a5e8..4fa84eb 100644
--- a/polygerrit-ui/app/elements/admin/gr-admin-group-list/gr-admin-group-list.ts
+++ b/polygerrit-ui/app/elements/admin/gr-admin-group-list/gr-admin-group-list.ts
@@ -95,7 +95,7 @@
@property({type: String})
_filter = '';
- private restApiService = appContext.restApiService;
+ private readonly restApiService = appContext.restApiService;
/** @override */
attached() {
diff --git a/polygerrit-ui/app/elements/admin/gr-admin-view/gr-admin-view.ts b/polygerrit-ui/app/elements/admin/gr-admin-view/gr-admin-view.ts
index 8a3e47f..bd2781f 100644
--- a/polygerrit-ui/app/elements/admin/gr-admin-view/gr-admin-view.ts
+++ b/polygerrit-ui/app/elements/admin/gr-admin-view/gr-admin-view.ts
@@ -173,7 +173,7 @@
@property({type: Boolean})
_showPluginList?: boolean;
- private restApiService = appContext.restApiService;
+ private readonly restApiService = appContext.restApiService;
private readonly jsAPI = appContext.jsApiService;
diff --git a/polygerrit-ui/app/elements/admin/gr-create-group-dialog/gr-create-group-dialog.ts b/polygerrit-ui/app/elements/admin/gr-create-group-dialog/gr-create-group-dialog.ts
index b68f720..e68f6c9 100644
--- a/polygerrit-ui/app/elements/admin/gr-create-group-dialog/gr-create-group-dialog.ts
+++ b/polygerrit-ui/app/elements/admin/gr-create-group-dialog/gr-create-group-dialog.ts
@@ -44,7 +44,7 @@
@property({type: Boolean})
_groupCreated = false;
- private restApiService = appContext.restApiService;
+ private readonly restApiService = appContext.restApiService;
_computeGroupUrl(groupId: string) {
return getBaseUrl() + '/admin/groups/' + encodeURL(groupId, true);
diff --git a/polygerrit-ui/app/elements/admin/gr-create-pointer-dialog/gr-create-pointer-dialog.ts b/polygerrit-ui/app/elements/admin/gr-create-pointer-dialog/gr-create-pointer-dialog.ts
index d50d7c5..6334670 100644
--- a/polygerrit-ui/app/elements/admin/gr-create-pointer-dialog/gr-create-pointer-dialog.ts
+++ b/polygerrit-ui/app/elements/admin/gr-create-pointer-dialog/gr-create-pointer-dialog.ts
@@ -68,7 +68,7 @@
this.hasNewItemName = !!name;
}
- private restApiService = appContext.restApiService;
+ private readonly restApiService = appContext.restApiService;
handleCreateItem() {
if (!this.repoName) {
diff --git a/polygerrit-ui/app/elements/admin/gr-create-repo-dialog/gr-create-repo-dialog.ts b/polygerrit-ui/app/elements/admin/gr-create-repo-dialog/gr-create-repo-dialog.ts
index c9fd241..f708485 100644
--- a/polygerrit-ui/app/elements/admin/gr-create-repo-dialog/gr-create-repo-dialog.ts
+++ b/polygerrit-ui/app/elements/admin/gr-create-repo-dialog/gr-create-repo-dialog.ts
@@ -70,7 +70,7 @@
@property({type: Object})
_queryGroups: AutocompleteQuery;
- private restApiService = appContext.restApiService;
+ private readonly restApiService = appContext.restApiService;
constructor() {
super();
diff --git a/polygerrit-ui/app/elements/admin/gr-group-audit-log/gr-group-audit-log.ts b/polygerrit-ui/app/elements/admin/gr-group-audit-log/gr-group-audit-log.ts
index bc4750f..201b340 100644
--- a/polygerrit-ui/app/elements/admin/gr-group-audit-log/gr-group-audit-log.ts
+++ b/polygerrit-ui/app/elements/admin/gr-group-audit-log/gr-group-audit-log.ts
@@ -55,7 +55,7 @@
@property({type: Boolean})
_loading = true;
- private restApiService = appContext.restApiService;
+ private readonly restApiService = appContext.restApiService;
/** @override */
attached() {
diff --git a/polygerrit-ui/app/elements/admin/gr-group-members/gr-group-members.ts b/polygerrit-ui/app/elements/admin/gr-group-members/gr-group-members.ts
index 451139c..54f58c2 100644
--- a/polygerrit-ui/app/elements/admin/gr-group-members/gr-group-members.ts
+++ b/polygerrit-ui/app/elements/admin/gr-group-members/gr-group-members.ts
@@ -117,7 +117,7 @@
_itemId?: AccountId | GroupId;
- private restApiService = appContext.restApiService;
+ private readonly restApiService = appContext.restApiService;
constructor() {
super();
diff --git a/polygerrit-ui/app/elements/admin/gr-group/gr-group.ts b/polygerrit-ui/app/elements/admin/gr-group/gr-group.ts
index 6f00445..84daef8 100644
--- a/polygerrit-ui/app/elements/admin/gr-group/gr-group.ts
+++ b/polygerrit-ui/app/elements/admin/gr-group/gr-group.ts
@@ -126,7 +126,7 @@
@property({type: Boolean})
_isAdmin = false;
- private restApiService = appContext.restApiService;
+ private readonly restApiService = appContext.restApiService;
constructor() {
super();
diff --git a/polygerrit-ui/app/elements/admin/gr-permission/gr-permission.ts b/polygerrit-ui/app/elements/admin/gr-permission/gr-permission.ts
index 5702bfb..85ba052 100644
--- a/polygerrit-ui/app/elements/admin/gr-permission/gr-permission.ts
+++ b/polygerrit-ui/app/elements/admin/gr-permission/gr-permission.ts
@@ -140,7 +140,7 @@
@property({type: Boolean})
_originalExclusiveValue?: boolean;
- private restApiService = appContext.restApiService;
+ private readonly restApiService = appContext.restApiService;
constructor() {
super();
diff --git a/polygerrit-ui/app/elements/admin/gr-plugin-list/gr-plugin-list.ts b/polygerrit-ui/app/elements/admin/gr-plugin-list/gr-plugin-list.ts
index fc1ceee..f5e9a92 100644
--- a/polygerrit-ui/app/elements/admin/gr-plugin-list/gr-plugin-list.ts
+++ b/polygerrit-ui/app/elements/admin/gr-plugin-list/gr-plugin-list.ts
@@ -77,7 +77,7 @@
@property({type: String})
_filter = '';
- private restApiService = appContext.restApiService;
+ private readonly restApiService = appContext.restApiService;
/** @override */
attached() {
diff --git a/polygerrit-ui/app/elements/admin/gr-repo-access/gr-repo-access.ts b/polygerrit-ui/app/elements/admin/gr-repo-access/gr-repo-access.ts
index 935d091..26ff799 100644
--- a/polygerrit-ui/app/elements/admin/gr-repo-access/gr-repo-access.ts
+++ b/polygerrit-ui/app/elements/admin/gr-repo-access/gr-repo-access.ts
@@ -120,7 +120,7 @@
private _originalInheritsFrom?: ProjectInfo | null;
- private restApiService = appContext.restApiService;
+ private readonly restApiService = appContext.restApiService;
constructor() {
super();
diff --git a/polygerrit-ui/app/elements/admin/gr-repo-commands/gr-repo-commands.ts b/polygerrit-ui/app/elements/admin/gr-repo-commands/gr-repo-commands.ts
index 14cf234..f209729 100644
--- a/polygerrit-ui/app/elements/admin/gr-repo-commands/gr-repo-commands.ts
+++ b/polygerrit-ui/app/elements/admin/gr-repo-commands/gr-repo-commands.ts
@@ -91,7 +91,7 @@
@property({type: Boolean})
_runningGC = false;
- private restApiService = appContext.restApiService;
+ private readonly restApiService = appContext.restApiService;
/** @override */
attached() {
diff --git a/polygerrit-ui/app/elements/admin/gr-repo-dashboards/gr-repo-dashboards.ts b/polygerrit-ui/app/elements/admin/gr-repo-dashboards/gr-repo-dashboards.ts
index 5f6cd29..7b3c7fb 100644
--- a/polygerrit-ui/app/elements/admin/gr-repo-dashboards/gr-repo-dashboards.ts
+++ b/polygerrit-ui/app/elements/admin/gr-repo-dashboards/gr-repo-dashboards.ts
@@ -50,7 +50,7 @@
@property({type: Array})
_dashboards?: DashboardRef[];
- private restApiService = appContext.restApiService;
+ private readonly restApiService = appContext.restApiService;
_repoChanged(repo?: RepoName) {
this._loading = true;
diff --git a/polygerrit-ui/app/elements/admin/gr-repo-list/gr-repo-list.ts b/polygerrit-ui/app/elements/admin/gr-repo-list/gr-repo-list.ts
index c1c8475..d6aa0e6 100644
--- a/polygerrit-ui/app/elements/admin/gr-repo-list/gr-repo-list.ts
+++ b/polygerrit-ui/app/elements/admin/gr-repo-list/gr-repo-list.ts
@@ -88,7 +88,7 @@
return this.computeShownItems(this._repos);
}
- private restApiService = appContext.restApiService;
+ private readonly restApiService = appContext.restApiService;
/** @override */
attached() {
diff --git a/polygerrit-ui/app/elements/admin/gr-repo/gr-repo.ts b/polygerrit-ui/app/elements/admin/gr-repo/gr-repo.ts
index bcc6039..b6881ff 100644
--- a/polygerrit-ui/app/elements/admin/gr-repo/gr-repo.ts
+++ b/polygerrit-ui/app/elements/admin/gr-repo/gr-repo.ts
@@ -141,7 +141,7 @@
@property({type: Array})
weblinks: WebLinkInfo[] = [];
- private restApiService = appContext.restApiService;
+ private readonly restApiService = appContext.restApiService;
/** @override */
attached() {
diff --git a/polygerrit-ui/app/elements/change-list/gr-change-list-view/gr-change-list-view.ts b/polygerrit-ui/app/elements/change-list/gr-change-list-view/gr-change-list-view.ts
index 441d514..42741fa 100644
--- a/polygerrit-ui/app/elements/change-list/gr-change-list-view/gr-change-list-view.ts
+++ b/polygerrit-ui/app/elements/change-list/gr-change-list-view/gr-change-list-view.ts
@@ -111,7 +111,7 @@
@property({type: String})
_repo: string | null = null;
- private restApiService = appContext.restApiService;
+ private readonly restApiService = appContext.restApiService;
/** @override */
created() {
diff --git a/polygerrit-ui/app/elements/change-list/gr-change-list/gr-change-list.ts b/polygerrit-ui/app/elements/change-list/gr-change-list/gr-change-list.ts
index f36df84..f26cd46 100644
--- a/polygerrit-ui/app/elements/change-list/gr-change-list/gr-change-list.ts
+++ b/polygerrit-ui/app/elements/change-list/gr-change-list/gr-change-list.ts
@@ -146,7 +146,7 @@
flagsService = appContext.flagsService;
- private restApiService = appContext.restApiService;
+ private readonly restApiService = appContext.restApiService;
keyboardShortcuts() {
return {
diff --git a/polygerrit-ui/app/elements/change-list/gr-dashboard-view/gr-dashboard-view.ts b/polygerrit-ui/app/elements/change-list/gr-dashboard-view/gr-dashboard-view.ts
index 841ee6e..9240905 100644
--- a/polygerrit-ui/app/elements/change-list/gr-dashboard-view/gr-dashboard-view.ts
+++ b/polygerrit-ui/app/elements/change-list/gr-dashboard-view/gr-dashboard-view.ts
@@ -121,7 +121,7 @@
private reporting = appContext.reportingService;
- private restApiService = appContext.restApiService;
+ private readonly restApiService = appContext.restApiService;
private lastVisibleTimestampMs = 0;
diff --git a/polygerrit-ui/app/elements/change-list/gr-user-header/gr-user-header.ts b/polygerrit-ui/app/elements/change-list/gr-user-header/gr-user-header.ts
index 10f65a5..cfee0cd 100644
--- a/polygerrit-ui/app/elements/change-list/gr-user-header/gr-user-header.ts
+++ b/polygerrit-ui/app/elements/change-list/gr-user-header/gr-user-header.ts
@@ -54,7 +54,7 @@
@property({type: String})
_status = '';
- private restApiService = appContext.restApiService;
+ private readonly restApiService = appContext.restApiService;
_accountChanged(userId?: AccountId) {
if (!userId) {
diff --git a/polygerrit-ui/app/elements/change/gr-change-actions/gr-change-actions.ts b/polygerrit-ui/app/elements/change/gr-change-actions/gr-change-actions.ts
index 89ca4ef..c3858d8 100644
--- a/polygerrit-ui/app/elements/change/gr-change-actions/gr-change-actions.ts
+++ b/polygerrit-ui/app/elements/change/gr-change-actions/gr-change-actions.ts
@@ -553,7 +553,7 @@
@property({type: Object})
_config?: ServerInfo;
- private restApiService = appContext.restApiService;
+ private readonly restApiService = appContext.restApiService;
/** @override */
created() {
diff --git a/polygerrit-ui/app/elements/change/gr-confirm-cherrypick-dialog/gr-confirm-cherrypick-dialog.ts b/polygerrit-ui/app/elements/change/gr-confirm-cherrypick-dialog/gr-confirm-cherrypick-dialog.ts
index 10cffba..225e3e9 100644
--- a/polygerrit-ui/app/elements/change/gr-confirm-cherrypick-dialog/gr-confirm-cherrypick-dialog.ts
+++ b/polygerrit-ui/app/elements/change/gr-confirm-cherrypick-dialog/gr-confirm-cherrypick-dialog.ts
@@ -144,7 +144,7 @@
private selectedChangeIds = new Set<ChangeInfoId>();
- private restApiService = appContext.restApiService;
+ private readonly restApiService = appContext.restApiService;
constructor() {
super();
diff --git a/polygerrit-ui/app/elements/change/gr-confirm-move-dialog/gr-confirm-move-dialog.ts b/polygerrit-ui/app/elements/change/gr-confirm-move-dialog/gr-confirm-move-dialog.ts
index ff61de9..5e95e66 100644
--- a/polygerrit-ui/app/elements/change/gr-confirm-move-dialog/gr-confirm-move-dialog.ts
+++ b/polygerrit-ui/app/elements/change/gr-confirm-move-dialog/gr-confirm-move-dialog.ts
@@ -67,7 +67,7 @@
};
}
- private restApiService = appContext.restApiService;
+ private readonly restApiService = appContext.restApiService;
constructor() {
super();
diff --git a/polygerrit-ui/app/elements/change/gr-confirm-rebase-dialog/gr-confirm-rebase-dialog.ts b/polygerrit-ui/app/elements/change/gr-confirm-rebase-dialog/gr-confirm-rebase-dialog.ts
index 9dcd849..b2b6e61 100644
--- a/polygerrit-ui/app/elements/change/gr-confirm-rebase-dialog/gr-confirm-rebase-dialog.ts
+++ b/polygerrit-ui/app/elements/change/gr-confirm-rebase-dialog/gr-confirm-rebase-dialog.ts
@@ -89,7 +89,7 @@
@property({type: Array})
_recentChanges?: RebaseChange[];
- private restApiService = appContext.restApiService;
+ private readonly restApiService = appContext.restApiService;
constructor() {
super();
diff --git a/polygerrit-ui/app/elements/diff/gr-apply-fix-dialog/gr-apply-fix-dialog.ts b/polygerrit-ui/app/elements/diff/gr-apply-fix-dialog/gr-apply-fix-dialog.ts
index 468bb97..e381213 100644
--- a/polygerrit-ui/app/elements/diff/gr-apply-fix-dialog/gr-apply-fix-dialog.ts
+++ b/polygerrit-ui/app/elements/diff/gr-apply-fix-dialog/gr-apply-fix-dialog.ts
@@ -100,7 +100,7 @@
private refitOverlay?: () => void;
- private restApiService = appContext.restApiService;
+ private readonly restApiService = appContext.restApiService;
/**
* Given robot comment CustomEvent object, fetch diffs associated
diff --git a/polygerrit-ui/app/elements/diff/gr-selection-action-box/gr-selection-action-box.ts b/polygerrit-ui/app/elements/diff/gr-selection-action-box/gr-selection-action-box.ts
index f38824f..ea7f6cd 100644
--- a/polygerrit-ui/app/elements/diff/gr-selection-action-box/gr-selection-action-box.ts
+++ b/polygerrit-ui/app/elements/diff/gr-selection-action-box/gr-selection-action-box.ts
@@ -60,7 +60,7 @@
@property({type: Boolean})
disableKeyboardShortcuts = false;
- private restApiService = appContext.restApiService;
+ private readonly restApiService = appContext.restApiService;
/** @override */
created() {
diff --git a/polygerrit-ui/app/elements/gr-app-element.ts b/polygerrit-ui/app/elements/gr-app-element.ts
index e4d72e1..ec3bd0f 100644
--- a/polygerrit-ui/app/elements/gr-app-element.ts
+++ b/polygerrit-ui/app/elements/gr-app-element.ts
@@ -206,7 +206,7 @@
private reporting = appContext.reportingService;
- private restApiService = appContext.restApiService;
+ private readonly restApiService = appContext.restApiService;
keyboardShortcuts() {
return {
diff --git a/polygerrit-ui/app/mixins/keyboard-shortcut-mixin/keyboard-shortcut-mixin.ts b/polygerrit-ui/app/mixins/keyboard-shortcut-mixin/keyboard-shortcut-mixin.ts
index 7050cbe..a907ddb 100644
--- a/polygerrit-ui/app/mixins/keyboard-shortcut-mixin/keyboard-shortcut-mixin.ts
+++ b/polygerrit-ui/app/mixins/keyboard-shortcut-mixin/keyboard-shortcut-mixin.ts
@@ -808,7 +808,7 @@
private _disableKeyboardShortcuts = false;
- private restApiService = appContext.restApiService;
+ private readonly restApiService = appContext.restApiService;
modifierPressed(event: CustomKeyboardEvent) {
/* We are checking for g/v as modifiers pressed. There are cases such as