mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-04 13:39:01 +01:00 
			
		
		
		
	fix search
This commit is contained in:
		
							parent
							
								
									1e767482b4
								
							
						
					
					
						commit
						4cc02ffb31
					
				
							
								
								
									
										40
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										40
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							@ -2970,9 +2970,9 @@
 | 
				
			|||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "electron": {
 | 
					    "electron": {
 | 
				
			||||||
      "version": "13.1.4",
 | 
					      "version": "13.1.5",
 | 
				
			||||||
      "resolved": "https://registry.npmjs.org/electron/-/electron-13.1.4.tgz",
 | 
					      "resolved": "https://registry.npmjs.org/electron/-/electron-13.1.5.tgz",
 | 
				
			||||||
      "integrity": "sha512-4qhRZbRvGqHmMWsCG/kRVF4X8VIq9Nujgm+gXZLBSpiR6uUtMHy7ViBTQZl1PGf6O9Ppxhpr9Yz+k6Um9WoP3Q==",
 | 
					      "integrity": "sha512-ZoMCcPQNs/zO/Zdb5hq5H+rwRaKrdI3/sfXEwBVMx7f5jwa9jPQB3dZ2+7t59uD9VcFAWsH/pozr8nPPlv0tyw==",
 | 
				
			||||||
      "dev": true,
 | 
					      "dev": true,
 | 
				
			||||||
      "requires": {
 | 
					      "requires": {
 | 
				
			||||||
        "@electron/get": "^1.0.1",
 | 
					        "@electron/get": "^1.0.1",
 | 
				
			||||||
@ -3769,9 +3769,9 @@
 | 
				
			|||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "electron-to-chromium": {
 | 
					    "electron-to-chromium": {
 | 
				
			||||||
      "version": "1.3.761",
 | 
					      "version": "1.3.765",
 | 
				
			||||||
      "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.761.tgz",
 | 
					      "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.765.tgz",
 | 
				
			||||||
      "integrity": "sha512-7a/wV/plM/b95XjTdA2Q4zAxxExTDKkNQpTiaU/nVT8tGCQVtX9NsnTjhALBFICpOB58hU6xg5fFC3CT2Bybpg==",
 | 
					      "integrity": "sha512-4NhcsfZYlr1x4FehYkK+R9CNNTOZ8vLcIu8Y1uWehxYp5r/jlCGAfBqChIubEfdtX+rBQpXx4yJuX/dzILH/nw==",
 | 
				
			||||||
      "dev": true
 | 
					      "dev": true
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "electron-window-state": {
 | 
					    "electron-window-state": {
 | 
				
			||||||
@ -4055,9 +4055,9 @@
 | 
				
			|||||||
      "integrity": "sha512-o1JrraDGpMFaPtkuvtZ4cIBC/xuJn90KBGlxRrm3FxcfER1bPaBnBsTnypF65p+CMTXul2KrZodb3Vv3MScB4A=="
 | 
					      "integrity": "sha512-o1JrraDGpMFaPtkuvtZ4cIBC/xuJn90KBGlxRrm3FxcfER1bPaBnBsTnypF65p+CMTXul2KrZodb3Vv3MScB4A=="
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "express-rate-limit": {
 | 
					    "express-rate-limit": {
 | 
				
			||||||
      "version": "5.2.6",
 | 
					      "version": "5.3.0",
 | 
				
			||||||
      "resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-5.2.6.tgz",
 | 
					      "resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-5.3.0.tgz",
 | 
				
			||||||
      "integrity": "sha512-nE96xaxGfxiS5jP3tD3kIW1Jg9yQgX0rXCs3rCkZtmbWHEGyotwaezkLj7bnB41Z0uaOLM8W4AX6qHao4IZ2YA=="
 | 
					      "integrity": "sha512-qJhfEgCnmteSeZAeuOKQ2WEIFTX5ajrzE0xS6gCOBCoRQcU+xEzQmgYQQTpzCcqUAAzTEtu4YEih4pnLfvNtew=="
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "express-session": {
 | 
					    "express-session": {
 | 
				
			||||||
      "version": "1.17.2",
 | 
					      "version": "1.17.2",
 | 
				
			||||||
@ -5127,19 +5127,19 @@
 | 
				
			|||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "jasmine": {
 | 
					    "jasmine": {
 | 
				
			||||||
      "version": "3.7.0",
 | 
					      "version": "3.8.0",
 | 
				
			||||||
      "resolved": "https://registry.npmjs.org/jasmine/-/jasmine-3.7.0.tgz",
 | 
					      "resolved": "https://registry.npmjs.org/jasmine/-/jasmine-3.8.0.tgz",
 | 
				
			||||||
      "integrity": "sha512-wlzGQ+cIFzMEsI+wDqmOwvnjTvolLFwlcpYLCqSPPH0prOQaW3P+IzMhHYn934l1imNvw07oCyX+vGUv3wmtSQ==",
 | 
					      "integrity": "sha512-kdQ3SfcNpMbbMdgJPLyFe9IksixdnrgYaCJapP9sS0aLgdWdIZADNXEr+11Zafxm1VDfRSC5ZL4fzXT0bexzXw==",
 | 
				
			||||||
      "dev": true,
 | 
					      "dev": true,
 | 
				
			||||||
      "requires": {
 | 
					      "requires": {
 | 
				
			||||||
        "glob": "^7.1.6",
 | 
					        "glob": "^7.1.6",
 | 
				
			||||||
        "jasmine-core": "~3.7.0"
 | 
					        "jasmine-core": "~3.8.0"
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "jasmine-core": {
 | 
					    "jasmine-core": {
 | 
				
			||||||
      "version": "3.7.1",
 | 
					      "version": "3.8.0",
 | 
				
			||||||
      "resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-3.7.1.tgz",
 | 
					      "resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-3.8.0.tgz",
 | 
				
			||||||
      "integrity": "sha512-DH3oYDS/AUvvr22+xUBW62m1Xoy7tUlY1tsxKEJvl5JeJ7q8zd1K5bUwiOxdH+erj6l2vAMM3hV25Xs9/WrmuQ==",
 | 
					      "integrity": "sha512-zl0nZWDrmbCiKns0NcjkFGYkVTGCPUgoHypTaj+G2AzaWus7QGoXARSlYsSle2VRpSdfJmM+hzmFKzQNhF2kHg==",
 | 
				
			||||||
      "dev": true
 | 
					      "dev": true
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "jest-worker": {
 | 
					    "jest-worker": {
 | 
				
			||||||
@ -8226,9 +8226,9 @@
 | 
				
			|||||||
      "integrity": "sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w=="
 | 
					      "integrity": "sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w=="
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "webpack": {
 | 
					    "webpack": {
 | 
				
			||||||
      "version": "5.41.1",
 | 
					      "version": "5.42.0",
 | 
				
			||||||
      "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.41.1.tgz",
 | 
					      "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.42.0.tgz",
 | 
				
			||||||
      "integrity": "sha512-AJZIIsqJ/MVTmegEq9Tlw5mk5EHdGiJbDdz9qP15vmUH+oxI1FdWcL0E9EO8K/zKaRPWqEs7G/OPxq1P61u5Ug==",
 | 
					      "integrity": "sha512-Ln8HL0F831t1x/yPB/qZEUVmZM4w9BnHZ1EQD/sAUHv8m22hthoPniWTXEzFMh/Sf84mhrahut22TX5KxWGuyQ==",
 | 
				
			||||||
      "dev": true,
 | 
					      "dev": true,
 | 
				
			||||||
      "requires": {
 | 
					      "requires": {
 | 
				
			||||||
        "@types/eslint-scope": "^3.7.0",
 | 
					        "@types/eslint-scope": "^3.7.0",
 | 
				
			||||||
@ -8236,7 +8236,7 @@
 | 
				
			|||||||
        "@webassemblyjs/ast": "1.11.0",
 | 
					        "@webassemblyjs/ast": "1.11.0",
 | 
				
			||||||
        "@webassemblyjs/wasm-edit": "1.11.0",
 | 
					        "@webassemblyjs/wasm-edit": "1.11.0",
 | 
				
			||||||
        "@webassemblyjs/wasm-parser": "1.11.0",
 | 
					        "@webassemblyjs/wasm-parser": "1.11.0",
 | 
				
			||||||
        "acorn": "^8.2.1",
 | 
					        "acorn": "^8.4.1",
 | 
				
			||||||
        "browserslist": "^4.14.5",
 | 
					        "browserslist": "^4.14.5",
 | 
				
			||||||
        "chrome-trace-event": "^1.0.2",
 | 
					        "chrome-trace-event": "^1.0.2",
 | 
				
			||||||
        "enhanced-resolve": "^5.8.0",
 | 
					        "enhanced-resolve": "^5.8.0",
 | 
				
			||||||
 | 
				
			|||||||
@ -42,7 +42,7 @@
 | 
				
			|||||||
    "electron-window-state": "5.0.3",
 | 
					    "electron-window-state": "5.0.3",
 | 
				
			||||||
    "express": "4.17.1",
 | 
					    "express": "4.17.1",
 | 
				
			||||||
    "express-partial-content": "^1.0.2",
 | 
					    "express-partial-content": "^1.0.2",
 | 
				
			||||||
    "express-rate-limit": "^5.2.6",
 | 
					    "express-rate-limit": "5.3.0",
 | 
				
			||||||
    "express-session": "1.17.2",
 | 
					    "express-session": "1.17.2",
 | 
				
			||||||
    "fs-extra": "10.0.0",
 | 
					    "fs-extra": "10.0.0",
 | 
				
			||||||
    "helmet": "4.6.0",
 | 
					    "helmet": "4.6.0",
 | 
				
			||||||
@ -81,16 +81,16 @@
 | 
				
			|||||||
  },
 | 
					  },
 | 
				
			||||||
  "devDependencies": {
 | 
					  "devDependencies": {
 | 
				
			||||||
    "cross-env": "7.0.3",
 | 
					    "cross-env": "7.0.3",
 | 
				
			||||||
    "electron": "13.1.4",
 | 
					    "electron": "13.1.5",
 | 
				
			||||||
    "electron-builder": "22.11.7",
 | 
					    "electron-builder": "22.11.7",
 | 
				
			||||||
    "electron-packager": "15.2.0",
 | 
					    "electron-packager": "15.2.0",
 | 
				
			||||||
    "electron-rebuild": "2.3.5",
 | 
					    "electron-rebuild": "2.3.5",
 | 
				
			||||||
    "esm": "3.2.25",
 | 
					    "esm": "3.2.25",
 | 
				
			||||||
    "jasmine": "3.7.0",
 | 
					    "jasmine": "3.8.0",
 | 
				
			||||||
    "jsdoc": "3.6.7",
 | 
					    "jsdoc": "3.6.7",
 | 
				
			||||||
    "lorem-ipsum": "2.0.3",
 | 
					    "lorem-ipsum": "2.0.3",
 | 
				
			||||||
    "rcedit": "3.0.0",
 | 
					    "rcedit": "3.0.0",
 | 
				
			||||||
    "webpack": "5.41.1",
 | 
					    "webpack": "5.42.0",
 | 
				
			||||||
    "webpack-cli": "4.7.2"
 | 
					    "webpack-cli": "4.7.2"
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  "optionalDependencies": {
 | 
					  "optionalDependencies": {
 | 
				
			||||||
 | 
				
			|||||||
@ -187,7 +187,7 @@ class Froca {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        const branches = [...note.getBranches(), ...note.getChildBranches()];
 | 
					        const branches = [...note.getBranches(), ...note.getChildBranches()];
 | 
				
			||||||
console.log("searchResultNoteIds", searchResultNoteIds);
 | 
					
 | 
				
			||||||
        searchResultNoteIds.forEach((resultNoteId, index) => branches.push({
 | 
					        searchResultNoteIds.forEach((resultNoteId, index) => branches.push({
 | 
				
			||||||
            // branchId should be repeatable since sometimes we reload some notes without rerendering the tree
 | 
					            // branchId should be repeatable since sometimes we reload some notes without rerendering the tree
 | 
				
			||||||
            branchId: "virt-" + note.noteId + '-' + resultNoteId,
 | 
					            branchId: "virt-" + note.noteId + '-' + resultNoteId,
 | 
				
			||||||
@ -197,8 +197,6 @@ console.log("searchResultNoteIds", searchResultNoteIds);
 | 
				
			|||||||
            fromSearchNote: true
 | 
					            fromSearchNote: true
 | 
				
			||||||
        }));
 | 
					        }));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        console.log("branches", branches);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        // update this note with standard (parent) branches + virtual (children) branches
 | 
					        // update this note with standard (parent) branches + virtual (children) branches
 | 
				
			||||||
        this.addResp({
 | 
					        this.addResp({
 | 
				
			||||||
            notes: [note],
 | 
					            notes: [note],
 | 
				
			||||||
 | 
				
			|||||||
@ -33,7 +33,7 @@ const TPL = `
 | 
				
			|||||||
    <button class="btn btn-outline-secondary search-button" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
 | 
					    <button class="btn btn-outline-secondary search-button" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
 | 
				
			||||||
        <span class="bx bx-search"></span>
 | 
					        <span class="bx bx-search"></span>
 | 
				
			||||||
    </button>
 | 
					    </button>
 | 
				
			||||||
    <div class="dropdown-menu dropdown-menu-right"></div>
 | 
					    <div class="dropdown-menu dropdown-menu-left"></div>
 | 
				
			||||||
  </div>
 | 
					  </div>
 | 
				
			||||||
  <input type="text" class="form-control form-control-sm search-string" placeholder="Quick search">
 | 
					  <input type="text" class="form-control form-control-sm search-string" placeholder="Quick search">
 | 
				
			||||||
  </div>
 | 
					  </div>
 | 
				
			||||||
@ -50,7 +50,7 @@ export default class QuickSearchWidget extends BasicWidget {
 | 
				
			|||||||
        this.$dropdownToggle = this.$widget.find('.search-button');
 | 
					        this.$dropdownToggle = this.$widget.find('.search-button');
 | 
				
			||||||
        this.$dropdownToggle.dropdown();
 | 
					        this.$dropdownToggle.dropdown();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        this.$widget.find('.input-group-append').on('shown.bs.dropdown', () => this.search());
 | 
					        this.$widget.find('.input-group-prepend').on('shown.bs.dropdown', () => this.search());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        utils.bindElShortcut(this.$searchString, 'return', () => {
 | 
					        utils.bindElShortcut(this.$searchString, 'return', () => {
 | 
				
			||||||
            if (this.$dropdownMenu.is(":visible")) {
 | 
					            if (this.$dropdownMenu.is(":visible")) {
 | 
				
			||||||
 | 
				
			|||||||
@ -41,6 +41,7 @@ export default class SearchResultWidget extends NoteContextAwareWidget {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    doRender() {
 | 
					    doRender() {
 | 
				
			||||||
        this.$widget = $(TPL);
 | 
					        this.$widget = $(TPL);
 | 
				
			||||||
 | 
					        this.contentSized();
 | 
				
			||||||
        this.$content = this.$widget.find('.search-result-widget-content');
 | 
					        this.$content = this.$widget.find('.search-result-widget-content');
 | 
				
			||||||
        this.$noResults = this.$widget.find('.search-no-results');
 | 
					        this.$noResults = this.$widget.find('.search-no-results');
 | 
				
			||||||
        this.$notExecutedYet = this.$widget.find('.search-not-executed-yet');
 | 
					        this.$notExecutedYet = this.$widget.find('.search-not-executed-yet');
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user