Compare commits

...
252 Commits
Author SHA1 Message Date
Nathan.fooo aecea10fd2 chore: bump client api and collab (#4900) 2024-03-14 16:23:45 +08:00
Richard Shiue 5a837a9482 fix: number and select filter logic (#4828)
* fix: number and select option filter bugs

* chore: rename filter condition enum and variants
2024-03-14 14:27:57 +08:00
Nathan.fooo 1a34366a3f chore: bump client api that adding constraints for init sync (#4897) 2024-03-14 12:24:49 +08:00
Richard Shiue 191a077a86 refactor: streamline create row logic (#4807) 2024-03-14 11:26:32 +08:00
Richard ShiueandMathias Mogensen 25d4b4f718 chore: revamp mobile url editor (#4602)
* chore: revamp mobile url editor

* chore: add i18n

* chore: use shared url launcher

* chore: translation bump

* chore: add a toast notification after URL is copied to clipboard

* chore: listen to onchanged

* chore: improve text field editing experience

* chore: disable quick action buttons if url cell data is empty

* chore: apply suggestions from code review

Co-authored-by: Mathias Mogensen <42929161+Xazin@users.noreply.github.com>

* chore: provide the bloc and watch changes

---------

Co-authored-by: Mathias Mogensen <42929161+Xazin@users.noreply.github.com>
2024-03-14 09:36:29 +08:00
Richard Shiueandnathan 48cac4c5ac feat: advanced filters backend logic (#4688)
* feat: implement advanced filters

* test: adapt tests to changes

* test: add advanced filter tests

* chore: adapt flutter frontend to changes

* chore: adapt tauri frontend to changes

* chore: bump collab

* chore: launch review

---------

Co-authored-by: nathan <nathan@appflowy.io>
2024-03-14 09:35:45 +08:00
Lucas.Xu 80e210b34a fix: sign in toast issue (#4895) 2024-03-14 09:17:59 +08:00
Nathan.fooo b57a870242 chore: 052 (#4890) 2024-03-13 19:40:36 +08:00
Nathan.fooo fd81d64a32 chore: fix database test (#4893)
* chore: fix database test

* chore: clippy

* chore: fmt
2024-03-13 19:39:56 +08:00
Zackandnathan bf70be1841 feat: add icon field (#4824)
* feat: add icon field

* fix: add sqlx migration files

* chore: fix tst

* chore: fix duplicate event name

* chore: update to lastest stable rust toolchain

* chore: use 1.75 channel

* chore: fix duplicate event name

* chore: fix duplicate event name

* chore: use more reliable assertion

---------

Co-authored-by: nathan <nathan@appflowy.io>
2024-03-13 15:07:52 +08:00
Richard Shiue af16299c83 fix: version bump sheet package (#4889) 2024-03-13 15:02:23 +08:00
polotop07100andRichard Shiue bb865c8f33 chore: update fr-FR translations (#4803)
* inlang: update translations

* inlang: update translations

* inlang: update translations

* inlang: update translations

* inlang: update translations

* inlang: update translations

* inlang: update translations

* chore: shuffle translation tokens

---------

Co-authored-by: Richard Shiue <71320345+richardshiue@users.noreply.github.com>
2024-03-13 14:17:31 +08:00
nathan 0f48310e22 chore: fix test 2024-03-13 13:30:29 +08:00
Zackandnathan 2c8fa1a2c3 chore: update client api (#4886)
* chore: update client api

* chore: bump client api

* ci: fix test

---------

Co-authored-by: nathan <nathan@appflowy.io>
2024-03-13 11:32:51 +08:00
Kilu.He 3dcf435f7d feat: support new settings UI (#4874)
* feat: support new settings UI

* feat: support splashscreen for tauri
2024-03-12 16:58:17 +08:00
Nathan.fooo 9c3be7e488 fix: stuck when importing large csv file (#4878)
* chore: fix import csv file

* chore: update collab

* chore: bump collab

* chore: workaround for row creating

* fix: test
2024-03-12 10:59:52 +08:00
Mathias MogensenandRichard Shiue c48001bd74 fix: launch review 0.5.1 (#4855)
* feat: floating calculations row

* fix: calculate cell overflow + tooltip

* fix: empty text cell should be counted as empty

* fix: empty text cell sohuld not be counted as not empty

* fix: conversion of some field types for calculations

* fix: tooltip + size of duplicate event button

* fix: minor view meta info changes

* fix: apply number format on word/char count

* fix: dart format

* fix: hide arrow for calc values

---------

Co-authored-by: Richard Shiue <71320345+richardshiue@users.noreply.github.com>
2024-03-11 10:41:51 +01:00
Richard Shiue 7afae69fe4 fix: release windows ci (#4873) 2024-03-11 16:48:44 +08:00
Lucas.Xu dd3f8b247a fix: only adding http(s) scheme if needed (#4871) 2024-03-11 16:43:43 +08:00
Richard Shiue b4c8011881 ci: fix flaky flutter integration tests (#4870) 2024-03-11 12:27:04 +08:00
Lucas.Xu f404882343 fix: disable the shortcut for converting to numbered list when the block is a heading (#4868) 2024-03-11 11:55:52 +08:00
Lucas.Xu fb887bec10 fix: potential risk of being unable to launch URLs without HTTP(S) scheme (#4867) 2024-03-11 11:02:29 +08:00
Richard Shiue 4b5195d891 ci: fix rust ci (#4861) 2024-03-10 16:02:30 +08:00
Nathan.fooo ddd4ba8287 chore: bump client api (#4860)
* chore: bump client api

* chore: bump client api
2024-03-10 13:52:54 +08:00
stmrandRichard Shiue 05f3885346 feat: support cs-CZ language (#4066)
* inlang: update translations

* inlang: update translations

* inlang: update translations

* inlang: update translations

* inlang: update translations

* inlang: update translations

* inlang: update translations

* inlang: update translations

* inlang: update translations

* inlang: update translations

* inlang: update translations

* inlang: update translations

* inlang: update translations

* inlang: update translations

* inlang: update translations

* inlang: update translations

* inlang: update translations

* inlang: update translations

* chore: enable czech language in settings

* chore: rename translation file

* chore: rename in inlang project json

---------

Co-authored-by: Richard Shiue <71320345+richardshiue@users.noreply.github.com>
2024-03-09 12:25:04 +08:00
Richard Shiue 70404816e7 fix: restore to use more conventional keyboard tab navigation (#4851) 2024-03-08 17:30:26 +08:00
Kilu.He 14f789f50b fix: support upload and render image(.git, .webp, .svg) (#4841)
* fix: add supported extension of image

* fix: display of select options when no typing

* chore: focus end when cell input actived

* fix: modified checklist keyboard event
2024-03-08 14:15:57 +08:00
Richard Shiue 574cca0a8b fix: bottom sheet color and sort ui imrprovement (#4849) 2024-03-08 10:16:03 +08:00
Richard Shiue f9c1cadbe0 chore: invalid url open behavior (#4850)
* chore: invalid url open behavior

* chore: use https instead of http by default
2024-03-08 10:15:19 +08:00
Lucas.Xu 6bac0412eb fix: v0.5.1 issues (#4844)
* chore: improve clear cache hint text

* fix: remove color tab in image picker
2024-03-07 23:13:04 +08:00
Richard Shiue 2a65c193c2 fix: desktop grid launch review (#4840)
* chore: disable changing the type of primary fields

* fix: don't persist text selection after text update in checklist

* chore: allow fn + backspace in macos to delete checklist item

* chore: shorten opacity fade between opacity shown and not shown

* fix: arrow key focus traversal
2024-03-07 21:05:19 +08:00
Mathias Mogensen cd245b5f0a fix: focus traversal in checklist popover (#4843)
* fix: focus traversal in checklist popover

* fix: dont trim input

* chore: remove redundant state var

* chore: remove late from controller
2024-03-07 21:04:10 +08:00
Richard Shiue 677617dcf2 fix: mobile grid launch review (#4839)
* fix: mobile database sort editor not working on prod

* fix: don't pop after creating field
2024-03-07 17:32:24 +08:00
Kilu.He a180cfcdc2 chore: support publish tauri app (#4829)
* chore: support publish tauri app

* chore: fixed others bugs

* fix: code review

* fix: code review

* fix: tauri ci
2024-03-07 13:46:09 +08:00
Lucas.Xu 0f13f86917 chore: update editor version (#4836) 2024-03-07 12:56:56 +08:00
Nathan.fooo 3d8ff062b5 chore: bump client api (#4819)
* chore: bump client api

* chore: bump client api

* chore: update ci

* chore: update client api

* chore: ci config

* chore: bump client api

* chore: bump client api

* chore: bump client api
2024-03-07 12:50:28 +08:00
Lucas.Xu 780f08dd28 test: execute the integration tests concurrently (#4831) 2024-03-07 12:48:51 +08:00
Richard Shiue 270d1c68b2 fix: relation hotfix (#4837) 2024-03-07 11:37:51 +08:00
Zack 88d14e7bde fix: delete workspace no panic (#4832) 2024-03-07 10:15:50 +08:00
Richard Shiue 90ebcb4cfc chore: enable relation (#4835) 2024-03-07 10:12:34 +08:00
Lucas.Xu a1823fa4c0 feat: feature flag in settings page (#4833) 2024-03-07 09:28:58 +08:00
Lucas.Xu f484675008 fix: uninitialized error in members setting page (#4834) 2024-03-07 09:28:31 +08:00
Mathias Mogensen f5cb8b6d25 fix: image url check for embed link (#4826)
* fix: image url check in for embed link

* chore: move all patterns to shared

* test: prefer enterText over manipulating widget
2024-03-06 16:31:30 +01:00
Zack 6e2caf3358 fix: delete workspace after deleting from remote (#4830) 2024-03-06 17:27:52 +08:00
Mathias Mogensen 66aea29ab7 feat: generic calculations (#4794)
* feat: add generic calculations

* chore: remove row count at bottom of grid

* fix: code review
2024-03-05 19:16:56 +01:00
Richard Shiue 3b0d82287d fix: some mobile ui bugs (#4823)
* fix: select option editor mobile

* chore: field type icon
2024-03-05 21:45:39 +08:00
Lucas.Xu b05897d3ab chore: add iOS integration test CI (#4822) 2024-03-05 17:20:27 +08:00
Kilu.He 2ec6250ddd feat: support uploading local image (#4820)
* feat: support uploading local image

* fix: code review

* fix: add hover style to empty image block
2024-03-05 16:59:30 +08:00
Richard Shiue ff8eb0d479 chore: mobile grid dark mode improvements (#4821)
* chore: field type grid

* chore: don't allow hiding primary field

* chore: bottom sheets

* chore: checklist bottom sheet
2024-03-05 15:44:16 +08:00
Lucas.Xu c8e86f4f26 feat: open workspace, rename workspace and update workspace icon (#4818)
* feat: support opening a workspace

* feat: support renaming a workspace

* fix: rename issue

* fix: rename issues

* feat: refactor menu bloc

* test: add collaborative workspace test

* test: add open workspace integration tet

* test: add delete workspace integration tet

* chore: turn off collab workspace feature
2024-03-05 13:51:03 +08:00
Kilu.He c0210a5778 feat: support adding cover to document (#4814) 2024-03-05 10:57:52 +08:00
Mathias Mogensen 5daf9d23f5 fix: update view names in page reference menu (#4802) 2024-03-04 18:24:49 +01:00
Mathias Mogensen b087a9aeb3 fix: filter keydownevents in actions handler (#4817) 2024-03-04 13:42:42 +01:00
Mathias Mogensen 107e3cea4f feat: duplicate calendar event (#4816)
* feat: duplicate calendar event

* test: add simple test
2024-03-04 12:42:00 +01:00
Mathias Mogensen ba965caa8f fix: stop hover when scrolling (#4801) 2024-03-04 12:41:34 +01:00
Zack 2af93a9bcb feat: add support for renaming and updating the icon for workspaces (#4806) 2024-03-04 16:05:16 +08:00
Nathan.fooo f8962edfd7 chore: bump client api (#4804)
* chore: bump client api

* chore: bump client api

* chore: bump client api
2024-03-04 14:05:04 +08:00
Lucas.Xu b236afd0c3 chore: update version to 0.5.1 (#4811) 2024-03-04 12:28:28 +08:00
Lucas.Xu 8944edf75f feat: support clearing caches and fix unable to load image (#4809)
* feat: support clearing caches

* fix: try to clear the image cache when loading failed.

* feat: clear cache on mobile

* chore: add error log
2024-03-04 12:24:25 +08:00
Richard Shiue 6b05be2362 fix: remove dup translation token and rearrange (#4810) 2024-03-04 12:01:31 +08:00
Lucas.Xu 90146148b6 feat: show the workspace list on top-left corner (#4799) 2024-03-04 10:43:00 +08:00
Mathias Mogensen 63464cbf2e fix: launch url on all platforms (#4797)
* fix: error handled launchUrl

* chore: update links to use new subdomain

* feat: show toast if onFailure is not provided
2024-03-03 22:04:59 +01:00
Daniil 1fadb15351 chore: update russian translations (#4796) 2024-03-03 09:41:33 +08:00
Lucas.Xu 8732c3c28b feat: members settings (#4788)
* feat: add member settings

* feat: fetch workspace members from server

* feat: add translations

* feat: implement invite feature

* feat: support inviting people via email

* feat: support updating member role

* feat: add feature flag to control the visibilty of members settings
2024-03-03 09:36:12 +08:00
YiHeCN f7233f6949 chore: update zh-CN translations (#4795) 2024-03-03 00:05:43 +08:00
Sore 8c7ed808a7 chore: rename ckb-KUR.json to ckb-KU.json (#4786) 2024-03-02 22:51:20 +08:00
Richard Shiue b38fc43300 feat: checklist cell editor a11y improvement (#4784) 2024-03-02 19:14:00 +08:00
Richard Shiue f4170755fa fix: reorder grid field updating all views (#4791) 2024-03-02 18:27:34 +08:00
Richard Shiue 79585d0835 fix: flutter_ci (#4793) 2024-03-02 17:30:27 +08:00
Kilu.He 835563f81b feat: support image block (#4783) 2024-03-01 10:48:07 +08:00
Richard Shiue 37bc5b3fbf chore: type option handler cleanup (#4787) 2024-03-01 10:26:38 +08:00
Richard Shiue 682bf19838 chore: type option cell data trait cleanup (#4782)
* chore: remove dead code

* chore: remove legacy FromCellStringTrait
2024-02-29 15:48:06 +08:00
Richard Shiue f4ca3ef782 feat: add basic relation field (#4397)
* feat: add basic relation field

* fix: clippy

* fix: tauri build 🤞

* chore: merge changes

* fix: merge main

* chore: initial code review pass

* fix: rust-lib test

* chore: code cleanup

* fix: unwrap or default
2024-02-29 14:38:18 +08:00
Richard Shiue f826d05f03 fix: mobile ui fixes (#4780)
* fix: adjust mobile grid padding

* fix: reorder field not working
2024-02-29 09:44:48 +08:00
Richard Shiue 01f2b15f70 fix: type option transform for checklists (#4779) 2024-02-28 22:04:32 +08:00
Mathias Mogensen 2d6856a23d fix: edit column sheet uniform ui (#4774) 2024-02-28 22:04:16 +08:00
Mohammad Zolfaghari 2286a1c726 feat: rtl toolbar item setting (#3958) 2024-02-28 21:56:18 +08:00
domenico code ef90c35175 chore: update translations (#4753) 2024-02-28 21:55:52 +08:00
Mathias Mogensen af12beb1c3 fix: remove empty space if no email (#4777) 2024-02-28 13:23:06 +01:00
Mathias Mogensen 0d68c42aab fix: symmetric padding in mobile database header (#4773) 2024-02-28 13:21:23 +01:00
Mathias Mogensen 0cffe42d80 fix: add time to view meta info (#4769) 2024-02-28 12:34:02 +01:00
Lucas.Xu abd08e5e53 feat: support customizing font and color before typing (#4765)
* fix: bius buttons highlight status

* feat: support customizing font family before typing

* feat: support customizing text color before typing
2024-02-28 15:51:50 +08:00
Kilu.He e250f780a4 feat: support to show condition in filter chip label (#4751)
* feat: support to show condition in filter chip label

* fix: improve the performance of inline formula with selection
2024-02-28 14:26:08 +08:00
Lucas.XuandMathias Mogensen 980bebf86a fix: mobile UI regression (#4754)
* fix: aa menu item selected status

* feat: support selecting word on iOS throught long pressing

* chore: update editor version

* feat: update add block menu colors

* feat: add scrollbar in bottom sheet

* fix: aa menu should not dimiss after changing block type

* fix: add link menu ui issues

* feat: sync bius status

* Update frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/mobile_toolbar_v3/appflowy_mobile_toolbar_item.dart

Co-authored-by: Mathias Mogensen <42929161+Xazin@users.noreply.github.com>

* chore: update editor version

* fix: flutter analyze

---------

Co-authored-by: Mathias Mogensen <42929161+Xazin@users.noreply.github.com>
2024-02-28 13:32:24 +08:00
Mathias Mogensen 26f8397624 feat: duplicate field with cell data (#4737)
* feat: duplicate field with cell data

* chore: code review remove extra option
2024-02-27 14:42:16 +01:00
Lucas.Xu d67e904f56 chore: cleanup disk space before running mobile ci (#4744)
* chore: use macos instead of linux in ci to avoid no spaces error

* chore: optimize disk space
2024-02-27 21:41:47 +08:00
Lucas.Xu f36ca3777b fix: unable to resize the image (#4750) 2024-02-27 21:41:14 +08:00
Richard Shiue 74233d2606 fix: mobile regression (#4747) 2024-02-27 10:51:32 +08:00
Nathan.fooo faea0fa532 chore: Update CHANGELOG.md 2024-02-27 03:37:56 +08:00
Lucas.Xu 3454af1caa chore: update privacy and terms link (#4742) 2024-02-26 15:29:55 +08:00
Nathan.fooo 8d50ad2936 chore: fix log (#4740)
* chore: fix log

* chore: fix log

* chore: bump client api
2024-02-26 15:27:12 +08:00
Richard Shiue daedf95c95 fix: some mobile database bugs (#4738)
* chore: no autofocus on field name

* refactor: one, two, many

* chore: reduce spacing between tabbar header and grid header

* fix: update field type

* fix: cannot edit view name

* fix: title for select field type bottom sheet

* fix: forget checks, just do it
2024-02-26 15:13:38 +08:00
Lucas.Xu 95bfda9dc6 chore: update changelog (#4743) 2024-02-26 15:02:04 +08:00
Lucas.Xu 93664167e0 fix: unable to redo/undo in lists and data loss issues (#4739) 2024-02-26 14:21:36 +08:00
Lucas.Xu dfe3b0a929 fix: the button sizes in math equation input field are not same (#4741) 2024-02-26 14:21:27 +08:00
Kilu.He e2028ac5a0 fix: database bugs (#4632)
* fix: database bugs

* fix: calendar picker

* fix: the position of collapse menu button

* fix: modified some style

* fix: slash command

* fix: selection style

* fix: support toggle inline formula

* fix: block color effect grid block

* fix: if isRange and date is greater than endDate, swap date and endDate

* fix: remove sorting before insert row

* fix: toggle property visible status

* fix: modified tauri window size

* fix: placeholder should be hidden when composing

* fix: support href shortcut

* fix: prevent submit when the formula has error

* fix: modified layout selection

* fix: add padding for record edit

* fix: remove sorts before drag row

* fix: modified chip style

* fix: if previous node is an embed, merge the current node to another node which is not an embed

* fix: modified emoji picker
2024-02-26 10:19:21 +08:00
Mathias Mogensen c9dc24a13c fix: launch review 0.5.0 (#4735)
* fix: top bar buttons slow respond

* fix: fav button responsive

* fix: add favorite button to database views

* fix: add overflow to calculation

* fix: minor workaround for showing number format prefix

* fix: clear calculation on empty field cells

* fix: average calculation should not have def value

* fix: cargo fmt
2024-02-25 21:32:44 +01:00
Mathias Mogensen 609557c357 feat: word and char count (#4705)
* feat: word and char count

* chore: lints after merge

* feat: add create time of view in more action

* fix: missing comma lint

* feat: add duplicate/delete + database view more

* fix: dispose logic

* feat: code cleanup

* fix: add false for isDocument in databases

* feat: register view info bloc on plugin basis

* fix: accidental removal

* chore: clean up

* fix: add ViewInfoBloc above Row Document Editor

* chore: final clean up
2024-02-25 16:46:13 +01:00
Lucas.Xu 93af6e69a1 feat: convert link preview block to url text (#4734) 2024-02-25 22:59:23 +08:00
Lucas.Xu b75947b630 fix: unable to click the items in a long list (#4733) 2024-02-25 21:36:46 +08:00
Lucas.Xu b60d25a0e3 fix: unable to upload image from clipboard (#4728)
* fix: unable to upload image from clipboard

* chore: apply suggestion
2024-02-25 18:50:35 +08:00
Richard Shiue 537fa52e77 chore: move database domain code to its own folder (#4556) 2024-02-25 18:38:18 +08:00
Richard Shiue d861ce6227 fix: mobile view and field list bottom sheets (#4727) 2024-02-25 11:51:18 +08:00
Nathan.fooo c3e5aa29fc fix: doc open sync (#4732)
* chore: bump client api

* fix: open document and folder

* chore: bump collab rev

* chore: fix wasm build

* chore: fix warnings
2024-02-25 07:49:44 +08:00
Richard Shiue 4ca3ba8e08 fix: cjk input in calendar and row detail (#4726) 2024-02-24 22:55:35 +08:00
Richard Shiue f5cc6521fb chore: clean up db sort blocs (#4725) 2024-02-24 22:55:22 +08:00
Lucas.Xu cea1c17b76 feat: improve outline block (#4722) 2024-02-24 21:54:21 +08:00
Lucas.Xu 2abb396467 feat: use result instead of either (#4724)
* feat: use result instead of either

* chore: remove dartz
2024-02-24 21:54:10 +08:00
Lucas.Xu 236b5bfe90 feat: error message should persist on the image block (#4710) 2024-02-24 11:05:20 +08:00
Dev-for-fun fa3bc97698 fix: remove duplicated button labels for done, cancel and ok (#4718) 2024-02-23 23:01:01 +08:00
Richard Shiue c0796e8ae5 feat: mobile sort editor (#4714) 2024-02-23 20:47:19 +08:00
Richard Shiue acd75befbc fix: disable onTap when quick action button is disabled (#4713) 2024-02-23 16:56:31 +08:00
Richard Shiue 746f0817bc fix: show database view options for inline as disabled (#4711) 2024-02-23 10:49:34 +08:00
Lucas.Xu c0b667b4ea chore: optimize image block actions menu (#4707) 2024-02-23 09:46:21 +08:00
Lucas.XuandMathias Mogensen ef83688907 fix: the keyboard blocked the content of bottom sheet (#4706)
* fix: the keyboard blocked the content of bottom sheet

* chore: apply suggestion

Co-authored-by: Mathias Mogensen <42929161+Xazin@users.noreply.github.com>

---------

Co-authored-by: Mathias Mogensen <42929161+Xazin@users.noreply.github.com>
2024-02-22 22:54:56 +08:00
Lucas.Xu c06a0346d8 chore: bump version 0.5.0 (#4700) 2024-02-22 10:22:33 +08:00
Richard Shiue 4a0c48f419 feat: bottom sheets with transition (#4608)
* feat: shiny new bottom sheets

* chore: code review
2024-02-22 09:54:54 +08:00
Lucas.Xu 7802c75d7c feat: support scaling text on mobile (#4690) 2024-02-22 09:50:24 +08:00
Richard Shiueandnathan f1831d07af chore: re-implement get_filter_by_field_id function (#4678)
* chore: remove inaccurate database view function

* chore: update collab rev

* chore: fix clippy

---------

Co-authored-by: nathan <nathan@appflowy.io>
2024-02-22 08:07:59 +08:00
Richard ShiueandNathan.fooo 6636731487 feat: checklist sort (#4659)
* refactor: use BoxAny for dynamically-typed cell changesets

* fix: rust-lib tests and clippy

* feat: enable sorting by checklist type option

* test: checklist sort rust-lib tests

* chore: update related tests

* fix: clippy

---------

Co-authored-by: Nathan.fooo <86001920+appflowy@users.noreply.github.com>
2024-02-22 08:00:59 +08:00
Richard Shiue a4a2a4088b refactor: use BoxAny for dynamically-typed cell changesets (#4655)
* refactor: use BoxAny for dynamically-typed cell changesets

* fix: rust-lib tests and clippy
2024-02-22 07:12:52 +08:00
Richard Shiue c500cd1287 refactor: improve type option filter logic (#4652) 2024-02-22 07:09:12 +08:00
Richard Shiue 6f173c2ada chore: adjust show mobile bottom sheet (#4689) 2024-02-21 21:06:46 +08:00
Richard Shiue 34fb1bcfa4 fix: disappearing sorts (#4691)
* chore: copy the field type

* chore: don't store field type in Sort

* fix: sorts disappearing
2024-02-21 20:01:57 +08:00
HY 58aa73b5be fix: resolve lexical ambiguity between "row" and "col" in zh-TW translation (#4683)
ref: https://terms.naer.edu.tw/detail/5e94c72b55cc73ebf81d71ca2b5d57e6/?seq=1
2024-02-20 22:40:03 +08:00
Richard Shiue 334aedd6c6 refactor: checkbox field type (#4682) 2024-02-20 14:02:32 +08:00
Richard Shiue a6c6aa819c fix: newly-created rows aren't being automatically sorted (#4661)
* fix: newly-created rows aren't being automatically sorted

* chore: new database view collab notification and add tests
2024-02-20 13:17:46 +08:00
Jayaprakash 15c9a67028 feat: implement outline block component depth control (#4642)
* feat: add support to control the depth of outline block component

* feat: update localization keys

* feat: add depth option to `BlockOptionButton`

* feat: retrive outline block heading components upto the depth level

* feat: add depth option config to editor configuration

* test: outline block depth control

* feat: add outline block placeholder

* refactor: remove redundant codes

* ci: trigger github actions

* chore: refactor `OptionDepthType` enum

* fix: flutter ci error

* refactor: removed `finalHeadingLevel` from outline keys

* fix: flutter ci error
2024-02-20 10:52:06 +08:00
Lucas.Xu 42cb032bca fix: flutter analyze (#4680) 2024-02-19 21:48:06 +08:00
Mathias Mogensen a3a5709b70 fix: dispose of previous applaunch tasks (#4631) 2024-02-19 21:32:01 +08:00
Ansah Mohammad 3a4247c304 feat: convert time format from HHmm to HH:mm in time field (#4641)
* feat: add a HHmm to HH:mm function

* fix: Replaced string.parse() with string.parseStrict() to address time input bug

* feat: add TextFormatter for formatting the time input
2024-02-19 21:30:28 +08:00
Sore 8eaadccda0 chore: add ckb-KUR translations (#4658)
* Create ckb-KUR.json

Add Translate (Kurdish-ckb Language)

* Update language.dart

i added ckb lang(kurdish).

* Update app_widget.dart
2024-02-19 17:43:01 +08:00
ArcesilasandLucas.Xu 2b6b10788d chore: update fr-FR and fr-CA translations (#4676)
Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io>
2024-02-19 17:25:00 +08:00
Lucas.Xu 26f8bbf7c6 feat: optimize image upload process and display an error message if upload fails (#4679)
* chore: optimize image upload

* feat: show upload image status

* chore: upload the ai image to cloud server
2024-02-19 17:24:47 +08:00
Lucas.Xu 252699d249 chore: upgrade to flutter 3.19.0 (#4677)
* chore: upgrade to flutter 3.19.0

* chore: adjust to the latest flutter convention

* chore: update CI flutter version

* fix: flutter analyze

* fix: flutter analyze

* fix: flutter analyze

* chore: fix docker build
2024-02-19 13:49:55 +08:00
Nathan.fooo b2e55c4e2e Fix: init state (#4672)
* chore: fix login state

* chore: change log

* chore: fix flutter version
2024-02-18 16:40:18 +08:00
Bastian Leichtandnathan d5ee372131 chore: update translations (#4615)
Co-authored-by: nathan <nathan@appflowy.io>
2024-02-18 07:36:23 +08:00
Arcesilasandnathan 39588a4731 chore: update translations (#4664)
Co-authored-by: nathan <nathan@appflowy.io>
2024-02-18 00:44:39 +08:00
HYandnathan 211559ed6e chore: Update translations for Traditional Chinese (#4662)
* chore: update zh-TW translations

* inlang: update translations

* inlang: update translations

* chore: update zh tw

* chore: update zh tw

---------

Co-authored-by: nathan <nathan@appflowy.io>
2024-02-18 00:40:22 +08:00
kosei a637517413 feat: update ja-JP translations (#4627) 2024-02-18 00:25:52 +08:00
Mathias Mogensen ddbe0fa698 fix: tauri build (#4669)
* ci: update workflows

* chore: add back translations used on web
2024-02-17 14:38:12 +01:00
TeddyFlink ee61ef3f12 feat: update translations (#4654) 2024-02-17 16:31:25 +08:00
PWandnathan 54bfc65664 feat: translate to traditional Chinese (#4505)
* inlang: update translations

* inlang: update translations

* inlang: update translations

* inlang: update translations

* inlang: update translations

---------

Co-authored-by: nathan <nathan@appflowy.io>
2024-02-17 16:28:10 +08:00
Richard Shiue c159a5e42b chore: enable number filter (#4653)
* chore: enable filtering by number field type

* chore: code cleanup

* fix: integration test

* chore: remove unnecessary async from event handler
2024-02-17 15:28:49 +08:00
Richard Shiue 1311e2d379 fix: build regression (#4667) 2024-02-17 14:42:01 +08:00
Hassam Sulehriaandjazima e6aa57275a feat: open emoji selection menu with keyboard short (#4133)
* feat: Implement emoji shortcut event (#2038)

* test: emoji shortcut integration test (#2038)

* test: Fixed testcase for emoji_shortcut_test (#2038)

* fix: remove _showEmojiPickerMenu (#4133)

* fix: change local variables with underscore

---------

Co-authored-by: jazima <jazim.a.29@gmail.com>
2024-02-16 18:47:23 +01:00
Danilo Barion Nogueiraandnathan d690ca2751 chore: update translations (#4270)
Co-authored-by: nathan <nathan@appflowy.io>
2024-02-17 01:44:05 +08:00
Richard Shiue 3e0a003872 fix: deleting a sort doesn't allow creating a new sort on that field (#4660) 2024-02-16 13:39:49 +08:00
Nathan.fooo e81a2ff577 fix: token refresh on local (#4650)
* fix: refresh user token on local

* chore: add test
2024-02-14 09:38:05 +08:00
Mathias Mogensen b356927e60 feat: improve more action in document (#4639) 2024-02-09 15:54:05 +01:00
Mathias Mogensen 1894409dc3 ci: resolve mobile build failing due to missing space (#4640)
* chore: remove additionally unused tools

* chore: test

* chore: bunch cleanup commands
2024-02-09 14:40:06 +01:00
nathan f29f1bae32 chore: update error message 2024-02-09 10:18:52 +08:00
Nathan.fooo 45054e7639 chore: bump version 047 (#4635) 2024-02-09 00:18:51 +08:00
Nathan.fooo 3b51a6e6be chore: reload workspace when fail to load at the first time (#4633)
* chore: reload workspace when fail to load at the first time

* fix: clippy

* chore: update client api

* chore: fix wasm build

* chore: fix test
2024-02-08 23:53:05 +08:00
Ansah Mohammad 747fe40648 feat: toggle favourites from the documents top bar. (#4382)
* feat: init star button

* feat: implemented star button on the right bar

* feat: Implemented toggle logic

* chore: Added ToolTip for favorite button

* refactor: renamed star to favorite

* refactor: moved appplication logic into favorite_cubit

* chore: arranged imports in alphabetical order

* refactor: reused favorite_bloc for toggle

* fix: fixed the icon no rebuild

* refactor: moved the FavoriteBloc higher in the widget tree

* refactor: moved FavoriteBloc inside multiBlocProvider of desktop_home_screen

* chore: specified bloc type

* chore: cleaned code

* refactor: use any instead of map
2024-02-08 10:45:54 +01:00
Kilu.He 60fc5bb2c8 fix: tauri folder bugs (#4589) 2024-02-08 14:22:44 +08:00
Mathias Mogensen 9d71464f1a fix: select name by default (#4630) 2024-02-07 21:49:17 +01:00
Mathias Mogensen 92ceb2cd7d fix: dispose of resources in time (#4625)
* fix: limit length when renaming views

* chore: clean up database listeners

* fix: dispose of controllers properly

* fix: dispose of resources properly

* fix: deleting filters with same name

* chore: extend DatabaseTabBarItemBuilder

* fix: null check on null value
2024-02-07 18:38:53 +01:00
Richard Shiue 0db21b91a3 fix: unequal grid header and body widths (#4626) 2024-02-07 17:49:53 +01:00
Richard Shiue 88e9d63a13 fix: show newChecklistTask on hover over entire list item in row detail page (#4622) 2024-02-07 23:20:26 +08:00
Mathias Mogensen 3129fa6cc1 fix: use cmd+. to toggle sidebar on macOS (#4621)
* fix: use cmd+. to hide sidebar on macOS

* fix: update missed tooltip
2024-02-07 12:18:13 +08:00
Mathias Mogensen db5372c18e feat: hotkey to open settings dialog (#4620)
* feat: hotkey to open settings dialog

* chore: change to cmd/ctrl+,
2024-02-07 12:17:48 +08:00
Richard Shiue b781c9aa0f fix: deleting a sorting field doesn't delete existing sorts (#4611) 2024-02-07 10:47:17 +08:00
Richard Shiue a9c6b80f4a chore: add spacing between field buttons in setting popover (#4612) 2024-02-07 10:46:36 +08:00
Lucas.Xu 271f781cce fix: application will raise an error when selecting unsplash image in local mode (#4604) 2024-02-05 21:53:14 +07:00
Richard Shiue ef4bce25d8 feat: sort by last modified time or created time (#4601) 2024-02-05 21:54:42 +08:00
ansizheshi 95c4cb241a chore: update zh-CN translations (#4599) 2024-02-05 17:39:45 +08:00
Dorian Péron e20d938ce3 chore: update translations (#4581) 2024-02-05 16:53:18 +08:00
Richard Shiue a515715543 feat: reorder sort precedence (#4592)
* feat: reorder sorts

* chore: add tests, fix tests, fix tauri build and fix clippy

* fix: add missing import
2024-02-05 13:52:59 +08:00
Nathan.fooo fda70ff560 feat: folder web (#4580)
* chore: folder wasm

* chore: folder wasm

* chore: resolve deps

* chore: fix trait

* chore: try localset

* chore: fix

* chore: fix

* chore: fix

* chore: async init sdk

* chore: fix test

* chore: fix test
2024-02-04 05:50:23 +08:00
Zackandnathan 08938b8c70 feat: cloud workspace api (#4469)
* feat: workspace api

* feat: added cloud apis for add and delete workspace

* feat: add and delete workspace event handlers

* chore: rust fmt

* chore: save user workspace

* test: add test

* test: add test

* chore: add to gitignore

* feat: update api add name to workspace

* chore: cargo clippy and rename to create

* chore: add envrc and direnv to gitignore

* chore: change name to create workspace instead of add workspace

* chore: update client api rev

* feat: add create workspace impl

* chore: restore gitignore to original

* test: fix create workspace event test

* fix: change delete workspace input

* fix: compile

* fix: create workspace test

* feat: add error code for request payload too large

* chore: remove cargo backup files

* feat: add is async option for upload file handler

* chore: update client api version

---------

Co-authored-by: nathan <nathan@appflowy.io>
2024-02-04 05:49:45 +08:00
Richard Shiueandnathan 250f29f325 chore: clean up sort and filter code (#4585)
* refactor: port away from extra SortType struct

* refactor: add validator to flowy_database and clean up unused structs

* refactor: port away from extra FilterType struct

* chore: analysis options

* fix: clippy and dart/ts compile

* fix: tauri build

---------

Co-authored-by: nathan <nathan@appflowy.io>
2024-02-04 05:49:28 +08:00
Yijing Huang d117cd6b5b chore: delete placeholder code and clean code (#4503) 2024-02-04 00:56:50 +08:00
Richard Shiue ca93cb20ec chore: revamp mobile database toolbar (#4579)
* chore: revamp mobile database toolbar

* chore: code cleanup
2024-02-04 00:55:44 +08:00
Richard Shiue 8c1d0106dd chore: inkwell mobile quick action sheets (#4576)
* chore: inkwell mobile quick action sheets

* chore: more subtle tap effect

* chore: improve code style
2024-02-04 00:55:05 +08:00
Mathias Mogensenandnathan 5cbc8b1e18 feat: calculations (#4473)
* feat: initial calculation controller

* fix: entities

* feat: calculations

* fix: review comments and support floats

* fix: abstract business logic into calculations service

* fix: clean calculation entities after merge

* feat: react to changes to row/cell/field_type

* chore: changes after merging main

* feat: handle delete field

* test: add grid calculations tests

* fix: add validation + format numbers

* refactor: get cell number

* chore: bump collab

* chore: fix clippy

* chore: update docs

* chore: update docs

* chore: fmt

* chore: fix flutter

* chore: collab rev

* fix: cleanup and hover to show

* fix: localization

* test: add basic rust test

* fix: clippy

* fix: support updating calculation on duplicate row

---------

Co-authored-by: nathan <nathan@appflowy.io>
2024-02-04 00:52:38 +08:00
Nathan.fooo 274742e334 chore: bump version v0.4.6 (#4595)
* chore: bump version

* chore: bump client api version
2024-02-03 19:45:46 +08:00
Lucas.Xu 792f56db79 chore: remove unused build and add build bot (#4586) 2024-02-02 17:42:23 +08:00
nathan 458d3f971b chore: bump client api 2024-02-02 09:35:55 +08:00
Nathan.fooo 2ffd6bf7ea chore: bump version (#4583) 2024-02-02 09:30:27 +08:00
Nathan.fooo 722691c922 chore: fix ws conn (#4582)
* chore: fix ws conn

* chore: flutter analyzer

* chore: update client api
2024-02-02 09:27:11 +08:00
Kilu.He 9746852b5f fix: fixed editor bugs (#4552)
* fix: fixed editor bugs

* fix: add error boundary
2024-02-02 05:47:41 +08:00
Lucas.Xu 5b030303a6 fix: appimage build (#4578)
* chore: force exec flutter package pub get

* feat: support building appimage on github ci
2024-02-01 20:58:58 +08:00
XiaoFans 1e4f342fc3 chore: update translations (#4577) 2024-02-01 20:53:49 +08:00
Richard Shiue 4f0379bdd7 fix: size of hitbox in app bar button (#4575) 2024-02-01 20:53:21 +08:00
Lucas.Xu ce261c9128 fix: keyboard not show automatically (#4572) 2024-02-01 15:41:14 +08:00
Richard Shiue 20391bfec4 chore: revamp database setting action sheets (#4570)
* chore: revamp database setting action sheets

* chore: field picker improvement

* chore: fix comments
2024-02-01 15:41:02 +08:00
Richard Shiue 9d28360887 fix: mobile ui improv and bugs (#4567)
* fix: quick edit field bottom sheet header

* fix: field editor appbar regression

This stems from moving to a standardized FlowyAppBar
2024-02-01 10:27:03 +08:00
Lucas.Xu 99f9cb2a09 chore: bump version 0.4.4 (#4566) 2024-01-31 22:37:04 +08:00
Mathias MogensenandLucas.Xu 247405ff51 fix: launch review reminder (#4514)
* fix: dismiss menu on enter on no result

* fix: add drag handle to mobile reminder dialog

* fix: show reminder icon  in date cell in grid

* fix: auto select day when selecting reminder

* fix: increase height of notification hub

* fix: let some reminder options require time and show time

* fix: handling of non-time reminder options

* test: fix edit date time cell test

* fix: close popover when pressing child again

* fix: add time of now when setting include time

* fix: clean logic

* fix: tests

* fix: add test and include time in notification hub

---------

Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io>
2024-01-31 21:17:36 +08:00
Nguyễn Thái Lâm d27e2179cc chore: update vietnamese translations (#4536) 2024-01-31 21:16:39 +08:00
indar 100cc19747 chore: update translations id-ID (#4548) 2024-01-31 21:16:11 +08:00
Richard Shiue fa66a119ed fix: mobile UI issues (#4561)
* fix: don't re-request focus after editing a cell

* fix: card detail more actions

* fix: select option indicators

* fix: add field bottom sheet revamp

* fix: edit field type bottom sheet

* chore: bump spacing between header and first row of field types

* fix: grid spacing

* refactor: use svg and background colors

* refactor: use shared component
2024-01-31 21:15:38 +08:00
Lucas.Xu a9787546b4 chore: update add block menu icons (#4565) 2024-01-31 21:15:23 +08:00
Peter Dave Hello 5cbe90c79f chore: further improve and update zh-TW translation (#4558)
This is a follow up of #4345, to continue improve the translation
quality, as the original translation was more Simplified-Chinese, and
there are also some new strings need to be translated.
2024-01-31 20:17:35 +08:00
Lucas.Xu a143a030a9 feat: reafactor add block menu (#4563) 2024-01-31 17:47:02 +08:00
Richard Shiue caede19267 chore: get rid of space in code block of readme (#4547) 2024-01-31 10:47:51 +08:00
Lucas.Xu d410ffbaa8 feat: support exporting log files (#4559)
* feat: support exporting log files

* feat: support uploading log files on Android
2024-01-31 10:07:50 +08:00
Nathan.foooandRichard Shiue 0483e305e7 chore: rename (#4551)
Co-authored-by: Richard Shiue <71320345+richardshiue@users.noreply.github.com>
2024-01-31 00:43:55 +08:00
Lucas.Xu f6242f1cc7 feat: add signout dialog (#4557) 2024-01-31 00:40:52 +08:00
Richard Shiue 18c7fff34b refactor: clean up select type option logic (#4554) 2024-01-30 23:20:11 +08:00
Lucas.Xu 792573f46d feat: optimize image block (#4553)
* feat: add tooltip for maximum image size

* feat: add maximum upload image size tooltip

* feat: limit image size to 10MB

* fix: disable copy link option for cloud image

* fix: disable copy link option for cloud image

* feat: use regex to match the appflowy.cloud image
2024-01-30 22:39:42 +08:00
Lucas.Xu e9d7d0b7b3 fix: incorrect background color using in view action menu (#4513) 2024-01-30 16:07:51 +08:00
Lucas.Xu 0b7ae734a1 fix: potential dependency conflict (#4550)
* fix: potential dependency conflict

* fix: ci issues
2024-01-30 16:05:56 +08:00
Nathan.fooo c0aef8f4fe fix: login issue (#4546)
* fix: reset server url when using appflowy cloud the first time

* refactor: set authenticator in frontend

* chore: log version

* chore: show hint when changing the server type

* chore: bump version

* chore: fix test

* chore: bump collab
2024-01-30 09:33:34 +08:00
Nathan.fooo 55c97b56a3 feat: calling user event from web (#4535)
* refactor: user manager

* refactor: user manager

* refactor: session location

* refactor: user manager

* chore: gen ts files

* feat: implement indexeddb persistence

* chore: integrate user manager

* chore: update

* chore: run on web thread

* chore: run on web thread

* chore: fix test

* chore: add test

* chore: add test

* chore: add user & sign in with password

* chore: fix test

* chore: update docs

* chore: fix warnings

* chore: gen files

* chore: add user

* chore: add files

* chore: update config

* chore: update scirpt

* chore: update scirpt

* fix: build

* chore: update command

* fix: ci

* ci: fix

* fix: compile

* fix: compile

* fix: ci

* fix: compile

* fix: tauri build

* chore: fix test

* chore: fix test
2024-01-30 05:36:27 +08:00
Mathias Mogensen 86a0569d84 feat: f2 to rename current view (#4522)
* feat: cmd+shift+r to rename current view

* test: change cmd to f2 and add test

* chore: code review

* fix: unawaited future
2024-01-29 20:55:37 +01:00
Lucas.Xu 5b3b0e54d9 feat: refactor app bar (#4539)
* feat: refactor appbar

* fix: flutter analyze
2024-01-29 23:13:06 +08:00
Lucas.Xu f1e380c276 fix: add more padding in bottom sheet widget (#4542) 2024-01-29 23:12:56 +08:00
Mathias Mogensen ea93f0e141 fix: idiomatic dow can be 1 character (#4543) 2024-01-29 13:10:47 +01:00
Abhijeet SinghandLucas.Xu c1433ce38a chore: update translations (#4510)
* Update es-VE.json

* inlang: update translations

* Delete project.inlang/project_id

* inlang: update translations

* Delete project.inlang directory

* Create settings.json

* inlang: update translations

* inlang: update translations

* inlang: update translations

* inlang: update translations

* inlang: update translations

* inlang: update translations

---------

Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io>
2024-01-29 17:33:58 +08:00
XiaoFansandLucas.Xu 831586293e chore: update Chinese translations (#4521)
* inlang: update translations

* Revert "inlang: update translations"

This reverts commit a6e1d945c1.

* chore: update Chinese translations

The translation this time is tailored to the reading habits of Chinese readers, correcting some machine-translated content. Additionally, I have included some content that was not translated before.

* chore: update frontend/resources/translations/zh-CN.json

---------

Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io>
2024-01-29 17:28:47 +08:00
Richard Shiue 5c5b6d02e8 fix: don't show ungrouped column when the field type is checkbox (#4538) 2024-01-29 17:27:59 +08:00
Lucas.Xu 8937856d36 feat: new UI design for number format list (#4537) 2024-01-29 16:34:19 +08:00
Richard Shiue 63c22feb8f fix: mobile field editing related bugs (#4534)
* fix: mobile field editing related bugs

* chore: review

* chore: restore podfile.lock
2024-01-29 13:19:35 +08:00
Richard Shiue 05a06980b9 chore: add unwaited futures to analysis options (#4485) 2024-01-29 10:26:45 +08:00
Lucas.Xu 7be29c04a2 fix: unable to delete image and refactor image actions menu (#4525)
* feat: refacotr image block action

* fix: unable to delete the image placeholder

* fix: unable to delete the image placeholder
2024-01-29 10:15:48 +08:00
Lucas.Xu 5a9a1e60e6 fix: bottom sheet issues (#4523)
* fix: bottom sheet padding

* fix: set divider width to 0.5px

* feat: optimize number select menu

* chore: update edit field icons

* chore: use short form in add block menu

* feat: optimize select and multi-select menu

* feat: refactor font settings page, theme mode menu and rtl menu
2024-01-28 22:50:25 +08:00
Richard Shiue 4811e65efa chore: reorganize cell code (#4516)
* chore: move cell bloc files to application

* chore: move cell editor widgets to its own folder
2024-01-27 10:57:09 +08:00
Lucas.Xu 72a23bfe82 feat: update recentViews list to only keep the first 20 items (#4512) 2024-01-26 22:35:33 +08:00
Lucas.Xu ed78cb4efc fix: the items in database field menu are not aligned (#4511)
* fix: title in settings page overflow

* fix: the icon and text in database field menu aren't aligned

* fix: the icon and text in database field menu aren't aligned
2024-01-26 22:35:16 +08:00
Richard Shiue d2cc799861 fix: mobile row detail title not being updated (#4507) 2024-01-26 22:23:59 +08:00
Richard Shiue 2e7a97c8a2 chore: enable timestamp field on mobile (#4506) 2024-01-26 22:23:47 +08:00
Lucas.Xu 64cd7d41ca fix: the text and icon in + menu are not aligned in the same baseline (#4500) 2024-01-26 10:06:49 +08:00
Lucas.Xu 0e3ffa8fd5 feat: action sheet revamp (#4497) 2024-01-26 00:33:45 +08:00
Lucas.Xu be00980fdd chore: optimize android UI (#4498) 2024-01-26 00:24:33 +08:00
Abhijeet Singh 7fbaf204ef chore: update translations (#4493) 2024-01-25 23:46:42 +08:00
Mathias Mogensen acc03b8cc4 chore: code cleanup according to unintroduced lints (#4488)
* chore: remove redundant arguments

* chore: remove unused constructor params

* chore: reorganize constructors

* chore: remove unnecessary awaits in returns

* chore: remove unnecessary paranthesis

* chore: add lints

* chore: clean up after merge

* chore: add sort constructors first

* chore: organize constructors in blocs

* chore: use sizedbox.shrink over empty container
2024-01-25 23:37:36 +08:00
Richard Shiue 747abba87f fix(mobile): remove elevation from edit field page and remove inksplash in card detail if disabled (#4491) 2024-01-25 13:20:48 +08:00
Richard Shiue e88fb533c8 fix: composing in select option text field doesn't work (#4470)
* fix: composing in select option text field doesn't work

* style: improve code style
2024-01-25 13:17:13 +08:00
Richard Shiue 3f896ad64f chore: reorganize code (#4490)
* rename select_option.rs to select_option_entities.rs

* move checklist_filter.rs from select_type_option to checklist_type_option
2024-01-25 12:56:43 +08:00
Richard Shiue 6591d5de52 chore: dart code cleanup (#4484)
* chore: use when instead of map in bloc event dispatch

* chore: dart code formatting, remove white space

* chore: remove unneeded hashmap for cell context

* fix: rebuild card content
2024-01-25 12:26:18 +08:00
Richard Shiue a1abcd7626 refactor: database cell controller and builder (#4398)
* refactor: get row/field data from row cache and field controller in cell controller

* refactor: reorganize cell controller tasks and builder

* refactor: rename cell_builder.dart

* refactor: database editable cell builder

* refactor: database card cell builder

* fix: make it work

* fix: start cell listener and adjust cell style on desktop

* fix: build card cell

* fix: remove unnecessary await in tests

* fix: cell cache validation

* fix: row detail banner bugs

* fix: row detail field doesn't update

* fix: calendar event card

* test: fix integration tests

* fix: adjust cell builders to fix cell controller getting disposed

* chore: code review

* fix: bugs on mobile

* test: add grid header integration tests

* test: suppress warnings, reduce flaky test and group tests
2024-01-24 23:59:45 +08:00
Abhijeet Singh 18a355601a chore: update translations (#4481) 2024-01-24 22:46:11 +08:00
Lucas.Xu c2fdfb6e89 fix: font shown in AA has _r as a suffix (#4482) 2024-01-24 22:45:13 +08:00
Mathias Mogensen baa7c8d826 feat: reminder on date (#4288)
* feat: support reminder on date

* feat: support reminder on date in database

* fix: include time static

* fix: do not force unwrap

* chore: clean flutter code

* test: add test for reminder in database

* fix: interpret reminder option

* feat: date and reminder on mobile

* feat: improve notification actions and support open row

* feat: support dates in document

* fix: minor changes + review

* feat: support reminder on mobile in document

* feat: support open row on database reminder mobile

* test: add more tests

* fix: first part of review

* fix: open row responsibility

* fix: abstract application logic from presentation layer

* fix: update reminder on date cell update

* test: fix failing test

* fix: show correct selected day after end date toggled
2024-01-24 15:15:57 +01:00
Mathias Mogensen 8105da1c2b Fix: mobile improvements (#4480)
* fix: copy on notifications screen is caught off

* fix: mobile event screen no events copy

* fix: hide notifications toggle from settings

* fix: cannot change type of field in grid
2024-01-24 12:07:02 +01:00
Lucas.Xu 827e41348b feat: keep the offset of the recent section (#4466) 2024-01-23 16:54:04 +08:00
Lucas.Xu e239ba46aa feat: customize self host url on launch page (#4465) 2024-01-23 16:38:15 +08:00
Lucas.Xu 2554ba81b5 feat: optimize cloud settings on mobile (#4444) 2024-01-23 01:37:02 +08:00
Nathan.fooo 84d171b1db chore: bump client api to fix user session issue (#4445) 2024-01-23 01:33:52 +08:00
Lucas.Xu 38902ed599 feat: enable anonymous sign in on mobile (#4442)
* feat: enable anoymous login on mobile

* feat: support signin with third party serices
2024-01-22 22:36:16 +08:00
Lucas.Xu 2cdee386c2 chore: add zip package for Windows (#4441) 2024-01-22 22:36:07 +08:00
Nathan.fooo 90516b6adc feat: wasm build (#4412)
* chore: enable wasm build

* chore: bump collab

* chore: fix build

* chore: flowy-document wasm

* chore: fix compile

* chore: fix compile

* chore: fix compile

* chore: fix compile

* chore: fix ci

* chore: fix ci

* chore: fix ci
2024-01-22 13:34:15 +08:00
Lucas.Xu c4acba8216 fix: mobile sign-in issue (#4424)
* Revert "chore: remove zip package for windows and macOS (#4404)"

This reverts commit f612d9b701.

* Revert "chore: remove zip package for windows and macOS (#4404)"

This reverts commit f612d9b701.

* fix: mobile signin
2024-01-21 21:47:14 +08:00
Continy 4404e0d727 chore: update translations (#4428)
* inlang: update translations

* inlang: update translations

* inlang: update translations
2024-01-20 23:24:10 +08:00
Abhijeet SinghandLucas.Xu 48c6c635f7 chore: update translations (#4406)
* Update es-VE.json

* inlang: update translations

* Delete project.inlang/project_id

* inlang: update translations

* Delete project.inlang directory

* Create settings.json

* inlang: update translations

* inlang: update translations

* inlang: update translations

---------

Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io>
2024-01-20 23:23:44 +08:00
Zsombor 332f40c915 choreL: update Hungarian translations (#4416) 2024-01-20 23:22:33 +08:00
Lecanora 2b32f0eff0 chore: update french translations for inlang (#4419) 2024-01-20 23:21:47 +08:00
Juliano Penna 7d20ca5a77 fix: print correct package name (#4425) 2024-01-20 23:18:50 +08:00
0a0f2adf76 feat: support uploading image to cloud storage (#4413)
* feat: add object ext

* feat: integrate upload image api

* feat: support uploading local file to cloud

* feat: abstact the CachedNetworkImage as FlowyNetworkImage

* ci: fix tauri ci

* fix: integration test

---------

Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io>
Co-authored-by: nathan <nathan@appflowy.io>
2024-01-20 23:16:18 +08:00
Richard Shiue 4852e5c8d4 fix: don't parse unexpected files while generating protobuf (#4411) 2024-01-17 11:20:02 +08:00
1930 changed files with 71473 additions and 37890 deletions

No files matched your search

+104
View File
@@ -0,0 +1,104 @@
name: Flutter Integration Test
description: Run integration tests for AppFlowy
inputs:
os:
description: "The operating system to run the tests on"
required: true
flutter_version:
description: "The version of Flutter to use"
required: true
rust_toolchain:
description: "The version of Rust to use"
required: true
cargo_make_version:
description: "The version of cargo-make to use"
required: true
rust_target:
description: "The target to build for"
required: true
flutter_profile:
description: "The profile to build with"
required: true
runs:
using: "composite"
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Install Rust toolchain
id: rust_toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ inputs.rust_toolchain }}
target: ${{ inputs.rust_target }}
override: true
profile: minimal
- name: Export pub environment variables and add to PATH
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
echo "PUB_CACHE=$LOCALAPPDATA\\Pub\\Cache" >> $GITHUB_ENV
fi
shell: bash
- name: Install flutter
id: flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
flutter-version: ${{ inputs.flutter_version }}
cache: true
- uses: Swatinem/rust-cache@v2
with:
prefix-key: ${{ inputs.os }}
workspaces: |
frontend/rust-lib
cache-all-crates: true
- uses: taiki-e/install-action@v2
with:
tool: cargo-make@${{ inputs.cargo_make_version }}, duckscript_cli
- name: Install prerequisites
working-directory: frontend
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo wget -qO /etc/apt/trusted.gpg.d/dart_linux_signing_key.asc https://dl-ssl.google.com/linux/linux_signing_key.pub
sudo wget -qO /etc/apt/sources.list.d/dart_stable.list https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list
sudo apt-get update
sudo apt-get install -y dart curl build-essential libssl-dev clang cmake ninja-build pkg-config libgtk-3-dev keybinder-3.0 libnotify-dev
elif [ "$RUNNER_OS" == "Windows" ]; then
vcpkg integrate install
elif [ "$RUNNER_OS" == "macOS" ]; then
echo 'do nothing'
fi
cargo make appflowy-flutter-deps-tools
shell: bash
- name: Build AppFlowy
working-directory: frontend
run: cargo make --profile ${{ inputs.flutter_profile }} appflowy-core-dev
shell: bash
- name: Run code generation
working-directory: frontend
run: cargo make code_generation
shell: bash
- name: Flutter Analyzer
working-directory: frontend/appflowy_flutter
run: flutter analyze .
shell: bash
- name: Compress appflowy_flutter
run: tar -czf appflowy_flutter.tar.gz frontend/appflowy_flutter
shell: bash
- uses: actions/upload-artifact@v4
with:
name: ${{ github.run_id }}-${{ matrix.os }}
path: appflowy_flutter.tar.gz
@@ -0,0 +1,78 @@
name: Flutter Integration Test
description: Run integration tests for AppFlowy
inputs:
test_path:
description: "The path to the integration test file"
required: true
flutter_version:
description: "The version of Flutter to use"
required: true
rust_toolchain:
description: "The version of Rust to use"
required: true
cargo_make_version:
description: "The version of cargo-make to use"
required: true
rust_target:
description: "The target to build for"
required: true
runs:
using: "composite"
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Install Rust toolchain
id: rust_toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ inputs.RUST_TOOLCHAIN }}
target: ${{ inputs.rust_target }}
override: true
profile: minimal
- name: Install flutter
id: flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
flutter-version: ${{ inputs.flutter_version }}
cache: true
- uses: taiki-e/install-action@v2
with:
tool: cargo-make@${{ inputs.cargo_make_version }}
- name: Install prerequisites
working-directory: frontend
run: |
sudo wget -qO /etc/apt/trusted.gpg.d/dart_linux_signing_key.asc https://dl-ssl.google.com/linux/linux_signing_key.pub
sudo wget -qO /etc/apt/sources.list.d/dart_stable.list https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list
sudo apt-get update
sudo apt-get install -y dart curl build-essential libssl-dev clang cmake ninja-build pkg-config libgtk-3-dev keybinder-3.0 libnotify-dev network-manager
shell: bash
- name: Enable Flutter Desktop
run: |
flutter config --enable-linux-desktop
shell: bash
- uses: actions/download-artifact@v4
with:
name: ${{ github.run_id }}-ubuntu-latest
- name: Uncompressed appflowy_flutter
run: tar -xf appflowy_flutter.tar.gz
shell: bash
- name: Run Flutter integration tests
working-directory: frontend/appflowy_flutter
run: |
export DISPLAY=:99
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 &
sudo apt-get install network-manager
flutter test ${{ inputs.test_path }} -d Linux --coverage
shell: bash
+126
View File
@@ -0,0 +1,126 @@
# name: Android CI
# on:
# push:
# branches:
# - "main"
# paths:
# - ".github/workflows/mobile_ci.yaml"
# - "frontend/**"
# - "!frontend/appflowy_tauri/**"
# pull_request:
# branches:
# - "main"
# paths:
# - ".github/workflows/mobile_ci.yaml"
# - "frontend/**"
# - "!frontend/appflowy_tauri/**"
# env:
# CARGO_TERM_COLOR: always
# FLUTTER_VERSION: "3.19.0"
# RUST_TOOLCHAIN: "1.75"
# CARGO_MAKE_VERSION: "0.36.6"
# concurrency:
# group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
# cancel-in-progress: true
# jobs:
# build:
# if: github.event.pull_request.draft != true
# strategy:
# fail-fast: true
# matrix:
# os: [macos-14]
# runs-on: ${{ matrix.os }}
# steps:
# - name: Check storage space
# run: df -h
# # the following step is required to avoid running out of space
# - name: Maximize build space
# if: matrix.os == 'ubuntu-latest'
# run: |
# sudo rm -rf /usr/share/dotnet
# sudo rm -rf /opt/ghc
# sudo rm -rf "/usr/local/share/boost"
# sudo rm -rf "$AGENT_TOOLSDIRECTORY"
# sudo docker image prune --all --force
# sudo rm -rf /opt/hostedtoolcache/codeQL
# sudo rm -rf ${GITHUB_WORKSPACE}/.git
# sudo rm -rf $ANDROID_HOME/ndk
# - name: Check storage space
# run: df -h
# - name: Checkout source code
# uses: actions/checkout@v4
# - uses: actions/setup-java@v4
# with:
# distribution: temurin
# java-version: 11
# - name: Install Rust toolchain
# id: rust_toolchain
# uses: actions-rs/toolchain@v1
# with:
# toolchain: ${{ env.RUST_TOOLCHAIN }}
# override: true
# profile: minimal
# - name: Install flutter
# id: flutter
# uses: subosito/flutter-action@v2
# with:
# channel: "stable"
# flutter-version: ${{ env.FLUTTER_VERSION }}
# - uses: gradle/gradle-build-action@v3
# with:
# gradle-version: 7.4.2
# - uses: davidB/rust-cargo-make@v1
# with:
# version: "0.36.6"
# - name: Install prerequisites
# working-directory: frontend
# run: |
# rustup target install aarch64-linux-android
# rustup target install x86_64-linux-android
# cargo install --force duckscript_cli
# cargo install cargo-ndk
# if [ "$RUNNER_OS" == "Linux" ]; then
# sudo wget -qO /etc/apt/trusted.gpg.d/dart_linux_signing_key.asc https://dl-ssl.google.com/linux/linux_signing_key.pub
# sudo wget -qO /etc/apt/sources.list.d/dart_stable.list https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list
# sudo apt-get update
# sudo apt-get install -y dart curl build-essential libssl-dev clang cmake ninja-build pkg-config libgtk-3-dev
# sudo apt-get install keybinder-3.0 libnotify-dev
# sudo apt-get install gcc-multilib
# elif [ "$RUNNER_OS" == "Windows" ]; then
# vcpkg integrate install
# elif [ "$RUNNER_OS" == "macOS" ]; then
# echo 'do nothing'
# fi
# cargo make appflowy-flutter-deps-tools
# shell: bash
# - name: Build AppFlowy
# working-directory: frontend
# run: |
# cargo make --profile development-android appflowy-android-dev-ci
# - name: Run integration tests
# # https://github.com/ReactiveCircus/android-emulator-runner
# uses: reactivecircus/android-emulator-runner@v2
# with:
# api-level: 32
# arch: arm64-v8a
# disk-size: 2048M
# working-directory: frontend/appflowy_flutter
# script: flutter test integration_test/runner.dart
-99
View File
@@ -1,99 +0,0 @@
name: Build AppFlowy Release APK
on: workflow_dispatch
env:
FLUTTER_VERSION: "3.18.0-0.2.pre"
RUST_TOOLCHAIN: "1.75"
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
include:
- os: ubuntu-latest
target: aarch64-linux-android
runs-on: ${{ matrix.os }}
steps:
# the following step is required to avoid running out of space
- name: Maximize build space
if: matrix.os == 'ubuntu-latest'
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Checkout source code
uses: actions/checkout@v2
- name: Install Rust toolchain
id: rust_toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
target: ${{ matrix.target }}
override: true
profile: minimal
- name: Install flutter
id: flutter
uses: subosito/flutter-action@v2
with:
channel: "beta"
flutter-version: ${{ env.FLUTTER_VERSION }}
cache: true
- uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: "r24"
add-to-path: true
- uses: Swatinem/rust-cache@v2
with:
prefix-key: ${{ matrix.os }}
workspaces: |
frontend/rust-lib
- uses: davidB/rust-cargo-make@v1
with:
version: "0.36.6"
- name: Install prerequisites
working-directory: frontend
run: |
rustup target install aarch64-linux-android
rustup target install x86_64-linux-android
cargo install --force duckscript_cli
cargo install cargo-ndk
if [ "$RUNNER_OS" == "Linux" ]; then
sudo wget -qO /etc/apt/trusted.gpg.d/dart_linux_signing_key.asc https://dl-ssl.google.com/linux/linux_signing_key.pub
sudo wget -qO /etc/apt/sources.list.d/dart_stable.list https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list
sudo apt-get update
sudo apt-get install -y dart curl build-essential libssl-dev clang cmake ninja-build pkg-config libgtk-3-dev
sudo apt-get install keybinder-3.0 libnotify-dev
sudo apt-get install gcc-multilib
elif [ "$RUNNER_OS" == "Windows" ]; then
vcpkg integrate install
elif [ "$RUNNER_OS" == "macOS" ]; then
echo 'do nothing'
fi
cargo make appflowy-flutter-deps-tools
shell: bash
- name: Build AppFlowy
working-directory: frontend
env:
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
run: |
cargo make --profile production-android appflowy-android
- name: Upload APK
uses: actions/upload-artifact@v2
with:
name: app-arm64-v8a-release.apk
path: frontend/appflowy_flutter/build/app/outputs/flutter-apk/app-arm64-v8a-release.apk
+28
View File
@@ -0,0 +1,28 @@
name: Build Bot
on:
issue_comment:
types: [created]
jobs:
dispatch_slash_command:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v4
# get build name from pubspec.yaml
- name: Get build version
working-directory: frontend/appflowy_flutter
id: get_build_name
run: |
echo "fetching version from pubspec.yaml..."
echo "build_name=$(grep 'version: ' pubspec.yaml | awk '{print $2}')" >> $GITHUB_OUTPUT
- uses: peter-evans/slash-command-dispatch@v4
with:
token: ${{ secrets.PAT }}
commands: build
static-args: |
ref=refs/pull/${{ github.event.issue.number }}/head
build_name=${{ steps.get_build_name.outputs.build_name }}
+42
View File
@@ -0,0 +1,42 @@
name: build
on:
repository_dispatch:
types: [build-command]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: notify appflowy_builder
run: |
platform=${{ github.event.client_payload.slash_command.args.unnamed.arg1 }}
build_name=${{ github.event.client_payload.slash_command.args.named.build_name }}
branch=${{ github.event.client_payload.slash_command.args.named.ref }}
build_type=""
arch=""
if [ "$platform" = "android" ]; then
build_type="apk"
elif [ "$platform" = "macos" ]; then
arch="universal"
fi
params=$(jq -n \
--arg ref "main" \
--arg repo "LucasXu0/AppFlowy" \
--arg branch "$branch" \
--arg build_name "$build_name" \
--arg build_type "$build_type" \
--arg arch "$arch" \
'{ref: $ref, inputs: {repo: $repo, branch: $branch, build_name: $build_name, build_type: $build_type, arch: $arch}} | del(.inputs | .. | select(. == ""))')
echo "params: $params"
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/AppFlowy-IO/AppFlowy-Builder/actions/workflows/$platform.yaml/dispatches \
-d "$params"
+1 -2
View File
@@ -5,8 +5,7 @@ jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v4
+1 -1
View File
@@ -31,7 +31,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Build the app
shell: bash
+121 -217
View File
@@ -9,6 +9,7 @@ on:
- ".github/workflows/flutter_ci.yaml"
- "frontend/rust-lib/**"
- "frontend/appflowy_flutter/**"
- "frontend/resources/**"
pull_request:
branches:
@@ -18,10 +19,11 @@ on:
- ".github/workflows/flutter_ci.yaml"
- "frontend/rust-lib/**"
- "frontend/appflowy_flutter/**"
- "frontend/resources/**"
env:
CARGO_TERM_COLOR: always
FLUTTER_VERSION: "3.18.0-0.2.pre"
FLUTTER_VERSION: "3.19.0"
RUST_TOOLCHAIN: "1.75"
CARGO_MAKE_VERSION: "0.36.6"
@@ -30,28 +32,21 @@ concurrency:
cancel-in-progress: true
jobs:
prepare:
prepare-linux:
if: github.event.pull_request.draft != true
strategy:
fail-fast: false
fail-fast: true
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest]
include:
- os: ubuntu-latest
flutter_profile: development-linux-x86_64
target: x86_64-unknown-linux-gnu
- os: macos-latest
flutter_profile: development-mac-x86_64
target: x86_64-apple-darwin
- os: windows-latest
flutter_profile: development-windows-x86
target: x86_64-pc-windows-msvc
runs-on: ${{ matrix.os }}
steps:
# the following step is required to avoid running out of space
- name: Maximize build space
if: matrix.os == 'ubuntu-latest'
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
@@ -59,74 +54,72 @@ jobs:
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Checkout source code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install Rust toolchain
id: rust_toolchain
uses: actions-rs/toolchain@v1
- name: Flutter build
uses: ./.github/actions/flutter_build
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
target: ${{ matrix.target }}
override: true
profile: minimal
os: ${{ matrix.os }}
flutter_version: ${{ env.FLUTTER_VERSION }}
rust_toolchain: ${{ env.RUST_TOOLCHAIN }}
cargo_make_version: ${{ env.CARGO_MAKE_VERSION }}
rust_target: ${{ matrix.target }}
flutter_profile: ${{ matrix.flutter_profile }}
- name: Install flutter
id: flutter
uses: subosito/flutter-action@v2
prepare-windows:
if: github.event.pull_request.draft != true
strategy:
fail-fast: true
matrix:
os: [windows-latest]
include:
- os: windows-latest
flutter_profile: development-windows-x86
target: x86_64-pc-windows-msvc
runs-on: ${{ matrix.os }}
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Flutter build
uses: ./.github/actions/flutter_build
with:
channel: "beta"
flutter-version: ${{ env.FLUTTER_VERSION }}
os: ${{ matrix.os }}
flutter_version: ${{ env.FLUTTER_VERSION }}
rust_toolchain: ${{ env.RUST_TOOLCHAIN }}
cargo_make_version: ${{ env.CARGO_MAKE_VERSION }}
rust_target: ${{ matrix.target }}
flutter_profile: ${{ matrix.flutter_profile }}
- uses: Swatinem/rust-cache@v2
prepare-macos:
if: github.event.pull_request.draft != true
strategy:
fail-fast: true
matrix:
os: [macos-latest]
include:
- os: macos-latest
flutter_profile: development-mac-x86_64
target: x86_64-apple-darwin
runs-on: ${{ matrix.os }}
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Flutter build
uses: ./.github/actions/flutter_build
with:
prefix-key: ${{ matrix.os }}
workspaces: |
frontend/rust-lib
cache-all-crates: true
- uses: taiki-e/install-action@v2
with:
tool: cargo-make@${{ env.CARGO_MAKE_VERSION }}, duckscript_cli
- name: Install prerequisites
working-directory: frontend
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo wget -qO /etc/apt/trusted.gpg.d/dart_linux_signing_key.asc https://dl-ssl.google.com/linux/linux_signing_key.pub
sudo wget -qO /etc/apt/sources.list.d/dart_stable.list https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list
sudo apt-get update
sudo apt-get install -y dart curl build-essential libssl-dev clang cmake ninja-build pkg-config libgtk-3-dev keybinder-3.0 libnotify-dev
elif [ "$RUNNER_OS" == "Windows" ]; then
vcpkg integrate install
elif [ "$RUNNER_OS" == "macOS" ]; then
echo 'do nothing'
fi
cargo make appflowy-flutter-deps-tools
shell: bash
- name: Build AppFlowy
working-directory: frontend
run: cargo make --profile ${{ matrix.flutter_profile }} appflowy-core-dev
- name: Run code generation
working-directory: frontend
run: cargo make code_generation
- name: Flutter Analyzer
working-directory: frontend/appflowy_flutter
run: flutter analyze .
- name: Compress appflowy_flutter
run: |
tar -czf appflowy_flutter.tar.gz frontend/appflowy_flutter
- uses: actions/upload-artifact@v3
with:
name: ${{ github.run_id }}-${{ matrix.os }}
path: appflowy_flutter.tar.gz
os: ${{ matrix.os }}
flutter_version: ${{ env.FLUTTER_VERSION }}
rust_toolchain: ${{ env.RUST_TOOLCHAIN }}
cargo_make_version: ${{ env.CARGO_MAKE_VERSION }}
rust_target: ${{ matrix.target }}
flutter_profile: ${{ matrix.flutter_profile }}
unit_test:
needs: [prepare]
needs: [prepare-linux]
if: github.event.pull_request.draft != true
strategy:
fail-fast: false
@@ -140,7 +133,7 @@ jobs:
steps:
- name: Checkout source code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install Rust toolchain
id: rust_toolchain
@@ -155,8 +148,9 @@ jobs:
id: flutter
uses: subosito/flutter-action@v2
with:
channel: "beta"
channel: "stable"
flutter-version: ${{ env.FLUTTER_VERSION }}
cache: true
- uses: Swatinem/rust-cache@v2
with:
@@ -192,7 +186,7 @@ jobs:
fi
shell: bash
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: ${{ github.run_id }}-${{ matrix.os }}
@@ -216,11 +210,11 @@ jobs:
shell: bash
cloud_integration_test:
needs: [ prepare ]
needs: [prepare-linux]
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
os: [ubuntu-latest]
include:
- os: ubuntu-latest
flutter_profile: development-linux-x86_64
@@ -229,11 +223,10 @@ jobs:
steps:
- name: Checkout appflowy cloud code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: AppFlowy-IO/AppFlowy-Cloud
path: AppFlowy-Cloud
depth: 1
- name: Prepare appflowy cloud env
working-directory: AppFlowy-Cloud
@@ -253,14 +246,15 @@ jobs:
sleep 10
- name: Checkout source code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install flutter
id: flutter
uses: subosito/flutter-action@v2
with:
channel: "beta"
channel: "stable"
flutter-version: ${{ env.FLUTTER_VERSION }}
cache: true
- uses: taiki-e/install-action@v2
with:
@@ -280,7 +274,7 @@ jobs:
flutter config --enable-linux-desktop
shell: bash
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: ${{ github.run_id }}-${{ matrix.os }}
@@ -303,8 +297,9 @@ jobs:
flutter test integration_test/cloud/cloud_runner.dart -d Linux --coverage
shell: bash
integration_test:
needs: [prepare]
# split the integration tests into different machines to minimize the time
integration_test_1:
needs: [prepare-linux]
if: github.event.pull_request.draft != true
strategy:
fail-fast: false
@@ -312,156 +307,65 @@ jobs:
os: [ubuntu-latest]
include:
- os: ubuntu-latest
flutter_profile: development-linux-x86_64
target: x86_64-unknown-linux-gnu
target: 'x86_64-unknown-linux-gnu'
runs-on: ${{ matrix.os }}
steps:
- name: Checkout source code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install Rust toolchain
id: rust_toolchain
uses: actions-rs/toolchain@v1
- name: Flutter Integration Test 1
uses: ./.github/actions/flutter_integration_test
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
target: ${{ matrix.target }}
override: true
profile: minimal
test_path: integration_test/desktop_runner_1.dart
flutter_version: ${{ env.FLUTTER_VERSION }}
rust_toolchain: ${{ env.RUST_TOOLCHAIN }}
cargo_make_version: ${{ env.CARGO_MAKE_VERSION }}
rust_target: ${{ matrix.target }}
- name: Install flutter
id: flutter
uses: subosito/flutter-action@v2
with:
channel: "beta"
flutter-version: ${{ env.FLUTTER_VERSION }}
- uses: taiki-e/install-action@v2
with:
tool: cargo-make@${{ env.CARGO_MAKE_VERSION }}
- name: Install prerequisites
working-directory: frontend
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo wget -qO /etc/apt/trusted.gpg.d/dart_linux_signing_key.asc https://dl-ssl.google.com/linux/linux_signing_key.pub
sudo wget -qO /etc/apt/sources.list.d/dart_stable.list https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list
sudo apt-get update
sudo apt-get install -y dart curl build-essential libssl-dev clang cmake ninja-build pkg-config libgtk-3-dev keybinder-3.0 libnotify-dev
fi
shell: bash
- name: Enable Flutter Desktop
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
flutter config --enable-linux-desktop
elif [ "$RUNNER_OS" == "macOS" ]; then
flutter config --enable-macos-desktop
elif [ "$RUNNER_OS" == "Windows" ]; then
git config --system core.longpaths true
flutter config --enable-windows-desktop
fi
shell: bash
- uses: actions/download-artifact@v3
with:
name: ${{ github.run_id }}-${{ matrix.os }}
- name: Uncompressed appflowy_flutter
run: tar -xf appflowy_flutter.tar.gz
- name: Run flutter pub get
working-directory: frontend
run: cargo make pub_get
- name: Run Flutter integration tests
working-directory: frontend/appflowy_flutter
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
export DISPLAY=:99
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 &
sudo apt-get install network-manager
flutter test integration_test/runner.dart -d Linux --coverage
elif [ "$RUNNER_OS" == "macOS" ]; then
flutter test integration_test/runner.dart -d macOS --coverage
elif [ "$RUNNER_OS" == "Windows" ]; then
flutter test integration_test/runner.dart -d Windows --coverage
fi
shell: bash
build:
needs: [prepare]
integration_test_2:
needs: [prepare-linux]
if: github.event.pull_request.draft != true
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest]
include:
- os: ubuntu-latest
flutter_profile: development-linux-x86_64
target: x86_64-unknown-linux-gnu
- os: macos-latest
flutter_profile: development-mac-x86_64
target: x86_64-apple-darwin
- os: windows-latest
flutter_profile: development-windows-x86
target: x86_64-pc-windows-msvc
target: 'x86_64-unknown-linux-gnu'
runs-on: ${{ matrix.os }}
steps:
- name: Checkout source code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install Rust toolchain
id: rust_toolchain
uses: actions-rs/toolchain@v1
- name: Flutter Integration Test 2
uses: ./.github/actions/flutter_integration_test
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
target: ${{ matrix.target }}
override: true
profile: minimal
test_path: integration_test/desktop_runner_2.dart
flutter_version: ${{ env.FLUTTER_VERSION }}
rust_toolchain: ${{ env.RUST_TOOLCHAIN }}
cargo_make_version: ${{ env.CARGO_MAKE_VERSION }}
rust_target: ${{ matrix.target }}
- name: Install flutter
id: flutter
uses: subosito/flutter-action@v2
integration_test_3:
needs: [prepare-linux]
if: github.event.pull_request.draft != true
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
include:
- os: ubuntu-latest
target: 'x86_64-unknown-linux-gnu'
runs-on: ${{ matrix.os }}
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Flutter Integration Test 3
uses: ./.github/actions/flutter_integration_test
with:
channel: "beta"
flutter-version: ${{ env.FLUTTER_VERSION }}
- uses: taiki-e/install-action@v2
with:
tool: cargo-make@${{ env.CARGO_MAKE_VERSION }}
- name: Install prerequisites
working-directory: frontend
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo wget -qO /etc/apt/trusted.gpg.d/dart_linux_signing_key.asc https://dl-ssl.google.com/linux/linux_signing_key.pub
sudo wget -qO /etc/apt/sources.list.d/dart_stable.list https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list
sudo apt-get update
sudo apt-get install -y dart curl build-essential libssl-dev clang cmake ninja-build pkg-config libgtk-3-dev keybinder-3.0 libnotify-dev
fi
shell: bash
- name: Enable Flutter Desktop
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
flutter config --enable-linux-desktop
elif [ "$RUNNER_OS" == "macOS" ]; then
flutter config --enable-macos-desktop
elif [ "$RUNNER_OS" == "Windows" ]; then
git config --system core.longpaths true
flutter config --enable-windows-desktop
fi
shell: bash
- uses: actions/download-artifact@v3
with:
name: ${{ github.run_id }}-${{ matrix.os }}
- name: Uncompressed appflowy_flutter
run: tar -xf appflowy_flutter.tar.gz
- name: Build flutter product
working-directory: frontend
run: |
cargo make --profile ${{ matrix.flutter_profile }} appflowy-make-product-dev
test_path: integration_test/desktop_runner_3.dart
flutter_version: ${{ env.FLUTTER_VERSION }}
rust_toolchain: ${{ env.RUST_TOOLCHAIN }}
cargo_make_version: ${{ env.CARGO_MAKE_VERSION }}
rust_target: ${{ matrix.target }}
+91
View File
@@ -0,0 +1,91 @@
name: iOS CI
on:
push:
branches:
- "main"
paths:
- ".github/workflows/mobile_ci.yaml"
- "frontend/**"
- "!frontend/appflowy_tauri/**"
pull_request:
branches:
- "main"
paths:
- ".github/workflows/mobile_ci.yaml"
- "frontend/**"
- "!frontend/appflowy_tauri/**"
env:
FLUTTER_VERSION: "3.19.0"
RUST_TOOLCHAIN: "1.75"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
if: github.event.pull_request.draft != true
strategy:
fail-fast: true
matrix:
os: [macos-14]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Install Rust toolchain
id: rust_toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
target: aarch64-apple-ios-sim
override: true
profile: minimal
- name: Install flutter
id: flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
flutter-version: ${{ env.FLUTTER_VERSION }}
cache: true
- uses: Swatinem/rust-cache@v2
with:
prefix-key: ${{ matrix.os }}
workspaces: |
frontend/rust-lib
- uses: davidB/rust-cargo-make@v1
with:
version: "0.36.6"
- name: Install prerequisites
working-directory: frontend
run: |
rustup target install aarch64-apple-ios-sim
cargo install --force duckscript_cli
cargo install cargo-lipo
cargo make appflowy-flutter-deps-tools
shell: bash
- name: Build AppFlowy
working-directory: frontend
run: |
cargo make --profile development-ios-arm64-sim appflowy-core-dev-ios
cargo make --profile development-ios-arm64-sim code_generation
- uses: futureware-tech/simulator-action@v3
id: simulator-action
with:
model: 'iPhone 15'
shutdown_after_job: false
- name: Run integration tests
working-directory: frontend/appflowy_flutter
run: flutter test integration_test/runner.dart -d ${{ steps.simulator-action.outputs.udid }}
-117
View File
@@ -1,117 +0,0 @@
name: Mobile-CI
on:
push:
branches:
- "main"
paths:
- ".github/workflows/mobile_ci.yaml"
- "frontend/**"
- "!frontend/appflowy_tauri/**"
pull_request:
branches:
- "main"
paths:
- ".github/workflows/mobile_ci.yaml"
- "frontend/**"
- "!frontend/appflowy_tauri/**"
env:
FLUTTER_VERSION: "3.18.0-0.2.pre"
RUST_TOOLCHAIN: "1.75"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
if: github.event.pull_request.draft != true
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
include:
- os: ubuntu-latest
target: aarch64-linux-android
runs-on: ${{ matrix.os }}
steps:
# the following step is required to avoid running out of space
- name: Maximize build space
if: matrix.os == 'ubuntu-latest'
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Checkout source code
uses: actions/checkout@v2
- name: Install Rust toolchain
id: rust_toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
target: ${{ matrix.target }}
override: true
profile: minimal
- name: Install flutter
id: flutter
uses: subosito/flutter-action@v2
with:
channel: "beta"
flutter-version: ${{ env.FLUTTER_VERSION }}
cache: true
- uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: "r24"
add-to-path: true
- uses: gradle/gradle-build-action@v2
with:
gradle-version: 7.6.3
- uses: Swatinem/rust-cache@v2
with:
prefix-key: ${{ matrix.os }}
workspaces: |
frontend/rust-lib
- uses: davidB/rust-cargo-make@v1
with:
version: "0.36.6"
- name: Install prerequisites
working-directory: frontend
run: |
rustup target install aarch64-linux-android
rustup target install x86_64-linux-android
cargo install --force duckscript_cli
cargo install cargo-ndk
if [ "$RUNNER_OS" == "Linux" ]; then
sudo wget -qO /etc/apt/trusted.gpg.d/dart_linux_signing_key.asc https://dl-ssl.google.com/linux/linux_signing_key.pub
sudo wget -qO /etc/apt/sources.list.d/dart_stable.list https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list
sudo apt-get update
sudo apt-get install -y dart curl build-essential libssl-dev clang cmake ninja-build pkg-config libgtk-3-dev
sudo apt-get install keybinder-3.0 libnotify-dev
sudo apt-get install gcc-multilib
elif [ "$RUNNER_OS" == "Windows" ]; then
vcpkg integrate install
elif [ "$RUNNER_OS" == "macOS" ]; then
echo 'do nothing'
fi
cargo make appflowy-flutter-deps-tools
shell: bash
- name: Build AppFlowy
working-directory: frontend
env:
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
run: |
cargo make --profile development-android appflowy-android-dev-ci
+73 -18
View File
@@ -6,7 +6,7 @@ on:
- "*"
env:
FLUTTER_VERSION: "3.18.0-0.2.pre"
FLUTTER_VERSION: "3.19.0"
RUST_TOOLCHAIN: "1.75"
jobs:
@@ -18,7 +18,7 @@ jobs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Build release notes
run: |
@@ -52,12 +52,19 @@ jobs:
- { target: x86_64-pc-windows-msvc, os: windows-2019 }
steps:
- name: Checkout source code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Export pub environment variable on Windows
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
echo "PUB_CACHE=$LOCALAPPDATA\\Pub\\Cache" >> $GITHUB_ENV
fi
shell: bash
- name: Install flutter
uses: subosito/flutter-action@v2
with:
channel: "beta"
channel: "stable"
flutter-version: ${{ env.FLUTTER_VERSION }}
- name: Install Rust toolchain
@@ -101,6 +108,17 @@ jobs:
run: |
iscc /F${{ env.WINDOWS_INSTALLER_NAME }} inno_setup_config.iss /DAppVersion=${{ github.ref_name }}
- name: Upload Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: ${{ env.WINDOWS_APP_RELEASE_PATH }}\${{ env.WINDOWS_ZIP_NAME }}
asset_name: ${{ env.WINDOWS_ZIP_NAME }}
asset_content_type: application/octet-stream
- name: Upload Installer Asset
id: upload-installer-asset
uses: actions/upload-release-asset@v1
@@ -127,12 +145,12 @@ jobs:
- { target: x86_64-apple-darwin, os: macos-11, extra-build-args: "" }
steps:
- name: Checkout source code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install flutter
uses: subosito/flutter-action@v2
with:
channel: "beta"
channel: "stable"
flutter-version: ${{ env.FLUTTER_VERSION }}
- name: Install Rust toolchain
@@ -188,6 +206,16 @@ jobs:
working-directory: ${{ env.MACOS_APP_RELEASE_PATH }}
run: zip --symlinks -qr ${{ env.MACOS_X86_ZIP_NAME }} AppFlowy.app
- name: Upload Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: ${{ env.MACOS_APP_RELEASE_PATH }}/${{ env.MACOS_X86_ZIP_NAME }}
asset_name: ${{ env.MACOS_X86_ZIP_NAME }}
asset_content_type: application/octet-stream
- name: Upload DMG Asset
uses: actions/upload-release-asset@v1
env:
@@ -217,12 +245,12 @@ jobs:
}
steps:
- name: Checkout source code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install flutter
uses: subosito/flutter-action@v2
with:
channel: "beta"
channel: "stable"
flutter-version: ${{ env.FLUTTER_VERSION }}
- name: Install Rust toolchain
@@ -276,6 +304,16 @@ jobs:
working-directory: ${{ env.MACOS_APP_RELEASE_PATH }}
run: zip --symlinks -qr ${{ env.MACOS_AARCH64_ZIP_NAME }} AppFlowy.app
- name: Upload Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: ${{ env.MACOS_APP_RELEASE_PATH }}/${{ env.MACOS_AARCH64_ZIP_NAME }}
asset_name: ${{ env.MACOS_AARCH64_ZIP_NAME }}
asset_content_type: application/octet-stream
- name: Upload DMG Asset
uses: actions/upload-release-asset@v1
env:
@@ -292,10 +330,12 @@ jobs:
needs: create-release
env:
LINUX_APP_RELEASE_PATH: frontend/appflowy_flutter/product/${{ github.ref_name }}/linux/Release
LINUX_ZIP_NAME: AppFlowy-${{ github.ref_name }}-linux-x86_64.tar.gz
LINUX_ZIP_NAME: AppFlowy-${{ matrix.job.target }}-x86_64.tar.gz
LINUX_PACKAGE_DEB_NAME: AppFlowy-${{ github.ref_name }}-linux-x86_64.deb
LINUX_PACKAGE_RPM_NAME: AppFlowy-${{ github.ref_name }}-linux-x86_64.rpm
LINUX_PACKAGE_TMP_RPM_NAME: AppFlowy-${{ github.ref_name }}-2.x86_64.rpm
LINUX_PACKAGE_TMP_APPIMAGE_NAME: AppFlowy-${{ github.ref_name }}-x86_64.AppImage
LINUX_PACKAGE_APPIMAGE_NAME: AppFlowy-${{ github.ref_name }}-linux-x86_64.AppImage
strategy:
fail-fast: false
@@ -310,12 +350,12 @@ jobs:
}
steps:
- name: Checkout source code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install flutter
uses: subosito/flutter-action@v2
with:
channel: "beta"
channel: "stable"
flutter-version: ${{ env.FLUTTER_VERSION }}
- name: Install Rust toolchain
@@ -364,11 +404,15 @@ jobs:
- name: Build Linux package (.rpm)
working-directory: ${{ env.LINUX_APP_RELEASE_PATH }}
run: |
ls -a
sudo alien -r ${{ env.LINUX_PACKAGE_DEB_NAME }}
echo '------------'
cp -r ${{ env.LINUX_PACKAGE_TMP_RPM_NAME }} ${{ env.LINUX_PACKAGE_RPM_NAME }}
ls -a
- name: Build Linux package (.AppImage)
working-directory: frontend
continue-on-error: true
run: |
sh scripts/linux_distribution/appimage/build_appimage.sh ${{ github.ref_name }}
cp -r ${{ env.LINUX_PACKAGE_TMP_APPIMAGE_NAME }} ${{ env.LINUX_PACKAGE_APPIMAGE_NAME }}
- name: Upload Asset
id: upload-release-asset
@@ -403,23 +447,34 @@ jobs:
asset_name: ${{ env.LINUX_PACKAGE_RPM_NAME }}
asset_content_type: application/octet-stream
- name: Upload AppImage package
id: upload-release-asset-install-package-appimage
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: ${{ env.LINUX_APP_RELEASE_PATH }}/${{ env.LINUX_PACKAGE_APPIMAGE_NAME }}
asset_name: ${{ env.LINUX_PACKAGE_APPIMAGE_NAME }}
asset_content_type: application/octet-stream
build-for-docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
context: .
file: ./frontend/scripts/docker-buildfiles/Dockerfile
+26 -24
View File
@@ -23,11 +23,26 @@ env:
jobs:
test-on-ubuntu:
# environment: SUPABASE_CI
runs-on: ubuntu-latest
steps:
# - name: Maximize build space
# uses: easimon/maximize-build-space@master
# with:
# root-reserve-mb: 2048
# swap-size-mb: 1024
# remove-dotnet: 'true'
#
# # the following step is required to avoid running out of space
# - name: Maximize build space
# run: |
# sudo rm -rf /usr/share/dotnet
# sudo rm -rf /opt/ghc
# sudo rm -rf "/usr/local/share/boost"
# sudo rm -rf "$AGENT_TOOLSDIRECTORY"
# sudo docker image prune --all --force
- name: Checkout source code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install Rust toolchain
id: rust_toolchain
@@ -46,32 +61,15 @@ jobs:
- uses: Swatinem/rust-cache@v2
with:
prefix-key: 'ubuntu-latest'
prefix-key: "ubuntu-latest"
workspaces: |
frontend/rust-lib
# - name: Create .env file in flowy-server
# working-directory: frontend/rust-lib/flowy-server
# run: |
# touch .env.ci
# echo SUPABASE_URL=${{ secrets.SUPABASE_URL }} >> .env.ci
# echo SUPABASE_ANON_KEY=${{ secrets.SUPABASE_ANON_KEY }} >> .env.ci
# echo SUPABASE_JWT_SECRET=${{ secrets.SUPABASE_JWT_SECRET }} >> .env.ci
#
# - name: Create .env file in event-integration
# working-directory: frontend/rust-lib/event-integration
# run: |
# touch .env.ci
# echo SUPABASE_URL=${{ secrets.SUPABASE_URL }} >> .env.ci
# echo SUPABASE_ANON_KEY=${{ secrets.SUPABASE_ANON_KEY }} >> .env.ci
# echo SUPABASE_JWT_SECRET=${{ secrets.SUPABASE_JWT_SECRET }} >> .env.ci
- name: Checkout appflowy cloud code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: AppFlowy-IO/AppFlowy-Cloud
path: AppFlowy-Cloud
depth: 1
- name: Prepare appflowy cloud env
working-directory: AppFlowy-Cloud
@@ -93,10 +91,9 @@ jobs:
RUST_LOG: info
RUST_BACKTRACE: 1
af_cloud_test_base_url: http://localhost
af_cloud_test_ws_url: ws://localhost/ws
af_cloud_test_ws_url: ws://localhost/ws/v1
af_cloud_test_gotrue_url: http://localhost/gotrue
run: cargo test --no-default-features --features="rev-sqlite" -- --nocapture
run: cargo test --no-default-features --features="rev-sqlite,dart" -- --nocapture
- name: rustfmt rust-lib
run: cargo fmt --all -- --check
@@ -105,3 +102,8 @@ jobs:
- name: clippy rust-lib
run: cargo clippy --all-targets -- -D warnings
working-directory: frontend/rust-lib
- name: Clean up Docker images
run: |
docker image prune -af
docker volume prune -f
+3 -3
View File
@@ -10,7 +10,7 @@ on:
env:
CARGO_TERM_COLOR: always
FLUTTER_VERSION: "3.18.0-0.2.pre"
FLUTTER_VERSION: "3.19.0"
RUST_TOOLCHAIN: "1.75"
jobs:
@@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install Rust toolchain
id: rust_toolchain
@@ -33,7 +33,7 @@ jobs:
id: flutter
uses: subosito/flutter-action@v2
with:
channel: "beta"
channel: "stable"
flutter-version: ${{ env.FLUTTER_VERSION }}
cache: true
+42 -39
View File
@@ -5,6 +5,7 @@ on:
- ".github/workflows/tauri_ci.yaml"
- "frontend/rust-lib/**"
- "frontend/appflowy_tauri/**"
- "frontend/resources/**"
env:
NODE_VERSION: "18.16.0"
@@ -21,36 +22,36 @@ jobs:
strategy:
fail-fast: false
matrix:
# platform: [macos-latest, ubuntu-latest, windows-latest]
platform: [ubuntu-latest]
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
env:
CI: true
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Maximize build space (ubuntu only)
if: matrix.platform == 'ubuntu-latest'
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
sudo docker image prune --all --force
sudo rm -rf /opt/hostedtoolcache/codeQL
sudo rm -rf ${GITHUB_WORKSPACE}/.git
sudo rm -rf $ANDROID_HOME/ndk
- name: setup node
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Cache Rust Dependencies
uses: Swatinem/rust-cache@v2
- name: setup pnpm
uses: pnpm/action-setup@v2
with:
key: rust-dependencies-${{ runner.os }}
workspaces: |
frontend/rust-lib
frontend/appflowy_tauri/src-tauri
- name: Cache Node.js dependencies
uses: actions/cache@v2
with:
path: ~/.npm
key: npm-${{ runner.os }}
- name: Cache node_modules
uses: actions/cache@v2
with:
path: frontend/appflowy_tauri/node_modules
key: node-modules-${{ runner.os }}
version: ${{ env.PNPM_VERSION }}
- name: Install Rust toolchain
id: rust_toolchain
@@ -60,15 +61,23 @@ jobs:
override: true
profile: minimal
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: "./frontend/appflowy_tauri/src-tauri -> target"
- name: Node_modules cache
uses: actions/cache@v2
with:
path: frontend/appflowy_tauri/node_modules
key: node-modules-${{ runner.os }}
- name: install dependencies (windows only)
if: matrix.platform == 'windows-latest'
working-directory: frontend
run: |
cargo install --force cargo-make
cargo install --force duckscript_cli
vcpkg integrate install
cargo make appflowy-tauri-deps-tools
npm install -g pnpm@${{ env.PNPM_VERSION }}
- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-latest'
@@ -76,35 +85,29 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
cargo install --force cargo-make
cargo make appflowy-tauri-deps-tools
npm install -g pnpm@${{ env.PNPM_VERSION }}
- name: install dependencies (macOS only)
if: matrix.platform == 'macos-latest'
- name: install cargo-make
working-directory: frontend
run: |
cargo install --force cargo-make
cargo make appflowy-tauri-deps-tools
npm install -g pnpm@${{ env.PNPM_VERSION }}
- name: Build
- name: install frontend dependencies
working-directory: frontend/appflowy_tauri
run: |
mkdir dist
pnpm install
cargo make --cwd .. tauri_build
- name: frontend tests and linting
working-directory: frontend/appflowy_tauri
run: |
pnpm test
pnpm test:errors
- name: Check for uncommitted changes
run: |
diff_files=$(git status --porcelain)
if [ -n "$diff_files" ]; then
echo "There are uncommitted changes in the working tree. Please commit them before pushing."
exit 1
fi
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tauriScript: pnpm tauri
projectPath: frontend/appflowy_tauri
+153
View File
@@ -0,0 +1,153 @@
name: Publish Tauri Release
on:
workflow_dispatch:
inputs:
branch:
description: 'The branch to release'
required: true
default: 'main'
version:
description: 'The version to release'
required: true
default: '0.0.0'
env:
NODE_VERSION: "18.16.0"
PNPM_VERSION: "8.5.0"
RUST_TOOLCHAIN: "1.75"
jobs:
publish-tauri:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
settings:
- platform: windows-latest
args: "--verbose"
target: "windows-x86_64"
- platform: macos-latest
args: "--target x86_64-apple-darwin"
target: "macos-x86_64"
- platform: ubuntu-latest
args: "--target x86_64-unknown-linux-gnu"
target: "linux-x86_64"
runs-on: ${{ matrix.settings.platform }}
env:
CI: true
PACKAGE_PREFIX: AppFlowy_Tauri-${{ github.event.inputs.version }}-${{ matrix.settings.target }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch }}
- name: Maximize build space (ubuntu only)
if: matrix.settings.platform == 'ubuntu-latest'
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
sudo docker image prune --all --force
sudo rm -rf /opt/hostedtoolcache/codeQL
sudo rm -rf ${GITHUB_WORKSPACE}/.git
sudo rm -rf $ANDROID_HOME/ndk
- name: setup node
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: setup pnpm
uses: pnpm/action-setup@v2
with:
version: ${{ env.PNPM_VERSION }}
- name: Install Rust toolchain
id: rust_toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
override: true
profile: minimal
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: "./frontend/appflowy_tauri/src-tauri -> target"
- name: install dependencies (windows only)
if: matrix.settings.platform == 'windows-latest'
working-directory: frontend
run: |
cargo install --force duckscript_cli
vcpkg integrate install
- name: install dependencies (ubuntu only)
if: matrix.settings.platform == 'ubuntu-latest'
working-directory: frontend
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
- name: install cargo-make
working-directory: frontend
run: |
cargo install --force cargo-make
cargo make appflowy-tauri-deps-tools
- name: install frontend dependencies
working-directory: frontend/appflowy_tauri
run: |
mkdir dist
pnpm install
pnpm exec node scripts/update_version.cjs ${{ github.event.inputs.version }}
cargo make --cwd .. tauri_build
- uses: tauri-apps/tauri-action@dev
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
APPLE_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
APPLE_SIGNING_IDENTITY: ${{ secrets.MACOS_TEAM_ID }}
APPLE_ID: ${{ secrets.MACOS_NOTARY_USER }}
APPLE_TEAM_ID: ${{ secrets.MACOS_TEAM_ID }}
APPLE_PASSWORD: ${{ secrets.MACOS_NOTARY_PWD }}
CI: true
with:
args: ${{ matrix.settings.args }}
appVersion: ${{ github.event.inputs.version }}
tauriScript: pnpm tauri
projectPath: frontend/appflowy_tauri
- name: Upload EXE package(windows only)
uses: actions/upload-artifact@v4
if: matrix.settings.platform == 'windows-latest'
with:
name: ${{ env.PACKAGE_PREFIX }}.exe
path: frontend/appflowy_tauri/src-tauri/target/release/bundle/nsis/AppFlowy_${{ github.event.inputs.version }}_x64-setup.exe
- name: Upload DMG package(macos only)
uses: actions/upload-artifact@v4
if: matrix.settings.platform == 'macos-latest'
with:
name: ${{ env.PACKAGE_PREFIX }}.dmg
path: frontend/appflowy_tauri/src-tauri/target/x86_64-apple-darwin/release/bundle/dmg/AppFlowy_${{ github.event.inputs.version }}_x64.dmg
- name: Upload Deb package(ubuntu only)
uses: actions/upload-artifact@v4
if: matrix.settings.platform == 'ubuntu-latest'
with:
name: ${{ env.PACKAGE_PREFIX }}.deb
path: frontend/appflowy_tauri/src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/deb/app-flowy_${{ github.event.inputs.version }}_amd64.deb
- name: Upload AppImage package(ubuntu only)
uses: actions/upload-artifact@v4
if: matrix.settings.platform == 'ubuntu-latest'
with:
name: ${{ env.PACKAGE_PREFIX }}.AppImage
path: frontend/appflowy_tauri/src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/appimage/app-flowy_${{ github.event.inputs.version }}_amd64.AppImage
+7 -5
View File
@@ -26,9 +26,9 @@ jobs:
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
@@ -40,14 +40,16 @@ jobs:
frontend/rust-lib
frontend/appflowy_web/appflowy_wasm
# TODO: Can combine caching deps and node_modules in one
# See Glob patterns: https://github.com/actions/toolkit/tree/main/packages/glob
- name: Cache Node.js dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.npm
key: npm-${{ runner.os }}
- name: Cache node_modules
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: frontend/appflowy_web/node_modules
key: node-modules-${{ runner.os }}
@@ -79,4 +81,4 @@ jobs:
working-directory: frontend/appflowy_web
run: |
pnpm install
pnpm run wasm
pnpm run build_release_wasm
+72
View File
@@ -1,3 +1,75 @@
# Release Notes
## Version 0.5.2 - 03/13/2024
### Bug Fixes
- Import csv file.
## Version 0.5.1 - 03/11/2024
### New Features
- Introduced support for performing generic calculations on databases.
- Implemented functionality for easily duplicating calendar events.
- Added the ability to duplicate fields with cell data, facilitating smoother data management.
- Now supports customizing font styles and colors prior to typing.
- Enhanced the checklist user experience with the integration of keyboard shortcuts.
- Improved the dark mode experience on mobile devices.
### Bug Fixes
- Fixed an issue with some pages failing to sync properly.
- Fixed an issue where links without the http(s) scheme could not be opened, ensuring consistent link functionality.
- Fixed an issue that prevented numbers from being inserted before heading blocks.
- Fixed the inline page reference update mechanism to accurately reflect workspace changes.
- Fixed an issue that made it difficult to resize images in certain cases.
- Enhanced image loading reliability by clearing the image cache when images fail to load.
- Resolved a problem preventing the launching of URLs on some Linux distributions.
## Version 0.5.0 - 02/26/2024
### New Features
- Added support for scaling text on mobile platforms for better readability.
- Introduced a toggle for favorites directly from the documents' top bar.
- Optimized the image upload process and added error messaging for failed uploads.
- Implemented depth control for outline block components.
- New checklist task creation is now more intuitive, with prompts appearing on hover over list items in the row detail page.
- Enhanced sorting capabilities, allowing reordering and addition of multiple sorts.
- Expanded sorting and filtering options to include more field types like checklist, creation time, and modification time.
- Added support for field calculations within databases.
### Bug Fixes
- Fixed an issue where inserting an image from Unsplash in local mode was not possible.
- Fixed undo/redo functionality in lists.
- Fixed data loss issues when converting between block types.
- Fixed a bug where newly created rows were not being automatically sorted.
- Fixed issues related to deleting a sorting field or sort not removing existing sorts properly.
### Notes
- Windows 7, Windows 8, and iOS 11 are not yet supported due to the upgrade to Flutter 3.19.0.
## Version 0.4.9 - 02/17/2024
### Bug Fixes
- Resolved the issue that caused users to be redirected to the Sign In page
## Version 0.4.8 - 02/13/2024
### Bug Fixes
- Fixed a possible error when loading workspaces
## Version 0.4.6 - 02/03/2024
### Bug Fixes
- Fixed refresh token bug
## Version 0.4.5 - 02/01/2024
### Bug Fixes
- Fixed WebSocket connection issue
## Version 0.4.4 - 01/31/2024
### New Features
- Added functionality for uploading images to cloud storage.
- Enabled anonymous sign-in option for mobile platform users.
- Introduced the ability to customize cloud settings directly from the startup page.
- Added support for inserting reminders on the mobile platform.
- Overhauled the user interface on mobile devices, including improvements to the action bottom sheet, editor toolbar, database details page, and app bar.
- Implemented a shortcut (F2 key) to rename the current view.
### Bug Fixes
- Fixed an issue where the font family was not displaying correctly on the mobile platform.
- Resolved a problem with the mobile row detail title not updating correctly.
- Fixed issues related to deleting images and refactored the image actions menu for better usability.
- Fixed other known issues.
# Release Notes
## Version 0.4.3 - 01/16/2024
### Bug Fixes
+1 -1
View File
@@ -12,7 +12,7 @@
"program": "./lib/main.dart",
"type": "dart",
"env": {
"RUST_LOG": "trace",
"RUST_LOG": "debug",
"RUST_BACKTRACE": "1"
},
// uncomment the following line to testing performance.
+1 -1
View File
@@ -257,7 +257,7 @@
"label": "AF: Tauri UI Dev",
"type": "shell",
"isBackground": true,
"command": "pnpm run tauri:dev",
"command": "pnpm sync:i18n && pnpm run dev",
"options": {
"cwd": "${workspaceFolder}/appflowy_tauri"
}
+4 -1
View File
@@ -10,6 +10,7 @@ extend = [
{ path = "scripts/makefile/flutter.toml" },
{ path = "scripts/makefile/tool.toml" },
{ path = "scripts/makefile/tauri.toml" },
{ path = "scripts/makefile/web.toml" },
]
[config]
@@ -25,7 +26,7 @@ CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true
CARGO_MAKE_CRATE_FS_NAME = "dart_ffi"
CARGO_MAKE_CRATE_NAME = "dart-ffi"
LIB_NAME = "dart_ffi"
APPFLOWY_VERSION = "0.4.3"
APPFLOWY_VERSION = "0.5.2"
FLUTTER_DESKTOP_FEATURES = "dart,rev-sqlite"
PRODUCT_NAME = "AppFlowy"
MACOSX_DEPLOYMENT_TARGET = "11.0"
@@ -48,6 +49,8 @@ LIB_EXT = "a"
APP_ENVIRONMENT = "local"
FLUTTER_FLOWY_SDK_PATH = "appflowy_flutter/packages/appflowy_backend"
TAURI_BACKEND_SERVICE_PATH = "appflowy_tauri/src/services/backend"
WEB_BACKEND_SERVICE_PATH = "appflowy_web/src/services/backend"
WEB_LIB_PATH= "appflowy_web/wasm-libs/af-wasm"
# Test default config
TEST_CRATE_TYPE = "cdylib"
TEST_LIB_EXT = "dylib"
@@ -30,16 +30,26 @@ linter:
rules:
- require_trailing_commas
- prefer_collection_literals
- prefer_final_fields
- prefer_final_in_for_each
- prefer_final_locals
- sized_box_for_whitespace
- use_decorated_box
- unnecessary_parenthesis
- unnecessary_await_in_return
- unnecessary_raw_strings
- avoid_unnecessary_containers
- avoid_redundant_argument_values
- avoid_unused_constructor_parameters
- always_declare_return_types
- unnecessary_raw_strings
- use_decorated_box
- sort_constructors_first
- unawaited_futures
# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
@@ -3,7 +3,7 @@
#include <stdint.h>
#include <stdlib.h>
int64_t init_sdk(char *data);
int64_t init_sdk(int64_t port, char *data);
void async_event(int64_t port, const uint8_t *input, uintptr_t len);
@@ -13,6 +13,6 @@ int32_t set_stream_port(int64_t port);
void link_me_please(void);
void backend_log(int64_t level, const char *data);
void rust_log(int64_t level, const char *data);
void set_env(const char *data);
@@ -73,9 +73,9 @@
"attributes": { "subtype": "checkbox", "checkbox": true },
"delta": [
{ "insert": "Click " },
{ "insert": "+ New Page ", "attributes": { "code": true } },
{ "insert": "+ New Page", "attributes": { "code": true } },
{
"insert": "button at the bottom of your sidebar to add a new page."
"insert": " button at the bottom of your sidebar to add a new page."
}
]
},
@@ -16,9 +16,9 @@ import 'package:flowy_infra/uuid.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:path/path.dart' as p;
import 'package:integration_test/integration_test.dart';
import '../util/dir.dart';
import '../util/mock/mock_file_picker.dart';
import '../util/util.dart';
import '../shared/dir.dart';
import '../shared/mock/mock_file_picker.dart';
import '../shared/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
@@ -11,10 +11,11 @@ import 'package:appflowy/workspace/presentation/settings/widgets/settings_user_v
import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra/uuid.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:path/path.dart' as p;
import 'package:integration_test/integration_test.dart';
import '../util/mock/mock_file_picker.dart';
import '../util/util.dart';
import 'package:path/path.dart' as p;
import '../shared/mock/mock_file_picker.dart';
import '../shared/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
@@ -47,13 +48,13 @@ void main() {
tester.expectToSeeGoogleLoginButton();
});
testWidgets('sign in as annoymous', (tester) async {
testWidgets('sign in as anonymous', (tester) async {
await tester.initializeAppFlowy(
cloudType: AuthenticatorType.appflowyCloudSelfHost,
);
await tester.tapSignInAsGuest();
// should not see the sync setting page when sign in as annoymous
// should not see the sync setting page when sign in as anonymous
await tester.openSettings();
await tester.openSettingsPage(SettingsPage.user);
tester.expectToSeeGoogleLoginButton();
@@ -1,8 +1,9 @@
import 'empty_test.dart' as preset_af_cloud_env_test;
import 'anon_user_continue_test.dart' as anon_user_continue_test;
import 'appflowy_cloud_auth_test.dart' as appflowy_cloud_auth_test;
import 'collaborative_workspace_test.dart' as collaboration_workspace_test;
import 'empty_test.dart' as preset_af_cloud_env_test;
// import 'document_sync_test.dart' as document_sync_test;
import 'user_setting_sync_test.dart' as user_sync_test;
import 'anon_user_continue_test.dart' as anon_user_continue_test;
Future<void> main() async {
preset_af_cloud_env_test.main();
@@ -14,4 +15,6 @@ Future<void> main() async {
user_sync_test.main();
anon_user_continue_test.main();
collaboration_workspace_test.main();
}
@@ -0,0 +1,115 @@
// ignore_for_file: unused_import
import 'dart:io';
import 'package:appflowy/env/cloud_env.dart';
import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:appflowy/shared/feature_flags.dart';
import 'package:appflowy/startup/startup.dart';
import 'package:appflowy/user/application/auth/af_cloud_mock_auth_service.dart';
import 'package:appflowy/user/application/auth/auth_service.dart';
import 'package:appflowy/workspace/application/settings/prelude.dart';
import 'package:appflowy/workspace/presentation/home/menu/sidebar/sidebar_workspace.dart';
import 'package:appflowy/workspace/presentation/home/menu/sidebar/workspace/_sidebar_workspace_actions.dart';
import 'package:appflowy/workspace/presentation/home/menu/sidebar/workspace/_sidebar_workspace_menu.dart';
import 'package:appflowy/workspace/presentation/settings/widgets/setting_appflowy_cloud.dart';
import 'package:appflowy/workspace/presentation/settings/widgets/settings_user_view.dart';
import 'package:appflowy/workspace/presentation/widgets/user_avatar.dart';
import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra/uuid.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:path/path.dart' as p;
import '../shared/database_test_op.dart';
import '../shared/dir.dart';
import '../shared/emoji.dart';
import '../shared/mock/mock_file_picker.dart';
import '../shared/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
final email = '${uuid()}@appflowy.io';
group('collaborative workspace', () {
// only run the test when the feature flag is on
if (!FeatureFlag.collaborativeWorkspace.isOn) {
return;
}
// combine the create and delete workspace test to reduce the time
testWidgets('create a new workspace, open it and then delete it',
(tester) async {
await tester.initializeAppFlowy(
cloudType: AuthenticatorType.appflowyCloudSelfHost,
email: email,
);
await tester.tapGoogleLoginInButton();
await tester.expectToSeeHomePageWithGetStartedPage();
const name = 'AppFlowy.IO';
await tester.createCollaborativeWorkspace(name);
// see the success message
var success = find.text(LocaleKeys.workspace_createSuccess.tr());
expect(success, findsOneWidget);
await tester.pumpUntilNotFound(success);
// check the create result
await tester.openCollaborativeWorkspaceMenu();
var items = find.byType(WorkspaceMenuItem);
expect(items, findsNWidgets(2));
expect(
tester.widget<WorkspaceMenuItem>(items.last).workspace.name,
name,
);
// open the newly created workspace
await tester.tapButton(items.last);
success = find.text(LocaleKeys.workspace_openSuccess.tr());
expect(success, findsOneWidget);
await tester.pumpUntilNotFound(success);
await tester.closeCollaborativeWorkspaceMenu();
// delete the newly created workspace
await tester.openCollaborativeWorkspaceMenu();
final secondWorkspace = find.byType(WorkspaceMenuItem).last;
await tester.hoverOnWidget(
secondWorkspace,
onHover: () async {
// click the more button
final moreButton = find.byType(WorkspaceMoreActionList);
expect(moreButton, findsOneWidget);
await tester.tapButton(moreButton);
// click the delete button
final deleteButton = find.text(LocaleKeys.button_delete.tr());
expect(deleteButton, findsOneWidget);
await tester.tapButton(deleteButton);
// see the delete confirm dialog
final confirm =
find.text(LocaleKeys.workspace_deleteWorkspaceHintText.tr());
expect(confirm, findsOneWidget);
await tester.tapButton(find.text(LocaleKeys.button_ok.tr()));
// delete success
success = find.text(LocaleKeys.workspace_createSuccess.tr());
expect(success, findsOneWidget);
await tester.pumpUntilNotFound(success);
},
);
// check the result
await tester.openCollaborativeWorkspaceMenu();
items = find.byType(WorkspaceMenuItem);
expect(items, findsOneWidget);
expect(
tester.widget<WorkspaceMenuItem>(items.last).workspace.name != name,
true,
);
await tester.closeCollaborativeWorkspaceMenu();
});
});
}
@@ -16,9 +16,9 @@ import 'package:flowy_infra/uuid.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:path/path.dart' as p;
import 'package:integration_test/integration_test.dart';
import '../util/dir.dart';
import '../util/mock/mock_file_picker.dart';
import '../util/util.dart';
import '../shared/dir.dart';
import '../shared/mock/mock_file_picker.dart';
import '../shared/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
@@ -38,9 +38,7 @@ void main() {
await tester.expectToSeeHomePageWithGetStartedPage();
// create a new document called Sample
await tester.createNewPage(
layout: ViewLayoutPB.Document,
);
await tester.createNewPage();
// focus on the editor
await tester.editor.tapLineOfEditorAt(0);
@@ -2,7 +2,7 @@ import 'package:appflowy/env/cloud_env.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import '../util/util.dart';
import '../shared/util.dart';
// This test is meaningless, just for preventing the CI from failing.
void main() {
@@ -6,7 +6,8 @@ import 'package:appflowy/workspace/presentation/settings/widgets/settings_user_v
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import '../util/util.dart';
import '../shared/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
@@ -35,11 +36,11 @@ void main() {
tester.expectToSeeGoogleLoginButton();
});
testWidgets('sign in as annoymous', (tester) async {
testWidgets('sign in as anonymous', (tester) async {
await tester.initializeAppFlowy(cloudType: AuthenticatorType.supabase);
await tester.tapSignInAsGuest();
// should not see the sync setting page when sign in as annoymous
// should not see the sync setting page when sign in as anonymous
await tester.openSettings();
await tester.openSettingsPage(SettingsPage.user);
tester.expectToSeeGoogleLoginButton();
@@ -18,11 +18,11 @@ import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:path/path.dart' as p;
import 'package:integration_test/integration_test.dart';
import '../util/database_test_op.dart';
import '../util/dir.dart';
import '../util/emoji.dart';
import '../util/mock/mock_file_picker.dart';
import '../util/util.dart';
import '../shared/database_test_op.dart';
import '../shared/dir.dart';
import '../shared/emoji.dart';
import '../shared/mock/mock_file_picker.dart';
import '../shared/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
@@ -40,19 +40,19 @@ void main() {
await tester.openSettings();
await tester.openSettingsPage(SettingsPage.user);
final userAvatarFinder = find.descendant(
of: find.byType(SettingsUserView),
matching: find.byType(UserAvatar),
);
// final userAvatarFinder = find.descendant(
// of: find.byType(SettingsUserView),
// matching: find.byType(UserAvatar),
// );
// Open icon picker dialog and select emoji
await tester.tap(userAvatarFinder);
await tester.pumpAndSettle();
await tester.tapEmoji('😁');
await tester.pumpAndSettle();
final UserAvatar userAvatar =
tester.widget(userAvatarFinder) as UserAvatar;
expect(userAvatar.iconUrl, '😁');
// await tester.tap(userAvatarFinder);
// await tester.pumpAndSettle();
// await tester.tapEmoji('😁');
// await tester.pumpAndSettle();
// final UserAvatar userAvatar =
// tester.widget(userAvatarFinder) as UserAvatar;
// expect(userAvatar.iconUrl, '😁');
// enter user name
final userNameFinder = find.descendant(
@@ -81,12 +81,12 @@ void main() {
await tester.openSettingsPage(SettingsPage.user);
// verify icon
final userAvatarFinder = find.descendant(
of: find.byType(SettingsUserView),
matching: find.byType(UserAvatar),
);
final UserAvatar userAvatar = tester.widget(userAvatarFinder) as UserAvatar;
expect(userAvatar.iconUrl, '😁');
// final userAvatarFinder = find.descendant(
// of: find.byType(SettingsUserView),
// matching: find.byType(UserAvatar),
// );
// final UserAvatar userAvatar = tester.widget(userAvatarFinder) as UserAvatar;
// expect(userAvatar.iconUrl, '😁');
// verify name
final userNameFinder = find.descendant(
@@ -1,212 +0,0 @@
import 'package:appflowy/plugins/database/grid/presentation/grid_page.dart';
import 'package:appflowy/plugins/database/grid/presentation/widgets/header/type_option/select/select_option.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pbenum.dart';
import 'package:appflowy_backend/protobuf/flowy-folder/protobuf.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import '../util/database_test_op.dart';
import '../util/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
group('grid field editor:', () {
testWidgets('rename existing field', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
// Invoke the field editor
await tester.tapGridFieldWithName('Name');
await tester.tapEditPropertyButton();
await tester.renameField('hello world');
await tester.dismissFieldEditor();
await tester.tapGridFieldWithName('hello world');
await tester.pumpAndSettle();
});
testWidgets('update field type of existing field', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
// Invoke the field editor
await tester.tapGridFieldWithName('Type');
await tester.tapEditPropertyButton();
await tester.tapTypeOptionButton();
await tester.selectFieldType(FieldType.Checkbox);
await tester.dismissFieldEditor();
await tester.assertFieldTypeWithFieldName(
'Type',
FieldType.Checkbox,
);
await tester.pumpAndSettle();
});
testWidgets('create a field and rename it', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
// create a new grid
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
// create a field
await tester.createField(FieldType.Checklist, 'checklist');
// check the field is created successfully
await tester.findFieldWithName('checklist');
await tester.pumpAndSettle();
});
testWidgets('delete field', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
// create a field
await tester.createField(FieldType.Checkbox, 'New field 1');
// Delete the field
await tester.tapGridFieldWithName('New field 1');
await tester.tapDeletePropertyButton();
// confirm delete
await tester.tapDialogOkButton();
await tester.noFieldWithName('New field 1');
await tester.pumpAndSettle();
});
testWidgets('duplicate field', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
// create a field
await tester.scrollToRight(find.byType(GridPage));
await tester.tapNewPropertyButton();
await tester.renameField('New field 1');
await tester.dismissFieldEditor();
// duplicate the field
await tester.tapGridFieldWithName('New field 1');
await tester.tapDuplicatePropertyButton();
await tester.findFieldWithName('New field 1 (copy)');
await tester.pumpAndSettle();
});
testWidgets('insert field on either side of a field', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
await tester.scrollToRight(find.byType(GridPage));
// insert new field to the right
await tester.tapGridFieldWithName('Type');
await tester.tapInsertFieldButton(left: false, name: 'Right');
await tester.dismissFieldEditor();
await tester.findFieldWithName('Right');
// insert new field to the right
await tester.tapGridFieldWithName('Type');
await tester.tapInsertFieldButton(left: true, name: "Left");
await tester.dismissFieldEditor();
await tester.findFieldWithName('Left');
await tester.pumpAndSettle();
});
testWidgets('create checklist field', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
await tester.scrollToRight(find.byType(GridPage));
await tester.tapNewPropertyButton();
// Open the type option menu
await tester.tapTypeOptionButton();
await tester.selectFieldType(FieldType.Checklist);
// After update the field type, the cells should be updated
await tester.findCellByFieldType(FieldType.Checklist);
await tester.pumpAndSettle();
});
testWidgets('create list of fields', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
for (final fieldType in [
FieldType.Checklist,
FieldType.DateTime,
FieldType.Number,
FieldType.URL,
FieldType.MultiSelect,
FieldType.LastEditedTime,
FieldType.CreatedTime,
FieldType.Checkbox,
]) {
await tester.scrollToRight(find.byType(GridPage));
await tester.tapNewPropertyButton();
await tester.renameField(fieldType.name);
// Open the type option menu
await tester.tapTypeOptionButton();
await tester.selectFieldType(fieldType);
await tester.dismissFieldEditor();
// After update the field type, the cells should be updated
await tester.findCellByFieldType(fieldType);
await tester.pumpAndSettle();
}
});
testWidgets('add option', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.createNewPageWithNameUnderParent(
layout: ViewLayoutPB.Grid,
);
// Invoke the field editor
await tester.tapGridFieldWithName('Type');
await tester.tapEditPropertyButton();
// tap 'add option' button
await tester.tapAddSelectOptionButton();
const text = 'Hello AppFlowy';
final inputField = find.descendant(
of: find.byType(CreateOptionTextField),
matching: find.byType(TextField),
);
await tester.enterText(inputField, text);
await tester.pumpAndSettle();
await tester.testTextInput.receiveAction(TextInputAction.done);
await tester.pumpAndSettle(const Duration(seconds: 1));
// check the result
tester.expectToSeeText(text);
});
});
}
@@ -3,12 +3,11 @@ import 'package:appflowy/plugins/database/board/presentation/widgets/board_colum
import 'package:appflowy/plugins/database/widgets/card/container/card_container.dart';
import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
import 'package:appflowy_board/appflowy_board.dart';
import 'package:flowy_infra_ui/style_widget/text.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import '../util/util.dart';
import '../../shared/util.dart';
const defaultFirstCardName = 'Card 1';
const defaultLastCardName = 'Card 3';
@@ -25,11 +24,11 @@ void main() {
final findFirstCard = find.descendant(
of: find.byType(AppFlowyGroupCard),
matching: find.byType(FlowyText),
matching: find.byType(Text),
);
FlowyText firstCardText = tester.firstWidget(findFirstCard);
expect(firstCardText.text, defaultFirstCardName);
Text firstCardText = tester.firstWidget(findFirstCard);
expect(firstCardText.data, defaultFirstCardName);
await tester.tap(
find
@@ -51,13 +50,13 @@ void main() {
),
newCardName,
);
await tester.pumpAndSettle();
await tester.pumpAndSettle(const Duration(milliseconds: 500));
await tester.tap(find.byType(AppFlowyBoard));
await tester.pumpAndSettle();
firstCardText = tester.firstWidget(findFirstCard);
expect(firstCardText.text, newCardName);
expect(firstCardText.data, newCardName);
});
testWidgets('from footer', (tester) async {
@@ -68,12 +67,11 @@ void main() {
final findLastCard = find.descendant(
of: find.byType(AppFlowyGroupCard),
matching: find.byType(FlowyText),
matching: find.byType(Text),
);
FlowyText? lastCardText =
tester.widgetList(findLastCard).last as FlowyText;
expect(lastCardText.text, defaultLastCardName);
Text? lastCardText = tester.widgetList(findLastCard).last as Text;
expect(lastCardText.data, defaultLastCardName);
await tester.tap(
find
@@ -93,13 +91,13 @@ void main() {
),
newCardName,
);
await tester.pumpAndSettle();
await tester.pumpAndSettle(const Duration(milliseconds: 500));
await tester.tap(find.byType(AppFlowyBoard));
await tester.pumpAndSettle();
lastCardText = tester.widgetList(findLastCard).last as FlowyText;
expect(lastCardText.text, newCardName);
lastCardText = tester.widgetList(findLastCard).last as Text;
expect(lastCardText.data, newCardName);
});
});
}
@@ -1,12 +1,12 @@
import 'package:appflowy/plugins/database/widgets/row/cells/select_option_cell/extension.dart';
import 'package:appflowy/plugins/database/widgets/cell_editor/extension.dart';
import 'package:appflowy/plugins/database/widgets/row/row_property.dart';
import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:appflowy_board/appflowy_board.dart';
import '../util/util.dart';
import '../../shared/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
@@ -19,10 +19,10 @@ void main() {
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Board);
final card1 = find.ancestor(
of: find.findTextInFlowyText(card1Name),
of: find.text(card1Name),
matching: find.byType(AppFlowyGroupCard),
);
final doingGroup = find.findTextInFlowyText('Doing');
final doingGroup = find.text('Doing');
final doingGroupCenter = tester.getCenter(doingGroup);
final card1Center = tester.getCenter(card1);
@@ -39,11 +39,11 @@ void main() {
of: find.byType(RowPropertyList),
matching: find.descendant(
of: find.byType(SelectOptionTag),
matching: find.byType(FlowyText),
matching: find.byType(Text),
),
);
expect(card1StatusFinder, findsNWidgets(1));
final card1StatusText = tester.widget<FlowyText>(card1StatusFinder).text;
final card1StatusText = tester.widget<Text>(card1StatusFinder).data;
expect(card1StatusText, 'Doing');
});
});
@@ -7,8 +7,8 @@ import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import '../util/database_test_op.dart';
import '../util/util.dart';
import '../../shared/database_test_op.dart';
import '../../shared/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
@@ -7,8 +7,8 @@ import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import '../util/util.dart';
import '../util/database_test_op.dart';
import '../../shared/util.dart';
import '../../shared/database_test_op.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
@@ -20,16 +20,16 @@ void main() {
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Board);
const name = 'Card 1';
final card1 = find.findTextInFlowyText(name);
final card1 = find.text(name);
await tester.hoverOnWidget(
card1,
onHover: () async {
final moreOption = find.byType(CardMoreOption);
final moreOption = find.byType(MoreCardOptionsAccessory);
await tester.tapButton(moreOption);
},
);
await tester.tapButtonWithName(LocaleKeys.button_delete.tr());
expect(find.findTextInFlowyText(name), findsNothing);
expect(find.text(name), findsNothing);
});
testWidgets('duplicate item in ToDo card', (tester) async {
@@ -38,11 +38,11 @@ void main() {
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Board);
const name = 'Card 1';
final card1 = find.findTextInFlowyText(name);
final card1 = find.text(name);
await tester.hoverOnWidget(
card1,
onHover: () async {
final moreOption = find.byType(CardMoreOption);
final moreOption = find.byType(MoreCardOptionsAccessory);
await tester.tapButton(moreOption);
},
);
@@ -1,10 +1,12 @@
import 'package:appflowy/plugins/database/calendar/presentation/calendar_event_editor.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/setting_entities.pbenum.dart';
import 'package:appflowy_backend/protobuf/flowy-folder/view.pbenum.dart';
import 'package:flowy_infra_ui/style_widget/icon_button.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import '../util/database_test_op.dart';
import '../util/util.dart';
import '../../shared/database_test_op.dart';
import '../../shared/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
@@ -80,7 +82,7 @@ void main() {
// Hover over today's calendar cell
await tester.hoverOnTodayCalendarCell(
// Tap on create new event button
onHover: () async => await tester.tapAddCalendarEventButton(),
onHover: tester.tapAddCalendarEventButton,
);
// Make sure that the event editor popup is shown
@@ -147,6 +149,49 @@ void main() {
tester.assertNumberOfEventsOnSpecificDay(1, DateTime.now());
});
testWidgets('create and duplicate calendar event', (tester) async {
const customTitle = "EventTitleCustom";
await tester.initializeAppFlowy();
await tester.tapGoButton();
// Create the calendar view
await tester.createNewPageWithNameUnderParent(
layout: ViewLayoutPB.Calendar,
);
// Scroll until today's date cell is visible
await tester.scrollToToday();
// Hover over today's calendar cell
await tester.hoverOnTodayCalendarCell(
// Tap on create new event button
onHover: () async => tester.tapAddCalendarEventButton(),
);
// Make sure that the event editor popup is shown
tester.assertEventEditorOpen();
tester.assertNumberOfEventsInCalendar(1);
// Change the title of the event
await tester.editEventTitle(customTitle);
// Duplicate event
final duplicateBtnFinder = find
.descendant(
of: find.byType(CalendarEventEditor),
matching: find.byType(
FlowyIconButton,
),
)
.first;
await tester.tap(duplicateBtnFinder);
await tester.pumpAndSettle();
tester.assertNumberOfEventsInCalendar(2, title: customTitle);
});
testWidgets('rescheduling events', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
@@ -158,7 +203,7 @@ void main() {
// Create a new event on the first of this month
final today = DateTime.now();
final firstOfThisMonth = DateTime(today.year, today.month, 1);
final firstOfThisMonth = DateTime(today.year, today.month);
await tester.doubleClickCalendarCell(firstOfThisMonth);
await tester.dismissEventEditor();
@@ -4,8 +4,8 @@ import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:intl/intl.dart';
import '../util/database_test_op.dart';
import '../util/util.dart';
import '../../shared/database_test_op.dart';
import '../../shared/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
@@ -23,7 +23,7 @@ void main() {
input: 'hello world',
);
await tester.assertCellContent(
tester.assertCellContent(
rowIndex: 0,
fieldType: FieldType.RichText,
content: 'hello world',
@@ -56,14 +56,13 @@ void main() {
cellIndex: 1,
);
await tester.assertCellContent(
tester.assertCellContent(
rowIndex: 0,
fieldType: FieldType.RichText,
content: 'hello',
cellIndex: 0,
);
await tester.assertCellContent(
tester.assertCellContent(
rowIndex: 0,
fieldType: FieldType.RichText,
content: 'world',
@@ -96,7 +95,7 @@ void main() {
input: '0.2',
);
// -1 -> -1
await tester.assertCellContent(
tester.assertCellContent(
rowIndex: 0,
fieldType: fieldType,
content: '-1',
@@ -109,7 +108,7 @@ void main() {
input: '.1',
);
// 0.2 -> 0.2
await tester.assertCellContent(
tester.assertCellContent(
rowIndex: 1,
fieldType: fieldType,
content: '0.2',
@@ -122,7 +121,7 @@ void main() {
input: '',
);
// .1 -> 0.1
await tester.assertCellContent(
tester.assertCellContent(
rowIndex: 2,
fieldType: fieldType,
content: '0.1',
@@ -216,13 +215,13 @@ void main() {
await tester.dismissCellEditor();
await tester.assertDateCellInGrid(
tester.assertCellContent(
rowIndex: 0,
fieldType: FieldType.DateTime,
content: DateFormat('MMM dd, y').format(today),
);
await tester.tapCellInGrid(rowIndex: 0, fieldType: fieldType);
await tester.findDateEditor(findsOneWidget);
// Toggle include time
final now = DateTime.now();
@@ -230,8 +229,9 @@ void main() {
await tester.dismissCellEditor();
await tester.assertDateCellInGrid(
tester.assertCellContent(
rowIndex: 0,
fieldType: FieldType.DateTime,
content: DateFormat('MMM dd, y HH:mm').format(now),
);
@@ -239,12 +239,14 @@ void main() {
await tester.findDateEditor(findsOneWidget);
// Change date format
await tester.tapChangeDateTimeFormatButton();
await tester.changeDateFormat();
await tester.dismissCellEditor();
await tester.assertDateCellInGrid(
tester.assertCellContent(
rowIndex: 0,
fieldType: FieldType.DateTime,
content: DateFormat('dd/MM/y HH:mm').format(now),
);
@@ -252,12 +254,14 @@ void main() {
await tester.findDateEditor(findsOneWidget);
// Change time format
await tester.tapChangeDateTimeFormatButton();
await tester.changeTimeFormat();
await tester.dismissCellEditor();
await tester.assertDateCellInGrid(
tester.assertCellContent(
rowIndex: 0,
fieldType: FieldType.DateTime,
content: DateFormat('dd/MM/y hh:mm a').format(now),
);
@@ -267,8 +271,9 @@ void main() {
// Clear the date and time
await tester.clearDate();
await tester.assertDateCellInGrid(
tester.assertCellContent(
rowIndex: 0,
fieldType: FieldType.DateTime,
content: '',
);
@@ -4,8 +4,8 @@ import 'package:appflowy_backend/protobuf/flowy-folder/view.pbenum.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import '../util/database_test_op.dart';
import '../util/util.dart';
import '../../shared/database_test_op.dart';
import '../../shared/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
@@ -27,29 +27,29 @@ void main() {
// hide the field
await tester.tapGridFieldWithName('New field 1');
await tester.tapHidePropertyButton();
await tester.noFieldWithName('New field 1');
tester.noFieldWithName('New field 1');
// go back to inline database view, expect field to be shown
await tester.tapTabBarLinkedViewByViewName('Untitled');
await tester.findFieldWithName('New field 1');
tester.findFieldWithName('New field 1');
// go back to linked database view, expect field to be hidden
await tester.tapTabBarLinkedViewByViewName('Grid');
await tester.noFieldWithName('New field 1');
tester.noFieldWithName('New field 1');
// use the settings button to show the field
await tester.tapDatabaseSettingButton();
await tester.tapViewPropertiesButton();
await tester.tapViewTogglePropertyVisibilityButtonByName('New field 1');
await tester.dismissFieldEditor();
await tester.findFieldWithName('New field 1');
tester.findFieldWithName('New field 1');
// open first row in popup then hide the field
await tester.openFirstRowDetailPage();
await tester.tapGridFieldWithNameInRowDetailPage('New field 1');
await tester.tapHidePropertyButtonInFieldEditor();
await tester.dismissRowDetailPage();
await tester.noFieldWithName('New field 1');
tester.noFieldWithName('New field 1');
});
});
}
@@ -0,0 +1,395 @@
import 'package:appflowy/plugins/database/grid/presentation/grid_page.dart';
import 'package:appflowy/plugins/database/grid/presentation/widgets/header/type_option/select/select_option.dart';
import 'package:appflowy/util/field_type_extension.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pbenum.dart';
import 'package:appflowy_backend/protobuf/flowy-folder/protobuf.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:intl/intl.dart';
import '../../shared/database_test_op.dart';
import '../../shared/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
group('grid field editor:', () {
testWidgets('rename existing field', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
// Invoke the field editor
await tester.tapGridFieldWithName('Name');
await tester.tapEditFieldButton();
await tester.renameField('hello world');
await tester.dismissFieldEditor();
await tester.tapGridFieldWithName('hello world');
await tester.pumpAndSettle();
});
testWidgets('update field type of existing field', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
// Invoke the field editor
await tester.changeFieldTypeOfFieldWithName('Type', FieldType.Checkbox);
await tester.assertFieldTypeWithFieldName(
'Type',
FieldType.Checkbox,
);
await tester.pumpAndSettle();
});
testWidgets('create a field and rename it', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
// create a new grid
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
// create a field
await tester.createField(FieldType.Checklist, 'checklist');
// check the field is created successfully
tester.findFieldWithName('checklist');
await tester.pumpAndSettle();
});
testWidgets('delete field', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
// create a field
await tester.createField(FieldType.Checkbox, 'New field 1');
// Delete the field
await tester.tapGridFieldWithName('New field 1');
await tester.tapDeletePropertyButton();
// confirm delete
await tester.tapDialogOkButton();
tester.noFieldWithName('New field 1');
await tester.pumpAndSettle();
});
testWidgets('duplicate field', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
// create a field
await tester.scrollToRight(find.byType(GridPage));
await tester.tapNewPropertyButton();
await tester.renameField('New field 1');
await tester.dismissFieldEditor();
// duplicate the field
await tester.tapGridFieldWithName('New field 1');
await tester.tapDuplicatePropertyButton();
tester.findFieldWithName('New field 1 (copy)');
await tester.pumpAndSettle();
});
testWidgets('insert field on either side of a field', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
await tester.scrollToRight(find.byType(GridPage));
// insert new field to the right
await tester.tapGridFieldWithName('Type');
await tester.tapInsertFieldButton(left: false, name: 'Right');
await tester.dismissFieldEditor();
tester.findFieldWithName('Right');
// insert new field to the right
await tester.tapGridFieldWithName('Type');
await tester.tapInsertFieldButton(left: true, name: "Left");
await tester.dismissFieldEditor();
tester.findFieldWithName('Left');
await tester.pumpAndSettle();
});
testWidgets('create checklist field', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
await tester.scrollToRight(find.byType(GridPage));
await tester.tapNewPropertyButton();
// Open the type option menu
await tester.tapSwitchFieldTypeButton();
await tester.selectFieldType(FieldType.Checklist);
// After update the field type, the cells should be updated
await tester.findCellByFieldType(FieldType.Checklist);
await tester.pumpAndSettle();
});
testWidgets('create list of fields', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
for (final fieldType in [
FieldType.Checklist,
FieldType.DateTime,
FieldType.Number,
FieldType.URL,
FieldType.MultiSelect,
FieldType.LastEditedTime,
FieldType.CreatedTime,
FieldType.Checkbox,
]) {
await tester.scrollToRight(find.byType(GridPage));
await tester.tapNewPropertyButton();
await tester.renameField(fieldType.name);
// Open the type option menu
await tester.tapSwitchFieldTypeButton();
await tester.selectFieldType(fieldType);
await tester.dismissFieldEditor();
// After update the field type, the cells should be updated
await tester.findCellByFieldType(fieldType);
await tester.pumpAndSettle();
}
});
testWidgets('field types with empty type option editor', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
for (final fieldType in [
FieldType.RichText,
FieldType.Checkbox,
FieldType.Checklist,
FieldType.URL,
]) {
// create the field
await tester.scrollToRight(find.byType(GridPage));
await tester.tapNewPropertyButton();
await tester.renameField(fieldType.i18n);
// change field type
await tester.tapSwitchFieldTypeButton();
await tester.selectFieldType(fieldType);
await tester.dismissFieldEditor();
// open the field editor
await tester.tapGridFieldWithName(fieldType.i18n);
await tester.tapEditFieldButton();
// check type option editor is empty
tester.expectEmptyTypeOptionEditor();
await tester.dismissFieldEditor();
}
});
testWidgets('number field type option', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
await tester.scrollToRight(find.byType(GridPage));
// create a number field
await tester.tapNewPropertyButton();
await tester.renameField("Number");
await tester.tapSwitchFieldTypeButton();
await tester.selectFieldType(FieldType.Number);
await tester.dismissFieldEditor();
// enter some data into the first number cell
await tester.editCell(
rowIndex: 0,
fieldType: FieldType.Number,
input: '123',
);
// edit the next cell to force the previous cell at row 0 to lose focus
await tester.editCell(
rowIndex: 1,
fieldType: FieldType.Number,
input: '0.2',
);
tester.assertCellContent(
rowIndex: 0,
fieldType: FieldType.Number,
content: '123',
);
// open editor and change number format
await tester.tapGridFieldWithName('Number');
await tester.tapEditFieldButton();
await tester.changeNumberFieldFormat();
await tester.dismissFieldEditor();
// assert number format has been changed
tester.assertCellContent(
rowIndex: 0,
fieldType: FieldType.Number,
content: '\$123',
);
});
testWidgets('add option', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.createNewPageWithNameUnderParent(
layout: ViewLayoutPB.Grid,
);
// invoke the field editor
await tester.tapGridFieldWithName('Type');
await tester.tapEditFieldButton();
// tap 'add option' button
await tester.tapAddSelectOptionButton();
const text = 'Hello AppFlowy';
final inputField = find.descendant(
of: find.byType(CreateOptionTextField),
matching: find.byType(TextField),
);
await tester.enterText(inputField, text);
await tester.pumpAndSettle();
await tester.testTextInput.receiveAction(TextInputAction.done);
await tester.pumpAndSettle(const Duration(milliseconds: 500));
// check the result
tester.expectToSeeText(text);
});
testWidgets('date time field type options', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
await tester.scrollToRight(find.byType(GridPage));
// create a date field
await tester.tapNewPropertyButton();
await tester.renameField(FieldType.DateTime.i18n);
await tester.tapSwitchFieldTypeButton();
await tester.selectFieldType(FieldType.DateTime);
await tester.dismissFieldEditor();
// edit the first date cell
await tester.tapCellInGrid(rowIndex: 0, fieldType: FieldType.DateTime);
await tester.toggleIncludeTime();
final now = DateTime.now();
await tester.selectDay(content: now.day);
await tester.dismissCellEditor();
tester.assertCellContent(
rowIndex: 0,
fieldType: FieldType.DateTime,
content: DateFormat('MMM dd, y HH:mm').format(now),
);
// open editor and change date & time format
await tester.tapGridFieldWithName(FieldType.DateTime.i18n);
await tester.tapEditFieldButton();
await tester.changeDateFormat();
await tester.changeTimeFormat();
await tester.dismissFieldEditor();
// assert date format has been changed
tester.assertCellContent(
rowIndex: 0,
fieldType: FieldType.DateTime,
content: DateFormat('dd/MM/y hh:mm a').format(now),
);
});
testWidgets('last modified and created at field type options',
(tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
final created = DateTime.now();
// create a created at field
await tester.tapNewPropertyButton();
await tester.renameField(FieldType.CreatedTime.i18n);
await tester.tapSwitchFieldTypeButton();
await tester.selectFieldType(FieldType.CreatedTime);
await tester.dismissFieldEditor();
// create a last modified field
await tester.tapNewPropertyButton();
await tester.renameField(FieldType.LastEditedTime.i18n);
await tester.tapSwitchFieldTypeButton();
// get time just before modifying
final modified = DateTime.now();
// create a last modified field (cont'd)
await tester.selectFieldType(FieldType.LastEditedTime);
await tester.dismissFieldEditor();
tester.assertCellContent(
rowIndex: 0,
fieldType: FieldType.CreatedTime,
content: DateFormat('MMM dd, y HH:mm').format(created),
);
tester.assertCellContent(
rowIndex: 0,
fieldType: FieldType.LastEditedTime,
content: DateFormat('MMM dd, y HH:mm').format(modified),
);
// open field editor and change date & time format
await tester.tapGridFieldWithName(FieldType.LastEditedTime.i18n);
await tester.tapEditFieldButton();
await tester.changeDateFormat();
await tester.changeTimeFormat();
await tester.dismissFieldEditor();
// open field editor and change date & time format
await tester.tapGridFieldWithName(FieldType.CreatedTime.i18n);
await tester.tapEditFieldButton();
await tester.changeDateFormat();
await tester.changeTimeFormat();
await tester.dismissFieldEditor();
// assert format has been changed
tester.assertCellContent(
rowIndex: 0,
fieldType: FieldType.CreatedTime,
content: DateFormat('dd/MM/y hh:mm a').format(created),
);
tester.assertCellContent(
rowIndex: 0,
fieldType: FieldType.LastEditedTime,
content: DateFormat('dd/MM/y hh:mm a').format(modified),
);
});
});
}
@@ -4,12 +4,12 @@ import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pbenum.
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import '../util/database_test_op.dart';
import '../../shared/database_test_op.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
group('database filter', () {
group('grid filter:', () {
testWidgets('add text filter', (tester) async {
await tester.openV020database();
@@ -103,8 +103,8 @@ void main() {
// select the option 's4'
await tester.tapOptionFilterWithName('s4');
// The row with 's4' or 's5' should be shown.
await tester.assertNumberOfRowsInGridPage(2);
// The row with 's4' should be shown.
await tester.assertNumberOfRowsInGridPage(1);
await tester.pumpAndSettle();
});
@@ -0,0 +1,206 @@
import 'package:appflowy/workspace/presentation/notifications/widgets/notification_item.dart';
import 'package:appflowy/workspace/presentation/widgets/date_picker/widgets/reminder_selector.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pbenum.dart';
import 'package:appflowy_backend/protobuf/flowy-folder/protobuf.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import '../../shared/database_test_op.dart';
import '../../shared/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
group('reminder in database', () {
testWidgets('add date field and add reminder', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
// Invoke the field editor
await tester.tapGridFieldWithName('Type');
await tester.tapEditFieldButton();
// Change to date type
await tester.tapSwitchFieldTypeButton();
await tester.selectFieldType(FieldType.DateTime);
await tester.dismissFieldEditor();
// Open date picker
await tester.tapCellInGrid(rowIndex: 0, fieldType: FieldType.DateTime);
await tester.findDateEditor(findsOneWidget);
// Select date
final isToday = await tester.selectLastDateInPicker();
// Select "On day of event" reminder
await tester.selectReminderOption(ReminderOption.onDayOfEvent);
// Expect "On day of event" to be displayed
tester.expectSelectedReminder(ReminderOption.onDayOfEvent);
// Dismiss the cell/date editor
await tester.dismissCellEditor();
// Open date picker again
await tester.tapCellInGrid(rowIndex: 0, fieldType: FieldType.DateTime);
await tester.findDateEditor(findsOneWidget);
// Expect "On day of event" to be displayed
tester.expectSelectedReminder(ReminderOption.onDayOfEvent);
// Dismiss the cell/date editor
await tester.dismissCellEditor();
int tabIndex = 1;
final now = DateTime.now();
if (isToday && now.hour >= 9) {
tabIndex = 0;
}
// Open "Upcoming" in Notification hub
await tester.openNotificationHub(tabIndex: tabIndex);
// Expect 1 notification
tester.expectNotificationItems(1);
});
testWidgets('navigate from reminder to open row', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
// Invoke the field editor
await tester.tapGridFieldWithName('Type');
await tester.tapEditFieldButton();
// Change to date type
await tester.tapSwitchFieldTypeButton();
await tester.selectFieldType(FieldType.DateTime);
await tester.dismissFieldEditor();
// Open date picker
await tester.tapCellInGrid(rowIndex: 0, fieldType: FieldType.DateTime);
await tester.findDateEditor(findsOneWidget);
// Select date
final isToday = await tester.selectLastDateInPicker();
// Select "On day of event"-reminder
await tester.selectReminderOption(ReminderOption.onDayOfEvent);
// Expect "On day of event" to be displayed
tester.expectSelectedReminder(ReminderOption.onDayOfEvent);
// Dismiss the cell/date editor
await tester.dismissCellEditor();
// Open date picker again
await tester.tapCellInGrid(rowIndex: 0, fieldType: FieldType.DateTime);
await tester.findDateEditor(findsOneWidget);
// Expect "On day of event" to be displayed
tester.expectSelectedReminder(ReminderOption.onDayOfEvent);
// Dismiss the cell/date editor
await tester.dismissCellEditor();
// Create and Navigate to a new document
await tester.createNewPageWithNameUnderParent();
await tester.pumpAndSettle();
int tabIndex = 1;
final now = DateTime.now();
if (isToday && now.hour >= 9) {
tabIndex = 0;
}
// Open correct tab in Notification hub
await tester.openNotificationHub(tabIndex: tabIndex);
// Expect 1 notification
tester.expectNotificationItems(1);
// Tap on the notification
await tester.tap(find.byType(NotificationItem));
await tester.pumpAndSettle();
// Expect to see Row Editor Dialog
tester.expectToSeeRowDetailsPageDialog();
});
testWidgets(
'toggle include time sets reminder option correctly',
(tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.createNewPageWithNameUnderParent(
layout: ViewLayoutPB.Grid,
);
// Invoke the field editor
await tester.tapGridFieldWithName('Type');
await tester.tapEditFieldButton();
// Change to date type
await tester.tapSwitchFieldTypeButton();
await tester.selectFieldType(FieldType.DateTime);
await tester.dismissFieldEditor();
// Open date picker
await tester.tapCellInGrid(rowIndex: 0, fieldType: FieldType.DateTime);
await tester.findDateEditor(findsOneWidget);
// Select date
await tester.selectLastDateInPicker();
// Select "On day of event"-reminder
await tester.selectReminderOption(ReminderOption.onDayOfEvent);
// Expect "On day of event" to be displayed
tester.expectSelectedReminder(ReminderOption.onDayOfEvent);
// Dismiss the cell/date editor
await tester.dismissCellEditor();
// Open date picker again
await tester.tapCellInGrid(rowIndex: 0, fieldType: FieldType.DateTime);
await tester.findDateEditor(findsOneWidget);
// Expect "On day of event" to be displayed
tester.expectSelectedReminder(ReminderOption.onDayOfEvent);
// Toggle include time on
await tester.toggleIncludeTime();
// Expect "At time of event" to be displayed
tester.expectSelectedReminder(ReminderOption.atTimeOfEvent);
// Dismiss the cell/date editor
await tester.dismissCellEditor();
// Open date picker again
await tester.tapCellInGrid(rowIndex: 0, fieldType: FieldType.DateTime);
await tester.findDateEditor(findsOneWidget);
// Expect "At time of event" to be displayed
tester.expectSelectedReminder(ReminderOption.atTimeOfEvent);
// Select "One hour before"-reminder
await tester.selectReminderOption(ReminderOption.oneHourBefore);
// Expect "One hour before" to be displayed
tester.expectSelectedReminder(ReminderOption.oneHourBefore);
// Toggle include time off
await tester.toggleIncludeTime();
// Expect "On day of event" to be displayed
tester.expectSelectedReminder(ReminderOption.onDayOfEvent);
},
);
});
}
@@ -7,15 +7,15 @@ import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import '../util/database_test_op.dart';
import '../util/emoji.dart';
import '../util/util.dart';
import '../../shared/database_test_op.dart';
import '../../shared/emoji.dart';
import '../../shared/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
group('grid', () {
testWidgets('row details page opens', (tester) async {
group('grid row detail page:', () {
testWidgets('opens', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
@@ -27,9 +27,12 @@ void main() {
// Make sure that the row page is opened
tester.assertRowDetailPageOpened();
// Each row detail page should have a document
await tester.assertDocumentExistInRowDetailPage();
});
testWidgets('insert emoji in the row detail page', (tester) async {
testWidgets('add emoji', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
@@ -48,7 +51,7 @@ void main() {
await tester.tapButton(find.byType(EmojiButton));
});
testWidgets('update emoji in the row detail page', (tester) async {
testWidgets('update emoji', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
@@ -75,7 +78,7 @@ void main() {
expect(emojiText, findsNWidgets(2));
});
testWidgets('remove emoji in the row detail page', (tester) async {
testWidgets('remove emoji', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
@@ -96,7 +99,7 @@ void main() {
expect(emojiText, findsNothing);
});
testWidgets('create list of fields in row detail page', (tester) async {
testWidgets('create list of fields', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
@@ -120,7 +123,7 @@ void main() {
await tester.renameField(fieldType.name);
// Open the type option menu
await tester.tapTypeOptionButton();
await tester.tapSwitchFieldTypeButton();
await tester.selectFieldType(fieldType);
@@ -211,20 +214,6 @@ void main() {
tester.assertToggleShowHiddenFieldsVisibility(false);
});
testWidgets('check document exists in row detail page', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
// Create a new grid
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
// Hover first row and then open the row page
await tester.openFirstRowDetailPage();
// Each row detail page should have a document
await tester.assertDocumentExistInRowDetailPage();
});
testWidgets('update the contents of the document and re-open it',
(tester) async {
await tester.initializeAppFlowy();
@@ -305,7 +294,7 @@ void main() {
expect(tester.takeException(), isNull);
});
testWidgets('delete row in row detail page', (tester) async {
testWidgets('delete row', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
@@ -322,7 +311,7 @@ void main() {
await tester.assertNumberOfRowsInGridPage(2);
});
testWidgets('duplicate row in row detail page', (tester) async {
testWidgets('duplicate row', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
@@ -2,8 +2,8 @@ import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import '../util/database_test_op.dart';
import '../util/util.dart';
import '../../shared/database_test_op.dart';
import '../../shared/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
@@ -16,7 +16,7 @@ void main() {
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
await tester.tapCreateRowButtonInGrid();
// The initial number of rows is 3
// 3 initial rows + 1 created
await tester.assertNumberOfRowsInGridPage(4);
await tester.pumpAndSettle();
});
@@ -31,9 +31,8 @@ void main() {
await tester.tapCreateRowButtonInRowMenuOfGrid();
// The initial number of rows is 3
// 3 initial rows + 1 created
await tester.assertNumberOfRowsInGridPage(4);
await tester.assertRowCountInGridPage(4);
await tester.pumpAndSettle();
});
@@ -48,9 +47,8 @@ void main() {
await tester.tapRowMenuButtonInGrid();
await tester.tapDeleteOnRowMenu();
// The initial number of rows is 3
// 3 initial rows - 1 deleted
await tester.assertNumberOfRowsInGridPage(2);
await tester.assertRowCountInGridPage(2);
await tester.pumpAndSettle();
});
@@ -60,7 +58,6 @@ void main() {
await tester.tapGoButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
await tester.assertRowCountInGridPage(3);
await tester.pumpAndSettle();
});
@@ -3,8 +3,8 @@ import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import '../util/database_test_op.dart';
import '../util/util.dart';
import '../../shared/database_test_op.dart';
import '../../shared/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
@@ -2,7 +2,7 @@ import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pbenum.
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import '../util/database_test_op.dart';
import '../../shared/database_test_op.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
@@ -16,7 +16,7 @@ void main() {
// check the text cell
final textCells = <String>['A', 'B', 'C', 'D', 'E', '', '', '', '', ''];
for (final (index, content) in textCells.indexed) {
await tester.assertCellContent(
tester.assertCellContent(
rowIndex: index,
fieldType: FieldType.RichText,
content: content,
@@ -57,7 +57,7 @@ void main() {
'',
];
for (final (index, content) in numberCells.indexed) {
await tester.assertCellContent(
tester.assertCellContent(
rowIndex: index,
fieldType: FieldType.Number,
content: content,
@@ -74,7 +74,7 @@ void main() {
'',
];
for (final (index, content) in urlCells.indexed) {
await tester.assertCellContent(
tester.assertCellContent(
rowIndex: index,
fieldType: FieldType.URL,
content: content,
@@ -135,7 +135,7 @@ void main() {
null,
];
for (final (index, percent) in checklistCells.indexed) {
await tester.assertChecklistCellInGrid(
tester.assertChecklistCellInGrid(
rowIndex: index,
percent: percent,
);
@@ -155,8 +155,9 @@ void main() {
'',
];
for (final (index, content) in dateCells.indexed) {
await tester.assertDateCellInGrid(
tester.assertCellContent(
rowIndex: index,
fieldType: FieldType.DateTime,
content: content,
);
}
@@ -2,7 +2,7 @@ import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pbenum.
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import '../util/database_test_op.dart';
import '../../shared/database_test_op.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
@@ -28,7 +28,7 @@ void main() {
'',
];
for (final (index, content) in textCells.indexed) {
await tester.assertCellContent(
tester.assertCellContent(
rowIndex: index,
fieldType: FieldType.RichText,
content: content,
@@ -51,7 +51,7 @@ void main() {
'',
'',
].indexed) {
await tester.assertCellContent(
tester.assertCellContent(
rowIndex: index,
fieldType: FieldType.RichText,
content: content,
@@ -75,7 +75,7 @@ void main() {
'',
'',
].indexed) {
await tester.assertCellContent(
tester.assertCellContent(
rowIndex: index,
fieldType: FieldType.RichText,
content: content,
@@ -86,7 +86,7 @@ void main() {
testWidgets('add checkbox sort', (tester) async {
await tester.openV020database();
// create a filter
// create a sort
await tester.tapDatabaseSortButton();
await tester.tapCreateSortByFieldType(FieldType.Checkbox, 'Done');
@@ -136,7 +136,7 @@ void main() {
testWidgets('add number sort', (tester) async {
await tester.openV020database();
// create a filter
// create a sort
await tester.tapDatabaseSortButton();
await tester.tapCreateSortByFieldType(FieldType.Number, 'number');
@@ -153,7 +153,7 @@ void main() {
'12',
'',
].indexed) {
await tester.assertCellContent(
tester.assertCellContent(
rowIndex: index,
fieldType: FieldType.Number,
content: content,
@@ -176,7 +176,7 @@ void main() {
'-2',
'',
].indexed) {
await tester.assertCellContent(
tester.assertCellContent(
rowIndex: index,
fieldType: FieldType.Number,
content: content,
@@ -188,7 +188,7 @@ void main() {
testWidgets('add checkbox and number sort', (tester) async {
await tester.openV020database();
// create a filter
// create a sort
await tester.tapDatabaseSortButton();
await tester.tapCreateSortByFieldType(FieldType.Checkbox, 'Done');
@@ -255,7 +255,7 @@ void main() {
'2',
'',
].indexed) {
await tester.assertCellContent(
tester.assertCellContent(
rowIndex: index,
fieldType: FieldType.Number,
content: content,
@@ -264,5 +264,111 @@ void main() {
await tester.pumpAndSettle();
});
testWidgets('reorder sort', (tester) async {
await tester.openV020database();
// create a sort
await tester.tapDatabaseSortButton();
await tester.tapCreateSortByFieldType(FieldType.Checkbox, 'Done');
// open the sort menu and sort checkbox by descending
await tester.tapSortMenuInSettingBar();
await tester.tapSortButtonByName('Done');
await tester.tapSortByDescending();
// add another sort, this time by number descending
await tester.tapSortMenuInSettingBar();
await tester.tapCreateSortByFieldTypeInSortMenu(
FieldType.Number,
'number',
);
await tester.tapSortButtonByName('number');
await tester.tapSortByDescending();
// check checkbox cell order
for (final (index, content) in <bool>[
true,
true,
true,
true,
true,
false,
false,
false,
false,
false,
].indexed) {
await tester.assertCheckboxCell(
rowIndex: index,
isSelected: content,
);
}
// check number cell order
for (final (index, content) in <String>[
'1',
'0.2',
'0.1',
'-1',
'-2',
'12',
'11',
'10',
'2',
'',
].indexed) {
tester.assertCellContent(
rowIndex: index,
fieldType: FieldType.Number,
content: content,
);
}
// reorder sort
await tester.tapSortMenuInSettingBar();
await tester.reorderSort(
(FieldType.Number, 'number'),
(FieldType.Checkbox, 'Done'),
);
// check checkbox cell order
for (final (index, content) in <bool>[
false,
false,
false,
false,
true,
true,
true,
true,
true,
false,
].indexed) {
await tester.assertCheckboxCell(
rowIndex: index,
isSelected: content,
);
}
// check the number cell order
for (final (index, content) in <String>[
'12',
'11',
'10',
'2',
'1',
'0.2',
'0.1',
'-1',
'-2',
'',
].indexed) {
tester.assertCellContent(
rowIndex: index,
fieldType: FieldType.Number,
content: content,
);
}
});
});
}
@@ -3,8 +3,8 @@ import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import '../util/database_test_op.dart';
import '../util/util.dart';
import '../../shared/database_test_op.dart';
import '../../shared/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
@@ -5,8 +5,8 @@ import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import '../util/keyboard.dart';
import '../util/util.dart';
import '../../shared/keyboard.dart';
import '../../shared/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
@@ -57,7 +57,7 @@ void main() {
final editorState = tester.editor.getCurrentEditorState();
final first = editorState.getNodeAtPath([0])!;
// expect to see text aligned to the right
await FlowyTestKeyboard.simulateKeyDownEvent(
[
@@ -7,7 +7,7 @@ import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import '../util/util.dart';
import '../../shared/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
@@ -8,7 +8,7 @@ import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import '../util/util.dart';
import '../../shared/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
@@ -4,7 +4,7 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import '../util/util.dart';
import '../../shared/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
@@ -35,7 +35,7 @@ void main() {
// delete the readme page
await tester.hoverOnPageName(
gettingStarted,
onHover: () async => await tester.tapDeletePageButton(),
onHover: () async => tester.tapDeletePageButton(),
);
// the banner should show up and the readme page should be gone
@@ -59,7 +59,7 @@ void main() {
// delete the readme page
await tester.hoverOnPageName(
gettingStarted,
onHover: () async => await tester.tapDeletePageButton(),
onHover: () async => tester.tapDeletePageButton(),
);
// the banner should show up and the readme page should be gone
@@ -1,15 +1,13 @@
import 'package:flutter/services.dart';
import 'package:appflowy/plugins/document/presentation/editor_plugins/mention/mention_page_block.dart';
import 'package:appflowy/plugins/inline_actions/widgets/inline_actions_handler.dart';
import 'package:appflowy/workspace/presentation/home/menu/view/view_item.dart';
import 'package:appflowy_backend/protobuf/flowy-folder/protobuf.dart';
import 'package:flowy_infra/uuid.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import '../util/keyboard.dart';
import '../util/util.dart';
import '../../shared/keyboard.dart';
import '../../shared/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
@@ -89,7 +87,6 @@ Future<String> createDocumentToReference(WidgetTester tester) async {
await tester.createNewPageWithNameUnderParent(
name: name,
layout: ViewLayoutPB.Document,
openAfterCreated: false,
);
@@ -1,7 +1,7 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import '../util/util.dart';
import '../../shared/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
@@ -1,16 +1,15 @@
import 'package:appflowy/workspace/application/settings/appearance/appearance_cubit.dart';
import 'package:appflowy_editor/appflowy_editor.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import '../util/util.dart';
import '../../shared/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
group('text direction', () {
testWidgets(
'''no text direction items will be displayed in the default/LTR mode,and three text direction items will be displayed in the RTL mode.''',
'''no text direction items will be displayed in the default/LTR mode, and three text direction items will be displayed when toggle is enabled.''',
(tester) async {
// combine the two tests into one to avoid the time-consuming process of initializing the app
await tester.initializeAppFlowy();
@@ -29,10 +28,10 @@ void main() {
// because this icons are defined in the appflowy_editor package, we can't fetch the icons by SVG data. [textDirectionItems]
final textDirectionIconNames = [
'toolbar/text_direction_auto',
'toolbar/text_direction_left',
'toolbar/text_direction_right',
'toolbar/text_direction_ltr',
'toolbar/text_direction_rtl',
];
// no text direction items in default/LTR mode
// no text direction items by default
var button = find.byWidgetPredicate(
(widget) =>
widget is SVGIconItemWidget &&
@@ -41,7 +40,7 @@ void main() {
expect(button, findsNothing);
// switch to the RTL mode
await tester.switchLayoutDirectionMode(LayoutDirection.rtlLayout);
await tester.toggleEnableRTLToolbarItems();
await tester.editor.tapLineOfEditorAt(0);
await tester.editor.updateSelection(selection);
@@ -7,8 +7,8 @@ import 'package:flutter_emoji_mart/flutter_emoji_mart.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import '../util/emoji.dart';
import '../util/util.dart';
import '../../shared/emoji.dart';
import '../../shared/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
@@ -43,8 +43,6 @@ void main() {
await tester.editor.hoverOnCover();
await tester.editor.tapOnChangeCover();
await tester.editor.addNetworkImageCover(imageUrl);
await tester.editor.switchNetworkImageCover(imageUrl);
await tester.editor.dismissCoverPicker();
tester.expectToSeeDocumentCover(CoverType.file);
// Remove the cover
@@ -1,9 +1,9 @@
import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:appflowy/plugins/inline_actions/widgets/inline_actions_handler.dart';
import 'package:appflowy/plugins/database/board/presentation/board_page.dart';
import 'package:appflowy/plugins/database/calendar/presentation/calendar_page.dart';
import 'package:appflowy/plugins/database/grid/presentation/grid_page.dart';
import 'package:appflowy/plugins/database/widgets/row/cells/text_cell/text_cell.dart';
import 'package:appflowy/plugins/database/widgets/cell/editable_cell_skeleton/text.dart';
import 'package:appflowy/plugins/inline_actions/widgets/inline_actions_handler.dart';
import 'package:appflowy/workspace/presentation/home/menu/view/view_item.dart';
import 'package:appflowy_backend/protobuf/flowy-folder/protobuf.dart';
import 'package:appflowy_editor/appflowy_editor.dart';
@@ -12,7 +12,7 @@ import 'package:flowy_infra/uuid.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import '../util/util.dart';
import '../../shared/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
@@ -40,7 +40,7 @@ void main() {
Position(path: [1]),
),
);
final gridTextCell = find.byType(GridTextCell).first;
final gridTextCell = find.byType(EditableTextCell).first;
await tester.tapButton(gridTextCell);
expect(tester.editor.getCurrentEditorState().selection, isNull);
@@ -84,7 +84,7 @@ void main() {
await createInlineDatabase(tester, ViewLayoutPB.Grid);
// validate the referenced grid is inserted
// validate the inline grid is created
expect(
find.descendant(
of: find.byType(AppFlowyEditor),
@@ -100,7 +100,7 @@ void main() {
await createInlineDatabase(tester, ViewLayoutPB.Board);
// validate the referenced grid is inserted
// validate the inline board is created
expect(
find.descendant(
of: find.byType(AppFlowyEditor),
@@ -116,7 +116,7 @@ void main() {
await createInlineDatabase(tester, ViewLayoutPB.Calendar);
// validate the referenced grid is inserted
// validate the inline calendar is created
expect(
find.descendant(
of: find.byType(AppFlowyEditor),
@@ -144,8 +144,6 @@ Future<void> insertReferenceDatabase(
// create a new document
await tester.createNewPageWithNameUnderParent(
name: 'insert_a_reference_${layout.name}',
layout: ViewLayoutPB.Document,
openAfterCreated: true,
);
// tap the first line of the document
await tester.editor.tapLineOfEditorAt(0);
@@ -173,8 +171,6 @@ Future<void> createInlineDatabase(
final documentName = 'insert_a_inline_${layout.name}';
await tester.createNewPageWithNameUnderParent(
name: documentName,
layout: ViewLayoutPB.Document,
openAfterCreated: true,
);
// tap the first line of the document
await tester.editor.tapLineOfEditorAt(0);
@@ -1,13 +1,17 @@
import 'dart:io';
import 'package:appflowy/core/config/kv.dart';
import 'package:appflowy/core/config/kv_keys.dart';
import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:appflowy/plugins/document/presentation/editor_plugins/image/custom_image_block_component.dart';
import 'package:appflowy/plugins/document/presentation/editor_plugins/image/embed_image_url_widget.dart';
import 'package:appflowy/plugins/document/presentation/editor_plugins/image/image_placeholder.dart';
import 'package:appflowy/plugins/document/presentation/editor_plugins/image/resizeable_image.dart';
import 'package:appflowy/plugins/document/presentation/editor_plugins/image/unsplash_image_widget.dart';
import 'package:appflowy/plugins/document/presentation/editor_plugins/image/upload_image_menu.dart';
import 'package:appflowy_backend/protobuf/flowy-folder/protobuf.dart';
import 'package:appflowy_editor/appflowy_editor.dart' hide UploadImageMenu;
import 'package:appflowy/startup/startup.dart';
import 'package:appflowy_editor/appflowy_editor.dart'
hide UploadImageMenu, ResizableImage;
import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:flutter/material.dart';
@@ -18,8 +22,8 @@ import 'package:path/path.dart' as p;
import 'package:path_provider/path_provider.dart';
import 'package:run_with_network_images/run_with_network_images.dart';
import '../util/mock/mock_file_picker.dart';
import '../util/util.dart';
import '../../shared/mock/mock_file_picker.dart';
import '../../shared/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
@@ -33,7 +37,6 @@ void main() {
// create a new document
await tester.createNewPageWithNameUnderParent(
name: LocaleKeys.document_plugins_image_addAnImage.tr(),
layout: ViewLayoutPB.Document,
);
// tap the first line of the document
@@ -61,6 +64,7 @@ void main() {
paths: [imagePath],
);
await getIt<KeyValueStorage>().set(KVKeys.kCloudType, '0');
await tester.tapButtonWithName(
LocaleKeys.document_imageBlock_upload_placeholder.tr(),
);
@@ -81,7 +85,6 @@ void main() {
// create a new document
await tester.createNewPageWithNameUnderParent(
name: LocaleKeys.document_plugins_image_addAnImage.tr(),
layout: ViewLayoutPB.Document,
);
// tap the first line of the document
@@ -135,7 +138,6 @@ void main() {
// create a new document
await tester.createNewPageWithNameUnderParent(
name: LocaleKeys.document_plugins_image_addAnImage.tr(),
layout: ViewLayoutPB.Document,
);
// tap the first line of the document
@@ -1,6 +1,5 @@
import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:appflowy/plugins/document/presentation/editor_plugins/plugins.dart';
import 'package:appflowy_backend/protobuf/flowy-folder/protobuf.dart';
import 'package:appflowy_editor/appflowy_editor.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra_ui/style_widget/button.dart';
@@ -8,7 +7,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import '../util/util.dart';
import '../../shared/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
@@ -22,7 +21,6 @@ void main() {
// create a new document
await tester.createNewPageWithNameUnderParent(
name: 'math equation',
layout: ViewLayoutPB.Document,
);
// tap the first line of the document
@@ -68,7 +66,6 @@ void main() {
// create a new document
await tester.createNewPageWithNameUnderParent(
name: 'math equation',
layout: ViewLayoutPB.Document,
);
// tap the first line of the document
@@ -5,7 +5,7 @@ import 'package:flowy_infra_ui/widget/error_page.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import '../util/util.dart';
import '../../shared/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
@@ -65,7 +65,7 @@ void main() {
const newName = 'RenameToNewPageName';
await tester.hoverOnPageName(
pageName,
onHover: () async => await tester.renamePage(newName),
onHover: () async => tester.renamePage(newName),
);
final finder = find.descendant(
of: find.byType(MentionPageBlock),
@@ -84,7 +84,7 @@ void main() {
await tester.hoverOnPageName(
pageName,
layout: ViewLayoutPB.Grid,
onHover: () async => await tester.tapDeletePageButton(),
onHover: () async => tester.tapDeletePageButton(),
);
final finder = find.descendant(
of: find.byType(MentionPageBlock),
@@ -114,7 +114,6 @@ Future<String> insertInlinePage(
// create a new document
await tester.createNewPageWithNameUnderParent(
name: 'insert_a_inline_page_${layout.name}',
layout: ViewLayoutPB.Document,
);
// tap the first line of the document
@@ -1,4 +1,3 @@
import 'package:appflowy_backend/protobuf/flowy-folder/protobuf.dart';
import 'package:appflowy_editor/appflowy_editor.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
@@ -6,7 +5,7 @@ import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:url_launcher_platform_interface/url_launcher_platform_interface.dart';
import '../util/util.dart';
import '../../shared/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
@@ -24,9 +23,7 @@ void main() {
await tester.tapGoButton();
// create a new document
await tester.createNewPageWithNameUnderParent(
layout: ViewLayoutPB.Document,
);
await tester.createNewPageWithNameUnderParent();
// tap the first line of the document
await tester.editor.tapLineOfEditorAt(0);
@@ -0,0 +1,199 @@
import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:appflowy/plugins/document/presentation/editor_plugins/outline/outline_block_component.dart';
import 'package:appflowy/plugins/document/presentation/editor_plugins/plugins.dart';
import 'package:appflowy/workspace/presentation/widgets/pop_up_action.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import '../../shared/util.dart';
const String heading1 = "Heading 1";
const String heading2 = "Heading 2";
const String heading3 = "Heading 3";
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
group('outline block test', () {
testWidgets('insert an outline block', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.createNewPageWithNameUnderParent(
name: 'outline_test',
);
await tester.editor.tapLineOfEditorAt(0);
await insertOutlineInDocument(tester);
// validate the outline is inserted
expect(find.byType(OutlineBlockWidget), findsOneWidget);
});
testWidgets('insert an outline block and check if headings are visible',
(tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.createNewPageWithNameUnderParent(
name: 'outline_test',
);
await insertHeadingComponent(tester);
/* Results in:
* # Heading 1
* ## Heading 2
* ### Heading 3
*/
await tester.editor.tapLineOfEditorAt(3);
await insertOutlineInDocument(tester);
expect(
find.descendant(
of: find.byType(OutlineBlockWidget),
matching: find.text(heading1),
),
findsOneWidget,
);
// Heading 2 is prefixed with a bullet
expect(
find.descendant(
of: find.byType(OutlineBlockWidget),
matching: find.text(heading2),
),
findsOneWidget,
);
// Heading 3 is prefixed with a dash
expect(
find.descendant(
of: find.byType(OutlineBlockWidget),
matching: find.text(heading3),
),
findsOneWidget,
);
// update the Heading 1 to Heading 1Hello world
await tester.editor.tapLineOfEditorAt(0);
await tester.ime.insertText('Hello world');
expect(
find.descendant(
of: find.byType(OutlineBlockWidget),
matching: find.text('${heading1}Hello world'),
),
findsOneWidget,
);
});
testWidgets("control the depth of outline block", (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.createNewPageWithNameUnderParent(
name: 'outline_test',
);
await insertHeadingComponent(tester);
/* Results in:
* # Heading 1
* ## Heading 2
* ### Heading 3
*/
await tester.editor.tapLineOfEditorAt(3);
await insertOutlineInDocument(tester);
// expect to find only the `heading1` widget under the [OutlineBlockWidget]
await hoverAndClickDepthOptionAction(tester, [3], 1);
expect(
find.descendant(
of: find.byType(OutlineBlockWidget),
matching: find.text(heading2),
),
findsNothing,
);
expect(
find.descendant(
of: find.byType(OutlineBlockWidget),
matching: find.text(heading3),
),
findsNothing,
);
//////
/// expect to find only the 'heading1' and 'heading2' under the [OutlineBlockWidget]
await hoverAndClickDepthOptionAction(tester, [3], 2);
expect(
find.descendant(
of: find.byType(OutlineBlockWidget),
matching: find.text(heading3),
),
findsNothing,
);
//////
// expect to find all the headings under the [OutlineBlockWidget]
await hoverAndClickDepthOptionAction(tester, [3], 3);
expect(
find.descendant(
of: find.byType(OutlineBlockWidget),
matching: find.text(heading1),
),
findsOneWidget,
);
expect(
find.descendant(
of: find.byType(OutlineBlockWidget),
matching: find.text(heading2),
),
findsOneWidget,
);
expect(
find.descendant(
of: find.byType(OutlineBlockWidget),
matching: find.text(heading3),
),
findsOneWidget,
);
//////
});
});
}
/// Inserts an outline block in the document
Future<void> insertOutlineInDocument(WidgetTester tester) async {
// open the actions menu and insert the outline block
await tester.editor.showSlashMenu();
await tester.editor.tapSlashMenuItemWithName(
LocaleKeys.document_selectionMenu_outline.tr(),
);
await tester.pumpAndSettle();
}
Future<void> hoverAndClickDepthOptionAction(
WidgetTester tester,
List<int> path,
int level,
) async {
await tester.editor.hoverAndClickOptionMenuButton([3]);
await tester.tap(find.byType(AppFlowyPopover).hitTestable().last);
await tester.pumpAndSettle();
// Find a total of 4 HoverButtons under the [BlockOptionButton],
// in addition to 3 HoverButtons under the [DepthOptionAction] - (child of BlockOptionButton)
await tester.tap(find.byType(HoverButton).hitTestable().at(3 + level));
await tester.pumpAndSettle();
}
Future<void> insertHeadingComponent(WidgetTester tester) async {
await tester.editor.tapLineOfEditorAt(0);
await tester.ime.insertText('# $heading1\n');
await tester.ime.insertText('## $heading2\n');
await tester.ime.insertText('### $heading3\n');
}
@@ -1,14 +1,13 @@
import 'dart:io';
import 'package:appflowy/plugins/document/presentation/editor_plugins/plugins.dart';
import 'package:appflowy_backend/protobuf/flowy-folder/protobuf.dart';
import 'package:appflowy_editor/appflowy_editor.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import '../util/util.dart';
import '../../shared/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
@@ -40,9 +39,7 @@ void main() {
await tester.tapGoButton();
// create a new document
await tester.createNewPageWithNameUnderParent(
layout: ViewLayoutPB.Document,
);
await tester.createNewPageWithNameUnderParent();
// tap the first line of the document
await tester.editor.tapLineOfEditorAt(0);
@@ -86,9 +83,7 @@ void main() {
await tester.tapGoButton();
// create a new document
await tester.createNewPageWithNameUnderParent(
layout: ViewLayoutPB.Document,
);
await tester.createNewPageWithNameUnderParent();
// tap the first line of the document
await tester.editor.tapLineOfEditorAt(0);
@@ -125,9 +120,7 @@ void main() {
await tester.tapGoButton();
// create a new document
await tester.createNewPageWithNameUnderParent(
layout: ViewLayoutPB.Document,
);
await tester.createNewPageWithNameUnderParent();
// tap the first line of the document
await tester.editor.tapLineOfEditorAt(0);
@@ -162,9 +155,7 @@ void main() {
await tester.tapGoButton();
// create a new document
await tester.createNewPageWithNameUnderParent(
layout: ViewLayoutPB.Document,
);
await tester.createNewPageWithNameUnderParent();
// tap the first line of the document
await tester.editor.tapLineOfEditorAt(0);
@@ -176,11 +167,8 @@ void main() {
final toggleListIcon = find.byIcon(Icons.arrow_right);
await tester.tapButton(toggleListIcon);
await tester.editor.updateSelection(
Selection.collapsed(
Position(path: [0], offset: 0),
),
);
await tester.editor
.updateSelection(Selection.collapsed(Position(path: [0])));
await tester.ime.insertCharacter('\n');
final editorState = tester.editor.getCurrentEditorState();
@@ -196,9 +184,7 @@ void main() {
await tester.tapGoButton();
// create a new document
await tester.createNewPageWithNameUnderParent(
layout: ViewLayoutPB.Document,
);
await tester.createNewPageWithNameUnderParent();
// tap the first line of the document
await tester.editor.tapLineOfEditorAt(0);
@@ -209,7 +195,7 @@ void main() {
await tester.editor.updateSelection(
Selection.collapsed(
Position(path: [0], offset: 0),
Position(path: [0]),
),
);
await tester.simulateKeyEvent(
@@ -1,12 +1,11 @@
import 'dart:io';
import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
import 'package:appflowy_editor/appflowy_editor.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import '../util/util.dart';
import '../../shared/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
@@ -18,10 +17,7 @@ void main() {
// create a new document called Sample
const pageName = 'Sample';
await tester.createNewPageWithNameUnderParent(
name: pageName,
layout: ViewLayoutPB.Document,
);
await tester.createNewPageWithNameUnderParent(name: pageName);
// focus on the editor
await tester.editor.tapLineOfEditorAt(0);
@@ -75,10 +71,7 @@ void main() {
// create a new document called Sample
const pageName = 'Sample';
await tester.createNewPageWithNameUnderParent(
name: pageName,
layout: ViewLayoutPB.Document,
);
await tester.createNewPageWithNameUnderParent(name: pageName);
// focus on the editor
await tester.editor.tapLineOfEditorAt(0);
@@ -0,0 +1,107 @@
import 'package:appflowy_backend/protobuf/flowy-database2/protobuf.dart';
import 'package:appflowy_backend/protobuf/flowy-folder/view.pbenum.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import '../../shared/database_test_op.dart';
import '../../shared/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
group('Grid Calculations', () {
testWidgets('add calculation and update cell', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
// Change one Field to Number
await tester.changeFieldTypeOfFieldWithName('Type', FieldType.Number);
expect(find.text('Calculate'), findsOneWidget);
await tester.changeCalculateAtIndex(1, CalculationType.Sum);
// Enter values in cells
await tester.editCell(
rowIndex: 0,
fieldType: FieldType.Number,
input: '100',
);
await tester.editCell(
rowIndex: 1,
fieldType: FieldType.Number,
input: '100',
);
// Dismiss edit cell
await tester.sendKeyDownEvent(LogicalKeyboardKey.enter);
await tester.pumpAndSettle(const Duration(seconds: 1));
expect(find.text('200'), findsOneWidget);
});
testWidgets('add calculations and remove row', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
// Change two Fields to Number
await tester.changeFieldTypeOfFieldWithName('Type', FieldType.Number);
await tester.changeFieldTypeOfFieldWithName('Done', FieldType.Number);
expect(find.text('Calculate'), findsNWidgets(2));
await tester.changeCalculateAtIndex(1, CalculationType.Sum);
await tester.changeCalculateAtIndex(2, CalculationType.Min);
// Enter values in cells
await tester.editCell(
rowIndex: 0,
fieldType: FieldType.Number,
input: '100',
);
await tester.editCell(
rowIndex: 1,
fieldType: FieldType.Number,
input: '150',
);
await tester.editCell(
rowIndex: 0,
fieldType: FieldType.Number,
input: '50',
cellIndex: 1,
);
await tester.editCell(
rowIndex: 1,
fieldType: FieldType.Number,
input: '100',
cellIndex: 1,
);
await tester.pumpAndSettle();
// Dismiss edit cell
await tester.sendKeyDownEvent(LogicalKeyboardKey.enter);
await tester.pumpAndSettle();
expect(find.text('250'), findsOneWidget);
expect(find.text('50'), findsNWidgets(2));
// Delete 1st row
await tester.hoverOnFirstRowOfGrid();
await tester.tapRowMenuButtonInGrid();
await tester.tapDeleteOnRowMenu();
await tester.pumpAndSettle(const Duration(seconds: 1));
expect(find.text('150'), findsNWidgets(2));
expect(find.text('100'), findsNWidgets(2));
});
});
}
@@ -2,6 +2,7 @@ import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:appflowy/plugins/document/presentation/editor_plugins/mention/mention_block.dart';
import 'package:appflowy/user/application/user_settings_service.dart';
import 'package:appflowy/workspace/application/settings/date_time/date_format_ext.dart';
import 'package:appflowy/workspace/presentation/notifications/widgets/notification_item.dart';
import 'package:appflowy/workspace/presentation/widgets/toggle/toggle.dart';
import 'package:appflowy_backend/protobuf/flowy-user/date_time.pbenum.dart';
import 'package:appflowy_editor/appflowy_editor.dart';
@@ -12,10 +13,11 @@ import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import '../util/base.dart';
import '../util/common_operations.dart';
import '../util/editor_test_operations.dart';
import '../util/keyboard.dart';
import '../../shared/base.dart';
import '../../shared/common_operations.dart';
import '../../shared/editor_test_operations.dart';
import '../../shared/expectation.dart';
import '../../shared/keyboard.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
@@ -35,7 +37,7 @@ void main() {
await tester.pumpAndSettle();
// Trigger iline action menu and type 'remind tomorrow'
// Trigger inline action menu and type 'remind tomorrow'
final tomorrow = await _insertReminderTomorrow(tester);
Node node = tester.editor.getCurrentEditorState().getNodeAtPath([1])!;
@@ -43,7 +45,7 @@ void main() {
node.delta!.first.attributes![MentionBlockKeys.mention];
expect(node.type, 'paragraph');
expect(mentionAttr['type'], MentionType.reminder.name);
expect(mentionAttr['type'], MentionType.date.name);
expect(mentionAttr['date'], tomorrow.toIso8601String());
await tester.tap(
@@ -67,9 +69,57 @@ void main() {
_dateWithTime(dateTimeSettings.timeFormat, tomorrow, time);
expect(node.type, 'paragraph');
expect(mentionAttr['type'], MentionType.reminder.name);
expect(mentionAttr['type'], MentionType.date.name);
expect(mentionAttr['date'], tomorrowWithTime.toIso8601String());
});
testWidgets('Add reminder for tomorrow, and navigate to it',
(tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.editor.tapLineOfEditorAt(0);
await tester.editor.getCurrentEditorState().insertNewLine();
await tester.pumpAndSettle();
// Trigger inline action menu and type 'remind tomorrow'
final tomorrow = await _insertReminderTomorrow(tester);
final Node node =
tester.editor.getCurrentEditorState().getNodeAtPath([1])!;
final Map<String, dynamic> mentionAttr =
node.delta!.first.attributes![MentionBlockKeys.mention];
expect(node.type, 'paragraph');
expect(mentionAttr['type'], MentionType.date.name);
expect(mentionAttr['date'], tomorrow.toIso8601String());
// Create and Navigate to a new document
await tester.createNewPageWithNameUnderParent();
await tester.pumpAndSettle();
// Open "Upcoming" in Notification hub
await tester.openNotificationHub(tabIndex: 1);
// Expect 1 notification
tester.expectNotificationItems(1);
// Tap on the notification
await tester.tap(find.byType(NotificationItem));
await tester.pumpAndSettle();
// Expect node at path 1 to be the date/reminder
expect(
tester.editor
.getCurrentEditorState()
.getNodeAtPath([1])
?.delta
?.first
.attributes?[MentionBlockKeys.mention]['type'],
MentionType.date.name,
);
});
});
}
@@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import '../util/util.dart';
import '../../shared/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
@@ -1,10 +1,11 @@
import 'dart:ui';
import 'package:appflowy/workspace/presentation/settings/widgets/settings_language_view.dart';
import 'package:integration_test/integration_test.dart';
import 'package:flutter_test/flutter_test.dart';
import '../util/util.dart';
import 'package:appflowy/workspace/application/settings/prelude.dart';
import 'package:appflowy/workspace/presentation/settings/widgets/settings_language_view.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import '../../shared/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
@@ -0,0 +1,50 @@
import 'package:appflowy/workspace/presentation/home/menu/view/view_item.dart';
import 'package:appflowy/workspace/presentation/widgets/rename_view_popover.dart';
import 'package:appflowy_editor/appflowy_editor.dart';
import 'package:flowy_infra_ui/style_widget/text_field.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import '../../shared/keyboard.dart';
import '../../shared/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
group('Rename current view item', () {
testWidgets('by F2 shortcut', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await FlowyTestKeyboard.simulateKeyDownEvent(
[LogicalKeyboardKey.f2],
tester: tester,
);
await tester.pumpAndSettle();
expect(find.byType(RenameViewPopover), findsOneWidget);
await tester.enterText(
find.descendant(
of: find.byType(RenameViewPopover),
matching: find.byType(FlowyTextField),
),
'hello',
);
await tester.pumpAndSettle();
// Dismiss rename popover
await tester.tap(find.byType(AppFlowyEditor));
await tester.pumpAndSettle();
expect(
find.descendant(
of: find.byType(SingleInnerViewItem),
matching: find.text('hello'),
),
findsOneWidget,
);
});
});
}
@@ -6,7 +6,7 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import '../util/util.dart';
import '../../shared/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
@@ -1,15 +1,14 @@
import 'package:appflowy/workspace/application/sidebar/folder/folder_bloc.dart';
import 'package:appflowy/workspace/presentation/home/menu/sidebar/folder/favorite_folder.dart';
import 'package:appflowy/workspace/presentation/home/menu/view/view_item.dart';
import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
import 'package:appflowy_popover/appflowy_popover.dart';
import 'package:flowy_infra_ui/style_widget/hover.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import '../util/base.dart';
import '../util/common_operations.dart';
import '../util/expectation.dart';
import '../../shared/base.dart';
import '../../shared/common_operations.dart';
import '../../shared/expectation.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
@@ -34,14 +33,8 @@ void main() {
await tester.createNewPageWithNameUnderParent(
name: names[i],
parentName: parentName,
layout: ViewLayoutPB.Document,
);
tester.expectToSeePageName(
names[i],
parentName: parentName,
layout: ViewLayoutPB.Document,
parentLayout: ViewLayoutPB.Document,
);
tester.expectToSeePageName(names[i], parentName: parentName);
}
await tester.favoriteViewByName(gettingStarted);
@@ -87,7 +80,6 @@ void main() {
await tester.favoriteViewByName(gettingStarted);
await tester.hoverOnPageName(
gettingStarted,
layout: ViewLayoutPB.Document,
onHover: () async {
await tester.renamePage(name);
await tester.pumpAndSettle();
@@ -116,7 +108,6 @@ void main() {
await tester.createNewPageWithNameUnderParent(
name: names[i],
parentName: parentName,
layout: ViewLayoutPB.Document,
);
tester.expectToSeePageName(names[i], parentName: parentName);
}
@@ -136,7 +127,6 @@ void main() {
await tester.hoverOnPageName(
names[1],
layout: ViewLayoutPB.Document,
onHover: () async {
await tester.tapDeletePageButton();
await tester.pumpAndSettle();
@@ -150,7 +140,6 @@ void main() {
await tester.hoverOnPageName(
gettingStarted,
layout: ViewLayoutPB.Document,
onHover: () async {
await tester.tapDeletePageButton();
await tester.pumpAndSettle();
@@ -194,7 +183,6 @@ void main() {
await tester.favoriteViewByName(gettingStarted);
await tester.hoverOnPageName(
gettingStarted,
layout: ViewLayoutPB.Document,
useLast: false,
onHover: () async {
await tester.tapPageOptionButton();
@@ -2,9 +2,9 @@ import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import '../util/base.dart';
import '../util/common_operations.dart';
import '../util/expectation.dart';
import '../../shared/base.dart';
import '../../shared/common_operations.dart';
import '../../shared/expectation.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
@@ -12,7 +12,7 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import '../util/util.dart';
import '../../shared/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
@@ -82,7 +82,6 @@ void main() {
await tester.createNewPageWithNameUnderParent(
name: names[i],
parentName: parentName,
layout: ViewLayoutPB.Document,
);
tester.expectToSeePageName(names[i], parentName: parentName);
}
@@ -148,7 +147,7 @@ void main() {
name: document,
openAfterCreated: false,
);
tester.expectToSeePageName(document, layout: ViewLayoutPB.Document);
tester.expectToSeePageName(document);
const grid = 'grid';
await tester.createNewPageWithNameUnderParent(
@@ -190,7 +189,6 @@ void main() {
await tester.createNewPageWithNameUnderParent(
name: grid,
layout: ViewLayoutPB.Grid,
openAfterCreated: true,
);
tester.expectToSeePageName(grid, layout: ViewLayoutPB.Grid);
@@ -5,7 +5,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'util/util.dart';
import '../../shared/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
@@ -1,7 +1,8 @@
import 'package:appflowy_board/appflowy_board.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'util/util.dart';
import '../../shared/util.dart';
/// Integration tests for an empty board. The [TestWorkspaceService] will load
/// a workspace from an empty board `assets/test/workspaces/board.zip` for all
@@ -32,8 +33,8 @@ void main() {
const service = TestWorkspaceService(TestWorkspace.board);
group('board', () {
setUpAll(() async => await service.setUpAll());
setUp(() async => await service.setUp());
setUpAll(() async => service.setUpAll());
setUp(() async => service.setUp());
testWidgets('open the board with data structure in v0.2.0', (tester) async {
await tester.initializeAppFlowy();
@@ -0,0 +1,42 @@
import 'dart:io';
import 'package:appflowy/workspace/presentation/settings/widgets/emoji_picker/emoji_picker.dart';
import 'package:appflowy_editor/appflowy_editor.dart';
import 'package:appflowy_editor/src/editor/editor_component/service/editor.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import '../../shared/keyboard.dart';
import '../../shared/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
// May be better to move this to an existing test but unsure what it fits with
group('Keyboard shortcuts related to emojis', () {
testWidgets('cmd/ctrl+alt+e shortcut opens the emoji picker',
(tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
final Finder editor = find.byType(AppFlowyEditor);
await tester.tap(editor);
await tester.pumpAndSettle();
expect(find.byType(EmojiSelectionMenu), findsNothing);
await FlowyTestKeyboard.simulateKeyDownEvent(
[
Platform.isMacOS
? LogicalKeyboardKey.meta
: LogicalKeyboardKey.control,
LogicalKeyboardKey.alt,
LogicalKeyboardKey.keyE,
],
tester: tester,
);
expect(find.byType(EmojiSelectionMenu), findsOneWidget);
});
});
}
@@ -3,8 +3,9 @@ import 'package:appflowy_editor/appflowy_editor.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'util/keyboard.dart';
import 'util/util.dart';
import '../../shared/keyboard.dart';
import '../../shared/util.dart';
/// Integration tests for an empty document. The [TestWorkspaceService] will load a workspace from an empty document `assets/test/workspaces/empty_document.zip` for all tests.
///
@@ -28,8 +29,8 @@ void main() {
const service = TestWorkspaceService(TestWorkspace.emptyDocument);
group('Tests on a workspace with only an empty document', () {
setUpAll(() async => await service.setUpAll());
setUp(() async => await service.setUp());
setUpAll(() async => service.setUpAll());
setUp(() async => service.setUp());
testWidgets('/board shortcut creates a new board and view of the board',
(tester) async {
@@ -1,7 +1,7 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'util/util.dart';
import '../../shared/util.dart';
// This test is meaningless, just for preventing the CI from failing.
void main() {
@@ -1,4 +1,5 @@
import 'dart:io';
import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:appflowy/workspace/application/settings/prelude.dart';
import 'package:appflowy/workspace/presentation/home/menu/sidebar/sidebar.dart';
@@ -8,8 +9,8 @@ import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'util/keyboard.dart';
import 'util/util.dart';
import '../../shared/keyboard.dart';
import '../../shared/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
@@ -3,11 +3,11 @@ import 'dart:io';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'util/mock/mock_file_picker.dart';
import 'util/util.dart';
import 'package:path/path.dart' as p;
import '../../shared/mock/mock_file_picker.dart';
import '../../shared/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
@@ -33,7 +33,7 @@ void main() {
File(path).writeAsStringSync(str);
}
// mock get files
await mockPickFilePaths(
mockPickFilePaths(
paths: testFileNames
.map((e) => p.join(context.applicationDataDirectory, e))
.toList(),
@@ -2,7 +2,7 @@ import 'package:appflowy/workspace/presentation/settings/widgets/settings_langua
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'util/util.dart';
import '../../shared/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
@@ -7,16 +7,16 @@ import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'util/mock/mock_openai_repository.dart';
import 'util/util.dart';
import '../../shared/mock/mock_openai_repository.dart';
import '../../shared/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
const service = TestWorkspaceService(TestWorkspace.aiWorkSpace);
group('integration tests for open-ai smart menu', () {
setUpAll(() async => await service.setUpAll());
setUp(() async => await service.setUp());
setUpAll(() async => service.setUpAll());
setUp(() async => service.setUp());
testWidgets('testing selection on open-ai smart menu replace',
(tester) async {
@@ -59,7 +59,7 @@ void main() {
editorState.service.selectionService.updateSelection(
Selection(
start: Position(path: [1], offset: 0),
start: Position(path: [1]),
end: Position(path: [1], offset: 5),
),
);
@@ -80,8 +80,8 @@ void main() {
expect(
editorState.service.selectionService.currentSelection.value,
Selection(
start: Position(path: [2], offset: 0),
end: Position(path: [3], offset: 0),
start: Position(path: [2]),
end: Position(path: [3]),
),
);
});
@@ -99,7 +99,7 @@ Future<AppFlowyEditor> setUpOpenAITesting(WidgetTester tester) async {
final Finder editor = find.byType(AppFlowyEditor);
await tester.tap(editor);
await tester.pumpAndSettle();
return (tester.state(editor).widget as AppFlowyEditor);
return tester.state(editor).widget as AppFlowyEditor;
}
Future<void> mockOpenAIRepository() async {
@@ -5,8 +5,8 @@ import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:path/path.dart' as p;
import 'util/mock/mock_file_picker.dart';
import 'util/util.dart';
import '../../shared/mock/mock_file_picker.dart';
import '../../shared/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
@@ -7,8 +7,8 @@ import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:path/path.dart' as p;
import 'util/mock/mock_file_picker.dart';
import 'util/util.dart';
import '../../shared/mock/mock_file_picker.dart';
import '../../shared/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
@@ -8,10 +8,10 @@ import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'util/base.dart';
import 'util/common_operations.dart';
import 'util/expectation.dart';
import 'util/keyboard.dart';
import '../../shared/base.dart';
import '../../shared/common_operations.dart';
import '../../shared/expectation.dart';
import '../../shared/keyboard.dart';
const _documentName = 'First Doc';
const _documentTwoName = 'Second Doc';
@@ -32,15 +32,9 @@ void main() {
findsNothing,
);
await tester.createNewPageWithNameUnderParent(
name: _documentName,
layout: ViewLayoutPB.Document,
);
await tester.createNewPageWithNameUnderParent(name: _documentName);
await tester.createNewPageWithNameUnderParent(
name: _documentTwoName,
layout: ViewLayoutPB.Document,
);
await tester.createNewPageWithNameUnderParent(name: _documentTwoName);
/// Open second menu item in a new tab
await tester.openAppInNewTab(gettingStarted, ViewLayoutPB.Document);
@@ -0,0 +1,21 @@
import 'package:integration_test/integration_test.dart';
import 'desktop/document/document_test_runner.dart' as document_test_runner;
import 'desktop/uncategorized/empty_test.dart' as first_test;
import 'desktop/uncategorized/switch_folder_test.dart' as switch_folder_test;
Future<void> main() async {
await runIntegration1OnDesktop();
}
Future<void> runIntegration1OnDesktop() async {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
// This test must be run first, otherwise the CI will fail.
first_test.main();
switch_folder_test.main();
document_test_runner.startTesting();
// DON'T add more tests here. This is the first test runner for desktop.
}
@@ -0,0 +1,40 @@
import 'package:integration_test/integration_test.dart';
import 'desktop/database/database_calendar_test.dart' as database_calendar_test;
import 'desktop/database/database_cell_test.dart' as database_cell_test;
import 'desktop/database/database_field_settings_test.dart'
as database_field_settings_test;
import 'desktop/database/database_field_test.dart' as database_field_test;
import 'desktop/database/database_filter_test.dart' as database_filter_test;
import 'desktop/database/database_row_page_test.dart' as database_row_page_test;
import 'desktop/database/database_row_test.dart' as database_row_test;
import 'desktop/database/database_setting_test.dart' as database_setting_test;
import 'desktop/database/database_share_test.dart' as database_share_test;
import 'desktop/database/database_sort_test.dart' as database_sort_test;
import 'desktop/database/database_view_test.dart' as database_view_test;
import 'desktop/uncategorized/empty_test.dart' as first_test;
Future<void> main() async {
await runIntegration2OnDesktop();
}
Future<void> runIntegration2OnDesktop() async {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
// This test must be run first, otherwise the CI will fail.
first_test.main();
database_cell_test.main();
database_field_test.main();
database_field_settings_test.main();
database_share_test.main();
database_row_page_test.main();
database_row_test.main();
database_setting_test.main();
database_filter_test.main();
database_sort_test.main();
database_view_test.main();
database_calendar_test.main();
// DON'T add more tests here. This is the second test runner for desktop.
}
@@ -0,0 +1,36 @@
import 'package:integration_test/integration_test.dart';
import 'desktop/board/board_test_runner.dart' as board_test_runner;
import 'desktop/settings/settings_runner.dart' as settings_test_runner;
import 'desktop/sidebar/sidebar_test_runner.dart' as sidebar_test_runner;
import 'desktop/uncategorized/appearance_settings_test.dart'
as appearance_test_runner;
import 'desktop/uncategorized/emoji_shortcut_test.dart' as emoji_shortcut_test;
import 'desktop/uncategorized/empty_test.dart' as first_test;
import 'desktop/uncategorized/hotkeys_test.dart' as hotkeys_test;
import 'desktop/uncategorized/import_files_test.dart' as import_files_test;
import 'desktop/uncategorized/share_markdown_test.dart' as share_markdown_test;
import 'desktop/uncategorized/tabs_test.dart' as tabs_test;
Future<void> main() async {
await runIntegration3OnDesktop();
}
Future<void> runIntegration3OnDesktop() async {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
// This test must be run first, otherwise the CI will fail.
first_test.main();
hotkeys_test.main();
emoji_shortcut_test.main();
hotkeys_test.main();
emoji_shortcut_test.main();
appearance_test_runner.main();
settings_test_runner.main();
share_markdown_test.main();
import_files_test.main();
sidebar_test_runner.startTesting();
board_test_runner.startTesting();
tabs_test.main();
}
@@ -1,102 +0,0 @@
import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:appflowy/plugins/document/presentation/editor_plugins/outline/outline_block_component.dart';
import 'package:appflowy_backend/protobuf/flowy-folder/protobuf.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import '../util/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
group('outline block test', () {
testWidgets('insert an outline block', (tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.createNewPageWithNameUnderParent(
name: 'outline_test',
layout: ViewLayoutPB.Document,
);
await tester.editor.tapLineOfEditorAt(0);
await insertOutlineInDocument(tester);
// validate the outline is inserted
expect(find.byType(OutlineBlockWidget), findsOneWidget);
});
testWidgets('insert an outline block and check if headings are visible',
(tester) async {
await tester.initializeAppFlowy();
await tester.tapGoButton();
await tester.createNewPageWithNameUnderParent(
name: 'outline_test',
layout: ViewLayoutPB.Document,
);
await tester.editor.tapLineOfEditorAt(0);
await tester.ime.insertText('# Heading 1\n');
await tester.ime.insertText('## Heading 2\n');
await tester.ime.insertText('### Heading 3\n');
/* Results in:
* # Heading 1
* ## Heading 2
* ### Heading 3
*/
await tester.editor.tapLineOfEditorAt(3);
await insertOutlineInDocument(tester);
expect(
find.descendant(
of: find.byType(OutlineBlockWidget),
matching: find.text('Heading 1'),
),
findsOneWidget,
);
// Heading 2 is prefixed with a bullet
expect(
find.descendant(
of: find.byType(OutlineBlockWidget),
matching: find.text('Heading 2'),
),
findsOneWidget,
);
// Heading 3 is prefixed with a dash
expect(
find.descendant(
of: find.byType(OutlineBlockWidget),
matching: find.text('Heading 3'),
),
findsOneWidget,
);
// update the Heading 1 to Heading 1Hello world
await tester.editor.tapLineOfEditorAt(0);
await tester.ime.insertText('Hello world');
expect(
find.descendant(
of: find.byType(OutlineBlockWidget),
matching: find.text('Heading 1Hello world'),
),
findsOneWidget,
);
});
});
}
/// Inserts an outline block in the document
Future<void> insertOutlineInDocument(WidgetTester tester) async {
// open the actions menu and insert the outline block
await tester.editor.showSlashMenu();
await tester.editor.tapSlashMenuItemWithName(
LocaleKeys.document_selectionMenu_outline.tr(),
);
await tester.pumpAndSettle();
}
@@ -0,0 +1,44 @@
// ignore_for_file: unused_import
import 'dart:io';
import 'package:appflowy/env/cloud_env.dart';
import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:appflowy/mobile/presentation/home/home.dart';
import 'package:appflowy/startup/startup.dart';
import 'package:appflowy/user/application/auth/af_cloud_mock_auth_service.dart';
import 'package:appflowy/user/application/auth/auth_service.dart';
import 'package:appflowy/user/presentation/screens/sign_in_screen/widgets/widgets.dart';
import 'package:appflowy/workspace/application/settings/prelude.dart';
import 'package:appflowy/workspace/presentation/settings/widgets/setting_appflowy_cloud.dart';
import 'package:appflowy/workspace/presentation/settings/widgets/settings_user_view.dart';
import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra/uuid.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:path/path.dart' as p;
import '../../shared/dir.dart';
import '../../shared/mock/mock_file_picker.dart';
import '../../shared/util.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
group('anonymous sign in on mobile', () {
testWidgets('anon user and then sign in', (tester) async {
await tester.initializeAppFlowy(
cloudType: AuthenticatorType.local,
);
// click the anonymousSignInButton
final anonymousSignInButton = find.byType(SignInAnonymousButton);
expect(anonymousSignInButton, findsOneWidget);
await tester.tapButton(anonymousSignInButton);
// expect to see the home page
expect(find.byType(MobileHomeScreen), findsOneWidget);
});
});
}
@@ -0,0 +1,8 @@
import 'package:integration_test/integration_test.dart';
import 'mobile/sign_in/anonymous_sign_in_test.dart' as anonymous_sign_in_test;
Future<void> runIntegrationOnMobile() async {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
anonymous_sign_in_test.main();
}
@@ -1,29 +1,9 @@
import 'package:integration_test/integration_test.dart';
import 'dart:io';
import 'appearance_settings_test.dart' as appearance_test_runner;
import 'board/board_test_runner.dart' as board_test_runner;
import 'database/database_calendar_test.dart' as database_calendar_test;
import 'database/database_cell_test.dart' as database_cell_test;
import 'database/database_field_settings_test.dart'
as database_field_settings_test;
import 'database/database_field_test.dart' as database_field_test;
import 'database/database_filter_test.dart' as database_filter_test;
import 'database/database_row_page_test.dart' as database_row_page_test;
import 'database/database_row_test.dart' as database_row_test;
import 'database/database_setting_test.dart' as database_setting_test;
import 'database/database_share_test.dart' as database_share_test;
import 'database/database_sort_test.dart' as database_sort_test;
import 'database/database_view_test.dart' as database_view_test;
import 'document/document_test_runner.dart' as document_test_runner;
import 'empty_test.dart' as first_test;
import 'hotkeys_test.dart' as hotkeys_test;
import 'import_files_test.dart' as import_files_test;
import 'settings/settings_runner.dart' as settings_test_runner;
import 'share_markdown_test.dart' as share_markdown_test;
import 'sidebar/sidebar_test_runner.dart' as sidebar_test_runner;
import 'switch_folder_test.dart' as switch_folder_test;
import 'tabs_test.dart' as tabs_test;
// import 'auth/supabase_auth_test.dart' as supabase_auth_test_runner;
import 'desktop_runner_1.dart';
import 'desktop_runner_2.dart';
import 'desktop_runner_3.dart';
import 'mobile_runner.dart';
/// The main task runner for all integration tests in AppFlowy.
///
@@ -33,50 +13,13 @@ import 'tabs_test.dart' as tabs_test;
/// Once removed, the integration_test.yaml must be updated to exclude this as
/// as the test target.
Future<void> main() async {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
// This test must be run first, otherwise the CI will fail.
first_test.main();
switch_folder_test.main();
share_markdown_test.main();
import_files_test.main();
// Document integration tests
document_test_runner.startTesting();
// Sidebar integration tests
sidebar_test_runner.startTesting();
// Board integration test
board_test_runner.startTesting();
// Database integration tests
database_cell_test.main();
database_field_test.main();
database_field_settings_test.main();
database_share_test.main();
database_row_page_test.main();
database_row_test.main();
database_setting_test.main();
database_filter_test.main();
database_sort_test.main();
database_view_test.main();
database_calendar_test.main();
// Tabs
tabs_test.main();
// Others
hotkeys_test.main();
// Appearance integration test
appearance_test_runner.main();
// User settings
settings_test_runner.main();
// board_test.main();
// empty_document_test.main();
// smart_menu_test.main();
if (Platform.isLinux || Platform.isMacOS || Platform.isWindows) {
await runIntegration1OnDesktop();
await runIntegration2OnDesktop();
await runIntegration3OnDesktop();
} else if (Platform.isIOS || Platform.isAndroid) {
await runIntegrationOnMobile();
} else {
throw Exception('Unsupported platform');
}
}
Loaded 100 of 1930 files, more files were not shown because too many files have changed in this diff. Show more