Merge branch 'develop' into revisions_number_limit

This commit is contained in:
SiriusXT 2024-09-17 19:58:16 +08:00
commit 353c410f0e
11 changed files with 80 additions and 17 deletions

View File

@ -66,8 +66,10 @@ jobs:
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Run the container in the background
run: docker run -d --rm --name trilium_local ${{ env.TEST_TAG }}
- name: Validate container run output
run: |
CONTAINER_ID=$(docker run -d --log-driver=journald --rm --name trilium_local ${{ env.TEST_TAG }})
echo "Container ID: $CONTAINER_ID"
- name: Wait for the healthchecks to pass
uses: stringbean/docker-healthcheck-action@v1
@ -77,6 +79,12 @@ jobs:
require-status: running
require-healthy: true
# Print the entire log of the container thus far, regardless if the healthcheck failed or succeeded
- name: Print entire log
if: always()
run: |
journalctl -u docker CONTAINER_NAME=trilium_local --no-pager
build:
name: Build Docker images
runs-on: ubuntu-latest

View File

@ -13,11 +13,13 @@ import cls from "../services/cls.js";
import entityConstructor from "../becca/entity_constructor.js";
import { AttributeRow, BranchRow, EtapiTokenRow, NoteRow, OptionRow } from './entities/rows.js';
import AbstractBeccaEntity from "./entities/abstract_becca_entity.js";
import options_init from "../services/options_init.js";
import ws from "../services/ws.js";
const beccaLoaded = new Promise<void>(async (res, rej) => {
const sqlInit = (await import("../services/sql_init.js")).default;
// We have to import async since options init requires keyboard actions which require translations.
const options_init = (await import("../services/options_init.js")).default;
sqlInit.dbReady.then(() => {
cls.init(() => {
load();

View File

@ -175,7 +175,7 @@ const editorConfig = {
toolbar: {
items: []
},
placeholder: "Type the labels and relations here",
placeholder: t("attribute_editor.placeholder"),
mention: mentionSetup
};

View File

@ -280,7 +280,9 @@ export default class GlobalMenuWidget extends BasicWidget {
this.dropdown.toggle();
});
this.$widget.on('click', '.dropdown-submenu', e => {
if ($(e.target).children(".dropdown-menu").length === 1 || $(e.target).hasClass('dropdown-toggle')) {
e.stopPropagation();
}
})
this.$widget.find(".global-menu-button-update-available").append(

View File

@ -1,4 +1,5 @@
import NoteContextAwareWidget from "../note_context_aware_widget.js";
import { t } from "../../services/i18n.js";
const TPL = `
<div class="floating-buttons no-print">
@ -7,7 +8,7 @@ const TPL = `
position: relative;
}
.floating-buttons-children {
.floating-buttons-children,.show-floating-buttons {
position: absolute;
top: 10px;
right: 10px;
@ -42,12 +43,44 @@ const TPL = `
border-color: var(--button-border-color);
}
.floating-buttons.temporarily-hidden {
.floating-buttons .floating-buttons-children.temporarily-hidden {
display: none;
}
</style>
<div class="floating-buttons-children"></div>
<!-- Show button that displays floating button after click on close button -->
<div class="show-floating-buttons">
<style>
.floating-buttons-children.temporarily-hidden+.show-floating-buttons {
display: block;
}
.floating-buttons-children:not(.temporarily-hidden)+.show-floating-buttons {
display: none;
}
.show-floating-buttons {
/* display: none;*/
margin-left: 5px !important;
}
.show-floating-buttons-button {
border: 1px solid transparent;
color: var(--button-text-color);
padding: 6px;
border-radius: 100px;
}
.show-floating-buttons-button:hover {
border: 1px solid var(--button-border-color);
}
</style>
<button type="button" class="show-floating-buttons-button btn bx bx-chevrons-left"
title="${t('show_floating_buttons_button.button_title')}"></button>
</div>
</div>`;
export default class FloatingButtons extends NoteContextAwareWidget {
@ -62,10 +95,11 @@ export default class FloatingButtons extends NoteContextAwareWidget {
async refreshWithNote(note) {
this.toggle(true);
this.$widget.find(".show-floating-buttons-button").on('click', () => this.toggle(true));
}
toggle(show) {
this.$widget.toggleClass("temporarily-hidden", !show);
this.$widget.find(".floating-buttons-children").toggleClass("temporarily-hidden", !show);
}
hideFloatingButtonsCommand() {

View File

@ -27,7 +27,7 @@ const TPL = `
</style>
<button type="button"
class="close-floating-buttons-button btn bx bx-x"
class="close-floating-buttons-button btn bx bx-chevrons-right"
title="${t('hide_floating_buttons_button.button_title')}"></button>
</div>
`;

View File

@ -18,11 +18,14 @@ const TPL = `
}
.basic-properties-widget > * {
margin-right: 30px;
margin-top: 9px;
margin-bottom: 2px;
}
.basic-properties-widget > * > :last-child {
margin-right: 30px;
}
.note-type-container, .editability-select-container {
display: flex;
align-items: center;

View File

@ -411,7 +411,8 @@
"add_new_label": "Add new label <kbd data-command=\"addNewLabel\"></kbd>",
"add_new_relation": "Add new relation <kbd data-command=\"addNewRelation\"></kbd>",
"add_new_label_definition": "Add new label definition",
"add_new_relation_definition": "Add new relation definition"
"add_new_relation_definition": "Add new relation definition",
"placeholder": "Type the labels and relations here"
},
"abstract_bulk_action": {
"remove_this_search_action": "Remove this search action"
@ -662,6 +663,9 @@
"hide_floating_buttons_button": {
"button_title": "Hide buttons"
},
"show_floating_buttons_button": {
"button_title": "Show buttons"
},
"svg_export_button": {
"button_title": "Export diagram as SVG"
},

View File

@ -237,7 +237,8 @@
"help_text_body1": "Pentru a adăuga o etichetă doar scrieți, spre exemplu, <code>#piatră</code> sau <code>#an = 2020</code> dacă se dorește adăugarea unei valori",
"help_text_body2": "Pentru relații, scrieți <code>author = @</code> ce va afișa o autocompletare pentru identificarea notiței dorite.",
"help_text_body3": "În mod alternativ, se pot adăuga etichete și relații utilizând butonul <code>+</code> din partea dreaptă.",
"save_attributes": "Salvează atributele <enter>"
"save_attributes": "Salvează atributele <enter>",
"placeholder": "Aici puteți introduce etichete și relații"
},
"backend_log": {
"refresh": "Reîmprospătare"

View File

@ -18,6 +18,10 @@ const isElectron = utils.isElectron();
* e.g. CTRL-C in note tree does something a bit different from CTRL-C in the text editor.
*/
if (!t("keyboard_actions.note-navigation")) {
throw new Error("Keyboard actions loaded before translations.");
}
const DEFAULT_KEYBOARD_ACTIONS: KeyboardShortcut[] = [
{
separator: t("keyboard_actions.note-navigation")

View File

@ -11,7 +11,6 @@ import migrationService from "./migration.js";
import cls from "./cls.js";
import config from "./config.js";
import { OptionRow } from '../becca/entities/rows.js';
import optionsInitService from "./options_init.js";
import BNote from "../becca/entities/bnote.js";
import BBranch from "../becca/entities/bbranch.js";
import zipImportService from "./import/zip.js";
@ -62,6 +61,9 @@ async function createInitialDatabase() {
let rootNote!: BNote;
// We have to import async since options init requires keyboard actions which require translations.
const optionsInitService = (await import("./options_init.js")).default;
sql.transactional(() => {
log.info("Creating database schema ...");
@ -129,6 +131,9 @@ async function createDatabaseForSync(options: OptionRow[], syncServerHost = '',
const defaultTheme = await getDefaultTheme();
const schema = fs.readFileSync(`${resourceDir.DB_INIT_DIR}/schema.sql`, "utf8");
// We have to import async since options init requires keyboard actions which require translations.
const optionsInitService = (await import("./options_init.js")).default;
sql.transactional(() => {
sql.executeScript(schema);