mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
CI: Appflowy tauri ci (#1851)
* chore: add notification parser * chore: rename classes to models * refactor: add effects and reducers folder * chore: update eslint version * chore: run npx eslint --fix src * fix: ParserOptions.project error by ignore linting the .eslintrc.cjs * ci: add tauri lint * ci: disable ubuntu and windows tauri ci * ci: install --------- Co-authored-by: Annie <anqi.annie.wang@gmail.com>
This commit is contained in:
parent
59cb4a890a
commit
51041f6860
10
.github/workflows/tauri_ci.yaml
vendored
10
.github/workflows/tauri_ci.yaml
vendored
@ -14,7 +14,8 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
platform: [macos-latest, ubuntu-20.04, windows-latest]
|
# platform: [macos-latest, ubuntu-20.04, windows-latest]
|
||||||
|
platform: [macos-latest]
|
||||||
|
|
||||||
runs-on: ${{ matrix.platform }}
|
runs-on: ${{ matrix.platform }}
|
||||||
steps:
|
steps:
|
||||||
@ -61,6 +62,13 @@ jobs:
|
|||||||
cargo install --force cargo-make
|
cargo install --force cargo-make
|
||||||
cargo make appflowy-tauri-deps-tools
|
cargo make appflowy-tauri-deps-tools
|
||||||
|
|
||||||
|
- name: lint
|
||||||
|
working-directory: frontend/appflowy_tauri
|
||||||
|
run: |
|
||||||
|
yarn --frozen-lockfile
|
||||||
|
yarn test:prettier
|
||||||
|
yarn test:code
|
||||||
|
|
||||||
- name: build
|
- name: build
|
||||||
working-directory: frontend/appflowy_tauri
|
working-directory: frontend/appflowy_tauri
|
||||||
run: |
|
run: |
|
||||||
|
2
frontend/.vscode/settings.json
vendored
2
frontend/.vscode/settings.json
vendored
@ -27,6 +27,8 @@
|
|||||||
"prettier.printWidth": 140,
|
"prettier.printWidth": 140,
|
||||||
"editor.wordWrap": "wordWrapColumn",
|
"editor.wordWrap": "wordWrapColumn",
|
||||||
"dart.lineLength": 80,
|
"dart.lineLength": 80,
|
||||||
|
"typescript.validate.enable": true,
|
||||||
|
"javascript.validate.enable": true,
|
||||||
"files.associations": {
|
"files.associations": {
|
||||||
"*.log.*": "log"
|
"*.log.*": "log"
|
||||||
},
|
},
|
||||||
|
16
frontend/.vscode/tasks.json
vendored
16
frontend/.vscode/tasks.json
vendored
@ -170,7 +170,7 @@
|
|||||||
"type": "shell",
|
"type": "shell",
|
||||||
"isBackground": true,
|
"isBackground": true,
|
||||||
"command": "npm run dev",
|
"command": "npm run dev",
|
||||||
"problemMatcher": ["$tsc"],
|
"problemMatcher": "$tsc-watch",
|
||||||
"options": {
|
"options": {
|
||||||
"cwd": "${workspaceFolder}/appflowy_tauri"
|
"cwd": "${workspaceFolder}/appflowy_tauri"
|
||||||
}
|
}
|
||||||
@ -179,7 +179,7 @@
|
|||||||
"label": "AF: Tauri UI Build",
|
"label": "AF: Tauri UI Build",
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"command": "npm run build",
|
"command": "npm run build",
|
||||||
"problemMatcher": ["$tsc"],
|
"problemMatcher": "$tsc-watch",
|
||||||
"options": {
|
"options": {
|
||||||
"cwd": "${workspaceFolder}/appflowy_tauri"
|
"cwd": "${workspaceFolder}/appflowy_tauri"
|
||||||
}
|
}
|
||||||
@ -188,7 +188,7 @@
|
|||||||
"label": "AF: Tauri Dev",
|
"label": "AF: Tauri Dev",
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"command": "npm run tauri dev",
|
"command": "npm run tauri dev",
|
||||||
"problemMatcher": ["$tsc"],
|
"problemMatcher": "$tsc-watch",
|
||||||
"options": {
|
"options": {
|
||||||
"cwd": "${workspaceFolder}/appflowy_tauri"
|
"cwd": "${workspaceFolder}/appflowy_tauri"
|
||||||
}
|
}
|
||||||
@ -200,7 +200,7 @@
|
|||||||
"options": {
|
"options": {
|
||||||
"cwd": "${workspaceFolder}"
|
"cwd": "${workspaceFolder}"
|
||||||
},
|
},
|
||||||
"problemMatcher": ["$tsc"]
|
"problemMatcher": "$tsc-watch"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "AF: Tauri Clean + Dev",
|
"label": "AF: Tauri Clean + Dev",
|
||||||
@ -213,6 +213,14 @@
|
|||||||
"options": {
|
"options": {
|
||||||
"cwd": "${workspaceFolder}"
|
"cwd": "${workspaceFolder}"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "AF: Tauri ESLint",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "npx eslint --fix src",
|
||||||
|
"options": {
|
||||||
|
"cwd": "${workspaceFolder}/appflowy_tauri"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
@ -1,2 +1,4 @@
|
|||||||
/src/services
|
/src/services
|
||||||
/src/styles
|
/src/styles
|
||||||
|
.eslintrc.cjs
|
||||||
|
node_modules
|
2
frontend/appflowy_tauri/.gitignore
vendored
2
frontend/appflowy_tauri/.gitignore
vendored
@ -23,5 +23,5 @@ dist-ssr
|
|||||||
*.sln
|
*.sln
|
||||||
*.sw?
|
*.sw?
|
||||||
|
|
||||||
**/src/services/backend/classes/
|
**/src/services/backend/models/
|
||||||
**/src/services/backend/events/
|
**/src/services/backend/events/
|
@ -8,6 +8,8 @@
|
|||||||
"build": "tsc && vite build",
|
"build": "tsc && vite build",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"format": "prettier --write .",
|
"format": "prettier --write .",
|
||||||
|
"test:code": "eslint --max-warnings=0 --ext .js,.ts,.tsx .",
|
||||||
|
"test:prettier": "yarn prettier --list-different src",
|
||||||
"tauri:dev": "tauri dev"
|
"tauri:dev": "tauri dev"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -29,11 +31,12 @@
|
|||||||
"@types/node": "^18.7.10",
|
"@types/node": "^18.7.10",
|
||||||
"@types/react": "^18.0.15",
|
"@types/react": "^18.0.15",
|
||||||
"@types/react-dom": "^18.0.6",
|
"@types/react-dom": "^18.0.6",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.49.0",
|
"@typescript-eslint/eslint-plugin": "^5.51.0",
|
||||||
"@typescript-eslint/parser": "^5.49.0",
|
"@typescript-eslint/parser": "^5.51.0",
|
||||||
"@vitejs/plugin-react": "^3.0.0",
|
"@vitejs/plugin-react": "^3.0.0",
|
||||||
"autoprefixer": "^10.4.13",
|
"autoprefixer": "^10.4.13",
|
||||||
"eslint": "^8.33.0",
|
"eslint": "^8.34.0",
|
||||||
|
"eslint-plugin-react": "^7.32.2",
|
||||||
"postcss": "^8.4.21",
|
"postcss": "^8.4.21",
|
||||||
"prettier": "^2.8.3",
|
"prettier": "^2.8.3",
|
||||||
"prettier-plugin-tailwindcss": "^0.2.2",
|
"prettier-plugin-tailwindcss": "^0.2.2",
|
||||||
|
@ -2,16 +2,16 @@ import { Routes, Route, BrowserRouter } from 'react-router-dom';
|
|||||||
|
|
||||||
import { TestColors } from './components/TestColors/TestColors';
|
import { TestColors } from './components/TestColors/TestColors';
|
||||||
import TestApiButton from './components/TestApiButton/TestApiButton';
|
import TestApiButton from './components/TestApiButton/TestApiButton';
|
||||||
import { Welcome } from './pages/Welcome';
|
import { Welcome } from './views/Welcome';
|
||||||
import { Provider } from 'react-redux';
|
import { Provider } from 'react-redux';
|
||||||
import { store } from './store';
|
import { store } from './stores/store';
|
||||||
import { DocumentPage } from './pages/DocumentPage';
|
import { DocumentPage } from './views/DocumentPage';
|
||||||
import { BoardPage } from './pages/BoardPage';
|
import { BoardPage } from './views/BoardPage';
|
||||||
import { GridPage } from './pages/GridPage';
|
import { GridPage } from './views/GridPage';
|
||||||
import { LoginPage } from './pages/LoginPage';
|
import { LoginPage } from './views/LoginPage';
|
||||||
import { ProtectedRoutes } from './components/auth/ProtectedRoutes';
|
import { ProtectedRoutes } from './components/auth/ProtectedRoutes';
|
||||||
import { SignUpPage } from './pages/SignUpPage';
|
import { SignUpPage } from './views/SignUpPage';
|
||||||
import { ConfirmAccountPage } from './pages/ConfirmAccountPage';
|
import { ConfirmAccountPage } from './views/ConfirmAccountPage';
|
||||||
|
|
||||||
const App = () => {
|
const App = () => {
|
||||||
// const location = useLocation();
|
// const location = useLocation();
|
||||||
|
@ -1,9 +1,6 @@
|
|||||||
import {
|
import {
|
||||||
UserEventSignIn,
|
|
||||||
SignInPayloadPB,
|
SignInPayloadPB,
|
||||||
UserEventGetUserProfile,
|
} from '../../../services/backend/models/flowy-user/index';
|
||||||
UserEventGetUserSetting,
|
|
||||||
} from '../../../services/backend/events/flowy-user/index';
|
|
||||||
import { nanoid } from 'nanoid';
|
import { nanoid } from 'nanoid';
|
||||||
import { UserNotificationListener } from '../user/application/notifications';
|
import { UserNotificationListener } from '../user/application/notifications';
|
||||||
import {
|
import {
|
||||||
@ -11,14 +8,13 @@ import {
|
|||||||
CreateAppPayloadPB,
|
CreateAppPayloadPB,
|
||||||
CreateWorkspacePayloadPB,
|
CreateWorkspacePayloadPB,
|
||||||
FolderEventCreateApp,
|
FolderEventCreateApp,
|
||||||
FolderEventCreateView,
|
|
||||||
FolderEventCreateWorkspace,
|
FolderEventCreateWorkspace,
|
||||||
FolderEventOpenWorkspace,
|
FolderEventOpenWorkspace,
|
||||||
FolderEventReadCurrentWorkspace,
|
|
||||||
WorkspaceIdPB,
|
WorkspaceIdPB,
|
||||||
} from '../../../services/backend/events/flowy-folder';
|
} from '../../../services/backend/events/flowy-folder';
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import * as dependency_1 from '../../../services/backend/classes/flowy-folder/app';
|
import * as dependency_1 from '../../../services/backend/models/flowy-folder/app';
|
||||||
|
import { UserEventGetUserSetting, UserEventSignIn } from '../../../services/backend/events/flowy-user';
|
||||||
|
|
||||||
const TestApiButton = () => {
|
const TestApiButton = () => {
|
||||||
const [workspaceId, setWorkspaceId] = useState('');
|
const [workspaceId, setWorkspaceId] = useState('');
|
||||||
@ -59,14 +55,14 @@ const TestApiButton = () => {
|
|||||||
}, [workspaceId]);
|
}, [workspaceId]);
|
||||||
|
|
||||||
async function sendSignInEvent() {
|
async function sendSignInEvent() {
|
||||||
let make_payload = () =>
|
const make_payload = () =>
|
||||||
SignInPayloadPB.fromObject({
|
SignInPayloadPB.fromObject({
|
||||||
email: nanoid(4) + '@gmail.com',
|
email: nanoid(4) + '@gmail.com',
|
||||||
password: 'A!@123abc',
|
password: 'A!@123abc',
|
||||||
name: 'abc',
|
name: 'abc',
|
||||||
});
|
});
|
||||||
|
|
||||||
let listener = new UserNotificationListener({
|
const listener = new UserNotificationListener({
|
||||||
onUserSignIn: (userProfile) => {
|
onUserSignIn: (userProfile) => {
|
||||||
console.log(userProfile);
|
console.log(userProfile);
|
||||||
},
|
},
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { currentUserActions } from '../../../redux/current-user/slice';
|
import { currentUserActions } from '../../../stores/reducers/current-user/slice';
|
||||||
import { useAppDispatch, useAppSelector } from '../../../store';
|
import { useAppDispatch, useAppSelector } from '../../../stores/store';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
|
|
||||||
export const useConfirmAccount = () => {
|
export const useConfirmAccount = () => {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { currentUserActions } from '../../../redux/current-user/slice';
|
import { currentUserActions } from '../../../stores/reducers/current-user/slice';
|
||||||
import { useAppDispatch, useAppSelector } from '../../../store';
|
import { useAppDispatch, useAppSelector } from '../../../stores/store';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
|
|
||||||
export const useLogin = () => {
|
export const useLogin = () => {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { useAppDispatch, useAppSelector } from '../../../store';
|
import { useAppDispatch, useAppSelector } from '../../../stores/store';
|
||||||
import { currentUserActions } from '../../../redux/current-user/slice';
|
import { currentUserActions } from '../../../stores/reducers/current-user/slice';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
|
|
||||||
export const useSignUp = () => {
|
export const useSignUp = () => {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { currentUserActions } from '../../redux/current-user/slice';
|
import { currentUserActions } from '../../stores/reducers/current-user/slice';
|
||||||
import { useAppDispatch, useAppSelector } from '../../store';
|
import { useAppDispatch, useAppSelector } from '../../stores/store';
|
||||||
|
|
||||||
export const useAuth = () => {
|
export const useAuth = () => {
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
|
@ -1 +0,0 @@
|
|||||||
export {}
|
|
@ -1 +0,0 @@
|
|||||||
export {}
|
|
@ -1 +0,0 @@
|
|||||||
export {}
|
|
@ -1 +0,0 @@
|
|||||||
export {}
|
|
@ -1 +0,0 @@
|
|||||||
export {}
|
|
@ -1 +0,0 @@
|
|||||||
export {}
|
|
@ -1 +0,0 @@
|
|||||||
export {}
|
|
@ -1 +0,0 @@
|
|||||||
export {}
|
|
@ -1 +0,0 @@
|
|||||||
export {}
|
|
@ -1,4 +1,4 @@
|
|||||||
import { useAppSelector } from '../../../store';
|
import { useAppSelector } from '../../../stores/store';
|
||||||
|
|
||||||
export const useGridTableCount = () => {
|
export const useGridTableCount = () => {
|
||||||
const { grid } = useAppSelector((state) => state);
|
const { grid } = useAppSelector((state) => state);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { nanoid } from 'nanoid';
|
import { nanoid } from 'nanoid';
|
||||||
import { FieldType } from '../../../../services/backend/classes/flowy-database/field_entities';
|
import { FieldType } from '../../../../services/backend/models/flowy-database/field_entities';
|
||||||
import { gridActions } from '../../../redux/grid/slice';
|
import { gridActions } from '../../../stores/reducers/grid/slice';
|
||||||
import { useAppDispatch, useAppSelector } from '../../../store';
|
import { useAppDispatch, useAppSelector } from '../../../stores/store';
|
||||||
|
|
||||||
export const useGridTableHeaderHooks = function () {
|
export const useGridTableHeaderHooks = function () {
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
|
@ -7,7 +7,7 @@ import { SingleSelectTypeSvg } from '../../_shared/svg/SingleSelectTypeSvg';
|
|||||||
import { MultiSelectTypeSvg } from '../../_shared/svg/MultiSelectTypeSvg';
|
import { MultiSelectTypeSvg } from '../../_shared/svg/MultiSelectTypeSvg';
|
||||||
import { ChecklistTypeSvg } from '../../_shared/svg/ChecklistTypeSvg';
|
import { ChecklistTypeSvg } from '../../_shared/svg/ChecklistTypeSvg';
|
||||||
import { UrlTypeSvg } from '../../_shared/svg/UrlTypeSvg';
|
import { UrlTypeSvg } from '../../_shared/svg/UrlTypeSvg';
|
||||||
import { FieldType } from '../../../../services/backend/classes/flowy-database/field_entities';
|
import { FieldType } from '../../../../services/backend/models/flowy-database/field_entities';
|
||||||
|
|
||||||
export const GridTableHeader = () => {
|
export const GridTableHeader = () => {
|
||||||
const { fields, onAddField } = useGridTableHeaderHooks();
|
const { fields, onAddField } = useGridTableHeaderHooks();
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { gridActions } from '../../../redux/grid/slice';
|
import { gridActions } from '../../../stores/reducers/grid/slice';
|
||||||
import { useAppDispatch } from '../../../store';
|
import { useAppDispatch } from '../../../stores/store';
|
||||||
|
|
||||||
export const useGridAddRow = () => {
|
export const useGridAddRow = () => {
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { gridActions } from '../../../redux/grid/slice';
|
import { gridActions } from '../../../stores/reducers/grid/slice';
|
||||||
import { useAppDispatch, useAppSelector } from '../../../store';
|
import { useAppDispatch, useAppSelector } from '../../../stores/store';
|
||||||
|
|
||||||
export const useGridTableItemHooks = (
|
export const useGridTableItemHooks = (
|
||||||
rowItem: { value: string | number; fieldId: string; cellId: string },
|
rowItem: { value: string | number; fieldId: string; cellId: string },
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { useAppSelector } from '../../../store';
|
import { useAppSelector } from '../../../stores/store';
|
||||||
|
|
||||||
export const useGridTableRowsHooks = () => {
|
export const useGridTableRowsHooks = () => {
|
||||||
const grid = useAppSelector((state) => state.grid);
|
const grid = useAppSelector((state) => state.grid);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { gridActions } from '../../../redux/grid/slice';
|
import { gridActions } from '../../../stores/reducers/grid/slice';
|
||||||
|
|
||||||
import { useAppDispatch, useAppSelector } from '../../../store';
|
import { useAppDispatch, useAppSelector } from '../../../stores/store';
|
||||||
|
|
||||||
export const useGridTitleHooks = function () {
|
export const useGridTitleHooks = function () {
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
|
@ -1 +0,0 @@
|
|||||||
export {}
|
|
@ -1,8 +1,8 @@
|
|||||||
import { foldersActions, IFolder } from '../../../redux/folders/slice';
|
import { foldersActions, IFolder } from '../../../stores/reducers/folders/slice';
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { useAppDispatch } from '../../../store';
|
import { useAppDispatch } from '../../../stores/store';
|
||||||
import { nanoid } from 'nanoid';
|
import { nanoid } from 'nanoid';
|
||||||
import { pagesActions } from '../../../redux/pages/slice';
|
import { pagesActions } from '../../../stores/reducers/pages/slice';
|
||||||
|
|
||||||
export const useFolderEvents = (folder: IFolder) => {
|
export const useFolderEvents = (folder: IFolder) => {
|
||||||
const appDispatch = useAppDispatch();
|
const appDispatch = useAppDispatch();
|
||||||
|
@ -2,9 +2,9 @@ import { Details2Svg } from '../../_shared/svg/Details2Svg';
|
|||||||
import AddSvg from '../../_shared/svg/AddSvg';
|
import AddSvg from '../../_shared/svg/AddSvg';
|
||||||
import { NavItemOptionsPopup } from './NavItemOptionsPopup';
|
import { NavItemOptionsPopup } from './NavItemOptionsPopup';
|
||||||
import { NewPagePopup } from './NewPagePopup';
|
import { NewPagePopup } from './NewPagePopup';
|
||||||
import { IFolder } from '../../../redux/folders/slice';
|
import { IFolder } from '../../../stores/reducers/folders/slice';
|
||||||
import { useFolderEvents } from './FolderItem.hooks';
|
import { useFolderEvents } from './FolderItem.hooks';
|
||||||
import { IPage } from '../../../redux/pages/slice';
|
import { IPage } from '../../../stores/reducers/pages/slice';
|
||||||
import { PageItem } from './PageItem';
|
import { PageItem } from './PageItem';
|
||||||
import { Button } from '../../_shared/Button';
|
import { Button } from '../../_shared/Button';
|
||||||
import { RenamePopup } from './RenamePopup';
|
import { RenamePopup } from './RenamePopup';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { useAppSelector } from '../../../store';
|
import { useAppSelector } from '../../../stores/store';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
|
|
||||||
export const useNavigationPanelHooks = function () {
|
export const useNavigationPanelHooks = function () {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { useResizer } from '../../_shared/useResizer';
|
import { useResizer } from '../../_shared/useResizer';
|
||||||
import { useAppDispatch, useAppSelector } from '../../../store';
|
import { useAppDispatch, useAppSelector } from '../../../stores/store';
|
||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
import { navigationWidthActions } from '../../../redux/navigation-width/slice';
|
import { navigationWidthActions } from '../../../stores/reducers/navigation-width/slice';
|
||||||
|
|
||||||
export const NavigationResizer = () => {
|
export const NavigationResizer = () => {
|
||||||
const width = useAppSelector((state) => state.navigationWidth);
|
const width = useAppSelector((state) => state.navigationWidth);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { useAppDispatch } from '../../../store';
|
import { useAppDispatch } from '../../../stores/store';
|
||||||
import { foldersActions } from '../../../redux/folders/slice';
|
import { foldersActions } from '../../../stores/reducers/folders/slice';
|
||||||
import { nanoid } from 'nanoid';
|
import { nanoid } from 'nanoid';
|
||||||
|
|
||||||
export const useNewFolder = () => {
|
export const useNewFolder = () => {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { IPage, pagesActions } from '../../../redux/pages/slice';
|
import { IPage, pagesActions } from '../../../stores/reducers/pages/slice';
|
||||||
import { useAppDispatch } from '../../../store';
|
import { useAppDispatch } from '../../../stores/store';
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { nanoid } from 'nanoid';
|
import { nanoid } from 'nanoid';
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ import { BoardSvg } from '../../_shared/svg/BoardSvg';
|
|||||||
import { GridSvg } from '../../_shared/svg/GridSvg';
|
import { GridSvg } from '../../_shared/svg/GridSvg';
|
||||||
import { Details2Svg } from '../../_shared/svg/Details2Svg';
|
import { Details2Svg } from '../../_shared/svg/Details2Svg';
|
||||||
import { NavItemOptionsPopup } from './NavItemOptionsPopup';
|
import { NavItemOptionsPopup } from './NavItemOptionsPopup';
|
||||||
import { IPage } from '../../../redux/pages/slice';
|
import { IPage } from '../../../stores/reducers/pages/slice';
|
||||||
import { Button } from '../../_shared/Button';
|
import { Button } from '../../_shared/Button';
|
||||||
import { usePageEvents } from './PageItem.hooks';
|
import { usePageEvents } from './PageItem.hooks';
|
||||||
import { RenamePopup } from './RenamePopup';
|
import { RenamePopup } from './RenamePopup';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { useAppSelector } from '../../store';
|
import { useAppSelector } from '../../stores/store';
|
||||||
|
|
||||||
export const Workspace = () => {
|
export const Workspace = () => {
|
||||||
const currentUser = useAppSelector((state) => state.currentUser);
|
const currentUser = useAppSelector((state) => state.currentUser);
|
||||||
|
@ -8,7 +8,7 @@ export class UserNotificationParser extends NotificationParser<UserNotification>
|
|||||||
super(
|
super(
|
||||||
params.callback,
|
params.callback,
|
||||||
(ty) => {
|
(ty) => {
|
||||||
let notification = UserNotification[ty];
|
const notification = UserNotification[ty];
|
||||||
if (isUserNotification(notification)) {
|
if (isUserNotification(notification)) {
|
||||||
return UserNotification[notification];
|
return UserNotification[notification];
|
||||||
} else {
|
} else {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { FlowyError, UserNotification, UserProfilePB } from '../../../../../services/backend';
|
import { UserNotification, UserProfilePB } from '../../../../../services/backend';
|
||||||
import { AFNotificationListener, OnNotificationError } from '../../../../../services/backend/notifications';
|
import { AFNotificationListener, OnNotificationError } from '../../../../../services/backend/notifications';
|
||||||
import { UserNotificationParser } from './parser';
|
import { UserNotificationParser } from './parser';
|
||||||
|
|
||||||
@ -15,7 +15,7 @@ export class UserNotificationListener extends AFNotificationListener<UserNotific
|
|||||||
onProfileUpdate?: OnUserProfileUpdate;
|
onProfileUpdate?: OnUserProfileUpdate;
|
||||||
onError?: OnNotificationError;
|
onError?: OnNotificationError;
|
||||||
}) {
|
}) {
|
||||||
let parser = new UserNotificationParser({
|
const parser = new UserNotificationParser({
|
||||||
callback: (notification, payload) => {
|
callback: (notification, payload) => {
|
||||||
switch (notification) {
|
switch (notification) {
|
||||||
case UserNotification.DidUpdateUserProfile:
|
case UserNotification.DidUpdateUserProfile:
|
||||||
|
@ -1 +0,0 @@
|
|||||||
export {};
|
|
@ -1 +0,0 @@
|
|||||||
export {}
|
|
@ -1 +0,0 @@
|
|||||||
export {}
|
|
@ -1 +0,0 @@
|
|||||||
export {}
|
|
@ -1 +0,0 @@
|
|||||||
export {}
|
|
@ -1,5 +1,5 @@
|
|||||||
import { FolderNotification } from '../../../../services/backend';
|
import { FolderNotification } from '../../../../../services/backend';
|
||||||
import { NotificationParser, OnNotificationError } from '../../../../services/backend/notifications/parser';
|
import { NotificationParser, OnNotificationError } from '../../../../../services/backend/notifications';
|
||||||
|
|
||||||
declare type FolderNotificationCallback = (ty: FolderNotification, payload: Uint8Array) => void;
|
declare type FolderNotificationCallback = (ty: FolderNotification, payload: Uint8Array) => void;
|
||||||
|
|
||||||
@ -8,7 +8,7 @@ export class FolderNotificationParser extends NotificationParser<FolderNotificat
|
|||||||
super(
|
super(
|
||||||
params.callback,
|
params.callback,
|
||||||
(ty) => {
|
(ty) => {
|
||||||
let notification = FolderNotification[ty];
|
const notification = FolderNotification[ty];
|
||||||
if (isFolderNotification(notification)) {
|
if (isFolderNotification(notification)) {
|
||||||
return FolderNotification[notification];
|
return FolderNotification[notification];
|
||||||
} else {
|
} else {
|
@ -1,14 +1,14 @@
|
|||||||
import { DatabaseNotification } from "../../../../../services/backend";
|
import { DatabaseNotification } from '../../../../../services/backend';
|
||||||
import { NotificationParser, OnNotificationError } from "../../../../../services/backend/notifications/parser";
|
import { NotificationParser, OnNotificationError } from '../../../../../services/backend/notifications';
|
||||||
|
|
||||||
declare type DatabaseNotificationCallback = (ty: DatabaseNotification, payload: Uint8Array) => void;
|
declare type DatabaseNotificationCallback = (ty: DatabaseNotification, payload: Uint8Array) => void;
|
||||||
|
|
||||||
export class DatabaseNotificationParser extends NotificationParser<DatabaseNotification> {
|
export class DatabaseNotificationParser extends NotificationParser<DatabaseNotification> {
|
||||||
constructor(params: { id?: String; callback: DatabaseNotificationCallback; onError?: OnNotificationError }) {
|
constructor(params: { id?: string; callback: DatabaseNotificationCallback; onError?: OnNotificationError }) {
|
||||||
super(
|
super(
|
||||||
params.callback,
|
params.callback,
|
||||||
(ty) => {
|
(ty) => {
|
||||||
let notification = DatabaseNotification[ty];
|
const notification = DatabaseNotification[ty];
|
||||||
if (isDatabaseNotification(notification)) {
|
if (isDatabaseNotification(notification)) {
|
||||||
return DatabaseNotification[notification];
|
return DatabaseNotification[notification];
|
||||||
} else {
|
} else {
|
@ -1,6 +1,6 @@
|
|||||||
import { createSlice, PayloadAction } from '@reduxjs/toolkit';
|
import { createSlice, PayloadAction } from '@reduxjs/toolkit';
|
||||||
import { nanoid } from 'nanoid';
|
import { nanoid } from 'nanoid';
|
||||||
import { FieldType } from '../../../services/backend/classes/flowy-database/field_entities';
|
import { FieldType } from '../../../../services/backend/models/flowy-database/field_entities';
|
||||||
|
|
||||||
const initialState = {
|
const initialState = {
|
||||||
title: 'My plans on the week',
|
title: 'My plans on the week',
|
@ -7,11 +7,11 @@ import {
|
|||||||
ListenerEffectAPI,
|
ListenerEffectAPI,
|
||||||
addListener,
|
addListener,
|
||||||
} from '@reduxjs/toolkit';
|
} from '@reduxjs/toolkit';
|
||||||
import { foldersSlice } from './redux/folders/slice';
|
import { foldersSlice } from './reducers/folders/slice';
|
||||||
import { pagesSlice } from './redux/pages/slice';
|
import { pagesSlice } from './reducers/pages/slice';
|
||||||
import { navigationWidthSlice } from './redux/navigation-width/slice';
|
import { navigationWidthSlice } from './reducers/navigation-width/slice';
|
||||||
import { currentUserSlice } from './redux/current-user/slice';
|
import { currentUserSlice } from './reducers/current-user/slice';
|
||||||
import { gridSlice } from './redux/grid/slice';
|
import { gridSlice } from './reducers/grid/slice';
|
||||||
|
|
||||||
const listenerMiddlewareInstance = createListenerMiddleware({
|
const listenerMiddlewareInstance = createListenerMiddleware({
|
||||||
onError: () => console.error,
|
onError: () => console.error,
|
@ -1,6 +1,6 @@
|
|||||||
export * from "./classes/flowy-user";
|
export * from "./models/flowy-user";
|
||||||
export * from "./classes/flowy-document";
|
export * from "./models/flowy-document";
|
||||||
export * from "./classes/flowy-database";
|
export * from "./models/flowy-database";
|
||||||
export * from "./classes/flowy-folder";
|
export * from "./models/flowy-folder";
|
||||||
export * from "./classes/flowy-net";
|
export * from "./models/flowy-net";
|
||||||
export * from "./classes/flowy-error";
|
export * from "./models/flowy-error";
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { listen, UnlistenFn } from "@tauri-apps/api/event";
|
import { listen, UnlistenFn } from "@tauri-apps/api/event";
|
||||||
import { FlowyError } from "../classes/flowy-error";
|
import { FlowyError } from "../models/flowy-error";
|
||||||
import { SubscribeObject } from "../classes/flowy-notification";
|
import { SubscribeObject } from "../models/flowy-notification";
|
||||||
import { NotificationParser } from "./parser";
|
import { NotificationParser } from "./parser";
|
||||||
|
|
||||||
declare type OnError = (error: FlowyError) => void;
|
declare type OnError = (error: FlowyError) => void;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { Ok, Err, Result } from "ts-results/result";
|
import { Ok, Err, Result } from "ts-results/result";
|
||||||
import { FlowyError } from "../classes/flowy-error";
|
import { FlowyError } from "../models/flowy-error";
|
||||||
import { SubscribeObject } from "../classes/flowy-notification";
|
import { SubscribeObject } from "../models/flowy-notification";
|
||||||
|
|
||||||
export declare type OnNotificationPayload<T> = (ty: T, payload: Uint8Array) => void;
|
export declare type OnNotificationPayload<T> = (ty: T, payload: Uint8Array) => void;
|
||||||
export declare type OnNotificationError = (error: FlowyError) => void;
|
export declare type OnNotificationError = (error: FlowyError) => void;
|
||||||
|
@ -119,7 +119,7 @@ fn generate_ts_protobuf_files(
|
|||||||
let mut output = PathBuf::new();
|
let mut output = PathBuf::new();
|
||||||
output.push(root);
|
output.push(root);
|
||||||
output.push(tauri_backend_service_path);
|
output.push(tauri_backend_service_path);
|
||||||
output.push("classes");
|
output.push("models");
|
||||||
output.push(name);
|
output.push(name);
|
||||||
|
|
||||||
if !output.as_path().exists() {
|
if !output.as_path().exists() {
|
||||||
|
@ -81,7 +81,7 @@ pub fn gen(crate_name: &str) {
|
|||||||
Ok(ref mut file) => {
|
Ok(ref mut file) => {
|
||||||
let mut export = String::new();
|
let mut export = String::new();
|
||||||
export.push_str("// Auto-generated, do not edit \n");
|
export.push_str("// Auto-generated, do not edit \n");
|
||||||
export.push_str(&format!("export * from '../../classes/{}';\n", crate_name));
|
export.push_str(&format!("export * from '../../models/{}';\n", crate_name));
|
||||||
export.push_str(&format!("export * from './{}';\n", event_file));
|
export.push_str(&format!("export * from './{}';\n", event_file));
|
||||||
file.write_all(export.as_bytes()).unwrap();
|
file.write_all(export.as_bytes()).unwrap();
|
||||||
File::flush(file).unwrap();
|
File::flush(file).unwrap();
|
||||||
|
@ -27,7 +27,7 @@ run_task = { name = [
|
|||||||
[tasks.rm_tauri_generated_protobuf_files]
|
[tasks.rm_tauri_generated_protobuf_files]
|
||||||
private = true
|
private = true
|
||||||
script = ["""
|
script = ["""
|
||||||
protobuf_file_paths = glob_array ${TAURI_BACKEND_SERVICE_PATH}/classes
|
protobuf_file_paths = glob_array ${TAURI_BACKEND_SERVICE_PATH}/models
|
||||||
if not array_is_empty ${protobuf_file_paths}
|
if not array_is_empty ${protobuf_file_paths}
|
||||||
echo Remove generated protobuf files:
|
echo Remove generated protobuf files:
|
||||||
for path in ${protobuf_file_paths}
|
for path in ${protobuf_file_paths}
|
||||||
|
Loading…
Reference in New Issue
Block a user