Commit Graph

118 Commits

Author SHA1 Message Date
Gabriel Horner
6116b51a46 chore: replace test helper with better supported promesa fn 2024-11-14 12:10:45 -05:00
Gabriel Horner
939dd23f79 chore: use test helpers across db tests
instead of copied and pasted versions
2024-09-27 14:54:03 -04:00
Gabriel Horner
a0d4e43d18 enhance: add /Advanced Query for db graphs
Related to
https://linear.app/logseq/issue/LOG-3246/improve-advanced-query-editor.
Had to upgrade promesa to get p/doseq
2024-09-26 10:55:50 -04:00
Gabriel Horner
afe4280c6a refactor: DRY up spread out definition of db's
namespace/parent feature. Following up to #11517, provide vars
so it's clear how a feature is used and coupled throughout the codebase
2024-09-23 14:53:12 -04:00
Gabriel Horner
5146e0da40 fix: validate property name when changed from menu
Fixes logseq/db-test#69
2024-09-10 17:45:05 -04:00
Gabriel Horner
e5e9c5c687 chore: mv file-based util namespaces to their own directory
Makes maintenance of different graph types easier and increases linting
of what occurs in these namespaces
2024-09-09 14:31:56 -04:00
Gabriel Horner
70383cd813 fix: stop shadowing vars for rest of frontend
Follow up to 5ff364ba1e
2024-09-07 00:13:09 -04:00
Gabriel Horner
47970ee4c6 fix: :node property values should show unique names by tag
Fixes logseq/db-test#44 and also a part of LOG-3191
2024-08-30 12:36:49 -04:00
Gabriel Horner
5ff364ba1e fix: stop shadowing vars for components
Turn on kondo :shadowed-var lint and fix failures.  If this lint had
been turned on, it would have caught logseq/db-test#38 and saved us time
from debugging which random component was accidentally shadowed by a var
and failing with 'Objects are not valid as a React child'. Also fixed a
few outside components but stopped b/c there are too many to do right
now
2024-08-23 15:19:33 -04:00
Gabriel Horner
261118d4dc refactor: finish frontend independence from worker and add lint
Remaining fixes worker all file related. Fixes LOG-3717
2024-08-09 12:16:20 -04:00
Gabriel Horner
20eac03cea refactor: mv common worker/frontend ns to frontend/common
Move common core.async, date and search utils to frontend/common.
Part of LOG-3171
2024-08-09 11:18:32 -04:00
Gabriel Horner
7a40761eca refactor: organize worker namespaces and lint them
Organize them to live under src/main/frontend/worker and add a lint to ensure
that common code with frontend is only under frontend/common/.
Add a linter to ensure that worker doesn't depend on frontend.
Motivated to fix after recent worker breakage fixed by
75463c4df4
2024-08-08 23:01:57 -04:00
Gabriel Horner
c660096937 fix: common test failing due to code organization
datascript based utils should be in db dep. common is for dependency free
namespaces
2024-08-08 09:24:02 -04:00
rcmerci
00fb6c52e7 fix(lint): update clj-kondo config to exclude test-graph dirs 2024-07-24 17:53:21 +08:00
Gabriel Horner
3746b8c848 fix: lint and update related ns to have consistent alias 2024-07-22 09:46:49 -04:00
Gabriel Horner
84638989f6 chore: remove some unused db fns and aliases
and some aliases that were barely used
2024-06-25 17:37:52 -04:00
Gabriel Horner
b35f30e203 fix: circular dependency between outliner and frontend
by moving batch-tx into outliner dep. Outliner dep is
now fully independent and we are able to write unit tests
for all outliner namespaces unlike before
2024-06-19 17:21:22 -04:00
Gabriel Horner
9a8c91c0cc chore: mv logseq.db.sqlite.db into sqlite.cli
for more explicit name and purpose. Also updated outdated db readme
and removed unused fns in logseq.db.sqlite.db
2024-06-14 16:53:19 -04:00
Gabriel Horner
8ba5c15f93 fix: remove cli namespace dependency from electron namespaces
Added a :discouraged-namespace linter check for future times.
Had to add clj-kondo configs for db and outliner since they
were incorrectly inheriting the frontend config, specifically
the :discouraged-namespace linter. Also removed a 'm/=>' in outliner dep
b/c it would've created a complex clj-kondo setup for malli that
would need to be updated for both top-level clj-kondo and deps/outliner
2024-06-14 15:50:05 -04:00
Gabriel Horner
effde81161 enhance: all user classes have :db/ident
This is important as a user's ontology (properties + classes) is now describable
with unique identifiers. This will allow for easy sharing and
importing of ontologies between users.
Also <create-class! now exists to create classes consistently. Will
be helpful when we want to provide some validation for classes
2024-05-28 16:52:12 -04:00
Gabriel Horner
d1d50a5b85 chore: mv marker + priority fns to file specific ns
part of LOG-3042
2024-05-06 14:52:28 -04:00
Gabriel Horner
24c48e7a87 fix: multiple fixes related to lookup-by-name
- only use it for user properties
- don't use create ident fn to lookup names
- fixed get-area-block-asset-url which didn't work for db graphs without
  the frontend
2024-05-02 15:16:03 -04:00
Gabriel Horner
5c81b61774 fix: file graphs can't load b/c db specific attribute fetched 2024-05-01 09:07:23 -04:00
Gabriel Horner
0aa4bda66c fix: inlined db-based-graph? calls in db-property
Addressed fixmes for db-based-graph fns that were inlined to prevent
circular dependencies b/n db-property and sqlite-util.  Moved multi
graph fns to db-property-util and existing db-property-util to
db-property-build to address this
2024-04-16 14:43:28 -04:00
Gabriel Horner
97367c3d4f fix: add timestamps to built-in property pair
Also cleanup build-initial-properties and remove unused ns
2024-04-11 18:23:52 -04:00
rcmerci
2772592720 enhance(undo): batch process undo/redo-ops 2024-04-09 12:27:33 +08:00
rcmerci
ef834cdaf7 feat: add defkeyword to define keyword
- add docstring for common used keywords
- support jump to definition in editors
- register malli-schema for keywords if provided
2024-04-07 15:40:30 +08:00
Gabriel Horner
f728b7b9f6 fix: multiple bugs with built-in pages, fixes LOG-3046
- file graph wasn't creating built in pages
- 3 places where db graphs were incorrectly using file graph built in
  page names
- file graphs creating default pages with incorrect format
2024-03-29 16:21:19 -04:00
Gabriel Horner
bd49f8d750 enhance: add shui components to import form
Also tweaked import messages and made shui alias consistent
2024-02-27 13:47:41 -05:00
Gabriel Horner
bfc5bf9ccc enhance: allow user macros for :url property values
and single line :default values
2024-02-22 14:49:03 -05:00
Gabriel Horner
f28cf73ef4 enhance: validate db once for an import
and notify if there are invalid blocks. Removed validating per tx during
import which speeds up import 5-10% on small graphs and more on larger
graphs. Also print some useful stats in the console
2024-02-19 15:34:58 -05:00
Gabriel Horner
26bc6f0d1d chore: mv logseq.graph-parser.util.db to db dep
This ns is more appropriate in db and was only in graph-parser because
the date-time-util lib wasn't accessible to db until #10933 landed.
graph-parser dep is specific to file graphs and as much as possible
anything unrelated to this should not be in this dep
2024-02-09 16:16:33 -05:00
Gabriel Horner
58b2888729 fix: test and lints
also remove unused binding not caught by linter b/c it's used
2024-02-07 12:23:14 -05:00
Gabriel Horner
b1bcc1b2dd fix: unit test, lint + script 2024-02-07 04:09:01 +08:00
Gabriel Horner
6a73ffa5f7 fix: lints and a docstring 2024-02-05 17:03:44 -05:00
Gabriel Horner
e0059892aa chore: mv file-based repo and repo-config fns as well nfs
to file-based namespaces. Confirmed and QAed these are only for
file-based. This moves the majority of graph-parser/parse-file calls
into file-based namespaces. The only ones left are in handler.file which
can be done later
2024-02-02 14:40:05 -05:00
Gabriel Horner
073f37dcc7 fix: kondo lint and add worker aliases
also fixed location of a test ns and fixed some inconsistent worker
aliases
2024-01-17 12:57:16 -05:00
Gabriel Horner
cdddce0120 fix deps db test and most lints
Also deleted duplicated gp-util.{page-ref,block-ref} files that were moved to common
and moved a related test to common dep
2024-01-11 14:35:04 -05:00
Tienson Qin
eb6e5942f8 fix: lint warnings 2024-01-10 01:34:15 +08:00
Gabriel Horner
6f8badf18f add frontend.persist.db* to list of db namespaces
also cleaned up inconsistent alias and fixed export-db calling
db-based-graph? when caller fns already do this
2023-12-15 09:50:22 -05:00
Gabriel Horner
2554016d63 enhance: make closed values scriptable
Added closed value examples of all 5 property types
to properties graph. Part of LOG-2903
2023-12-04 10:11:52 -05:00
Gabriel Horner
4058b43d1c chore: move db specific page components to their own ns
Components were disorganized enough that we were resorting to declare
2023-11-27 16:17:01 -05:00
Gabriel Horner
e95531869a chore: move db only property util fns to their own ns
by doing this found a couple places where we accidentally called db fns
in file graph contexts
2023-11-17 16:36:49 -05:00
Gabriel Horner
61eeb96709 fix: 3 bugs with persisting whiteboard data
- :block/uuid was a string
- no timestamps on whiteboard blocks
- no created-at on whiteboard shape blocks

Also added missing page attributes for whiteboard page. Initially I
modeled whiteboards as its own schema type with fewer page attributes
but then I noticed it got format and journal? when referenced so just
added the missing attributes. Fixes LOG-2915
2023-11-09 11:21:18 -05:00
Gabriel Horner
d6db27ce22 chore: split out class components from page
also fix LOG-2881
2023-10-31 10:53:10 -04:00
rcmerci
9eb2806305 enhance(rtc): add testcases, mock idb-keyval ns 2023-10-30 22:25:22 +08:00
Gabriel Horner
0715b03b8f chore: cleanup file-based.property* namespaces
Split out multi-graph fns from frontend.handler.file-based.property into
frontend.handler.property.file. This cleaned up the last of the namespaces
that didn't follow the convention of file-based.* and db-based.*
namespaces are for file graph and db graph only functionality
respectively. It's important to keep the two graph implementations separate as
it's simpler and easier to maintain them. We had already
introduced needless coupling between batch-set-block-property-aux and
multi-graph fns like remove-properties-when-file-based as
batch-set-block-property-aux is _only_ run in file graphs
2023-10-24 16:49:43 -04:00
Gabriel Horner
edaf9b286a chore: move frontend db namespaces to a dedicated parent ns
Moved these namespaces to logseq.db.frontend.* to make their purpose
explicit and make the namespaces easier to maintain
2023-10-16 17:24:51 -04:00
Gabriel Horner
ccc0bf9bad Add validation for property values
Reuse schema for property types and values from frontend. Moved into db
deps as it will soon be needed for a db namespace. Also tweaked schema
for :template type
2023-10-10 17:31:30 -04:00
Gabriel Horner
4b0100cb25 chore: cleanup page-property file based ns
All of frontend.util.page-property was file based except for one line.
Moved that ns to a file-based ns and moved the line out to the more
appropriate property-handler
2023-10-02 15:59:43 -04:00