Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified packages/core/internxt-drive-desktop-core-0.1.13.tgz
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/core/src/frontend/core/i18n/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ export const en = {
FILE_SIZE_TOO_BIG: 'File size too big (max 40GB)',
FOLDER_ACCESS_DENIED: 'The app does not have permission to access this folder',
FOLDER_DOES_NOT_EXIST: 'Folder does not exist',
INVALID_WINDOWS_NAME: String.raw`Windows does not allow names that include the characters \ / : * ? " < > |`,
INVALID_WINDOWS_NAME: String.raw`Windows does not allow names that include \ / : * ? " < > | or start/end with spaces`,
NETWORK_CONNECTIVITY_ERROR: 'Network connectivity error.',
NOT_ENOUGH_SPACE: 'You have not enough space to complete the operation',
PARENT_FOLDER_DOES_NOT_EXIST: 'Parent folder does not exist',
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/frontend/core/i18n/locales/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ export const es: Translation = {
FILE_SIZE_TOO_BIG: 'Archivo es demasiado grande (máximo 40GB)',
FOLDER_ACCESS_DENIED: 'La app no tiene permiso para acceder a esta carpeta',
FOLDER_DOES_NOT_EXIST: 'Carpeta no existe',
INVALID_WINDOWS_NAME: String.raw`Windows no permite nombres que incluyen los caracteres \ / : * ? " < > |`,
INVALID_WINDOWS_NAME: String.raw`Windows no permite nombres que incluyan \ / : * ? " < > | o que comiencen/terminen con espacios`,
NETWORK_CONNECTIVITY_ERROR: 'Error de conectividad de red',
NOT_ENOUGH_SPACE: 'No tienes suficiente espacio para completar la operación',
PARENT_FOLDER_DOES_NOT_EXIST: 'Carpeta padre no existe',
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/frontend/core/i18n/locales/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ export const fr: Translation = {
FILE_SIZE_TOO_BIG: 'Le fichier est trop grand (max 40GB)',
FOLDER_ACCESS_DENIED: "L'app n'a pas le droit d'accéder à cette dossier",
FOLDER_DOES_NOT_EXIST: 'Dossier non existant',
INVALID_WINDOWS_NAME: String.raw`Windows ne permet pas les noms contenant les caractères \ / : * ? " < > |`,
INVALID_WINDOWS_NAME: String.raw`Windows ne permet pas les noms contenant \ / : * ? " < > | ou commençant/terminant par des espaces`,
NETWORK_CONNECTIVITY_ERROR: 'Erreur de connectivité réseau',
NOT_ENOUGH_SPACE: "Vous n'avez pas assez d'espace pour compléter l'opération",
PARENT_FOLDER_DOES_NOT_EXIST: 'Dossier parent non existant',
Expand Down
30 changes: 20 additions & 10 deletions src/context/virtual-drive/items/validate-windows-name.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,53 +9,63 @@ describe('validate-windows-name', () => {
return mockProps<typeof validateWindowsName>({ name });
}

it('Should return true when the name is valid', () => {
it('should return true when the name is valid', () => {
const result = validateWindowsName(getProps({ name: 'test' }));
expect(result.isValid).toBe(true);
});

it('Should return false when the name includes \\', () => {
it('should return false when the name includes \\', () => {
const result = validateWindowsName(getProps({ name: '\\test' }));
expect(result.isValid).toBe(false);
});

it('Should return false when the name includes /', () => {
it('should return false when the name includes /', () => {
const result = validateWindowsName(getProps({ name: '/test' }));
expect(result.isValid).toBe(false);
});

it('Should return false when the name includes :', () => {
it('should return false when the name includes :', () => {
const result = validateWindowsName(getProps({ name: ':test' }));
expect(result.isValid).toBe(false);
});

it('Should return false when the name includes *', () => {
it('should return false when the name includes *', () => {
const result = validateWindowsName(getProps({ name: '*test' }));
expect(result.isValid).toBe(false);
});

it('Should return false when the name includes ?', () => {
it('should return false when the name includes ?', () => {
const result = validateWindowsName(getProps({ name: '?test' }));
expect(result.isValid).toBe(false);
});

it('Should return false when the name includes "', () => {
it('should return false when the name includes "', () => {
const result = validateWindowsName(getProps({ name: '"test' }));
expect(result.isValid).toBe(false);
});

it('Should return false when the name includes <', () => {
it('should return false when the name includes <', () => {
const result = validateWindowsName(getProps({ name: '<test' }));
expect(result.isValid).toBe(false);
});

it('Should return false when the name includes >', () => {
it('should return false when the name includes >', () => {
const result = validateWindowsName(getProps({ name: '>test' }));
expect(result.isValid).toBe(false);
});

it('Should return false when the name includes |', () => {
it('should return false when the name includes |', () => {
const result = validateWindowsName(getProps({ name: '|test' }));
expect(result.isValid).toBe(false);
});

it('should return false when the name starts with empty space', () => {
const result = validateWindowsName(getProps({ name: ' test' }));
expect(result.isValid).toBe(false);
});

it('should return false when the name ends with empty space', () => {
const result = validateWindowsName(getProps({ name: 'test ' }));
expect(result.isValid).toBe(false);
});
});
2 changes: 1 addition & 1 deletion src/context/virtual-drive/items/validate-windows-name.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function validateWindowsName({ path, name }: TProps) {
* v2.5.3 Daniel Jiménez
* These characters are invalid in windows paths.
*/
const forbiddenPattern = /[<>:"/\\|?*]/;
const forbiddenPattern = /[<>:"/\\|?*]|^\s|\s$/;
const isValid = !forbiddenPattern.test(name);

if (!isValid) {
Expand Down
Loading