From 42748cec4b6ba9336a29f2aa908d5162b5e2f6c3 Mon Sep 17 00:00:00 2001 From: AlexisG Date: Fri, 20 Dec 2024 14:29:55 +0100 Subject: [PATCH] feat: Upgrade cozy-ui 115.0.2 And apply BC --- package.json | 2 +- src/components/FileHistory/HistoryModal.jsx | 2 +- .../FolderPicker/FolderPickerListItem.tsx | 5 ++++- src/declarations.d.ts | 2 +- src/locales/de.json | 4 ++-- src/locales/en.json | 6 +++--- src/locales/es.json | 4 ++-- src/locales/fr.json | 6 +++--- src/locales/it.json | 4 ++-- src/locales/ja.json | 4 ++-- src/locales/nl_NL.json | 4 ++-- src/locales/ru.json | 4 ++-- yarn.lock | 16 ++++++++-------- 13 files changed, 33 insertions(+), 30 deletions(-) diff --git a/package.json b/package.json index 48f4f7f7ae..bcf4af15c5 100644 --- a/package.json +++ b/package.json @@ -98,7 +98,7 @@ "cozy-scripts": "^8.4.0", "cozy-sharing": "^16.17.0", "cozy-stack-client": "^51.6.0", - "cozy-ui": "^114.0.1", + "cozy-ui": "^115.0.2", "cozy-viewer": "^10.0.0", "date-fns": "2.30.0", "diacritics": "1.3.0", diff --git a/src/components/FileHistory/HistoryModal.jsx b/src/components/FileHistory/HistoryModal.jsx index b6d4bb937a..fdf6e4bbce 100644 --- a/src/components/FileHistory/HistoryModal.jsx +++ b/src/components/FileHistory/HistoryModal.jsx @@ -14,7 +14,7 @@ import { translate } from 'cozy-ui/transpiled/react/providers/I18n' import styles from './styles.styl' const formatDate = (date, f) => { - return f(date, 'DD MMMM - HH:mm') + return f(date, 'dd LLLL - HH:mm') } const HistoryModal = ({ diff --git a/src/components/FolderPicker/FolderPickerListItem.tsx b/src/components/FolderPicker/FolderPickerListItem.tsx index 1e5df6665c..f750622611 100644 --- a/src/components/FolderPicker/FolderPickerListItem.tsx +++ b/src/components/FolderPicker/FolderPickerListItem.tsx @@ -36,7 +36,10 @@ const FolderPickerListItem: FC = ({ onClick(file) } - const formattedUpdatedAt = f(file.updated_at, t('table.row_update_format')) + const formattedUpdatedAt = f( + new Date(file.updated_at), + t('table.row_update_format') + ) const formattedSize = file.size ? filesize(file.size, { base: 10 }) : undefined diff --git a/src/declarations.d.ts b/src/declarations.d.ts index 36e56c638d..1ec7685ba0 100644 --- a/src/declarations.d.ts +++ b/src/declarations.d.ts @@ -25,7 +25,7 @@ declare module 'cozy-ui/transpiled/react' { declare module 'cozy-ui/transpiled/react/providers/I18n' { export const useI18n: () => { t: (key: string, options?: Record) => string - f: (date: string, format: string) => string + f: (date: Date | number, format: string) => string lang: string } } diff --git a/src/locales/de.json b/src/locales/de.json index 53de1fc6ed..3ee5b7776a 100644 --- a/src/locales/de.json +++ b/src/locales/de.json @@ -149,8 +149,8 @@ "head_size": "Größe", "head_status": "Teilen", "head_thumbnail_size": "Wechsele die Größe des Vorschaubildes", - "row_update_format": "DD.MM.YYYY", - "row_update_format_full": "DD.MM.YYYY", + "row_update_format": "dd.LL.yyyy", + "row_update_format_full": "dd.LL.yyyy", "row_read_only": "Freigeben (nur Lesen)", "row_read_write": "Freigeben (Lesen & Schreiben)", "row_size_symbols": { diff --git a/src/locales/en.json b/src/locales/en.json index f4782f9f9d..5c49ab3010 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -157,8 +157,8 @@ "head_size": "Size", "head_status": "Share", "head_thumbnail_size": "Switch thumbnail size", - "row_update_format": "MMM D, YYYY", - "row_update_format_full": "MMMM D, YYYY", + "row_update_format": "LLL d, yyyy", + "row_update_format_full": "LLLL d, yyyy", "row_read_only": "Share (Read only)", "row_read_write": "Share (Read & Write)", "row_size_symbols": { @@ -796,7 +796,7 @@ "label": "Open directory" }, "LastUpdate": { - "titleFormat": "MMMM DD, YYYY, HH:MM" + "titleFormat": "LLLL dd, yyyy, HH:MM" }, "PublicNoteRedirect": { "error": { diff --git a/src/locales/es.json b/src/locales/es.json index 98fb6d6ce0..b7dae07fb3 100644 --- a/src/locales/es.json +++ b/src/locales/es.json @@ -142,8 +142,8 @@ "head_size": "Tamaño", "head_status": "Compartir", "head_thumbnail_size": "Cambiar el tamaño de las miniaturas", - "row_update_format": "MMM D, AAAA", - "row_update_format_full": "MMM D, AAAA", + "row_update_format": "LLL d, yyyy", + "row_update_format_full": "LLL d, yyyy", "row_read_only": "Compartido (sólo en lectura)", "row_read_write": "Compartido (Lectura & Escritura)", "row_size_symbols": { diff --git a/src/locales/fr.json b/src/locales/fr.json index 80efbac8d9..59b5a9c861 100644 --- a/src/locales/fr.json +++ b/src/locales/fr.json @@ -157,8 +157,8 @@ "head_size": "Taille", "head_status": "Partage", "head_thumbnail_size": "Changer la taille des miniatures", - "row_update_format": "D MMM YYYY", - "row_update_format_full": "D MMMM YYYY", + "row_update_format": "d LLL yyyy", + "row_update_format_full": "d LLLL yyyy", "row_read_only": "Partagé (lecture seule)", "row_read_write": "Partagé (lecture & écriture)", "row_size_symbols": { @@ -797,7 +797,7 @@ "label": "Ouvrir le dossier" }, "LastUpdate": { - "titleFormat": "DD MMMM YYYY, HH:MM" + "titleFormat": "dd LLLL yyyy, HH:MM" }, "PublicNoteRedirect": { "error": { diff --git a/src/locales/it.json b/src/locales/it.json index fac4dbb98a..43edef1e1b 100644 --- a/src/locales/it.json +++ b/src/locales/it.json @@ -138,8 +138,8 @@ "head_name": "Nome", "head_update": "Ultimo aggiornamento", "head_size": "Dimensione", - "row_update_format": "MMM D, YYYY", - "row_update_format_full": "MMMM D, YYYY", + "row_update_format": "LLL d, yyyy", + "row_update_format_full": "LLLL d, yyyy", "row_read_only": "Condividi (Solo Lettura)", "row_read_write": "Condividi (Lettura e Scrittura)", "row_size_symbols": { diff --git a/src/locales/ja.json b/src/locales/ja.json index 0b593c0a6a..7262522243 100644 --- a/src/locales/ja.json +++ b/src/locales/ja.json @@ -134,8 +134,8 @@ "head_update": "最終更新", "head_size": "サイズ", "head_thumbnail_size": "サムネイルのサイズを切り替え", - "row_update_format": "yyyy/MM/dd", - "row_update_format_full": "YYYY/MM/DD", + "row_update_format": "yyyy/LL/dd", + "row_update_format_full": "yyyy/LL/dd", "row_read_only": "共有 (読み取り専用)", "row_read_write": "共有 (読み書き)", "row_size_symbols": { diff --git a/src/locales/nl_NL.json b/src/locales/nl_NL.json index 18dac23d76..e7124f6412 100644 --- a/src/locales/nl_NL.json +++ b/src/locales/nl_NL.json @@ -151,8 +151,8 @@ "head_size": "Grootte", "head_status": "Delen", "head_thumbnail_size": "Miniatuurgrootte aanpassen", - "row_update_format": "MMM D, YYYY", - "row_update_format_full": "MMMM D, YYYY", + "row_update_format": "LLL d, yyyy", + "row_update_format_full": "LLLL d, yyyy", "row_read_only": "Delen (alleen-lezen)", "row_read_write": "Delen (lezen en bewerken)", "row_size_symbols": { diff --git a/src/locales/ru.json b/src/locales/ru.json index 8b9fe4c047..310b5fc23f 100644 --- a/src/locales/ru.json +++ b/src/locales/ru.json @@ -110,8 +110,8 @@ "head_name": "Имя", "head_update": "Последнее обновление", "head_size": "Размер", - "row_update_format": "MMM D, YYYY", - "row_update_format_full": "MMMM D, YYYY", + "row_update_format": "LLL d, yyyy", + "row_update_format_full": "LLLL d, yyyy", "row_read_only": "Поделится (Чтение)", "row_read_write": "Поделится (Чтение и Запись)", "row_size_symbols": { diff --git a/yarn.lock b/yarn.lock index d6408eb69e..a6338f76f6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6691,10 +6691,10 @@ cozy-tsconfig@1.2.0: resolved "https://registry.yarnpkg.com/cozy-tsconfig/-/cozy-tsconfig-1.2.0.tgz#17e61f960f139fae4d26cbac2254b9ab632b269e" integrity sha512-TRHnY9goF3FzVlUbP7BcHxuN2XAA4AmppT4fHHZmTKaSwYTByVR1Al+riFMDbce94kJZ1wzl9WNLWQuqzGZ6Cw== -cozy-ui@^114.0.1: - version "114.0.1" - resolved "https://registry.yarnpkg.com/cozy-ui/-/cozy-ui-114.0.1.tgz#c3321fbb3272868d50d32dae1792a5668d06bb7f" - integrity sha512-uq0SnZrUPMTya5NiRHxo9qVU/8s59RpO4M1S5w6oglChO+CZSavNi69FNi/bYaBtzrULEXyeXt1QDdRMgRP7gg== +cozy-ui@^115.0.2: + version "115.0.2" + resolved "https://registry.yarnpkg.com/cozy-ui/-/cozy-ui-115.0.2.tgz#8976de6e6141bd7255092f6e432ddacdb18d4689" + integrity sha512-U74ebvEQdQC1eNTfOEacHAM3yinNHVE3FfmvXyiIg2L0Yrjl2jk2LibdNVq5apHVqVKyJCe6El+tnVsX7x7rDg== dependencies: "@babel/runtime" "^7.3.4" "@material-ui/core" "4.12.3" @@ -6703,7 +6703,7 @@ cozy-ui@^114.0.1: chart.js "3.7.1" classnames "^2.2.5" cozy-interapp "^0.5.4" - date-fns "^1.28.5" + date-fns "2.30.0" filesize "8.0.7" hammerjs "^2.0.8" intersection-observer "0.11.0" @@ -7078,7 +7078,7 @@ date-fns@2.30.0, date-fns@^2.22.1: dependencies: "@babel/runtime" "^7.21.0" -date-fns@^1.28.5, date-fns@^1.30.1: +date-fns@^1.30.1: version "1.30.1" resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.30.1.tgz#2e71bf0b119153dbb4cc4e88d9ea5acfb50dc05c" integrity sha512-hBSVCvSmWC+QypYObzwGOd9wqdDpOt+0wl0KbU+R+uuZBS1jN8VsD1ss3irQDknRj5NvxiTF6oj/nDRnN/UQNw== @@ -13060,9 +13060,9 @@ msgpack5@^4.0.2: readable-stream "^2.3.6" safe-buffer "^5.1.2" -"mui-bottom-sheet@https://github.com/cozy/mui-bottom-sheet.git#v1.0.9": +"mui-bottom-sheet@git+https://github.com/cozy/mui-bottom-sheet.git#v1.0.9": version "1.0.8" - resolved "https://github.com/cozy/mui-bottom-sheet.git#3dc4c2a245ab39079bc2f73546bccf80847be14c" + resolved "git+https://github.com/cozy/mui-bottom-sheet.git#3dc4c2a245ab39079bc2f73546bccf80847be14c" dependencies: "@juggle/resize-observer" "^3.1.3" jest-environment-jsdom-sixteen "^1.0.3"