From f4a88015d706fed79b9dfb60c41f0a0348209a89 Mon Sep 17 00:00:00 2001 From: Xavier Abad <77491413+masterprog-cmd@users.noreply.github.com> Date: Tue, 20 Aug 2024 18:23:25 +0200 Subject: [PATCH 01/10] fix: avoid activating upsells from auth toggle button --- .../payment/views/IntegratedCheckoutView/CheckoutView.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app/payment/views/IntegratedCheckoutView/CheckoutView.tsx b/src/app/payment/views/IntegratedCheckoutView/CheckoutView.tsx index 840c09311..483958106 100644 --- a/src/app/payment/views/IntegratedCheckoutView/CheckoutView.tsx +++ b/src/app/payment/views/IntegratedCheckoutView/CheckoutView.tsx @@ -62,8 +62,11 @@ const CheckoutView = ({ }); function onAuthMethodToggled(authMethod: AuthMethodTypes) { + reset({ + email: '', + password: '', + }); checkoutViewManager.handleAuthMethodChange(authMethod); - reset(); } return ( From 4a4dd9ecdedf814ed9a00e84bbdc8288055307ef Mon Sep 17 00:00:00 2001 From: Rafa Date: Thu, 22 Aug 2024 13:26:41 +0200 Subject: [PATCH 02/10] [PB-2596] fix sorting reset --- .../slices/storage/storage.thunks/fetchFolderContentThunk.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/app/store/slices/storage/storage.thunks/fetchFolderContentThunk.ts b/src/app/store/slices/storage/storage.thunks/fetchFolderContentThunk.ts index 63ecee403..db8151afa 100644 --- a/src/app/store/slices/storage/storage.thunks/fetchFolderContentThunk.ts +++ b/src/app/store/slices/storage/storage.thunks/fetchFolderContentThunk.ts @@ -29,7 +29,6 @@ export const fetchPaginatedFolderContentThunk = createAsyncThunk Date: Fri, 23 Aug 2024 16:48:44 +0200 Subject: [PATCH 03/10] [PB-2612] fix backup items name --- .../BackupsAsFoldersList/BackupsAsFoldersList.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/app/backups/components/BackupsAsFoldersList/BackupsAsFoldersList.tsx b/src/app/backups/components/BackupsAsFoldersList/BackupsAsFoldersList.tsx index 9cd08297c..c1603209e 100644 --- a/src/app/backups/components/BackupsAsFoldersList/BackupsAsFoldersList.tsx +++ b/src/app/backups/components/BackupsAsFoldersList/BackupsAsFoldersList.tsx @@ -45,8 +45,9 @@ export default function BackupsAsFoldersList({ const storageClient = SdkFactory.getNewApiInstance().createNewStorageClient(); const [responsePromise] = storageClient.getFolderContentByUuid(folderId); const response = await responsePromise; - const folders = response.children.map((folder) => ({ ...folder, isFolder: true })); - const items = _.concat(folders as DriveItemData[], response.files as DriveItemData[]); + const files = response.files.map((file) => ({ ...file, isFolder: false, name: file.plainName })); + const folders = response.children.map((folder) => ({ ...folder, isFolder: true, name: folder.plainName })); + const items = _.concat(folders as DriveItemData[], files as DriveItemData[]); setCurrentItems(items); setIsloading(false); } @@ -128,9 +129,7 @@ export default function BackupsAsFoldersList({ isLoading={isLoading} itemComposition={[ (item) => { - const displayName = item.type - ? `${item.plainName ?? item.name}.${item.type}` - : item.plainName ?? item.name; + const displayName = item.type === 'folder' ? item.name : `${item.plainName}.${item.type}`; const Icon = iconService.getItemIcon(item.isFolder, item.type); return ( From 3508926a3d0b9fc96c8b20f74b5913787d09ff69 Mon Sep 17 00:00:00 2001 From: Rafa Date: Fri, 23 Aug 2024 19:35:20 +0200 Subject: [PATCH 04/10] [PB-2614] add download folders in the backups breadcrumb --- .../BackupsAsFoldersList/BackupsAsFoldersList.tsx | 2 ++ .../BreadcrumbsMenu/BreadcrumbsMenuBackups.tsx | 10 ++++++++-- src/app/store/slices/backups/index.ts | 5 +++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/app/backups/components/BackupsAsFoldersList/BackupsAsFoldersList.tsx b/src/app/backups/components/BackupsAsFoldersList/BackupsAsFoldersList.tsx index c1603209e..ec0635169 100644 --- a/src/app/backups/components/BackupsAsFoldersList/BackupsAsFoldersList.tsx +++ b/src/app/backups/components/BackupsAsFoldersList/BackupsAsFoldersList.tsx @@ -18,6 +18,7 @@ import List from '../../../shared/components/List'; import { deleteItemsThunk } from '../../../store/slices/storage/storage.thunks/deleteItemsThunk'; import { downloadItemsThunk } from '../../../store/slices/storage/storage.thunks/downloadItemsThunk'; import { uiActions } from '../../../store/slices/ui'; +import { backupsActions } from 'app/store/slices/backups'; export default function BackupsAsFoldersList({ className = '', @@ -159,6 +160,7 @@ export default function BackupsAsFoldersList({ isSelected: false, })); onItemSelected([...unselectedDevices, { device: item, isSelected: true }]); + dispatch(backupsActions.setCurrentFolder(item)); }} onDoubleClick={onClick} skinSkeleton={Skeleton} diff --git a/src/app/shared/components/Breadcrumbs/BreadcrumbsMenu/BreadcrumbsMenuBackups.tsx b/src/app/shared/components/Breadcrumbs/BreadcrumbsMenu/BreadcrumbsMenuBackups.tsx index 36e112d48..32c043e2f 100644 --- a/src/app/shared/components/Breadcrumbs/BreadcrumbsMenu/BreadcrumbsMenuBackups.tsx +++ b/src/app/shared/components/Breadcrumbs/BreadcrumbsMenu/BreadcrumbsMenuBackups.tsx @@ -14,16 +14,22 @@ const BreadcrumbsMenuBackups = (props: BreadcrumbsMenuProps): JSX.Element => { const dispatch = useAppDispatch(); const { breadcrumbDirtyName } = useDriveItemStoreProps(); const currentDevice = useAppSelector((state) => state.backups.currentDevice); + const currentFolder = useAppSelector((state) => state.backups.currentFolder); const path = getAppConfig().views.find((view) => view.path === location.pathname); const pathId = path?.id; const isSharedView = pathId === 'shared'; + const isFolder = props.items.length > 2; const onDeleteBackupButtonClicked = () => { dispatch(uiActions.setIsDeleteBackupDialog(true)); }; - const onDownloadBackupButtonClicked = () => { - dispatch(downloadItemsThunk([currentDevice as DriveItemData])); + const onDownloadBackupButtonClicked = async () => { + if (isFolder) { + dispatch(downloadItemsThunk([currentFolder as DriveItemData])); + } else { + dispatch(downloadItemsThunk([currentDevice as DriveItemData])); + } }; return ( diff --git a/src/app/store/slices/backups/index.ts b/src/app/store/slices/backups/index.ts index b4484b6e3..ab050e401 100644 --- a/src/app/store/slices/backups/index.ts +++ b/src/app/store/slices/backups/index.ts @@ -15,6 +15,7 @@ interface BackupsState { currentDevice: Device | DriveFolderData | null; devices: (Device | DriveFolderData)[]; backups: DeviceBackup[]; + currentFolder: Device | DriveFolderData | null; } const initialState: BackupsState = { @@ -23,6 +24,7 @@ const initialState: BackupsState = { currentDevice: null, devices: [], backups: [], + currentFolder: null, }; export const fetchDevicesThunk = createAsyncThunk, void, { state: RootState }>( @@ -154,6 +156,9 @@ export const backupsSlice = createSlice({ state.currentDevice = action.payload; state.backups = []; }, + setCurrentFolder: (state, action: PayloadAction) => { + state.currentFolder = action.payload; + }, }, extraReducers: (builder) => { builder From 8ad6add0ecbd080652f524508a6bf6cae16ac39b Mon Sep 17 00:00:00 2001 From: inxtci Date: Mon, 26 Aug 2024 09:56:37 +0000 Subject: [PATCH 05/10] [skip ci] Bump version v1.0.310 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3c5f6e182..badd3f1ed 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "drive-web", - "version": "v1.0.309", + "version": "v1.0.310", "private": true, "dependencies": { "@headlessui/react": "1.7.5", From 7192931aeb4e31d653eab8e60ce23e7d0e4d6c33 Mon Sep 17 00:00:00 2001 From: Rafa Date: Mon, 26 Aug 2024 12:17:57 +0200 Subject: [PATCH 06/10] updated sdk version --- package.json | 2 +- .../Containers/BreadcrumbsBackupsView.tsx | 5 +++- yarn.lock | 27 ++++--------------- 3 files changed, 10 insertions(+), 24 deletions(-) diff --git a/package.json b/package.json index 3c5f6e182..2d8321bdf 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "@iconscout/react-unicons": "^1.1.6", "@internxt/inxt-js": "=1.2.21", "@internxt/lib": "^1.2.0", - "@internxt/sdk": "^1.5.11", + "@internxt/sdk": "^1.5.13", "@phosphor-icons/react": "^2.1.7", "@popperjs/core": "^2.11.6", "@reduxjs/toolkit": "^1.6.0", diff --git a/src/app/shared/components/Breadcrumbs/Containers/BreadcrumbsBackupsView.tsx b/src/app/shared/components/Breadcrumbs/Containers/BreadcrumbsBackupsView.tsx index 03d5194a1..6fc941789 100644 --- a/src/app/shared/components/Breadcrumbs/Containers/BreadcrumbsBackupsView.tsx +++ b/src/app/shared/components/Breadcrumbs/Containers/BreadcrumbsBackupsView.tsx @@ -51,7 +51,10 @@ const BreadcrumbsBackupsView = ({ backupsAsFoldersPath.forEach((item, i) => { const clickableOptions = { active: true, - onClick: () => goToFolder(item.id), + onClick: () => { + dispatch(backupsActions.setCurrentFolder(item)); + goToFolder(item.id); + }, }; items.push({ uuid: item.uuid, diff --git a/yarn.lock b/yarn.lock index ffbf9c7bb..7bca6d061 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1612,10 +1612,10 @@ resolved "https://npm.pkg.github.com/download/@internxt/prettier-config/1.0.2/5bd220b8de76734448db5475b3e0c01f9d22c19b#5bd220b8de76734448db5475b3e0c01f9d22c19b" integrity sha512-t4HiqvCbC7XgQepwWlIaFJe3iwW7HCf6xOSU9nKTV0tiGqOPz7xMtIgLEloQrDA34Cx4PkOYBXrvFPV6RxSFAA== -"@internxt/sdk@^1.5.11": - version "1.5.11" - resolved "https://npm.pkg.github.com/download/@internxt/sdk/1.5.11/194f9b90accf09fdca3c04c5651fb6150d1362a2#194f9b90accf09fdca3c04c5651fb6150d1362a2" - integrity sha512-VODAZFuq2sncVrJkpfj3x31P3uevsg22iP0ID4SpN99yMYd+WprKO//G/FXpKZjbZSbh/4xRQ804Fdp4yPXokw== +"@internxt/sdk@^1.5.13": + version "1.5.13" + resolved "https://npm.pkg.github.com/download/@internxt/sdk/1.5.13/6f10ce1ddb39e17233c81ad4d56780407af0c10b#6f10ce1ddb39e17233c81ad4d56780407af0c10b" + integrity sha512-BNtwO8IJE48z1KQFMBUSk0q5jeJ5u437lVGRvCIWO60AVhTcV3eLHftiVbTEVITbuxuu/7eKMNzWoAsZRPBzCg== dependencies: axios "^0.24.0" query-string "^7.1.0" @@ -4811,7 +4811,7 @@ cross-spawn@^7.0.0, cross-spawn@^7.0.1, cross-spawn@^7.0.2, cross-spawn@^7.0.3: shebang-command "^2.0.0" which "^2.0.1" -crypto-browserify@^3.12.0: +crypto-browserify@^3.12.0, "crypto@npm:crypto-browserify": version "3.12.0" resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" integrity sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg== @@ -4838,23 +4838,6 @@ crypto-random-string@^2.0.0: resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-2.0.0.tgz#ef2a7a966ec11083388369baa02ebead229b30d5" integrity sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA== -"crypto@npm:crypto-browserify": - version "3.12.0" - resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" - integrity sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg== - dependencies: - browserify-cipher "^1.0.0" - browserify-sign "^4.0.0" - create-ecdh "^4.0.0" - create-hash "^1.1.0" - create-hmac "^1.1.0" - diffie-hellman "^5.0.0" - inherits "^2.0.1" - pbkdf2 "^3.0.3" - public-encrypt "^4.0.0" - randombytes "^2.0.0" - randomfill "^1.0.3" - css-blank-pseudo@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/css-blank-pseudo/-/css-blank-pseudo-3.0.3.tgz#36523b01c12a25d812df343a32c322d2a2324561" From 86b221b52addd336b2b8f35f1688e93f34405511 Mon Sep 17 00:00:00 2001 From: inxtci Date: Mon, 26 Aug 2024 10:27:42 +0000 Subject: [PATCH 07/10] [skip ci] Bump version v1.0.311 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b534cb691..7af045907 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "drive-web", - "version": "v1.0.310", + "version": "v1.0.311", "private": true, "dependencies": { "@headlessui/react": "1.7.5", From 2efddca389aa7962306c27c1127d467f752ce9d9 Mon Sep 17 00:00:00 2001 From: Xavier Abad <77491413+masterprog-cmd@users.noreply.github.com> Date: Mon, 26 Aug 2024 17:48:43 +0200 Subject: [PATCH 08/10] feat: discount for coupons who has the fixed price disc --- .../payment/components/checkout/ProductCardComponent.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/app/payment/components/checkout/ProductCardComponent.tsx b/src/app/payment/components/checkout/ProductCardComponent.tsx index 393768c67..e2d7ae519 100644 --- a/src/app/payment/components/checkout/ProductCardComponent.tsx +++ b/src/app/payment/components/checkout/ProductCardComponent.tsx @@ -61,6 +61,11 @@ export const ProductFeaturesComponent = ({ const planAmount = getProductAmount(selectedPlan.decimalAmount, couponCodeData).toFixed(2); const upsellPlanAmount = upsellManager.amount && getProductAmount(upsellManager.amount, couponCodeData).toFixed(2); + const discountPercentage = + couponCodeData?.amountOff && couponCodeData?.amountOff < selectedPlan.amount + ? ((couponCodeData?.amountOff / selectedPlan.amount) * 100).toFixed(2) + : undefined; + return (
@@ -91,7 +96,7 @@ export const ProductFeaturesComponent = ({

{translate('checkout.productCard.saving', { - percent: couponCodeData?.percentOff, + percent: couponCodeData?.percentOff ?? discountPercentage, })}

From d4dc297b5bc84df2e6aea9bd17c79c6e7238722f Mon Sep 17 00:00:00 2001 From: Rafa Date: Tue, 27 Aug 2024 10:11:09 +0200 Subject: [PATCH 09/10] [PB-2687] fix download folder from backups breadcrumbs --- .../components/BackupsAsFoldersList/BackupsAsFoldersList.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/backups/components/BackupsAsFoldersList/BackupsAsFoldersList.tsx b/src/app/backups/components/BackupsAsFoldersList/BackupsAsFoldersList.tsx index ec0635169..294eb0ebf 100644 --- a/src/app/backups/components/BackupsAsFoldersList/BackupsAsFoldersList.tsx +++ b/src/app/backups/components/BackupsAsFoldersList/BackupsAsFoldersList.tsx @@ -78,6 +78,7 @@ export default function BackupsAsFoldersList({ if (!isLoading) { setIsloading(true); onFolderPush(item as DriveFolderData); + dispatch(backupsActions.setCurrentFolder(item)); } } else { dispatch(uiActions.setIsFileViewerOpen(true)); @@ -160,7 +161,6 @@ export default function BackupsAsFoldersList({ isSelected: false, })); onItemSelected([...unselectedDevices, { device: item, isSelected: true }]); - dispatch(backupsActions.setCurrentFolder(item)); }} onDoubleClick={onClick} skinSkeleton={Skeleton} From c36d0e224b417654d5a3525de98eeb43039b4e79 Mon Sep 17 00:00:00 2001 From: inxtci Date: Tue, 27 Aug 2024 10:55:01 +0000 Subject: [PATCH 10/10] [skip ci] Bump version v1.0.312 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7af045907..35cb945ca 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "drive-web", - "version": "v1.0.311", + "version": "v1.0.312", "private": true, "dependencies": { "@headlessui/react": "1.7.5",