Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
ac4a599
switch to bucket keys
TamaraFinogina Jun 17, 2026
47f9734
fix tests
TamaraFinogina Jun 17, 2026
a404b3b
fix size limit check by useing server's script
TamaraFinogina Jun 17, 2026
a8ef764
use base_ref as variable
TamaraFinogina Jun 17, 2026
110ea79
change to yarn
TamaraFinogina Jun 17, 2026
a78b62d
align dependency with server
TamaraFinogina Jun 17, 2026
1fab86b
Merge remote-tracking branch 'origin/master' into add_new_sharings
TamaraFinogina Jun 17, 2026
d4f0cfa
bring master
TamaraFinogina Jun 17, 2026
e178e75
remove style changes
TamaraFinogina Jun 17, 2026
3e2bacb
fix repeated share
TamaraFinogina Jun 18, 2026
7d21423
add more tests
TamaraFinogina Jun 18, 2026
e57c738
Merge remote-tracking branch 'origin/master' into add_new_sharings
TamaraFinogina Jun 18, 2026
c28df23
add support for v2
TamaraFinogina Jun 18, 2026
dbbb6f8
Merge remote-tracking branch 'origin/master' into add_new_sharings
TamaraFinogina Jun 19, 2026
5dc75a0
don't set mnemonic in local storage
TamaraFinogina Jun 19, 2026
6075eef
add new version to password sharings
TamaraFinogina Jun 23, 2026
d5d5490
Merge remote-tracking branch 'origin/master' into add_new_sharings
TamaraFinogina Jun 25, 2026
dbd983f
Merge remote-tracking branch 'origin/master' into add_new_sharings
TamaraFinogina Jun 25, 2026
8ec99e2
Merge branch 'master' into add_new_sharings
sg-gs Jun 25, 2026
a5da70d
share changes from download PR
TamaraFinogina Jun 26, 2026
86c7ae8
switch to bucket keys
TamaraFinogina Jun 17, 2026
2c5ff9c
fix tests
TamaraFinogina Jun 17, 2026
ded06c8
fix size limit check by useing server's script
TamaraFinogina Jun 17, 2026
621f6df
use base_ref as variable
TamaraFinogina Jun 17, 2026
552b9bb
change to yarn
TamaraFinogina Jun 17, 2026
3b79dfb
align dependency with server
TamaraFinogina Jun 17, 2026
4ee4aba
remove style changes
TamaraFinogina Jun 17, 2026
143d805
fix repeated share
TamaraFinogina Jun 18, 2026
f9597ae
add more tests
TamaraFinogina Jun 18, 2026
11fcd16
add support for v2
TamaraFinogina Jun 18, 2026
2e8b84a
don't set mnemonic in local storage
TamaraFinogina Jun 19, 2026
d1e966b
add new version to password sharings
TamaraFinogina Jun 23, 2026
be86910
share changes from download PR
TamaraFinogina Jun 26, 2026
4cde5e6
Merge branch 'add_new_sharings' of https://github.com/internxt/drive-…
TamaraFinogina Jun 29, 2026
74784bb
Merge remote-tracking branch 'origin/add_new_download' into add_new_s…
TamaraFinogina Jun 29, 2026
34b7e5a
remove auto coma changes
TamaraFinogina Jun 29, 2026
96a5729
add more tests
TamaraFinogina Jun 29, 2026
ca30328
Merge remote-tracking branch 'origin/master' into add_new_sharings
TamaraFinogina Jul 1, 2026
a5b425b
add more tests
TamaraFinogina Jul 1, 2026
2881295
add more tests
TamaraFinogina Jul 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 25 additions & 8 deletions .github/workflows/pr-size-control.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,31 @@
name: PR Size Checker
on: pull_request
name: PR Size Check
on:
pull_request:
types: [opened, synchronize]

jobs:
check_pr_size:
name: Check PR size doesn't break set limit
runs-on: ubuntu-latest
name: Check PR Size
timeout-minutes: 1

steps:
# checkout your code with your git history
- uses: actions/checkout@v2
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: maidsafe/pr_size_checker@v2
with:
max_lines_changed: 500

- name: Get lines changed
run: |
LINES=$(git diff --shortstat origin/${{ github.base_ref }}...HEAD -- . ':!package.json' ':!yarn.lock' | awk '{print $4 + $6}')
echo "Lines changed: $LINES"
echo "LINES_CHANGED=$LINES" >> $GITHUB_ENV

- name: Fail if PR is too big
run: |
if [ "$LINES_CHANGED" -gt 500 ]; then
echo "::error::Large PR ($LINES_CHANGED lines). Please break it down into smaller PRs."
exit 1
else
echo "PR size OK ($LINES_CHANGED lines)"
fi
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"@headlessui/react": "^2.2.10",
"@iconscout/react-unicons": "^1.1.6",
"@internxt/css-config": "1.1.0",
"@internxt/lib": "1.4.1",
"@internxt/lib": "1.4.2",
"@internxt/sdk": "=1.17.12",
"@internxt/ui": "=0.1.21",
"@phosphor-icons/react": "^2.1.7",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import errorService from 'services/error.service';
import { ItemToShare } from 'app/store/slices/storage/types';
import envService from 'services/env.service';
import { copyTextToClipboard } from 'utils/copyToClipboard.utils';
import { SharingMeta } from '@internxt/sdk/dist/drive/share/types';

const { mockActionDispatch, mockUseShareDialogContext, mockTranslate, mockDispatch } = vi.hoisted(() => ({
mockActionDispatch: vi.fn(),
Expand Down Expand Up @@ -49,9 +50,9 @@ describe('Share Item Actions', () => {
const mockSharingMeta = {
id: 'sharing-id-123',
encryptedCode: 'encrypted-code',
token: 'share-token',
code: 'share-code',
};
itemToken: 'share-token',
encryptionAlgorithm: 'encryption-algorithm',
} as SharingMeta;

beforeEach(() => {
vi.clearAllMocks();
Expand Down Expand Up @@ -143,9 +144,7 @@ describe('Share Item Actions', () => {
},
dispatch: mockActionDispatch,
});
const getPublicShareLinkSpy = vi
.spyOn(shareService, 'getPublicShareLink')
.mockResolvedValue(mockSharingMeta as any);
const getPublicShareLinkSpy = vi.spyOn(shareService, 'getPublicShareLink').mockResolvedValue(mockSharingMeta);

const itemToShare = createItemToShare(false);
const { result } = renderHook(() =>
Expand Down Expand Up @@ -243,9 +242,7 @@ describe('Share Item Actions', () => {
},
dispatch: mockActionDispatch,
});
const saveSharingPasswordSpy = vi
.spyOn(shareService, 'saveSharingPassword')
.mockResolvedValue(mockSharingMeta as any);
const saveSharingPasswordSpy = vi.spyOn(shareService, 'saveSharingPassword').mockResolvedValue(mockSharingMeta);

const itemToShare = createItemToShare(true);
const { result } = renderHook(() =>
Expand All @@ -260,17 +257,23 @@ describe('Share Item Actions', () => {

await result.current.onSavePublicSharePassword('my-password');

expect(saveSharingPasswordSpy).toHaveBeenCalledWith('sharing-id-123', 'my-password', 'encrypted-code');
expect(saveSharingPasswordSpy).toHaveBeenCalledWith(
'sharing-id-123',
'my-password',
'encrypted-code',
'encryption-algorithm',
);
expect(mockActionDispatch).toHaveBeenCalledWith(
expect.objectContaining({ type: 'SET_IS_PASSWORD_PROTECTED', payload: true }),
);
expect(mockOnShareItem).toHaveBeenCalled();
});

test('When sharing info does not exist, then creates new public share with password', async () => {
const plainCode = 'test plain code';
const createPublicShareFromOwnerUserSpy = vi
.spyOn(shareService, 'createPublicShareFromOwnerUser')
.mockResolvedValue(mockSharingMeta as any);
.mockResolvedValue({ publicSharingItemData: mockSharingMeta, plainCode });

const itemToShare = createItemToShare(false);
const { result } = renderHook(() =>
Expand All @@ -285,7 +288,9 @@ describe('Share Item Actions', () => {

await result.current.onSavePublicSharePassword('my-password');

expect(createPublicShareFromOwnerUserSpy).toHaveBeenCalledWith('item-uuid-123', 'file', 'my-password');
expect(createPublicShareFromOwnerUserSpy).toHaveBeenCalledWith('item-uuid-123', 'file', {
plainPassword: 'my-password',
});
expect(mockActionDispatch).toHaveBeenCalledWith(
expect.objectContaining({ type: 'SET_SHARING_META', payload: mockSharingMeta }),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,19 @@ export const useShareItemActions = ({
let sharingInfo = sharingMeta;

if (sharingInfo?.encryptedCode) {
await shareService.saveSharingPassword(sharingInfo.id, plainPassword, sharingInfo.encryptedCode);
await shareService.saveSharingPassword(
sharingInfo.id,
plainPassword,
sharingInfo.encryptedCode,
sharingInfo.encryptionAlgorithm,
);
} else {
const itemType = itemToShare?.item.isFolder ? 'folder' : 'file';
const itemId = itemToShare?.item.uuid ?? '';
sharingInfo = await shareService.createPublicShareFromOwnerUser(itemId, itemType, plainPassword);
const { publicSharingItemData } = await shareService.createPublicShareFromOwnerUser(itemId, itemType, {
plainPassword,
});
sharingInfo = publicSharingItemData;
actionDispatch(setSharingMeta(sharingInfo));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import shareService from 'app/share/services/share.service';
import notificationsService, { ToastType } from 'app/notifications/services/notifications.service';
import errorService from 'services/error.service';
import { ItemToShare } from 'app/store/slices/storage/types';
import { SharingMeta, UpdateUserRoleResponse } from '@internxt/sdk/dist/drive/share/types';

const { mockDispatch, mockUseShareDialogContext, mockTranslate } = vi.hoisted(() => ({
mockDispatch: vi.fn(),
Expand All @@ -22,10 +23,19 @@ vi.mock('../context/ShareDialogContextProvider', () => ({

const mockSharingMeta = {
id: 'sharing-id-123',
itemId: 'sharing-itempid',
itemType: 'file',
encryptionKey: 'encrypted-key',
encryptedCode: 'encrypted-code',
token: 'share-token',
code: 'share-code',
};
encryptedPassword: null,
itemToken: 'share-token',
encryptionAlgorithm: 'inxt-v3',
type: 'public',
} as SharingMeta;

const mockUpdateUserRoleResponse = {
message: 'mock-update-user-role-response',
} as UpdateUserRoleResponse;

const mockRoles = [
{ id: '1', name: 'OWNER', createdAt: new Date('2024-01-01'), updatedAt: new Date('2024-01-01') },
Expand Down Expand Up @@ -130,11 +140,11 @@ describe('Share Items User Roles', () => {
});

test('When changing to public mode for file, then updates sharing type and creates public share', async () => {
const mockShareInfo = { token: 'share-token', code: 'share-code' };
const plainCode = 'test plain code';
const updateShareTypeSpy = vi.spyOn(shareService, 'updateSharingType').mockResolvedValue(undefined);
const createPublicShareFromOwnerUserSpy = vi
.spyOn(shareService, 'createPublicShareFromOwnerUser')
.mockResolvedValue(mockShareInfo as any);
.mockResolvedValue({ publicSharingItemData: mockSharingMeta, plainCode });

const itemToShare = createItemToShare(false);
const { result } = renderHook(() => useShareItemUserRoles({ isRestrictedSharingAvailable: true, itemToShare }));
Expand All @@ -144,7 +154,7 @@ describe('Share Items User Roles', () => {
expect(updateShareTypeSpy).toHaveBeenCalledWith('item-uuid-123', 'file', 'public');
expect(createPublicShareFromOwnerUserSpy).toHaveBeenCalledWith('item-uuid-123', 'file');
expect(mockDispatch).toHaveBeenCalledWith(
expect.objectContaining({ type: 'SET_SHARING_META', payload: mockShareInfo }),
expect.objectContaining({ type: 'SET_SHARING_META', payload: mockSharingMeta }),
);
expect(mockDispatch).toHaveBeenCalledWith(
expect.objectContaining({ type: 'SET_IS_PASSWORD_PROTECTED', payload: false }),
Expand Down Expand Up @@ -190,7 +200,7 @@ describe('Share Items User Roles', () => {
test('When changing user role successfully, then updates role in state', async () => {
const updateUserRoleOfSharedFolderSpy = vi
.spyOn(shareService, 'updateUserRoleOfSharedFolder')
.mockResolvedValue(mockSharingMeta as any);
.mockResolvedValue(mockUpdateUserRoleResponse);

const itemToShare = createItemToShare(true);
const { result } = renderHook(() => useShareItemUserRoles({ isRestrictedSharingAvailable: true, itemToShare }));
Expand All @@ -216,7 +226,7 @@ describe('Share Items User Roles', () => {
const itemToShare = createItemToShare(true);
const updateUserRoleOfSharedFolderSpy = vi
.spyOn(shareService, 'updateUserRoleOfSharedFolder')
.mockResolvedValue(mockSharingMeta as any);
.mockResolvedValue(mockUpdateUserRoleResponse);
const { result } = renderHook(() => useShareItemUserRoles({ isRestrictedSharingAvailable: true, itemToShare }));

await result.current.handleUserRoleChange('[email protected]', 'reader');
Expand All @@ -228,7 +238,7 @@ describe('Share Items User Roles', () => {
const itemToShare = createItemToShare(true);
const updateUserRoleOfSharedFolderSpy = vi
.spyOn(shareService, 'updateUserRoleOfSharedFolder')
.mockResolvedValue(mockSharingMeta as any);
.mockResolvedValue(mockUpdateUserRoleResponse);

const { result } = renderHook(() => useShareItemUserRoles({ isRestrictedSharingAvailable: true, itemToShare }));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ export const useShareItemUserRoles = ({ isRestrictedSharingAvailable, itemToShar
await shareService.updateSharingType(itemId, itemType, sharingType);

if (sharingType === 'public') {
const shareInfo = await shareService.createPublicShareFromOwnerUser(itemId, itemType);
const { publicSharingItemData: shareInfo } = await shareService.createPublicShareFromOwnerUser(
itemId,
itemType,
);
actionDispatch(setSharingMeta(shareInfo));
actionDispatch(setIsPasswordProtected(false));
}
Expand Down
Loading
Loading