Skip to content

Commit b5625ab

Browse files
committed
apply lint:fix
1 parent cbb6f2d commit b5625ab

5 files changed

Lines changed: 71 additions & 22 deletions

File tree

src/web/added-domains-reconfirmation.mjs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,13 @@ export class AddedDomainsReconfirmation {
2626
const originalBccDomains = data.originalRecipients.bcc?.map((_) => _.domain) ?? [];
2727
const originalRequiredAttendeesDomains = data.originalRecipients.requiredAttendees?.map((_) => _.domain) ?? [];
2828
const originalOptionalAttendeesDomains = data.originalRecipients.optionalAttendees?.map((_) => _.domain) ?? [];
29-
const originalDomains = new Set([...originalToDomains, ...originalCcDomains, ...originalBccDomains, ...originalRequiredAttendeesDomains, ...originalOptionalAttendeesDomains]);
29+
const originalDomains = new Set([
30+
...originalToDomains,
31+
...originalCcDomains,
32+
...originalBccDomains,
33+
...originalRequiredAttendeesDomains,
34+
...originalOptionalAttendeesDomains,
35+
]);
3036
if (originalDomains.size === 0) {
3137
return;
3238
}

src/web/app.js

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ async function getAllAppointmentData() {
262262
attachments,
263263
},
264264
config,
265-
originalRecipients : originalAttendees,
265+
originalRecipients: originalAttendees,
266266
itemType: Office.MailboxEnums.ItemType.Appointment,
267267
};
268268
}
@@ -377,16 +377,24 @@ function charsToPercentage(chars, maxSize) {
377377

378378
async function tryConfirm(data, asyncContext) {
379379
const { trustedDomains, unsafeDomains } = data.config;
380-
switch (data.itemType){
381-
case Office.MailboxEnums.ItemType.Message:
380+
switch (data.itemType) {
381+
case Office.MailboxEnums.ItemType.Message: {
382382
const { to, cc, bcc } = data.target;
383383
data.classified = RecipientClassifier.classifyAll({ locale, to, cc, bcc, trustedDomains, unsafeDomains });
384384
break;
385+
}
385386
case Office.MailboxEnums.ItemType.Appointment:
386-
default:
387+
default: {
387388
const { requiredAttendees, optionalAttendees } = data.target;
388-
data.classified = RecipientClassifier.classifyAll({ locale, requiredAttendees, optionalAttendees, trustedDomains, unsafeDomains });
389+
data.classified = RecipientClassifier.classifyAll({
390+
locale,
391+
requiredAttendees,
392+
optionalAttendees,
393+
trustedDomains,
394+
unsafeDomains,
395+
});
389396
break;
397+
}
390398
}
391399
console.debug("classified: ", data.classified);
392400

@@ -570,7 +578,10 @@ window.onNewMessageComposeCreated = onNewMessageComposeCreated;
570578

571579
// eslint-disable-next-line @typescript-eslint/no-unused-vars
572580
async function onAppointmentOrganizer(event) {
573-
const [requiredAttendees, optionalAttendees] = await Promise.all([getRequiredAttendeeAsync(), getOptionalAttendeeAsync()]);
581+
const [requiredAttendees, optionalAttendees] = await Promise.all([
582+
getRequiredAttendeeAsync(),
583+
getOptionalAttendeeAsync(),
584+
]);
574585
if (requiredAttendees.length > 0 || optionalAttendees.length > 0) {
575586
const originalAttendees = {
576587
requiredAttendees,

src/web/l10n.mjs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ export class L10n {
8181
key in this.locale
8282
? this.locale[key]
8383
: key in this.fallbackLocale
84-
? this.fallbackLocale[key]
85-
: key in this.defaultLocale
86-
? this.defaultLocale[key]
87-
: null;
84+
? this.fallbackLocale[key]
85+
: key in this.defaultLocale
86+
? this.defaultLocale[key]
87+
: null;
8888
if (message === null) {
8989
return key;
9090
}

src/web/recipient-classifier.mjs

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,35 +99,59 @@ export class RecipientClassifier {
9999
...classifiedTo.trusted.map((recipient) => ({ ...recipient, type: "To" })),
100100
...classifiedCc.trusted.map((recipient) => ({ ...recipient, type: "Cc" })),
101101
...classifiedBcc.trusted.map((recipient) => ({ ...recipient, type: "Bcc" })),
102-
...classifiedRequiredAttendee.trusted.map((recipient) => ({ ...recipient, type: locale.get("confirmation_requiredAttendee") })),
103-
...classifiedOptionalAttendee.trusted.map((recipient) => ({ ...recipient, type: locale.get("confirmation_optionalAttendee") })),
102+
...classifiedRequiredAttendee.trusted.map((recipient) => ({
103+
...recipient,
104+
type: locale.get("confirmation_requiredAttendee"),
105+
})),
106+
...classifiedOptionalAttendee.trusted.map((recipient) => ({
107+
...recipient,
108+
type: locale.get("confirmation_optionalAttendee"),
109+
})),
104110
]),
105111
],
106112
untrusted: [
107113
...new Set([
108114
...classifiedTo.untrusted.map((recipient) => ({ ...recipient, type: "To" })),
109115
...classifiedCc.untrusted.map((recipient) => ({ ...recipient, type: "Cc" })),
110116
...classifiedBcc.untrusted.map((recipient) => ({ ...recipient, type: "Bcc" })),
111-
...classifiedRequiredAttendee.untrusted.map((recipient) => ({ ...recipient, type: locale.get("confirmation_requiredAttendee") })),
112-
...classifiedOptionalAttendee.untrusted.map((recipient) => ({ ...recipient, type: locale.get("confirmation_optionalAttendee") })),
117+
...classifiedRequiredAttendee.untrusted.map((recipient) => ({
118+
...recipient,
119+
type: locale.get("confirmation_requiredAttendee"),
120+
})),
121+
...classifiedOptionalAttendee.untrusted.map((recipient) => ({
122+
...recipient,
123+
type: locale.get("confirmation_optionalAttendee"),
124+
})),
113125
]),
114126
],
115127
unsafeWithDomain: [
116128
...new Set([
117129
...classifiedTo.unsafeWithDomain.map((recipient) => ({ ...recipient, type: "To" })),
118130
...classifiedCc.unsafeWithDomain.map((recipient) => ({ ...recipient, type: "Cc" })),
119131
...classifiedBcc.unsafeWithDomain.map((recipient) => ({ ...recipient, type: "Bcc" })),
120-
...classifiedRequiredAttendee.unsafeWithDomain.map((recipient) => ({ ...recipient, type: locale.get("confirmation_requiredAttendee") })),
121-
...classifiedOptionalAttendee.unsafeWithDomain.map((recipient) => ({ ...recipient, type: locale.get("confirmation_optionalAttendee") })),
132+
...classifiedRequiredAttendee.unsafeWithDomain.map((recipient) => ({
133+
...recipient,
134+
type: locale.get("confirmation_requiredAttendee"),
135+
})),
136+
...classifiedOptionalAttendee.unsafeWithDomain.map((recipient) => ({
137+
...recipient,
138+
type: locale.get("confirmation_optionalAttendee"),
139+
})),
122140
]),
123141
],
124142
unsafe: [
125143
...new Set([
126144
...classifiedTo.unsafe.map((recipient) => ({ ...recipient, type: "To" })),
127145
...classifiedCc.unsafe.map((recipient) => ({ ...recipient, type: "Cc" })),
128146
...classifiedBcc.unsafe.map((recipient) => ({ ...recipient, type: "Bcc" })),
129-
...classifiedRequiredAttendee.unsafe.map((recipient) => ({ ...recipient, type: locale.get("confirmation_requiredAttendee") })),
130-
...classifiedOptionalAttendee.unsafe.map((recipient) => ({ ...recipient, type: locale.get("confirmation_optionalAttendee") })),
147+
...classifiedRequiredAttendee.unsafe.map((recipient) => ({
148+
...recipient,
149+
type: locale.get("confirmation_requiredAttendee"),
150+
})),
151+
...classifiedOptionalAttendee.unsafe.map((recipient) => ({
152+
...recipient,
153+
type: locale.get("confirmation_optionalAttendee"),
154+
})),
131155
]),
132156
],
133157
};

src/web/safe-bcc-confirmation.mjs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,20 @@ export class SafeBccConfirmation {
4646
return [];
4747
}
4848

49-
switch (this.itemType){
49+
switch (this.itemType) {
5050
case Office.MailboxEnums.ItemType.Message:
51-
return [{ label: this.locale.get("confirmation_safeBccThresholdCheckboxLabel", { threshold: this.threshold }) }];
51+
return [
52+
{ label: this.locale.get("confirmation_safeBccThresholdCheckboxLabel", { threshold: this.threshold }) },
53+
];
5254
case Office.MailboxEnums.ItemType.Appointment:
5355
default:
54-
return [{ label: this.locale.get("confirmation_safeBccThresholdForAttendeesCheckboxLabel", { threshold: this.threshold }) }];
56+
return [
57+
{
58+
label: this.locale.get("confirmation_safeBccThresholdForAttendeesCheckboxLabel", {
59+
threshold: this.threshold,
60+
}),
61+
},
62+
];
5563
}
5664
}
5765
}

0 commit comments

Comments
 (0)