From f4ed98ebda46b9c1b6a3a1d314f12d4d6c00e121 Mon Sep 17 00:00:00 2001 From: perf3ct Date: Mon, 18 Nov 2024 20:16:39 +0000 Subject: [PATCH 01/14] add renovate GitHub Action and json config --- .github/workflows/renovate.yaml | 25 +++++++++++++++++++++++++ renovate.json | 18 ++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 .github/workflows/renovate.yaml create mode 100644 renovate.json diff --git a/.github/workflows/renovate.yaml b/.github/workflows/renovate.yaml new file mode 100644 index 000000000..29bdd0da8 --- /dev/null +++ b/.github/workflows/renovate.yaml @@ -0,0 +1,25 @@ +name: Renovate +on: + schedule: + # Run every day at 1 AM UTC (before the nightly build at 2 AM UTC) + - cron: '0 1 * * *' + # Allow manual triggering + workflow_dispatch: + +permissions: + contents: write + pull-requests: write + issues: write + +jobs: + renovate: + name: Run Renovate + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Self-hosted Renovate + uses: renovatebot/github-action@v41.0.3 + with: + configurationFile: renovate.json + token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/renovate.json b/renovate.json new file mode 100644 index 000000000..e8531c3a2 --- /dev/null +++ b/renovate.json @@ -0,0 +1,18 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "config:base" + ], + "schedule": ["before 3am"], + "packageRules": [ + { + "matchUpdateTypes": ["minor", "patch"], + "matchCurrentVersion": "!/^0/", + "automerge": false + } + ], + "labels": ["dependencies"], + "prHourlyLimit": 0, + "prConcurrentLimit": 0, + "branchConcurrentLimit": 0 +} \ No newline at end of file From 180993ead901ae8065c7d08cd94bc1f5ec50abf9 Mon Sep 17 00:00:00 2001 From: perf3ct Date: Mon, 18 Nov 2024 20:22:38 +0000 Subject: [PATCH 02/14] make it clear that renovate opened this PR, for easier filtering --- renovate.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/renovate.json b/renovate.json index e8531c3a2..6321b1cb7 100644 --- a/renovate.json +++ b/renovate.json @@ -11,7 +11,7 @@ "automerge": false } ], - "labels": ["dependencies"], + "labels": ["dependencies", "renovate"], "prHourlyLimit": 0, "prConcurrentLimit": 0, "branchConcurrentLimit": 0 From 2b0d68368c9798c19b1bdf4255cec6d7e21cba9e Mon Sep 17 00:00:00 2001 From: SiriusXT <1160925501@qq.com> Date: Tue, 19 Nov 2024 11:08:20 +0800 Subject: [PATCH 03/14] Add box icons to note menu --- .../app/widgets/buttons/note_actions.js | 80 ++++++++++++------- 1 file changed, 49 insertions(+), 31 deletions(-) diff --git a/src/public/app/widgets/buttons/note_actions.js b/src/public/app/widgets/buttons/note_actions.js index bf24a6705..8c70d667d 100644 --- a/src/public/app/widgets/buttons/note_actions.js +++ b/src/public/app/widgets/buttons/note_actions.js @@ -10,44 +10,62 @@ import { t } from "../../services/i18n.js"; const TPL = ` `; export default class NoteActionsWidget extends NoteContextAwareWidget { From 0ba883ce2f9002c5139f4c8b5b276ddc03244b4b Mon Sep 17 00:00:00 2001 From: SiriusXT <1160925501@qq.com> Date: Tue, 19 Nov 2024 12:08:41 +0800 Subject: [PATCH 04/14] Add box icons to note menu --- src/public/app/widgets/buttons/note_actions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/public/app/widgets/buttons/note_actions.js b/src/public/app/widgets/buttons/note_actions.js index 8c70d667d..cdefcbb48 100644 --- a/src/public/app/widgets/buttons/note_actions.js +++ b/src/public/app/widgets/buttons/note_actions.js @@ -55,7 +55,7 @@ const TPL = ` ${t('note_actions.open_note_externally')} From f7b1c3fee39ae4a992733c23a703e1904f6e3e28 Mon Sep 17 00:00:00 2001 From: SiriusXT <1160925501@qq.com> Date: Tue, 19 Nov 2024 14:03:30 +0800 Subject: [PATCH 05/14] Add box icons to note menu --- .../app/widgets/buttons/note_actions.js | 103 +++++++++--------- 1 file changed, 53 insertions(+), 50 deletions(-) diff --git a/src/public/app/widgets/buttons/note_actions.js b/src/public/app/widgets/buttons/note_actions.js index cdefcbb48..7cb0c8c50 100644 --- a/src/public/app/widgets/buttons/note_actions.js +++ b/src/public/app/widgets/buttons/note_actions.js @@ -10,62 +10,65 @@ import { t } from "../../services/i18n.js"; const TPL = ` `; export default class NoteActionsWidget extends NoteContextAwareWidget { From d8e50a2ab85f3e1d649d6df7135def431815449c Mon Sep 17 00:00:00 2001 From: SiriusXT <1160925501@qq.com> Date: Tue, 19 Nov 2024 22:21:33 +0800 Subject: [PATCH 06/14] add icons to the Attachments menu --- .../widgets/buttons/attachments_actions.js | 33 +++++++++++++------ 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/src/public/app/widgets/buttons/attachments_actions.js b/src/public/app/widgets/buttons/attachments_actions.js index b0f0cc2fa..1580753c0 100644 --- a/src/public/app/widgets/buttons/attachments_actions.js +++ b/src/public/app/widgets/buttons/attachments_actions.js @@ -20,6 +20,13 @@ const TPL = ` width: 20em; } + .attachment-actions .dropdown-item .bx { + position: relative; + top: 3px; + font-size: 120%; + margin-right: 5px; + } + .attachment-actions .dropdown-item[disabled], .attachment-actions .dropdown-item[disabled]:hover { color: var(--muted-text-color) !important; background-color: transparent !important; @@ -32,16 +39,22 @@ const TPL = ` style="position: relative; top: 3px;"> From 5d6a42b987c3d60264f8097f8558faa2e2aa96aa Mon Sep 17 00:00:00 2001 From: MeIchthys Date: Tue, 19 Nov 2024 14:22:52 +0000 Subject: [PATCH 07/14] Improve note revision wording and consistency Removed plurals where not needed, capitalized revisions dialog title, made note revision setting titles consistent with note revision dialog. --- src/public/translations/en/translation.json | 24 ++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/public/translations/en/translation.json b/src/public/translations/en/translation.json index 9847b0e24..e74cf0ee1 100644 --- a/src/public/translations/en/translation.json +++ b/src/public/translations/en/translation.json @@ -238,23 +238,23 @@ "confirm_undelete": "Do you want to undelete this note and its sub-notes?" }, "revisions": { - "note_revisions": "Note revisions", + "note_revisions": "Note Revisions", "delete_all_revisions": "Delete all revisions of this note", "delete_all_button": "Delete all revisions", - "help_title": "Help on Note revisions", + "help_title": "Help on Note Revisions", "revision_last_edited": "This revision was last edited on {{date}}", - "confirm_delete_all": "Do you want to delete all revisions of this note? This action will erase revision title and content, but still preserve revision metadata.", + "confirm_delete_all": "Do you want to delete all revisions of this note? This action will erase the revision title and content, but still preserve the revision metadata.", "no_revisions": "No revisions for this note yet...", "restore_button": "Restore this revision", - "confirm_restore": "Do you want to restore this revision? This will overwrite current title and content of the note with this revision.", + "confirm_restore": "Do you want to restore this revision? This will overwrite the current title and content of the note with this revision.", "delete_button": "Delete this revision", - "confirm_delete": "Do you want to delete this revision? This action will delete revision title and content, but still preserve revision metadata.", - "revisions_deleted": "Note revisions has been deleted.", + "confirm_delete": "Do you want to delete this revision? This action will delete the revision title and content, but still preserve the revision metadata.", + "revisions_deleted": "Note revisions have been deleted.", "revision_restored": "Note revision has been restored.", "revision_deleted": "Note revision has been deleted.", - "snapshot_interval": "Note Revisions Snapshot Interval: {{seconds}}s.", - "maximum_revisions": "Maximum revisions for current note: {{number}}.", - "settings": "Settings for Note revisions", + "snapshot_interval": "Note Revision Snapshot Interval: {{seconds}}s.", + "maximum_revisions": "Note Revision Snapshot Limit: {{number}}.", + "settings": "Note Revision Settings", "download_button": "Download", "mime": "MIME: ", "file_size": "File size:", @@ -1108,12 +1108,12 @@ "deleted_notes_erased": "Deleted notes have been erased." }, "revisions_snapshot_interval": { - "note_revisions_snapshot_interval_title": "Note Revisions Snapshot Interval", - "note_revisions_snapshot_description": "Note revision snapshot time interval is time in seconds after which a new note revision will be created for the note. See wiki for more info.", + "note_revisions_snapshot_interval_title": "Note Revision Snapshot Interval", + "note_revisions_snapshot_description": "The Note revision snapshot interval is the time in seconds after which a new note revision will be created for the note. See wiki for more info.", "snapshot_time_interval_label": "Note revision snapshot time interval (in seconds):" }, "revisions_snapshot_limit": { - "note_revisions_snapshot_limit_title": "Note Revision Snapshots Limit", + "note_revisions_snapshot_limit_title": "Note Revision Snapshot Limit", "note_revisions_snapshot_limit_description": "The note revision snapshot number limit refers to the maximum number of revisions that can be saved for each note. Where -1 means no limit, 0 means delete all revisions. You can set the maximum revisions for a single note through the #versioningLimit label.", "snapshot_number_limit_label": "Note revision snapshot number limit:", "erase_excess_revision_snapshots": "Erase excess revision snapshots now", From 75941de449014c02012bd4890c8fe68b1d4efef6 Mon Sep 17 00:00:00 2001 From: Adorian Doran Date: Tue, 19 Nov 2024 17:42:03 +0200 Subject: [PATCH 08/14] Replace the "Existing backups" bulleted list with a table --- .../widgets/type_widgets/options/backup.js | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/public/app/widgets/type_widgets/options/backup.js b/src/public/app/widgets/type_widgets/options/backup.js index fc3c070a4..1cdfddad9 100644 --- a/src/public/app/widgets/type_widgets/options/backup.js +++ b/src/public/app/widgets/type_widgets/options/backup.js @@ -42,7 +42,17 @@ const TPL = `

${t('backup.existing_backups')}

-
    + + + + + + + + + +
    Date and timePath
    +
    `; @@ -73,7 +83,7 @@ export default class BackupOptions extends OptionsWidget { this.$monthlyBackupEnabled.on('change', () => this.updateCheckboxOption('monthlyBackupEnabled', this.$monthlyBackupEnabled)); - this.$existingBackupList = this.$widget.find(".existing-backup-list"); + this.$existingBackupList = this.$widget.find(".existing-backup-list-items"); } optionsLoaded(options) { @@ -89,7 +99,12 @@ export default class BackupOptions extends OptionsWidget { } for (const {filePath, mtime} of backupFiles) { - this.$existingBackupList.append($("
  • ").text(`${filePath} ${mtime ? ` - ${mtime}` : ''}`)); + this.$existingBackupList.append($(` + + ${(mtime) ? mtime : "-"} + ${filePath} + + `)); } }); } From 970c3bd7adec4183cfcef1c2e36e0331b69dcdd5 Mon Sep 17 00:00:00 2001 From: Adorian Doran Date: Tue, 19 Nov 2024 17:54:34 +0200 Subject: [PATCH 09/14] Format date and time --- src/public/app/widgets/type_widgets/options/backup.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/public/app/widgets/type_widgets/options/backup.js b/src/public/app/widgets/type_widgets/options/backup.js index 1cdfddad9..027453faf 100644 --- a/src/public/app/widgets/type_widgets/options/backup.js +++ b/src/public/app/widgets/type_widgets/options/backup.js @@ -98,10 +98,15 @@ export default class BackupOptions extends OptionsWidget { backupFiles = [{filePath: t('backup.no_backup_yet'), mtime: ''}]; } + const dateTimeFormatter = new Intl.DateTimeFormat(navigator.language, { + dateStyle: "medium", + timeStyle: "medium" + }); + for (const {filePath, mtime} of backupFiles) { this.$existingBackupList.append($(` - ${(mtime) ? mtime : "-"} + ${(mtime) ? dateTimeFormatter.format(new Date(mtime)) : "-"} ${filePath} `)); From 22b768e5e88b2bb2716c87764b115ed4d6ecaeb9 Mon Sep 17 00:00:00 2001 From: Adorian Doran Date: Tue, 19 Nov 2024 18:00:23 +0200 Subject: [PATCH 10/14] Add translation --- src/public/app/widgets/type_widgets/options/backup.js | 4 ++-- src/public/translations/en/translation.json | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/public/app/widgets/type_widgets/options/backup.js b/src/public/app/widgets/type_widgets/options/backup.js index 027453faf..dd51d0d7f 100644 --- a/src/public/app/widgets/type_widgets/options/backup.js +++ b/src/public/app/widgets/type_widgets/options/backup.js @@ -45,8 +45,8 @@ const TPL = ` - - + + diff --git a/src/public/translations/en/translation.json b/src/public/translations/en/translation.json index 9847b0e24..c949fd588 100644 --- a/src/public/translations/en/translation.json +++ b/src/public/translations/en/translation.json @@ -1183,6 +1183,8 @@ "backup_now": "Backup now", "backup_database_now": "Backup database now", "existing_backups": "Existing backups", + "date-and-time": "Date & time", + "path": "Path", "database_backed_up_to": "Database has been backed up to", "no_backup_yet": "no backup yet" }, From 32a4a9c072d17972fc6fc99fc5fb6db74d6301f7 Mon Sep 17 00:00:00 2001 From: Adorian Doran Date: Tue, 19 Nov 2024 18:07:42 +0200 Subject: [PATCH 11/14] Sort the backup files by date & time --- src/public/app/widgets/type_widgets/options/backup.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/public/app/widgets/type_widgets/options/backup.js b/src/public/app/widgets/type_widgets/options/backup.js index dd51d0d7f..f68fcb0dd 100644 --- a/src/public/app/widgets/type_widgets/options/backup.js +++ b/src/public/app/widgets/type_widgets/options/backup.js @@ -98,6 +98,13 @@ export default class BackupOptions extends OptionsWidget { backupFiles = [{filePath: t('backup.no_backup_yet'), mtime: ''}]; } + // Sort the backup files by modification date & time in a desceding order + backupFiles.sort((a, b) => { + if (a.mtime < b.mtime) return 1; + if (a.mtime > b.mtime) return -1; + return 0; + }); + const dateTimeFormatter = new Intl.DateTimeFormat(navigator.language, { dateStyle: "medium", timeStyle: "medium" From e94942d665519a84641b7568c6f791b101424b45 Mon Sep 17 00:00:00 2001 From: Adorian Doran Date: Tue, 19 Nov 2024 20:22:10 +0200 Subject: [PATCH 12/14] Handle the situation where no backups are available --- src/public/app/widgets/type_widgets/options/backup.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/public/app/widgets/type_widgets/options/backup.js b/src/public/app/widgets/type_widgets/options/backup.js index f68fcb0dd..dc647437b 100644 --- a/src/public/app/widgets/type_widgets/options/backup.js +++ b/src/public/app/widgets/type_widgets/options/backup.js @@ -95,7 +95,13 @@ export default class BackupOptions extends OptionsWidget { this.$existingBackupList.empty(); if (!backupFiles.length) { - backupFiles = [{filePath: t('backup.no_backup_yet'), mtime: ''}]; + this.$existingBackupList.append($(` + + + + `)); + + return; } // Sort the backup files by modification date & time in a desceding order From 349b1c1d78ad68043837828afc34acab0301d5f3 Mon Sep 17 00:00:00 2001 From: Adorian Doran Date: Tue, 19 Nov 2024 20:28:47 +0200 Subject: [PATCH 13/14] Improve appeareance --- src/public/app/widgets/type_widgets/options/backup.js | 6 +++++- src/public/stylesheets/style.css | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/public/app/widgets/type_widgets/options/backup.js b/src/public/app/widgets/type_widgets/options/backup.js index dc647437b..35cd4b829 100644 --- a/src/public/app/widgets/type_widgets/options/backup.js +++ b/src/public/app/widgets/type_widgets/options/backup.js @@ -43,6 +43,10 @@ const TPL = `

    ${t('backup.existing_backups')}

    Date and timePath${t("backup.date-and-time")}${t("backup.path")}
    ${t('backup.no_backup_yet')}
    + + + + @@ -97,7 +101,7 @@ export default class BackupOptions extends OptionsWidget { if (!backupFiles.length) { this.$existingBackupList.append($(` - + `)); diff --git a/src/public/stylesheets/style.css b/src/public/stylesheets/style.css index 60cda7349..bdcd6a7d8 100644 --- a/src/public/stylesheets/style.css +++ b/src/public/stylesheets/style.css @@ -1238,3 +1238,7 @@ textarea { padding: 1rem; } +.empty-table-placeholder { + text-align: center; + color: var(--muted-text-color); +} \ No newline at end of file From 70be4cd1c25fc7a2969e1978e5c685a834c6bc47 Mon Sep 17 00:00:00 2001 From: Adorian Doran Date: Tue, 19 Nov 2024 20:34:54 +0200 Subject: [PATCH 14/14] Update the Romanian translation --- src/public/translations/ro/translation.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/public/translations/ro/translation.json b/src/public/translations/ro/translation.json index 9bd9b0ccf..13d0ea3cf 100644 --- a/src/public/translations/ro/translation.json +++ b/src/public/translations/ro/translation.json @@ -254,6 +254,8 @@ "enable_monthly_backup": "Activează copia de siguranță lunară", "enable_weekly_backup": "Activează copia de siguranță săptămânală", "existing_backups": "Copii de siguranță existente", + "date-and-time": "Data și ora", + "path": "Calea fișierului", "no_backup_yet": "nu există încă nicio copie de siguranță" }, "basic_properties": {
    ${t("backup.date-and-time")}
    ${t('backup.no_backup_yet')}${t('backup.no_backup_yet')}