Skip to content

Commit 0bc681f

Browse files
committed
fixing code smell issues, globalThis and negatation
1 parent ee2de85 commit 0bc681f

21 files changed

+45
-43
lines changed

src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/CertificationCard.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,13 +172,13 @@ export default defineComponent({
172172
}
173173
} else if (this.certification.certificatePDFGeneration === "Yes") {
174174
const file = await getCertificateFileById(this.certification.id ?? "");
175-
this.pdfUrl = window.URL.createObjectURL(file.data);
175+
this.pdfUrl = globalThis.URL.createObjectURL(file.data);
176176
this.fileSize = humanFileSize(file.data.size);
177177
}
178178
}
179179
},
180180
unmounted() {
181-
window.URL.revokeObjectURL(this.pdfUrl);
181+
globalThis.URL.revokeObjectURL(this.pdfUrl);
182182
},
183183
methods: {
184184
generateFileDisplayName() {

src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/DownloadFileLink.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ export default defineComponent({
2525
};
2626
},
2727
unmounted() {
28-
window.URL.revokeObjectURL(this.documentUrl);
28+
globalThis.URL.revokeObjectURL(this.documentUrl);
2929
},
3030
methods: {
3131
async downloadFile() {
3232
this.loading = true;
3333
3434
try {
3535
const response = await this.getFileFunction();
36-
this.documentUrl = window.URL.createObjectURL(response.data);
36+
this.documentUrl = globalThis.URL.createObjectURL(response.data);
3737
3838
const anchor = document.createElement("a");
3939
anchor.href = this.documentUrl;

src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/LookupCertification.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ export default defineComponent({
184184
185185
//reset grecaptcha after success, token cannot be reused
186186
this.recaptchaToken = "";
187-
window.grecaptcha.reset();
187+
globalThis.grecaptcha.reset();
188188
await this.$nextTick();
189189
(this.$refs.lookupForm as VForm).resetValidation();
190190
}

src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/MessageList.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export default defineComponent({
6363
this.messages = response.data?.communications || [];
6464
this.messageCount = response.data?.totalMessagesCount || 0;
6565
66-
window.scrollTo({ top: 0, behavior: "smooth" });
66+
globalThis.scrollTo({ top: 0, behavior: "smooth" });
6767
6868
// After the list is rendered, select/load the first message if available
6969
await nextTick();

src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/MessageListItem.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export default defineComponent({
5858
async loadChildMessages(messageId: string) {
5959
this.messageStore.currentThread = (await getChildMessages({ parentId: messageId })).data?.communications;
6060
this.messageStore.currentMessage = this.message;
61-
window.scrollTo({
61+
globalThis.scrollTo({
6262
top: 0,
6363
behavior: "smooth",
6464
});

src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/Snackbar.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export default {
114114
}
115115
},
116116
timeoutCounter() {
117-
this.polling = window.setInterval(() => {
117+
this.polling = globalThis.setInterval(() => {
118118
if (this.pause) {
119119
this.timeout += 1;
120120
}

src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/UpsertCharacterReference.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export default defineComponent({
125125
if (refSet.has(`${this.formStore.formData.firstName.toLowerCase()} ${this.formStore.formData.lastName.toLowerCase()}`)) {
126126
this.isDuplicateReference = true;
127127
//scroll to top of page
128-
window.scrollTo({
128+
globalThis.scrollTo({
129129
top: 0,
130130
behavior: "smooth",
131131
});

src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/UpsertWorkExperienceReference.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export default defineComponent({
129129
if (refSet.has(`${this.formStore.formData.firstName.toLowerCase()} ${this.formStore.formData.lastName.toLowerCase()}`)) {
130130
this.isDuplicateReference = true;
131131
//scroll to top of page
132-
window.scrollTo({
132+
globalThis.scrollTo({
133133
top: 0,
134134
behavior: "smooth",
135135
});

src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/inputs/EceEducation.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ export default defineComponent({
573573
watch: {
574574
mode(newValue) {
575575
if (newValue === "list") {
576-
window.scrollTo({
576+
globalThis.scrollTo({
577577
top: 0,
578578
behavior: "smooth",
579579
});

src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/inputs/EceEmploymentExperience.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,14 +228,14 @@ export default defineComponent({
228228
this.resetFormData();
229229
// Change mode to list
230230
this.mode = "list";
231-
window.scroll(0, 0);
231+
globalThis.scroll(0, 0);
232232
},
233233
handleAddInternationalCertification() {
234234
// Reset the form fields
235235
this.resetFormData();
236236
this.mode = "add";
237237
this.employmentExperienceFormMode = "add";
238-
window.scroll(0, 0);
238+
globalThis.scroll(0, 0);
239239
},
240240
handleEdit(reference: Components.Schemas.EmploymentReference) {
241241
// Set the form fields to component data
@@ -247,7 +247,7 @@ export default defineComponent({
247247
248248
this.mode = "add";
249249
this.employmentExperienceFormMode = "edit";
250-
window.scroll(0, 0);
250+
globalThis.scroll(0, 0);
251251
},
252252
async handleDelete(_reference: Components.Schemas.EmploymentReference, index: number) {
253253
this.$emit("update:model-value", removeElementByIndex(this.modelValue, index));
@@ -288,7 +288,7 @@ export default defineComponent({
288288
289289
this.mode = "list";
290290
291-
window.scroll(0, 0);
291+
globalThis.scroll(0, 0);
292292
} else {
293293
this.alertStore.setFailureAlert("You must enter all required fields in the valid format.");
294294
}

0 commit comments

Comments
 (0)