Commit Graph

86 Commits (f8ac25154f1a8d47f7e5c3c3cc69b5e1be364c74)

Author SHA1 Message Date
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
Gabriel Horner fceb6ddb72 chore: split up page-handler into file-based, db-based and graph
Did this cleanup as I noticed that multiple fns were checking if they are in a
db context when they didn't need to. By organizing these namespaces, the
db and file versions will be easier to maintain.

While doing this refactor, I didn't change any logic except for removing
unnecessary db-based-graph? checks.  Also renamed a few fns to remove
redundant file- and db- prefixes
2023-10-02 14:32:02 -04:00
Gabriel Horner b264d17309 Move db-graph property fns to its own logseq.db ns
db-graph related fns like these shouldn't be in the graph-parser dep as
that dep should only really be used with file graphs as much as possible.
This is also being done in preparation for making the create-graph ns independent of
the frontend

Also db- prefixes in fns were dropped since the ns now carries the db-
prefix
2023-09-05 17:15:45 -04:00
Gabriel Horner b3efb93335 Move initial namespaces to start outliner dep 2023-09-01 17:23:34 -04:00
Gabriel Horner 6d303a9d02 enhance: add class to a new object option
If a user enters new option in an object property, give
the new option the user's intended class rather than error out
2023-08-24 10:22:07 -04:00
Gabriel Horner 11991a0919 fix query builder not starting
Also fix hidden properties showing up in property dropdown of query
builder
2023-08-04 12:00:59 -04:00
Gabriel Horner 7bca841afe Fix lints again to try to keep branch as green as possible 2023-07-27 10:15:27 -04:00
Gabriel Horner 045c51cded Use sqlite.db ns in electron.db
- Add more tests for sqlite.db
- Update readme and CI for db's tests
2023-06-30 17:36:01 -04:00
Tienson Qin c81e114a1c fix: lint 2023-06-28 15:20:22 +08:00
Gabriel Horner 29ebf73476 Upgrade clj-kondo in frontend with new fixes
- Couple tests didn't have an is so nothing was tested
- test-non-consecutive-blocks->vec-tree test was fixed
  by updating block->entity-map to include nil attributes
  as the original test wanted
- Also removed a stray :focus
2023-06-13 14:48:50 +08:00
Gabriel Horner e2214b9963 Add tests for function macro
Split out macros ns that it can be tested. Merged in handler ns as it is
only used for the function macro
2023-06-06 22:12:08 +08:00
Gabriel Horner 47508ac2ac Add :hidden config support to graph-parser.cli
Also fix lints and tests from previous commits
2023-05-18 23:25:15 +08:00
Gabriel Horner 9628fc52b9 Split out property related fns
in order to make editor ns more maintainable
2023-05-04 13:50:09 +08:00
Gabriel Horner 7d801c0f10 Add tests for result related transform and grouping
Also fixed two bugs related to new :group-by-page? option
2023-04-19 14:03:34 +08:00
Tienson Qin 551122e839 Update .clj-kondo/hooks/regex_checks.clj
Co-authored-by: Gabriel Horner <97210743+logseq-cldwalker@users.noreply.github.com>
2023-03-30 13:56:20 +08:00
Junyi Du 770fdc5894 clj-kondo: check regex error prone double escaping 2023-03-30 13:56:20 +08:00
Gabriel Horner d4cbe248f0 Finish making node-path consistent with electron renames 2023-03-30 12:57:22 +08:00
Gabriel Horner 1e9fac25e4 Add aliase and replace an outdated alias
Also start making node-path consistent for frontend
2023-03-30 12:57:22 +08:00
Tienson Qin db6fc6b7ee
feat: simple query builder (#8774)
Simple query builder

---------

Co-authored-by: Gabriel Horner <gabriel@logseq.com>
Co-authored-by: charlie <xyhp915@qq.com>
2023-03-21 14:27:00 +08:00
rcmerci 974e91c995 dev(lint): set :path-invalid-construct/string-join level to :info 2023-03-01 11:59:00 -05:00
rcmerci 40a1f5b6cd dev(lint): add :path-invalid-construct/string-join linter 2023-03-01 11:59:00 -05:00
Gabriel Horner 04f1e0e076 Page command enhancements
Three file commands will work in journal page when they have been
edited. These commands will also explicitly warn if no action is taken.
Also developer page commands recognize navigation now
2023-02-02 22:22:50 +08:00
Gabriel Horner bcaec408e6 Introduce keyword :fn to commands
Allows commands to invoke namespaces that previously caused circular
dependency issues
2023-01-30 14:56:35 +08:00
Junyi Du 414fef6933
Merge branch 'master' into dev/malli-schema&kondo-config 2023-01-12 19:28:24 +08:00
rcmerci 08edcb76b4
feat: add frontend.pubsub ns (#8312)
* feat: add frontend.pubsub ns
* update clj-kondo config
2023-01-12 18:07:05 +08:00
rcmerci 21e8a2eab9 dev: add malli-schema & generate kondo config 2023-01-08 20:33:27 +08:00
Gabriel Horner 17f51c7b77 Make resolve-input nbb compatible
- Brought back Xd-{before,after}-ms and tested it
- Move it to its own ns in graph-parser
- Updated nbb-logseq in deps/
- Made db-utils alias consistent
- Organized resolve-input
2023-01-07 02:49:07 -05:00
Gabriel Horner 6e0dea3f2c Add routing test and make ns name consistent 2022-12-15 11:14:56 -05:00
Gabriel Horner 65955f2ba2 Address lint failures and rm unused spec dep
Spec dep is no longer needed since it ships with bb
2022-12-09 13:17:09 -05:00
Gabriel Horner 584f3b068a Api fns can be called in prod builds with `call-api`
Follow up to
https://github.com/logseq/logseq/pull/7287#issuecomment-1321139222:
- Replace :classes approach with approach that works in dev and prod
  builds
- Remove graph-parser as it is unused
- Make api calling available for all contexts
2022-11-21 14:34:30 -05:00
Gabriel Horner 2ed7d82a02 Fix startup error introduced in dd0169b068
uncaughtException TypeError:
module$electron$utils.safe_decode_uri_component is not a function

Interesting that kondo doesn't catch invalid fns from js requires
2022-11-07 10:59:30 -05:00
Gabriel Horner 5962e0621d Bump to latest kondo and enable new aliased-namespace-symbol linter 2022-10-19 21:24:54 +08:00
Gabriel Horner 0c570a0300 Fix more bugs, move plugins.edn and add enabled
- Move plugins.edn to config/ as it is user configuration
- Add plugin-config enabled flag and moved plugin enabled
- Fixed bugs with manual install
- Refactored plugin-config component to have its own listener
- Split out shared plugin fns to a common ns - plugin-config shouldn't
  need to depend on a component like plugin-handler
- Bump rewrite-edn to include upstream fix and avoid tons of cljs
  warnings with earlier versions
- Fix react warning introduced outside this PR in ui/icon
2022-10-17 10:13:27 -04:00
Gabriel Horner 784ad7cce3 Add unit tests for create-if-not-exists and misc test improvements
- Added unit test as it is used by several handlers
- Fixed test suite failing from last commit now that a test fs is used
- Fixed test stat implementation
- Extracted out Plugin schema to make usage of it less impl dependent
- Made test.helper alias consistent
- Made async testing consistent for export-test
2022-10-17 10:13:27 -04:00
Gabriel Horner c8cda90373 Fix plugin install bugs and add plugin-config tests
- Add validation for plugins.edn with malli
- Add bb task using malli schema
- Add first async test that interacts with frontend.fs
- Add test helpers to make future async testing easier
2022-10-17 10:13:27 -04:00
Charlie d53ac94bfc
Enhance/pdf improvements (#6475)
Full-text search, highlights and assets alias support 
It also exposes a plugin API for highlight context menu   
    ```ts
    /**
       * Current it's only available for pdf viewer
       * @param label - displayed name of command
       * @param action - callback for the clickable item
       * @param opts - clearSelection: clear highlight selection when callback invoked
       */
      registerHighlightContextMenuItem: (
        label: string,
        action: SimpleCommandCallback,
        opts?: {
          clearSelection: boolean
        }
      ) => unknown
    ```
2022-10-09 20:44:18 +08:00