From f5247c9dfea31174c08ec2bf671ced2e221c6d94 Mon Sep 17 00:00:00 2001 From: Luiz Gribner Date: Wed, 20 Nov 2024 19:55:38 -0300 Subject: [PATCH 1/9] Translate completed to Portuguese-BR --- src/gui/src/i18n/translations/br.js | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/gui/src/i18n/translations/br.js b/src/gui/src/i18n/translations/br.js index 776e0ddf2..a28db8e45 100644 --- a/src/gui/src/i18n/translations/br.js +++ b/src/gui/src/i18n/translations/br.js @@ -350,20 +350,20 @@ const br = { // *********************************** // Missing translations // *********************************** - "change": undefined, // In English: "Change" - "clock_visibility": undefined, // In English: "Clock Visibility" - "reading": undefined, // In English: "Reading %strong%" - "writing": undefined, // In English: "Writing %strong%" - "unzipping": undefined, // In English: "Unzipping %strong%" - "sequencing": undefined, // In English: "Sequencing %strong%" - "zipping": undefined, // In English: "Zipping %strong%" - "Editor": undefined, // In English: "Editor" - "Viewer": undefined, // In English: "Viewer" - "People with access": undefined, // In English: "People with access" - "Share With…": undefined, // In English: "Share With…" - "Owner": undefined, // In English: "Owner" - "You can't share with yourself.": undefined, // In English: "You can't share with yourself." - "This user already has access to this item": undefined, // In English: "This user already has access to this item" + "change": "Alterar", // In English: "Change" + "clock_visibility": "Visibilidade do relógio", // In English: "Clock Visibility" + "reading": "Lendo %strong%", // In English: "Reading %strong%" + "writing": "Escrevendo %strong%", // In English: "Writing %strong%" + "unzipping": "Descompactando %strong%", // In English: "Unzipping %strong%" + "sequencing": "Sequenciando %strong%", // In English: "Sequencing %strong%" + "zipping": "Compactando %strong%", // In English: "Zipping %strong%" + "Editor": "Editor", // In English: "Editor" + "Viewer": "Visualizador", // In English: "Viewer" + "People with access": "Pessoas com acesso", // In English: "People with access" + "Share With…": "Compartilhar com...", // In English: "Share With…" + "Owner": "Proprietário", // In English: "Owner" + "You can't share with yourself.": "Vocẽ não pode compartilhar com você mesmo", // In English: "You can't share with yourself." + "This user already has access to this item": "Esse usuário já tem acesso a esse item", // In English: "This user already has access to this item" } }; From 035de8e73e59276a8a36955877ebe51490e05b26 Mon Sep 17 00:00:00 2001 From: jelveh Date: Wed, 20 Nov 2024 15:21:05 -0800 Subject: [PATCH 2/9] Update UIDesktop.js --- src/gui/src/UI/UIDesktop.js | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/src/gui/src/UI/UIDesktop.js b/src/gui/src/UI/UIDesktop.js index cc724ed55..a8f588949 100644 --- a/src/gui/src/UI/UIDesktop.js +++ b/src/gui/src/UI/UIDesktop.js @@ -166,9 +166,9 @@ async function UIDesktop(options){ window.socket.on('notif.message', async ({ uid, notification }) => { let icon = window.icons[notification.icon]; let round_icon = false; - + if(notification.template === "file-shared-with-you" && notification.fields?.username){ - let profile_pic = await get_profile_picture(notification.fields.username); + let profile_pic = await get_profile_picture(notification.fields?.username); if(profile_pic){ icon = profile_pic; round_icon = true; @@ -208,16 +208,26 @@ async function UIDesktop(options){ }); window.__already_got_unreads = false; - window.socket.on('notif.unreads', ({ unreads }) => { + window.socket.on('notif.unreads', async ({ unreads }) => { if ( window.__already_got_unreads ) return; window.__already_got_unreads = true; for ( const notif_info of unreads ) { const notification = notif_info.notification; - const icon = window.icons[notification.icon]; - + let icon = window.icons[notification.icon]; + let round_icon = false; + + if(notification.template === "file-shared-with-you" && notification.fields?.username){ + let profile_pic = await get_profile_picture(notification.fields?.username); + if(profile_pic){ + icon = profile_pic; + round_icon = true; + } + } + UINotification({ icon, + round_icon, title: notification.title, text: notification.text ?? notification.title, uid: notif_info.uid, @@ -1282,7 +1292,20 @@ async function UIDesktop(options){ .then(response => response.json()) .then(data => { if(data && data.result && data.result.length > 0){ - data.data?.forEach(notification => { + data.data?.forEach(async notification => { + let icon = window.icons['puter-logo.svg']; + let round_icon = false; + + if(notification.template === "file-shared-with-you" && notification.fields?.username){ + let profile_pic = await get_profile_picture(notification.fields?.username); + if(profile_pic){ + icon = profile_pic; + round_icon = true; + notification.round_icon = round_icon; + } + } + notification.icon = icon; + UINotification(notification); }) } From ca2f7b4326a37a21105bf494a2d614c2e86ce5a5 Mon Sep 17 00:00:00 2001 From: Nariman Jelveh Date: Wed, 20 Nov 2024 15:23:19 -0800 Subject: [PATCH 3/9] Update br.js --- src/gui/src/i18n/translations/br.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/gui/src/i18n/translations/br.js b/src/gui/src/i18n/translations/br.js index a28db8e45..310475bc0 100644 --- a/src/gui/src/i18n/translations/br.js +++ b/src/gui/src/i18n/translations/br.js @@ -347,9 +347,6 @@ const br = { "login2fa_recovery_back": "Voltar", "login2fa_recovery_placeholder": "XXXXXXXX", - // *********************************** - // Missing translations - // *********************************** "change": "Alterar", // In English: "Change" "clock_visibility": "Visibilidade do relógio", // In English: "Clock Visibility" "reading": "Lendo %strong%", // In English: "Reading %strong%" From bfacfc2a4e4b50c9e0842f9f2d56de67a598b959 Mon Sep 17 00:00:00 2001 From: jelveh Date: Wed, 20 Nov 2024 15:44:17 -0800 Subject: [PATCH 4/9] fix: sharing notification click opening directories --- src/gui/src/UI/UIDesktop.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/gui/src/UI/UIDesktop.js b/src/gui/src/UI/UIDesktop.js index a8f588949..963fff321 100644 --- a/src/gui/src/UI/UIDesktop.js +++ b/src/gui/src/UI/UIDesktop.js @@ -243,6 +243,18 @@ async function UIDesktop(options){ }), }); }, + click: async (notif) => { + if(notification.template === "file-shared-with-you"){ + let item_path = '/' + notification.fields?.username; + UIWindow({ + path: '/' + notification.fields?.username, + title: path.basename(item_path), + icon: await item_icon({is_dir: true, path: item_path}), + is_dir: true, + app: 'explorer', + }); + } + }, }); } }); @@ -1306,6 +1318,19 @@ async function UIDesktop(options){ } notification.icon = icon; + notification.click = async (notif) => { + if(notification.template === "file-shared-with-you"){ + let item_path = '/' + notification.fields?.username; + UIWindow({ + path: '/' + notification.fields?.username, + title: path.basename(item_path), + icon: await item_icon({is_dir: true, path: item_path}), + is_dir: true, + app: 'explorer', + }); + } + } + UINotification(notification); }) } From 16257a7b5459550ee3782cf32c87a8241325878d Mon Sep 17 00:00:00 2001 From: KernelDeimos Date: Wed, 20 Nov 2024 21:00:03 -0500 Subject: [PATCH 5/9] fix: permission grants in open_item --- src/backend/src/routers/open_item.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/backend/src/routers/open_item.js b/src/backend/src/routers/open_item.js index 1220d5aa6..ce7e2cb89 100644 --- a/src/backend/src/routers/open_item.js +++ b/src/backend/src/routers/open_item.js @@ -84,11 +84,14 @@ module.exports = eggspress('/open_item', { // Note: We always grant write permission here. If the user only // has read permission this is still safe; user permissions // are always checked during an app access. - const permission = `fs:${subject.uid}:write`; - const svc_permission = Context.get('services').get('permission'); - await svc_permission.grant_user_app_permission( - actor, app.uid, permission, {}, { reason: 'open_item' } - ); + const PERMS = action === 'write' ? ['read', 'write'] : ['read']; + for ( const perm of PERMS ) { + const permission = `fs:${subject.uid}:${perm}`; + const svc_permission = Context.get('services').get('permission'); + await svc_permission.grant_user_app_permission( + actor, app.uid, permission, {}, { reason: 'open_item' } + ); + } // Generate user-app token const svc_auth = Context.get('services').get('auth'); From 12cc7539033138cde5882faffa45427ade8775a4 Mon Sep 17 00:00:00 2001 From: tien0412 <75519924+tien0412@users.noreply.github.com> Date: Thu, 21 Nov 2024 10:29:42 +0700 Subject: [PATCH 6/9] finish translation for vi.js --- src/gui/src/i18n/translations/vi.js | 32 ++++++++++++++--------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/gui/src/i18n/translations/vi.js b/src/gui/src/i18n/translations/vi.js index 759b9ecf3..0918143f0 100644 --- a/src/gui/src/i18n/translations/vi.js +++ b/src/gui/src/i18n/translations/vi.js @@ -350,22 +350,22 @@ const vi = { // *********************************** // Missing translations // *********************************** - "change": undefined, // In English: "Change" - "clock_visibility": undefined, // In English: "Clock Visibility" - "plural_suffix": undefined, // In English: "s" - "reading": undefined, // In English: "Reading %strong%" - "writing": undefined, // In English: "Writing %strong%" - "unzipping": undefined, // In English: "Unzipping %strong%" - "sequencing": undefined, // In English: "Sequencing %strong%" - "zipping": undefined, // In English: "Zipping %strong%" - "Editor": undefined, // In English: "Editor" - "Viewer": undefined, // In English: "Viewer" - "People with access": undefined, // In English: "People with access" - "Share With…": undefined, // In English: "Share With…" - "Owner": undefined, // In English: "Owner" - "You can't share with yourself.": undefined, // In English: "You can't share with yourself." - "This user already has access to this item": undefined, // In English: "This user already has access to this item" + "change": 'Thay đổi', // In English: "Change" + "clock_visibility": 'ẩn/hiện đồng hồ', // In English: "Clock Visibility" + "plural_suffix": 'các', // In English: "s" + "reading": 'Đang đọc %strong%', // In English: "Reading %strong%" + "writing": 'Đang ghi dữ liệu %strong%', // In English: "Writing %strong%" + "unzipping": 'Đang giải nén %strong%', // In English: "Unzipping %strong%" + "sequencing": 'Đang đánh thứ tự %strong%', // In English: "Sequencing %strong%" + "zipping": 'Đang nén %strong%', // In English: "Zipping %strong%" + "Editor": 'Người chỉnh sửa', // In English: "Editor" + "Viewer": 'Người xem', // In English: "Viewer" + "People with access": 'Người dùng có quyền truy cập', // In English: "People with access" + "Share With…": 'Chia sẻ với...', // In English: "Share With…" + "Owner": 'Người sở hữu', // In English: "Owner" + "You can't share with yourself.": 'Bạn không thể tự chia sẻ với chính mình', // In English: "You can't share with yourself." + "This user already has access to this item": 'Người dùng này đã có sẵn quyền truy cập cho mục này', // In English: "This user already has access to this item" } }; -export default vi; \ No newline at end of file +export default vi; From 4d0d8e125b220ecd3ac64e2ec9d740aa6f0e727a Mon Sep 17 00:00:00 2001 From: Nariman Jelveh Date: Wed, 20 Nov 2024 19:49:26 -0800 Subject: [PATCH 7/9] Update vi.js --- src/gui/src/i18n/translations/vi.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/gui/src/i18n/translations/vi.js b/src/gui/src/i18n/translations/vi.js index 0918143f0..bf132e03c 100644 --- a/src/gui/src/i18n/translations/vi.js +++ b/src/gui/src/i18n/translations/vi.js @@ -347,9 +347,6 @@ const vi = { login2fa_recovery_back: 'Quay lại', login2fa_recovery_placeholder: 'XXXXXXXX', - // *********************************** - // Missing translations - // *********************************** "change": 'Thay đổi', // In English: "Change" "clock_visibility": 'ẩn/hiện đồng hồ', // In English: "Clock Visibility" "plural_suffix": 'các', // In English: "s" From 2f15d129b6a20759a36fffe22c5baf3c3b47916b Mon Sep 17 00:00:00 2001 From: kiwipix <140586538+kiwipix@users.noreply.github.com> Date: Thu, 21 Nov 2024 11:53:08 +0800 Subject: [PATCH 8/9] Update zhtw.js add translation for missing items --- src/gui/src/i18n/translations/zhtw.js | 28 +++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/gui/src/i18n/translations/zhtw.js b/src/gui/src/i18n/translations/zhtw.js index bec81cd7d..20427dfb0 100644 --- a/src/gui/src/i18n/translations/zhtw.js +++ b/src/gui/src/i18n/translations/zhtw.js @@ -349,20 +349,20 @@ const zhtw = { // *********************************** // Missing translations // *********************************** - "change": undefined, // In English: "Change" - "clock_visibility": undefined, // In English: "Clock Visibility" - "reading": undefined, // In English: "Reading %strong%" - "writing": undefined, // In English: "Writing %strong%" - "unzipping": undefined, // In English: "Unzipping %strong%" - "sequencing": undefined, // In English: "Sequencing %strong%" - "zipping": undefined, // In English: "Zipping %strong%" - "Editor": undefined, // In English: "Editor" - "Viewer": undefined, // In English: "Viewer" - "People with access": undefined, // In English: "People with access" - "Share With…": undefined, // In English: "Share With…" - "Owner": undefined, // In English: "Owner" - "You can't share with yourself.": undefined, // In English: "You can't share with yourself." - "This user already has access to this item": undefined, // In English: "This user already has access to this item" + "change": '更改', // In English: "Change" + "clock_visibility": '時鐘可視性', // In English: "Clock Visibility" + "reading": '正在讀取 %strong%', // In English: "Reading %strong%" + "writing": '正在寫入 %strong%', // In English: "Writing %strong%" + "unzipping": '正在解壓 %strong%', // In English: "Unzipping %strong%" + "sequencing": '正在排序 %strong%', // In English: "Sequencing %strong%" + "zipping": '正在壓縮 %strong%', // In English: "Zipping %strong%" + "Editor": '編輯器', // In English: "Editor" + "Viewer": '檢視者', // In English: "Viewer" + "People with access": '有權限的人', // In English: "People with access" + "Share With…": '分享給……', // In English: "Share With…" + "Owner": '所有者', // In English: "Owner" + "You can't share with yourself.": '您不能與自己分享。', // In English: "You can't share with yourself." + "This user already has access to this item": '該用戶已有訪問此項的權限', // In English: "This user already has access to this item" } }; From 46053f3e7c40aaa56e6ad183d9545baf7b104cf0 Mon Sep 17 00:00:00 2001 From: jelveh Date: Wed, 20 Nov 2024 20:04:00 -0800 Subject: [PATCH 9/9] Update zhtw.js --- src/gui/src/i18n/translations/zhtw.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/gui/src/i18n/translations/zhtw.js b/src/gui/src/i18n/translations/zhtw.js index 20427dfb0..5fdda1b37 100644 --- a/src/gui/src/i18n/translations/zhtw.js +++ b/src/gui/src/i18n/translations/zhtw.js @@ -346,9 +346,6 @@ const zhtw = { login2fa_recovery_back: '返回', login2fa_recovery_placeholder: 'XXXXXXXX', - // *********************************** - // Missing translations - // *********************************** "change": '更改', // In English: "Change" "clock_visibility": '時鐘可視性', // In English: "Clock Visibility" "reading": '正在讀取 %strong%', // In English: "Reading %strong%"