Skip to content

Commit c5f76ec

Browse files
committed
update @ProtonMail web clients
1 parent a30ef43 commit c5f76ec

File tree

20 files changed

+360
-225
lines changed

20 files changed

+360
-225
lines changed
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,16 @@ index 8f5e56ef0..a40d9dc17 100644
5151
export default Setup;
5252

5353
diff --git a/applications/account/src/app/content/MainContainer.tsx b/applications/account/src/app/content/MainContainer.tsx
54-
index 575b59dcec..5e774e01a1 100644
54+
index 8009f7f074..1938e387fb 100644
5555
--- a/applications/account/src/app/content/MainContainer.tsx
5656
+++ b/applications/account/src/app/content/MainContainer.tsx
57-
@@ -132,7 +132,7 @@ const MainContainer = () => {
58-
const loadingFeatures = featuresFlags.some(({ loading }) => loading) || loadingDataRecovery;
57+
@@ -137,7 +137,7 @@ const MainContainer = () => {
58+
const loadingFeatures = featuresFlags.some(({ loading }) => loading);
5959
const recoveryNotification = useRecoveryNotification(false);
6060

6161
- const appFromPathname = getAppFromPathnameSafe(location.pathname);
6262
+ const appFromPathname = getAppFromPathnameSafe(window.location.pathname);
6363
const app = appFromPathname || getToApp(undefined, user);
6464
const appSlug = getSlugFromApp(app);
6565

66+
Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
diff --git a/applications/drive/src/.htaccess b/applications/drive/src/.htaccess
2-
index 5b522f3deb..5523b5a5dc 100644
2+
index b0b25a5fae..11d4e4af0f 100644
33
--- a/applications/drive/src/.htaccess
44
+++ b/applications/drive/src/.htaccess
5-
@@ -39,11 +39,13 @@ ErrorDocument 404 /assets/404.html
6-
Header set X-Robots-Tag "noindex"
5+
@@ -40,10 +40,12 @@ ErrorDocument 404 /assets/404.html
76
</Files>
87

9-
+# <electron-mail-mark>
108
# The download service worker gets chunk hash appended to the end of the filename
9+
+# <electron-mail-mark>
1110
<Files ~ "^downloadSW">
1211
Header set Service-Worker-Allowed "/"
1312
Header set Service-Worker "script"
1413
</Files>
1514
+# </electron-mail-mark>
1615

17-
<IfModule mod_mime.c>
18-
AddType application/font-woff2 .woff2
16+
<IfModule mod_deflate.c>
17+
AddOutputFilter INCLUDES;DEFLATE svg
1918

2019
diff --git a/applications/drive/src/app/store/_downloads/fileSaver/download.ts b/applications/drive/src/app/store/_downloads/fileSaver/download.ts
2120
index 66a9aba1cc..2a7ab63889 100644
Lines changed: 42 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -149,27 +149,55 @@ index 4c16c85b5..8b93c6084 100644
149149
+}; /* </electron-mail-mark> */
150150

151151
diff --git a/packages/components/hooks/useGetEncryptionPreferences.ts b/packages/components/hooks/useGetEncryptionPreferences.ts
152-
index fe83b9e8c..b944a61e8 100644
152+
index dae0d635c7..6308e24fa9 100644
153153
--- a/packages/components/hooks/useGetEncryptionPreferences.ts
154154
+++ b/packages/components/hooks/useGetEncryptionPreferences.ts
155-
@@ -24,7 +24,7 @@ const DEFAULT_LIFETIME = 5 * MINUTE;
156-
* The logic for how those preferences are determined is laid out in the
157-
* Confluence document 'Encryption preferences for outgoing email'
155+
@@ -5,7 +5,7 @@ import { MINUTE, RECIPIENT_TYPES } from '@proton/shared/lib/constants';
156+
import { getSelfSendAddresses } from '@proton/shared/lib/helpers/address';
157+
import { canonicalizeEmail, canonicalizeInternalEmail } from '@proton/shared/lib/helpers/email';
158+
import { KT_VERIFICATION_STATUS } from '@proton/shared/lib/interfaces';
159+
-import { GetEncryptionPreferences } from '@proton/shared/lib/interfaces/hooks/GetEncryptionPreferences';
160+
+import { GetEncryptionPreferences } from '@proton/shared/lib/interfaces/hooks/GetEncryptionPreferences'; /* <electron-mail-mark/> TODO "GetEncryptionPreferences" is used as a method signature */
161+
import { getKeyHasFlagsToEncrypt } from '@proton/shared/lib/keys';
162+
import { getActiveKeys } from '@proton/shared/lib/keys/getActiveKeys';
163+
import { splitKeys } from '@proton/shared/lib/keys/keys';
164+
@@ -31,7 +31,7 @@ const DEFAULT_LIFETIME = 5 * MINUTE;
165+
* Confluence document 'Encryption preferences for outgoing email'.
166+
* NB: the current logic does not handle internal address keys belonging to external accounts, since these keys are not used by Inbox.
158167
*/
159168
-const useGetEncryptionPreferences = () => {
160-
+const useGetEncryptionPreferences = () => { /* <electron-mail-mark> */
169+
+const useGetEncryptionPreferences = () => { /* <electron-mail-mark> TODO "GetEncryptionPreferences" is used as a method signature */
161170
const api = useApi();
162171
const cache = useCache();
163172
const getAddresses = useGetAddresses();
164-
@@ -87,6 +87,6 @@ const useGetEncryptionPreferences = () => {
173+
@@ -109,6 +109,6 @@ const useGetEncryptionPreferences = () => {
165174
},
166175
[cache, getEncryptionPreferences]
167176
);
168177
-};
169-
+}; /* </electron-mail-mark> */
178+
+}; /* <electron-mail-mark> */
170179

171180
export default useGetEncryptionPreferences;
172181

182+
diff --git a/packages/shared/lib/interfaces/hooks/GetEncryptionPreferences.ts b/packages/shared/lib/interfaces/hooks/GetEncryptionPreferences.ts
183+
index d31b0bf797..407bb22503 100644
184+
--- a/packages/shared/lib/interfaces/hooks/GetEncryptionPreferences.ts
185+
+++ b/packages/shared/lib/interfaces/hooks/GetEncryptionPreferences.ts
186+
@@ -2,6 +2,7 @@ import { EncryptionPreferences } from '../../mail/encryptionPreferences';
187+
import { ContactEmail } from '../contacts';
188+
189+
export type GetEncryptionPreferences = ({
190+
+ /* <electron-mail-mark> TODO review signatures */
191+
email,
192+
intendedForEmail,
193+
lifetime,
194+
@@ -15,4 +16,4 @@ export type GetEncryptionPreferences = ({
195+
intendedForEmail?: boolean;
196+
lifetime?: number;
197+
contactEmailsMap?: { [email: string]: ContactEmail | undefined };
198+
-}) => Promise<EncryptionPreferences>;
199+
+}) => Promise<EncryptionPreferences>;/* </electron-mail-mark> */
200+
173201
diff --git a/packages/components/hooks/useApi.ts b/packages/components/hooks/useApi.ts
174202
index e2baface5..8b4317d5a 100644
175203
--- a/packages/components/hooks/useApi.ts
@@ -346,20 +374,19 @@ index 0d29745777..0000000000
346374
-export default MailDefaultHandlerModal;
347375

348376
diff --git a/applications/mail/src/app/components/header/search/MailSearch.tsx b/applications/mail/src/app/components/header/search/MailSearch.tsx
349-
index 1736085ad3..5f102e159e 100644
377+
index 9b542628da..f26b6a9ccc 100644
350378
--- a/applications/mail/src/app/components/header/search/MailSearch.tsx
351379
+++ b/applications/mail/src/app/components/header/search/MailSearch.tsx
352-
@@ -3,7 +3,6 @@ import { useEffect, useState } from 'react';
380+
@@ -3,21 +3,17 @@ import { useEffect, useState } from 'react';
353381
import { Location } from 'history';
354382

355383
import {
356384
- FeatureCode,
357385
TopNavbarListItemSearchButton,
358386
generateUID,
359387
useAddresses,
360-
@@ -11,14 +10,11 @@ import {
388+
useFolders,
361389
useLabels,
362-
useMailSettings,
363390
usePopperAnchor,
364391
- useProgressiveRollout,
365392
useToggle,
@@ -372,7 +399,7 @@ index 1736085ad3..5f102e159e 100644
372399
import { extractSearchParameters } from '../../../helpers/mailboxUrl';
373400
import { useClickMailContent } from '../../../hooks/useClickMailContent';
374401
import { Breakpoints } from '../../../models/utils';
375-
@@ -39,11 +35,9 @@ interface Props {
402+
@@ -37,17 +33,15 @@ interface Props {
376403

377404
const MailSearch = ({ breakpoints, labelID, location, columnMode }: Props) => {
378405
const [uid] = useState(generateUID('advanced-search-overlay'));
@@ -381,13 +408,11 @@ index 1736085ad3..5f102e159e 100644
381408
const searchParams = extractSearchParameters(location);
382409
const [searchInputValue, setSearchInputValue] = useState(searchParams.keyword || '');
383410
- const [user] = useUser();
384-
const [, loadingMailSettings] = useMailSettings();
385411
const [, loadingLabels] = useLabels();
386412
const [, loadingFolders] = useFolders();
387-
@@ -51,7 +45,7 @@ const MailSearch = ({ breakpoints, labelID, location, columnMode }: Props) => {
388-
const { getESDBStatus, cacheIndexedDB, closeDropdown } = useEncryptedSearchContext();
389-
const { dropdownOpened } = getESDBStatus();
390-
const esState = useEncryptedSearchToggleState(isOpen);
413+
const [, loadingAddresses] = useAddresses();
414+
const { esStatus, cacheIndexedDB, closeDropdown, esIndexingProgressState } = useEncryptedSearchContext();
415+
const { dropdownOpened } = esStatus;
391416
- const showEncryptedSearch = isEncryptedSearchAvailable(user, isESUserInterfaceAvailable);
392417
+ const showEncryptedSearch = false;
393418

File renamed without changes.

patches/protonmail/common-7.patch

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
diff --git a/packages/shared/lib/helpers/desktop.ts b/packages/shared/lib/helpers/desktop.ts
2+
index 4696b429a7..fe63f75e55 100644
3+
--- a/packages/shared/lib/helpers/desktop.ts
4+
+++ b/packages/shared/lib/helpers/desktop.ts
5+
@@ -1,13 +1,6 @@
6+
-import UAParser from 'ua-parser-js';
7+
-
8+
import { isMac } from './browser';
9+
10+
-const uaParser = new UAParser();
11+
-const ua = uaParser.getResult();
12+
-
13+
-export const isElectronApp = () => {
14+
- return /electron/i.test(ua.ua);
15+
-};
16+
+export const isElectronApp = () => false;
17+
18+
export const isElectronOnMac = () => {
19+
return isElectronApp() && isMac();
20+
121
diff --git a/packages/components/containers/unleash/UnleashFlagProvider.tsx b/packages/components/containers/unleash/UnleashFlagProvider.tsx
222
index 1531d1450b..a8a8d44677 100644
323
--- a/packages/components/containers/unleash/UnleashFlagProvider.tsx
Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,29 @@
1+
diff --git a/packages/shared/lib/helpers/desktop.ts b/packages/shared/lib/helpers/desktop.ts
2+
index 4696b429a7..fe63f75e55 100644
3+
--- a/packages/shared/lib/helpers/desktop.ts
4+
+++ b/packages/shared/lib/helpers/desktop.ts
5+
@@ -1,13 +1,6 @@
6+
-import UAParser from 'ua-parser-js';
7+
-
8+
import { isMac } from './browser';
9+
10+
-const uaParser = new UAParser();
11+
-const ua = uaParser.getResult();
12+
-
13+
-export const isElectronApp = () => {
14+
- return /electron/i.test(ua.ua);
15+
-};
16+
+export const isElectronApp = () => false;
17+
18+
export const isElectronOnMac = () => {
19+
return isElectronApp() && isMac();
20+
121
diff --git a/packages/components/containers/unleash/UnleashFlagProvider.tsx b/packages/components/containers/unleash/UnleashFlagProvider.tsx
2-
index 1531d1450b..a8a8d44677 100644
22+
index e9adc4f7f1..2e8d0388fd 100644
323
--- a/packages/components/containers/unleash/UnleashFlagProvider.tsx
424
+++ b/packages/components/containers/unleash/UnleashFlagProvider.tsx
525
@@ -3,20 +3,21 @@ import { ReactNode } from 'react';
6-
import FlagProvider from '@unleash/proxy-client-react';
26+
import FlagProvider from '@protontech/proxy-client-react';
727
import { IConfig } from 'unleash-proxy-client';
828

929
-import { Api } from '@proton/shared/lib/interfaces';
@@ -153,10 +173,10 @@ index 36bd0c712..c2fb3681c 100644
153173
return;
154174
}
155175

156-
diff --git a/applications/mail/src/app/components/list/auto-delete/variations/AutoDeleteFreeBanner.tsx b/applications/mail/src/app/components/list/auto-delete/variations/AutoDeleteFreeBanner.tsx
176+
diff --git a/applications/mail/src/app/components/list/banners/auto-delete/variations/AutoDeleteFreeBanner.tsx b/applications/mail/src/app/components/list/banners/auto-delete/variations/AutoDeleteFreeBanner.tsx
157177
index 24c56ef6fe..a6046b391c 100644
158-
--- a/applications/mail/src/app/components/list/auto-delete/variations/AutoDeleteFreeBanner.tsx
159-
+++ b/applications/mail/src/app/components/list/auto-delete/variations/AutoDeleteFreeBanner.tsx
178+
--- a/applications/mail/src/app/components/list/banners/auto-delete/variations/AutoDeleteFreeBanner.tsx
179+
+++ b/applications/mail/src/app/components/list/banners/auto-delete/variations/AutoDeleteFreeBanner.tsx
160180
@@ -7,6 +7,10 @@ import { AutoDeleteUpsellModal, useModalState } from '@proton/components/compone
161181
import { PromotionBanner } from '@proton/components/containers';
162182

@@ -170,26 +190,25 @@ index 24c56ef6fe..a6046b391c 100644
170190
return (
171191

172192
diff --git a/applications/mail/src/app/hooks/useShowUpsellBanner.ts b/applications/mail/src/app/hooks/useShowUpsellBanner.ts
173-
index d203f913fa..178153c592 100644
193+
index b82b7ae976..0907c85ec6 100644
174194
--- a/applications/mail/src/app/hooks/useShowUpsellBanner.ts
175195
+++ b/applications/mail/src/app/hooks/useShowUpsellBanner.ts
176-
@@ -33,6 +33,7 @@ const useShowUpsellBanner = (labelID: string, otherBannerDisplayed: boolean) =>
196+
@@ -33,12 +33,14 @@ const useShowUpsellBanner = (labelID: string) => {
177197
- No other banner is shown in the message list
178198
- If a value is found in the localStorage that should trigger a new display
179199
*/
180200
+ /* <electron-mail-mark> */
181201
const canDisplayUpsellBanner =
182202
user.isFree &&
183203
Date.now() > threeDaysAfterCreationDate &&
184-
@@ -40,6 +41,7 @@ const useShowUpsellBanner = (labelID: string, otherBannerDisplayed: boolean) =>
204+
isInbox &&
185205
needToShowUpsellBanner.current &&
186-
!otherBannerDisplayed &&
187206
showAgain;
188207
+ /* </electron-mail-mark> */
189208

190209
const handleDismissBanner = () => {
191210
// Set the ref to false so that we hide the banner and update the localStorage value
192-
@@ -72,6 +74,10 @@ const useShowUpsellBanner = (labelID: string, otherBannerDisplayed: boolean) =>
211+
@@ -71,6 +73,10 @@ const useShowUpsellBanner = (labelID: string) => {
193212
}
194213
}, []);
195214

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
diff --git a/packages/shared/lib/helpers/desktop.ts b/packages/shared/lib/helpers/desktop.ts
2+
new file mode 100644
3+
index 0000000000..6ece6922a0
4+
--- /dev/null
5+
+++ b/packages/shared/lib/helpers/desktop.ts
6+
@@ -0,0 +1,3 @@
7+
+/* <electron-mail-mark> */
8+
+// TODO remove when ./packages/shared/lib/helpers/desktop.ts gets added for the "drive" app
9+
+/* </electron-mail-mark> */
10+
111
diff --git a/packages/components/containers/unleash/UnleashFlagProvider.tsx b/packages/components/containers/unleash/UnleashFlagProvider.tsx
212
index c3e007aa4b..f51a74683e 100644
313
--- a/packages/components/containers/unleash/UnleashFlagProvider.tsx
@@ -120,10 +130,10 @@ index 36bd0c712..c2fb3681c 100644
120130
return;
121131
}
122132

123-
diff --git a/applications/mail/src/app/components/list/auto-delete/variations/AutoDeleteFreeBanner.tsx b/applications/mail/src/app/components/list/auto-delete/variations/AutoDeleteFreeBanner.tsx
133+
diff --git a/applications/mail/src/app/components/list/banners/auto-delete/variations/AutoDeleteFreeBanner.tsx b/applications/mail/src/app/components/list/banners/auto-delete/variations/AutoDeleteFreeBanner.tsx
124134
index 24c56ef6fe..a6046b391c 100644
125-
--- a/applications/mail/src/app/components/list/auto-delete/variations/AutoDeleteFreeBanner.tsx
126-
+++ b/applications/mail/src/app/components/list/auto-delete/variations/AutoDeleteFreeBanner.tsx
135+
--- a/applications/mail/src/app/components/list/banners/auto-delete/variations/AutoDeleteFreeBanner.tsx
136+
+++ b/applications/mail/src/app/components/list/banners/auto-delete/variations/AutoDeleteFreeBanner.tsx
127137
@@ -7,6 +7,10 @@ import { AutoDeleteUpsellModal, useModalState } from '@proton/components/compone
128138
import { PromotionBanner } from '@proton/components/containers';
129139

@@ -137,26 +147,25 @@ index 24c56ef6fe..a6046b391c 100644
137147
return (
138148

139149
diff --git a/applications/mail/src/app/hooks/useShowUpsellBanner.ts b/applications/mail/src/app/hooks/useShowUpsellBanner.ts
140-
index d203f913fa..178153c592 100644
150+
index b82b7ae976..0907c85ec6 100644
141151
--- a/applications/mail/src/app/hooks/useShowUpsellBanner.ts
142152
+++ b/applications/mail/src/app/hooks/useShowUpsellBanner.ts
143-
@@ -33,6 +33,7 @@ const useShowUpsellBanner = (labelID: string, otherBannerDisplayed: boolean) =>
153+
@@ -33,12 +33,14 @@ const useShowUpsellBanner = (labelID: string) => {
144154
- No other banner is shown in the message list
145155
- If a value is found in the localStorage that should trigger a new display
146156
*/
147157
+ /* <electron-mail-mark> */
148158
const canDisplayUpsellBanner =
149159
user.isFree &&
150160
Date.now() > threeDaysAfterCreationDate &&
151-
@@ -40,6 +41,7 @@ const useShowUpsellBanner = (labelID: string, otherBannerDisplayed: boolean) =>
161+
isInbox &&
152162
needToShowUpsellBanner.current &&
153-
!otherBannerDisplayed &&
154163
showAgain;
155164
+ /* </electron-mail-mark> */
156165

157166
const handleDismissBanner = () => {
158167
// Set the ref to false so that we hide the banner and update the localStorage value
159-
@@ -72,6 +74,10 @@ const useShowUpsellBanner = (labelID: string, otherBannerDisplayed: boolean) =>
168+
@@ -71,6 +73,10 @@ const useShowUpsellBanner = (labelID: string) => {
160169
}
161170
}, []);
162171

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
diff --git a/packages/shared/lib/constants.ts b/packages/shared/lib/constants.ts
2+
index 5481e3f8e4..a5634acd3b 100644
3+
--- a/packages/shared/lib/constants.ts
4+
+++ b/packages/shared/lib/constants.ts
5+
@@ -82,7 +82,7 @@ interface AppConfiguration {
6+
7+
export const APPS_CONFIGURATION: { [key in APP_NAMES]: AppConfiguration } = {
8+
[APPS.PROTONACCOUNT]: {
9+
- publicPath: '',
10+
+ publicPath: '/account',
11+
subdomain: 'account',
12+
name: 'Proton Account',
13+
bareName: 'Account',
14+
@@ -180,8 +180,8 @@ export const APPS_CONFIGURATION: { [key in APP_NAMES]: AppConfiguration } = {
15+
settingsSlug: '',
16+
},
17+
[APPS.PROTONVPN_SETTINGS]: {
18+
- publicPath: '',
19+
- subdomain: '',
20+
+ publicPath: 'account/vpn',
21+
+ subdomain: 'account',
22+
name: VPN_APP_NAME,
23+
bareName: VPN_SHORT_APP_NAME,
24+
webClientID: 'web-vpn-settings',

0 commit comments

Comments
 (0)