Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dashboard directory interactivity #6279

Merged
merged 272 commits into from
Apr 26, 2023
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
272 commits
Select commit Hold shift + click to select a range
db34112
turn object into var
indiv0 Mar 8, 2023
c079567
add todo
indiv0 Mar 8, 2023
5267b5d
Merge branch 'develop' into wip/pb/cognito-auth-electron-logic
mergify[bot] Mar 8, 2023
ce661fb
Merge branch 'develop' into wip/pb/cognito-auth-electron-logic
mergify[bot] Mar 8, 2023
e8529b1
Merge branch 'develop' into wip/pb/cognito-auth-electron-logic
mergify[bot] Mar 9, 2023
cd23085
fix style
indiv0 Mar 9, 2023
605621f
Merge branch 'wip/pb/cognito-auth-electron-logic' into wip/pb/cognito…
indiv0 Mar 9, 2023
ee86a8f
fixes
indiv0 Mar 9, 2023
e52f51a
remove forgot password + reset password
indiv0 Mar 9, 2023
08a96d3
remove signout
indiv0 Mar 9, 2023
84721bc
remove setusername
indiv0 Mar 9, 2023
8e6f9c1
remove login
indiv0 Mar 9, 2023
02439c9
remove registration
indiv0 Mar 9, 2023
3be99a4
fix comments
indiv0 Mar 9, 2023
1d91672
re-enable flag
indiv0 Mar 9, 2023
2fd20f2
rename div
indiv0 Mar 9, 2023
72eb1c8
add comment
indiv0 Mar 9, 2023
28f6255
fix lints
indiv0 Mar 9, 2023
eb47968
remove tailwind conf
indiv0 Mar 9, 2023
b57b6f4
Revert "remove registration"
indiv0 Mar 9, 2023
242bca6
Revert "remove login"
indiv0 Mar 9, 2023
69ccb02
Revert "remove setusername"
indiv0 Mar 9, 2023
fb00988
Revert "remove signout"
indiv0 Mar 9, 2023
8164b5c
Revert "remove forgot password + reset password"
indiv0 Mar 9, 2023
d6e758d
Merge branch 'develop' into wip/pb/cognito-auth-authorization-app
indiv0 Mar 10, 2023
56faede
remove opener
indiv0 Mar 10, 2023
d9edad6
Merge branch 'wip/pb/cognito-auth-authorization-app' into wip/np/cogn…
indiv0 Mar 10, 2023
499f966
move opener
indiv0 Mar 10, 2023
22a9bbd
Merge branch 'wip/pb/cognito-auth-authorization-app' into HEAD
indiv0 Mar 10, 2023
d07cae2
tmp
indiv0 Mar 10, 2023
ccf3c77
prettier
indiv0 Mar 10, 2023
6918411
expand docs
indiv0 Mar 11, 2023
8e6b3c0
tmp
indiv0 Mar 11, 2023
aed6a99
replace react-scripts with craco
indiv0 Mar 11, 2023
5061b64
add tailwindcss
indiv0 Mar 11, 2023
acc3016
switch to brands
indiv0 Mar 11, 2023
ea28d5f
tmp
indiv0 Mar 11, 2023
d385d46
tmp
indiv0 Mar 11, 2023
371145a
Merge branch 'develop' into wip/pb/cognito-auth-authorization-app
indiv0 Mar 11, 2023
ccd4317
tmp
indiv0 Mar 11, 2023
c09f3b1
Merge branch 'wip/pb/cognito-auth-authorization-app' into wip/np/cogn…
indiv0 Mar 12, 2023
ecb17ca
fixmes
indiv0 Mar 12, 2023
00e942a
Merge branch 'wip/np/cognito-auth-3' into wip/np/cognito-auth-4
indiv0 Mar 12, 2023
ba173ab
fixmes
indiv0 Mar 12, 2023
513d158
Merge branch 'wip/np/cognito-auth-4' into wip/np/cognito-auth-5
indiv0 Mar 13, 2023
d492365
fixmes
indiv0 Mar 13, 2023
82b797c
Merge branch 'wip/np/cognito-auth-5' into wip/np/cognito-auth-6
indiv0 Mar 13, 2023
1cd2aca
fixmes
indiv0 Mar 13, 2023
5be815c
Merge branch 'wip/np/cognito-auth-6' into wip/np/cognito-auth-7
indiv0 Mar 13, 2023
6059b38
fixmes
indiv0 Mar 13, 2023
f07f7a2
fixes for e-hern's comments
indiv0 Mar 13, 2023
1b5865d
use abortcontroller
indiv0 Mar 13, 2023
e24f3b6
add docs
indiv0 Mar 14, 2023
ee6005c
fixes
indiv0 Mar 14, 2023
73ceec5
revert craco, fix windows build
indiv0 Mar 14, 2023
16d11f7
remove from gitignore
indiv0 Mar 14, 2023
3221cff
Merge branch 'develop' into wip/pb/cognito-auth-authorization-app
mergify[bot] Mar 14, 2023
00c1a09
Merge branch 'develop' into wip/pb/cognito-auth-authorization-app
mergify[bot] Mar 14, 2023
f2227d0
Merge branch 'develop' into wip/pb/cognito-auth-authorization-app
mergify[bot] Mar 14, 2023
de6f806
remove unnecessary check
indiv0 Mar 14, 2023
7fd698e
Merge branch 'wip/pb/cognito-auth-authorization-app' into wip/np/cogn…
indiv0 Mar 14, 2023
02875e9
tmp
indiv0 Mar 14, 2023
81bbd06
Merge branch 'wip/pb/cognito-auth-authorization-app' into wip/np/cogn…
indiv0 Mar 14, 2023
2424b70
augment window
indiv0 Mar 14, 2023
34fec71
tmptmp
indiv0 Mar 14, 2023
6b5828b
split errors back up
indiv0 Mar 15, 2023
6285608
tmp
indiv0 Mar 15, 2023
2413c0e
tmp
indiv0 Mar 15, 2023
abd0193
Merge branch 'develop' into wip/np/cognito-auth-3
indiv0 Mar 16, 2023
c376f81
prettier
indiv0 Mar 16, 2023
86f6302
fix
indiv0 Mar 16, 2023
bda03ad
Fix lints
somebody1234 Mar 16, 2023
dce2fb4
Prepare for addition for `as T` lint
somebody1234 Mar 16, 2023
328df11
Merge and fix lint errors
somebody1234 Mar 16, 2023
0124b66
Add lint for early returns
somebody1234 Mar 16, 2023
bd97f86
Merge and fix lint errors
somebody1234 Mar 16, 2023
9eb76fb
Merge branch 'wip/np/cognito-auth-5' into wip/np/cognito-auth-6
somebody1234 Mar 16, 2023
aa92dfc
Address review issues
somebody1234 Mar 16, 2023
c55a304
Merge branch 'wip/np/cognito-auth-6' into wip/np/cognito-auth-7
somebody1234 Mar 16, 2023
a6ab4d5
Fix lints
somebody1234 Mar 16, 2023
c282666
remove withrouter
indiv0 Mar 16, 2023
bdcdcac
Merge branch 'wip/np/cognito-auth-3' into wip/np/cognito-auth-4
indiv0 Mar 16, 2023
8b718ca
Merge branch 'wip/np/cognito-auth-4' into wip/np/cognito-auth-5
indiv0 Mar 16, 2023
43d91cb
Merge branch 'wip/np/cognito-auth-5' into wip/np/cognito-auth-6
indiv0 Mar 16, 2023
051837d
Merge branch 'wip/np/cognito-auth-6' into wip/np/cognito-auth-7
indiv0 Mar 16, 2023
f3ed113
Merge branch 'develop' into wip/np/cognito-auth-3
indiv0 Mar 16, 2023
bc547fe
Merge branch 'wip/np/cognito-auth-3' into wip/np/cognito-auth-4
indiv0 Mar 16, 2023
a45d6a6
Merge branch 'wip/np/cognito-auth-4' into wip/np/cognito-auth-5
indiv0 Mar 16, 2023
40ae63a
Merge branch 'wip/np/cognito-auth-5' into wip/np/cognito-auth-6
indiv0 Mar 16, 2023
4546e55
Merge branch 'wip/np/cognito-auth-6' into wip/np/cognito-auth-7
indiv0 Mar 16, 2023
1e75fc6
fix file length
indiv0 Mar 16, 2023
2a10340
fixes
indiv0 Mar 16, 2023
b9fecbb
fixes
indiv0 Mar 16, 2023
949f86b
Merge branch 'wip/np/cognito-auth-4' into wip/np/cognito-auth-5
indiv0 Mar 16, 2023
80c9162
Merge branch 'wip/np/cognito-auth-5' into wip/np/cognito-auth-6
indiv0 Mar 16, 2023
6446d02
Merge branch 'wip/np/cognito-auth-6' into wip/np/cognito-auth-7
indiv0 Mar 16, 2023
c6616f0
remove dashboard
indiv0 Mar 16, 2023
0d4f256
remove dashboard
indiv0 Mar 16, 2023
50bd5be
Merge branch 'wip/np/cognito-auth-5' into wip/np/cognito-auth-6
indiv0 Mar 16, 2023
652bab8
remove dashboard
indiv0 Mar 16, 2023
128bb9d
fix
indiv0 Mar 16, 2023
928d238
Merge branch 'wip/np/cognito-auth-6' into wip/np/cognito-auth-7
indiv0 Mar 16, 2023
f74115d
use switch
indiv0 Mar 16, 2023
f2b0050
prettier
indiv0 Mar 16, 2023
f768633
fixes
indiv0 Mar 16, 2023
57f874d
prettier
indiv0 Mar 16, 2023
c88e75d
fixes
indiv0 Mar 16, 2023
f79db09
Merge branch 'wip/np/cognito-auth-3' into wip/np/cognito-auth-4
indiv0 Mar 16, 2023
6015db4
run prettier
indiv0 Mar 16, 2023
7c0bac2
Merge branch 'wip/np/cognito-auth-4' into wip/np/cognito-auth-5
indiv0 Mar 16, 2023
966b448
Merge branch 'wip/np/cognito-auth-5' into wip/np/cognito-auth-6
indiv0 Mar 16, 2023
f2a6cc7
run prettier
indiv0 Mar 16, 2023
31ba9fe
Merge branch 'wip/np/cognito-auth-6' into wip/np/cognito-auth-7
indiv0 Mar 16, 2023
9e459e2
run prettier
indiv0 Mar 16, 2023
48b0013
fix main page url
indiv0 Mar 17, 2023
0bc678e
allow node.js debugging
indiv0 Mar 17, 2023
70ca541
fix lints
indiv0 Mar 17, 2023
f640235
change not equal
indiv0 Mar 17, 2023
385731e
prettier
indiv0 Mar 17, 2023
e63279e
Merge branch 'develop' into wip/np/cognito-auth-4
indiv0 Mar 17, 2023
3bccd10
Merge branch 'wip/np/cognito-auth-4' into wip/np/cognito-auth-5
indiv0 Mar 17, 2023
7f1a654
Merge branch 'wip/np/cognito-auth-5' into wip/np/cognito-auth-6
indiv0 Mar 17, 2023
65d86ca
Merge branch 'wip/np/cognito-auth-6' into wip/np/cognito-auth-7
indiv0 Mar 17, 2023
56bc594
Remove references to withRouter; fix lints
somebody1234 Mar 20, 2023
d84842e
Run prettier
somebody1234 Mar 20, 2023
f9f589d
Add cloud endpoints
somebody1234 Mar 20, 2023
4a16b33
Add JSON-RPC endpoints
somebody1234 Mar 20, 2023
013f7ba
Merge branch 'wip/somebody1234/rpc-endpoints-for-desktop-ide' into wi…
somebody1234 Mar 20, 2023
e59c61a
Add dashboard skeleton
somebody1234 Mar 20, 2023
5dabcc8
Add components and edit dashboard
somebody1234 Mar 20, 2023
4ee27ec
Run prettier
somebody1234 Mar 21, 2023
3d5a89f
(WIP) Add cloud endpoints
somebody1234 Mar 21, 2023
2eadb96
Add rpc endpoints
somebody1234 Mar 21, 2023
f595d63
Merge branch 'develop' into wip/somebody1234/cognito-auth-prettier
somebody1234 Mar 21, 2023
a7da373
Address review issues
somebody1234 Mar 21, 2023
f4d92e9
Formatting and minor fixes for `newtype.ts`
somebody1234 Mar 21, 2023
9612813
Address review issues
somebody1234 Mar 21, 2023
c5fcfda
Merge remote-tracking branch 'origin/wip/somebody1234/cloud-endpoints…
somebody1234 Mar 21, 2023
bf9e1dc
Rename `Brand` to `NewtypeVariant`
somebody1234 Mar 22, 2023
b1ee3d9
Rename `Brand` to `NewtypeVariant`
somebody1234 Mar 22, 2023
ee6d9dd
Fix formatting in `newtype.ts`
somebody1234 Mar 22, 2023
2d30f33
Switch dashboard to esbuild
somebody1234 Mar 22, 2023
85a17de
Minor fixes; move Tailwind generation into esbuild-config
somebody1234 Mar 22, 2023
fb7593b
Fix watching `content/` and `client/`
somebody1234 Mar 22, 2023
6c40780
Bump esbuild binary versions; minor dependency list fixes
somebody1234 Mar 22, 2023
5fe57eb
Merge branch 'wip/somebody1234/cloud-endpoints-for-frontend' into wip…
somebody1234 Mar 22, 2023
a760d2a
Add dashboard skeleton
somebody1234 Mar 20, 2023
8626351
Merge branch 'wip/somebody1234/dashboard-skeleton' into wip/somebody1…
somebody1234 Mar 22, 2023
39fbd43
Merge branch 'develop' into wip/somebody1234/cognito-auth-prettier
somebody1234 Mar 22, 2023
fc5e9de
Run prettier
somebody1234 Mar 22, 2023
7903c1d
Merge branch 'develop' into wip/somebody1234/esbuild-for-dashboard
somebody1234 Mar 22, 2023
abc038c
Merge branch 'develop' into wip/somebody1234/esbuild-for-dashboard
somebody1234 Mar 22, 2023
862cf1c
Fixes; rename "npm run dev" to "npm run watch-dashboard"
somebody1234 Mar 22, 2023
de9b576
Avoid writing esbuild outputs to disk for `dashboard/`
somebody1234 Mar 22, 2023
cebc42b
Convert watch-dashboard to be fully in-memory; rebuild css files on c…
somebody1234 Mar 22, 2023
2323427
Remove obsolete FIXME
somebody1234 Mar 22, 2023
ca60a0d
Merge branch 'develop' into wip/somebody1234/esbuild-for-dashboard
somebody1234 Mar 22, 2023
c68ec39
Remove unused constants
somebody1234 Mar 22, 2023
83555d8
Run prettier
somebody1234 Mar 22, 2023
461e1fa
Merge branch 'develop' into wip/somebody1234/esbuild-for-dashboard
somebody1234 Mar 22, 2023
d9eb3ea
add missing styles
PabloBuchu Mar 22, 2023
697a02a
Merge branch 'wip/pb/auth-fix-styling' into wip/somebody1234/esbuild-…
somebody1234 Mar 22, 2023
16195b0
Fixes
somebody1234 Mar 22, 2023
ce6eed5
Fix the fixes
somebody1234 Mar 22, 2023
8f7a691
Run prettier
somebody1234 Mar 22, 2023
f892f3d
Fixes; use nesting plugin to wrap tailwind preflight
somebody1234 Mar 23, 2023
1ae8bc3
Remove testing flag from client/watch
somebody1234 Mar 23, 2023
33fa88d
Minor fixes
somebody1234 Mar 23, 2023
d8bdf2a
Run prettier
somebody1234 Mar 23, 2023
7d328c8
Merge branch 'wip/somebody1234/esbuild-for-dashboard' into wip/somebo…
somebody1234 Mar 23, 2023
56da39a
Merge branch 'wip/somebody1234/dashboard-skeleton' into wip/somebody1…
somebody1234 Mar 23, 2023
40036dd
Export newtypes
somebody1234 Mar 23, 2023
779ef69
Make css rebuild when tailwind config changes
somebody1234 Mar 23, 2023
2655f6e
Fix endpoints
somebody1234 Mar 23, 2023
a768a84
Finish copying changes over
somebody1234 Mar 23, 2023
5e65610
Remove duplicate type definitions
somebody1234 Mar 23, 2023
6124e30
Fix bundling for dashboard
somebody1234 Mar 23, 2023
74d3c5f
Fix dashboard/bundle.ts erroring when build directory does not exist
somebody1234 Mar 23, 2023
20735db
Move CSS to Tailwind config
somebody1234 Mar 24, 2023
d611319
Run prettier
somebody1234 Mar 24, 2023
093a3b4
Update endpoints
somebody1234 Mar 24, 2023
10d2c13
Merge branch 'wip/somebody1234/cloud-endpoints-for-frontend' into wip…
somebody1234 Mar 24, 2023
79f54bd
Merge branch 'wip/somebody1234/dashboard-skeleton' into wip/somebody1…
somebody1234 Mar 24, 2023
5d83374
Fix esbuild binary package names
somebody1234 Mar 24, 2023
bba8791
Remove redundant "npx" prefix from build scripts
somebody1234 Mar 24, 2023
030e76b
Remove unused dependency
somebody1234 Mar 24, 2023
d2022df
Begin adding interactivity
somebody1234 Mar 24, 2023
8659ea6
Merge branch 'develop' into wip/somebody1234/esbuild-for-dashboard
PabloBuchu Mar 27, 2023
267d6b6
workaround for mac freeze
PabloBuchu Mar 27, 2023
4f58016
Merge branch 'develop' into wip/somebody1234/esbuild-for-dashboard
PabloBuchu Mar 27, 2023
13eb67c
Fix modal bugs
somebody1234 Mar 27, 2023
68c3ccf
Merge branch 'wip/somebody1234/esbuild-for-dashboard' into wip/somebo…
somebody1234 Mar 28, 2023
cc6a0a1
Merge branch 'wip/somebody1234/cognito-auth-prettier' into wip/somebo…
somebody1234 Mar 28, 2023
f63bc66
Merge branch 'wip/somebody1234/cognito-auth-prettier' into wip/somebo…
somebody1234 Mar 28, 2023
cc9f915
Begin implementing forms, split forms and modals into new files
somebody1234 Mar 28, 2023
4f4741e
Get form UI working
somebody1234 Mar 28, 2023
403b8b4
Merge branch 'develop' into wip/somebody1234/esbuild-for-dashboard
PabloBuchu Mar 29, 2023
8727494
add missing sections
PabloBuchu Mar 29, 2023
34327f9
Minor fixes, save current directory to localStorage
somebody1234 Mar 29, 2023
24c6b10
Fixes for drop-to-upload
somebody1234 Mar 29, 2023
91b95d8
Address review issue
somebody1234 Mar 29, 2023
0d764c6
Merge branch 'develop' into wip/somebody1234/esbuild-for-dashboard
somebody1234 Mar 29, 2023
8681348
Fix prettier config; run prettier
somebody1234 Mar 29, 2023
642fd32
Fix live-reload of `npm run watch-dashboard`
somebody1234 Mar 29, 2023
a1dc091
(WIP)
somebody1234 Mar 29, 2023
d907004
Fix service worker for client-side routing
somebody1234 Mar 29, 2023
d47fb30
Add close button to asset creation forms; fix saving directory to loc…
somebody1234 Mar 29, 2023
2cc9cc8
Remove workaround for backend bug when listing directories
somebody1234 Mar 29, 2023
7ab0ea4
Fix drop-to-upload
somebody1234 Mar 30, 2023
71660a2
Merge branch 'wip/somebody1234/esbuild-for-dashboard' into wip/somebo…
somebody1234 Mar 30, 2023
fafafc6
Merge branch 'wip/sb/prettier' into wip/somebody1234/cloud-endpoints-…
somebody1234 Mar 30, 2023
25ac827
Merge branch 'wip/somebody1234/esbuild-for-dashboard' into wip/somebo…
somebody1234 Mar 30, 2023
fe57e00
Merge branch 'wip/sb/prettier' into wip/somebody1234/rpc-endpoints-fo…
somebody1234 Mar 30, 2023
d204840
Merge branch 'wip/somebody1234/rpc-endpoints-for-desktop-ide' into wi…
somebody1234 Mar 30, 2023
d0d180d
Merge branch 'wip/somebody1234/cloud-endpoints-for-frontend' into wip…
somebody1234 Mar 30, 2023
0414667
Merge branch 'wip/somebody1234/dashboard-skeleton' into wip/somebody1…
somebody1234 Mar 30, 2023
70c8f23
Fix sizing
somebody1234 Mar 30, 2023
8949165
Fix spacing, add fixed paths
somebody1234 Mar 30, 2023
5761102
WIP: fix toast notification styles, begin adding context menu
somebody1234 Mar 30, 2023
4debdbd
WIP: Add context menu, minor fixes
somebody1234 Mar 31, 2023
f340984
Merge branch 'wip/somebody1234/dashboard-directory-view' into wip/som…
somebody1234 Mar 31, 2023
03c3cef
Fix authentication on desktop IDE
somebody1234 Mar 31, 2023
8e2ba22
Merge branch 'wip/somebody1234/dashboard-directory-view' into wip/som…
somebody1234 Mar 31, 2023
39d40ee
Allow unused locals and parameters in tsconfig.json
somebody1234 Mar 31, 2023
238b22d
Run prettier
somebody1234 Mar 31, 2023
8357138
Merge branch 'wip/somebody1234/dashboard-directory-view' into wip/som…
somebody1234 Mar 31, 2023
9198107
Fix TypeScript errors
somebody1234 Mar 31, 2023
24fb8d4
Merge branch 'wip/somebody1234/dashboard-directory-view' into wip/som…
somebody1234 Mar 31, 2023
3f7073c
Fix modals; minor refactor
somebody1234 Apr 3, 2023
63a6947
Implement context menus for labels; fixes
somebody1234 Apr 3, 2023
fe2763f
Add modal provider and switch all modals to provider; fixes
somebody1234 Apr 5, 2023
8c35a4b
Fix modals and user icon size
somebody1234 Apr 7, 2023
5f59cb4
Fixes
somebody1234 Apr 10, 2023
8f7ce0c
Merge branch 'develop' into wip/somebody1234/dashboard-directory-inte…
somebody1234 Apr 14, 2023
8bbf12c
Remove obsolete files from incorrect merge
somebody1234 Apr 14, 2023
41fe420
Merge branch 'develop' into wip/somebody1234/dashboard-directory-inte…
somebody1234 Apr 15, 2023
8fc047e
Address review issues
somebody1234 Apr 15, 2023
7aad978
Fix type error
somebody1234 Apr 15, 2023
ea855f2
Merge branch 'develop' into wip/somebody1234/dashboard-directory-inte…
somebody1234 Apr 17, 2023
99a4d11
Stop removing `#root`
somebody1234 Apr 19, 2023
db12239
Fixes for cloud
somebody1234 Apr 19, 2023
e167b1a
Implement search on frontend side
somebody1234 Apr 21, 2023
e23a890
Fix race condition related to `directoryId`
somebody1234 Apr 21, 2023
5339d9f
Merge branch 'develop' into wip/somebody1234/dashboard-directory-inte…
somebody1234 Apr 21, 2023
cd20a40
Hide directories, files and secrets tables on desktop IDE
somebody1234 Apr 24, 2023
7e98831
Merge branch 'develop' into wip/somebody1234/dashboard-directory-inte…
somebody1234 Apr 25, 2023
dd42486
Fix lint errors
somebody1234 Apr 25, 2023
a6673ba
Properly update visible projects when a project is created
somebody1234 Apr 26, 2023
5eee25e
Pass directory id to create project
somebody1234 Apr 26, 2023
f7d342d
Hide column display switcher; remove placeholder column data
somebody1234 Apr 26, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/ide-desktop/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ export default [
},
],
'@typescript-eslint/no-confusing-void-expression': 'error',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-extraneous-class': 'error',
'@typescript-eslint/no-invalid-void-type': ['error', { allowAsThisParameter: true }],
// React 17 and later supports async functions as event handlers, so we need to disable this
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import * as router from 'react-router-dom'
import * as app from '../../components/app'
import * as auth from '../providers/auth'
import * as svg from '../../components/svg'

import Input from './input'
import SvgIcon from './svgIcon'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import * as fontawesomeIcons from '@fortawesome/free-brands-svg-icons'
import * as app from '../../components/app'
import * as auth from '../providers/auth'
import * as svg from '../../components/svg'

import FontAwesomeIcon from './fontAwesomeIcon'
import Input from './input'
import SvgIcon from './svgIcon'
Expand All @@ -15,9 +16,6 @@ import SvgIcon from './svgIcon'
// === Constants ===
// =================

const BUTTON_CLASS_NAME =
'relative mt-6 border rounded-md py-2 text-sm text-gray-800 bg-gray-100 hover:bg-gray-200'

const LOGIN_QUERY_PARAMS = {
email: 'email',
} as const
Expand Down Expand Up @@ -51,7 +49,7 @@ function Login() {
event.preventDefault()
await signInWithGoogle()
}}
className={BUTTON_CLASS_NAME}
className="relative mt-6 border rounded-md py-2 text-sm text-gray-800 bg-gray-100 hover:bg-gray-200"
>
<FontAwesomeIcon icon={fontawesomeIcons.faGithub} />
<span>Login with Google</span>
Expand All @@ -61,7 +59,7 @@ function Login() {
event.preventDefault()
await signInWithGitHub()
}}
className={BUTTON_CLASS_NAME}
className="relative mt-6 border rounded-md py-2 text-sm text-gray-800 bg-gray-100 hover:bg-gray-200"
>
<FontAwesomeIcon icon={fontawesomeIcons.faGithub} />
<span>Login with Github</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,31 +48,12 @@ interface SessionProviderProps {
export function SessionProvider(props: SessionProviderProps) {
const { mainPageUrl, children, userSession, registerAuthEventListener } = props

const [refresh, doRefresh] = hooks.useRefresh()

/** Flag used to avoid rendering child components until we've fetched the user's session at least
* once. Avoids flash of the login screen when the user is already logged in. */
const [initialized, setInitialized] = react.useState(false)

/** Produces a new object every time.
* This is not equal to any other empty object because objects are compared by reference.
* Because it is not equal to the old value, React re-renders the component. */
function newRefresh() {
return {}
}

/** State that, when set, forces a refresh of the user session. This is useful when a
* user has just logged in (so their cached credentials are out of date). Should be used via the
* `refreshSession` function. */
const [refresh, setRefresh] = react.useState(newRefresh())

/** Forces a refresh of the user session.
*
* Should be called after any operation that **will** (not **might**) change the user's session.
* For example, this should be called after signing out. Calling this will result in a re-render
* of the whole page, which is why it should only be done when necessary. */
const refreshSession = () => {
setRefresh(newRefresh())
}

/** Register an async effect that will fetch the user's session whenever the `refresh` state is
* incremented. This is useful when a user has just logged in (as their cached credentials are
* out of date, so this will update them). */
Expand All @@ -83,7 +64,7 @@ export function SessionProvider(props: SessionProviderProps) {
setInitialized(true)
return innerSession
},
[refresh, userSession]
[userSession, refresh]
)

/** Register an effect that will listen for authentication events. When the event occurs, we
Expand All @@ -97,7 +78,7 @@ export function SessionProvider(props: SessionProviderProps) {
switch (event) {
case listen.AuthEvent.signIn:
case listen.AuthEvent.signOut: {
refreshSession()
doRefresh()
break
}
case listen.AuthEvent.customOAuthState:
Expand All @@ -110,7 +91,7 @@ export function SessionProvider(props: SessionProviderProps) {
* See:
* https://github.com/aws-amplify/amplify-js/issues/3391#issuecomment-756473970 */
window.history.replaceState({}, '', mainPageUrl)
refreshSession()
doRefresh()
break
}
default: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export const SECRET_ICON = (
<path
d="M10.3 13a4 4 0 1 1 0-2h10a1 1 0 0 1 1 1v3a1 1 0 0 1-2 0v-2h-2v2a1 1 0 0 1-2 0v-2ZM3.5 12a1 1 0 1 1 2 0a1 1 0 1 1-2 0"
fill="currentColor"
fill-rule="evenodd"
fillRule="evenodd"
/>
</svg>
)
Expand Down Expand Up @@ -164,6 +164,16 @@ export const ARROW_UP_ICON = (
</svg>
)

export const ADD_ICON = (
<svg width={18} height={18} viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx={12} cy={12} r={12} fill="currentColor" fillOpacity={0.1} />
<g opacity={0.66}>
<rect x={11} y={6} width={2} height={12} fill="currentColor" />
<rect x={6} y={11} width={12} height={2} fill="currentColor" />
</g>
</svg>
)

/** Icon with three bars. */
export const BARS_ICON = (
<svg width={16} height={16} viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
Expand All @@ -181,7 +191,7 @@ export const MAGNIFYING_GLASS_ICON = (
d="M11.4142 10L15.6569 14.2426L14.2426 15.6569L10 11.4142L11.4142 10Z"
fill="currentColor"
/>
<circle cx={7} cy={7} r={5} stroke="currentColor" stroke-width={2} />
<circle cx={7} cy={7} r={5} stroke="currentColor" strokeWidth={2} />
</g>
</svg>
)
Expand All @@ -194,6 +204,16 @@ export const SPEECH_BUBBLE_ICON = (
</svg>
)

export const CLOSE_ICON = (
<svg width={18} height={18} viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx={12} cy={12} r={12} fill="currentColor" fillOpacity={0.1} />
<g opacity={0.66} transform="rotate(45 12 12)">
<rect x={11} y={6} width={2} height={12} fill="currentColor" />
<rect x={6} y={11} width={12} height={2} fill="currentColor" />
</g>
</svg>
)

// ===========
// === Svg ===
// ===========
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/** @file Modal for confirming delete of any type of asset. */
import toast from 'react-hot-toast'

import * as modalProvider from '../../providers/modal'
import * as svg from '../../components/svg'

import Modal from './modal'

// =================
// === Component ===
// =================

export interface ConfirmDeleteModalProps {
assetType: string
name: string
doDelete: () => Promise<void>
onSuccess: () => void
}

function ConfirmDeleteModal(props: ConfirmDeleteModalProps) {
const { assetType, name, doDelete, onSuccess } = props
const { unsetModal } = modalProvider.useSetModal()
return (
<Modal className="bg-opacity-90">
<form
className="relative bg-white shadow-soft rounded-lg w-96 p-2"
onClick={event => {
event.stopPropagation()
}}
>
<button type="button" className="absolute right-0 top-0 m-2" onClick={unsetModal}>
{svg.CLOSE_ICON}
</button>
Are you sure you want to delete the {assetType} '{name}'?
<div className="m-1">
<div
className="hover:cursor-pointer inline-block text-white bg-red-500 rounded-full px-4 py-1 m-1"
onClick={async () => {
unsetModal()
await toast.promise(doDelete(), {
loading: `Deleting ${assetType}...`,
success: `Deleted ${assetType}.`,
error: `Could not delete ${assetType}.`,
})
onSuccess()
}}
>
Delete
</div>
<div
className="hover:cursor-pointer inline-block bg-gray-200 rounded-full px-4 py-1 m-1"
onClick={unsetModal}
>
Cancel
</div>
</div>
</form>
</Modal>
)
}

export default ConfirmDeleteModal
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/** @file A context menu. */

import * as react from 'react'

// =================
// === Component ===
// =================

export interface ContextMenuProps {
// `left: number` and `top: number` may be more correct,
// however passing an event eliminates the chance
// of passing the wrong coordinates from the event.
event: react.MouseEvent
}

function ContextMenu(props: react.PropsWithChildren<ContextMenuProps>) {
const { children, event } = props
return (
<div
style={{ left: event.pageX, top: event.pageY }}
className="absolute bg-white rounded-lg shadow-soft flex flex-col flex-nowrap"
>
{children}
</div>
)
}

export default ContextMenu
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/** @file An entry in a context menu. */

import * as react from 'react'

export interface ContextMenuEntryProps {
disabled?: boolean
onClick: (event: react.MouseEvent<HTMLButtonElement>) => void
}

// This component MUST NOT use `useState` because it is not rendered directly.
function ContextMenuEntry(props: react.PropsWithChildren<ContextMenuEntryProps>) {
const { children, disabled, onClick } = props
return (
<button
disabled={disabled}
className={`${
disabled ? 'opacity-50' : ''
} p-1 hover:bg-gray-200 first:rounded-t-lg last:rounded-b-lg text-left`}
onClick={event => {
event.stopPropagation()
onClick(event)
}}
>
{children}
</button>
)
}

export default ContextMenuEntry
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/** @file Base form to create an asset.
* This should never be used directly, but instead should be wrapped in a component
* that creates a specific asset type. */

import * as react from 'react'

import * as modalProvider from '../../providers/modal'
import * as svg from '../../components/svg'

import Modal from './modal'

/** The props that should also be in the wrapper component. */
export interface CreateFormPassthroughProps {
left: number
top: number
}

/** `CreateFormPassthroughProps`, plus props that should be defined in the wrapper component. */
export interface CreateFormProps extends CreateFormPassthroughProps, react.PropsWithChildren {
title: string
onSubmit: (event: react.FormEvent) => Promise<void>
}

function CreateForm(props: CreateFormProps) {
const { title, left, top, children, onSubmit: wrapperOnSubmit } = props
const { unsetModal } = modalProvider.useSetModal()

async function onSubmit(event: react.FormEvent) {
event.preventDefault()
await wrapperOnSubmit(event)
}

return (
<Modal className="bg-opacity-25">
<form
style={{ left, top }}
className="absolute bg-white shadow-soft rounded-lg w-60"
onSubmit={onSubmit}
onClick={event => {
event.stopPropagation()
}}
>
<button type="button" className="absolute right-0 m-2" onClick={unsetModal}>
{svg.CLOSE_ICON}
</button>
<h2 className="inline-block font-semibold m-2">{title}</h2>
{children}
<input
type="submit"
className="hover:cursor-pointer inline-block text-white bg-blue-600 rounded-full px-4 py-1 m-2"
value="Create"
/>
</form>
</Modal>
)
}

export default CreateForm
Loading