Commit Graph

62 Commits

Author SHA1 Message Date
Sergei Garin
2ed83f2fb5
Send Payment method id in checkout session (#9932) 2024-05-13 13:43:34 +00:00
Sergei Garin
9f4b374485
Implement Subscribe flow (#9776) 2024-05-10 12:28:49 +00:00
Sergei Garin
077b6547a9
Fix Invite flow (#9890) 2024-05-08 18:07:32 +03:00
somebody1234
25d1007a9e
Allow downloading projects on GUI dev server (#9851)
- Fixes #9482
- Add URL rewriting logic to `npm run dev` in `app/gui2/` so that "download" actions work

# Important Notes
- ⚠️ `config.yaml` HAS BEEN REMOVED in favor of `config.json`.
- Most of the keys have been removed as they were only used by GUI1.
- This is a REQUIRED change, because the vite dev server does not seem to like importing yaml files when running `vite.config.ts`.
2024-05-03 13:37:26 +00:00
somebody1234
9cf4847a34
Keyboard navigation between components (#9499)
- Close https://github.com/enso-org/cloud-v2/issues/982
- Add keyboard navigation via arrows between different components
- This is achieved by a `Navigator2D` class which keeps track of the closest adjacent elements.

Other changes:
- Switch much of the codebase to use `react-aria-components`
- This *should* (but does not necessarily) give us improved accessibility for free.
- Refactor various common styles into styled components
- `FocusArea` to perform automatic registration with `Navigator2D`
- `Button` and `UnstyledButton` to let buttons participate in keyboard navigation
- `HorizontalMenuBar` - used for buttons below the titles in the Drive page, Keyboard Shortcuts settings page, and Members List settings page
- `SettingsPage` in the settings pages
- `SettingsSection` in the settings page to wrap around `FocusArea` and the heading for each section
- Add debugging utilities
- Add debugging when `body` has the `data-debug` attribute: `document.body.dataset.debug = ''`
- This adds rings around elements (all with different colors):
- That are `FocusArea`s. `FocusArea` is a wrapper component that makes an element participate in `Navigator2D`.
- That are `:focus`ed, and that are `:focus-visible`
- That are `.focus-child`. This is because keyboard navigation via arrows ***ignores*** all focusable elements that are not `.focus-child`.
- Debug `Navigator2D` neighbors when `body` has the `debug-navigator2d` attribute: `document.body.dataset.debugNavigator2d = ''`
- This highlights neighbors of the currently focused element. This is a separate debug option because computing neighbors is potentially quite expensive.

# Important Notes
- ⚠️ Modals and the authentication flow are not yet fully tested.
- Up+Down to navigate through suggestions has been disabled to improve UX when accidentally navigating upwards to the assets search bar.
- There are a number of *known* issues with keyboard navigation. For the most part it's because a proper solution will be quite difficult.
- Focus is lost when a column (from the extra columns selector) is toggled - because the button stops existing
- It's not possible to navigate to the icons on the assets table - so it's current not possible to *hide* columns via the keyboard
- Neighbors of the extra columns selector are not ideal (both when it is being navigated from, and when it is being navigated to)
- The suggestions in the `AssetSearchBar` aren't *quite* fully integrated with arrow keyboard navigation.
- This is *semi*-intentional. I think it makes a lot more sense to integrate them in, *however* it stays like this for now largely because I think pressing `ArrowUp` then `ArrowDown` from the assets table should return to the assets table
- Likewise for the assets table. The reason here, however, is because we want multi-select. While `react-aria-components` has lists which support multi-select, it doesn't allow programmatic focus control, making it not particularly ideal, as we want to focus the topmost element when navigating in from above.
- Clicking on the "New Folder" icon (and the like) do not focus on the newly created child. This one should be pretty easy to do, but I'm not sure whether it's the right thing to do.
2024-04-05 07:21:02 +00:00
somebody1234
770e18768a
Move all user-facing text to a central location (#8831)
- Closes https://github.com/enso-org/cloud-v2/issues/861
- Adds a `getText` function and React Context to abstract away all text that is shown to users

The main immediate benefit is making all text much more discoverable - both being able to know of every piece of text used across the entire application, and making it a lot easier to refactor certain strings when needed rather than having to hunt for strings to replace (and potentially miss one).

The longer term benefit is that this will make it easy to add localization, by simply adding another JSON file with the same keys as the existing one, and adding a little bit of logic.

# Important Notes
None
2024-03-25 08:13:24 +00:00
Sergei Garin
7c3e316239
Diff editor (#9458)
Closes  enso-org/cloud#940
2024-03-23 18:44:56 +00:00
Sergei Garin
80e2d68cda
Loose tailwind rules for eslint (#9496) 2024-03-21 09:53:34 +04:00
somebody1234
4379df7c2d
"Activity log" settings page (#9311)
- Close https://github.com/enso-org/cloud-v2/issues/942
- Add "Activity log" settings page
- Show info common between all events
- Specific event info NOT added yet as the appropriate info is currently lacking
- Add support for multi-select in dropdowns (required for the "Activity log" settings page)
- Animate opening of dropdowns

# Important Notes
None
2024-03-19 06:17:28 +00:00
somebody1234
87291d5e6c
Fix dashboard bugs (#9378)
- Fix https://github.com/enso-org/cloud-v2/issues/979
- Close https://github.com/enso-org/cloud-v2/issues/946
- Fix https://github.com/enso-org/cloud-v2/issues/974

# Important Notes
None
2024-03-14 20:01:49 +00:00
somebody1234
2ec7817068
Refactor CSS; address some design issues (#9260)
- Implement https://github.com/enso-org/cloud-v2/issues/924
- Refactor all numbers out to CSS variables
- Implement some issues raised in the design meeting
- The columns selector now only contains *hidden* columns, rather than all of them.
- Unified opacity for active (100%), selectable and hovered (75%), selectable (50%) and disabled (30%)
- Easily configurable if we want to change it in the future, so the specific values don't matter too much for now.
- Always show asset right panel if it is enabled - display placeholder text if <1 or >1 asset is selected
- Hide docs icon that was in the top right assets menubar (next to the gear icon for asset settings) (as backend functionality has yet to be implemented)
- Clicking a user in the "Shared with" column now adds them to the search as `owner:<username>`
- Add a gap between adjacent rows. This makes each row more visually distinct when many rows are selected
- Center the left column (the first column) of the context menu below the mouse, rather than centering the entire context menu.
- Fix regressions caused by CSS refactor
- Make keyboard selection indicator for asset rows rounded again
- Other misc. fixes and improvements
- Slightly modified styling of chat reaction bar
- Hide the row containing the "New Project" button in the cloud drive, when not in the "Home" drive tab
- Animate rotation of column sort arrow when clicking on a column to change the sort order
- Consistent duration of arrow rotation animation for folder arrows, column sort arrows, chat thread list arrows
- Consistent icon for sort arrow for folders and the chat thread list
- Minor adjustment of styles for optional properties in the Data Link input

Not included in this PR:
- Custom (HTML) scrollbars for consistency across all browsers and all OSes (except perhaps touchscreens)
- Potentially time-consuming to look for a library (and not quite trivial to implement ourselves)
- Columns sliding left as they expand and right as they collapse
- Also non-trivial, especially when taking into account horizontal scrolling.
- Fixing styles to closer resemble Figma design
- As (kinda) mentioned in the meeting - ideally it should be pixel perfect, *but* value consistency with other spacings, opacities etc. over being 100% pixel-perfect
- However, it has *partly* been done - mostly for the home page. It's entirely possible that changes made afterwards broke the spacing again though.

# Important Notes
None
2024-03-13 10:32:05 +00:00
somebody1234
d2f6b1026a
Refactor configuration keys out of repository (#8895)
- Close https://github.com/enso-org/cloud-v2/issues/866
- Remove *all* references to client keys and API base URLs from the codebase.
- The app can still be built by external contributors. *However*, the cloud backend (among some other things) will be completely disabled, as the required keys and base URLs will be missing.
- Add entry to `.gitignore` to allow `*.env` files in `app/ide-desktop/lib/dashboard/`

# Important Notes
- Tested (no `.env`; `.env` with prod backend; `.pbuchu.env`) on:
- `npm run dev` in `app/ide-desktop/lib/dashboard/`
- `./run ide build`
- `./run ide2 build`
- `./run gui watch`
2024-03-08 03:14:26 +00:00
Adam Obuchowicz
ba9b7f199a
E2E test fixing and bring back reports (#9238)
After investigating some errors, I found another two missing awaits in our tests. Because those are so easy to overlook, I added a lint rule which makes failure on unhandled promise (for e2e tests only).

Also, enabled HTML reports again, with traces this time, to enable closer investigation of any failure in the future. @mwu-tow added code for uploading them in GH.
2024-03-05 07:06:11 +00:00
somebody1234
0a28d91d35
Switch to AJV for validating JSON Schema (#9191)
As ~~requested~~ suggested by @radeusgd

# Important Notes
None
2024-02-29 10:36:47 +00:00
somebody1234
4e8f066ec0
Use backend errors in toast notifications (#9078)
Adds the `message` returned by the backend to the toast notification, so that the user gets a more detailed error message.

# Important Notes
- Not sure what's the best way to properly test this, as for a lot of the backend endpoints there is no easy way to (even intentionally) trigger them from the frontend, because the frontend does a decent amount of validation as well.
2024-02-26 14:51:44 +00:00
somebody1234
784d06912f
Make (almost) all interfaces readonly (#8800)
This is not strictly necessary (as indicated by the fact that no actual logic needed to be changed), but it doesn't hurt to make this change.
- Make (almost) all `interface`s `readonly`
- Some of them are *not* readonly; this is intentional as those *do* need to be mutated
- A `no-restricted-syntax` lint rule has been added, but only for `interfaces` - it has been added neither for `classes` nor for `readonly T[]`
- A lint rule for `extends React.PropsWithChildren` instead of `extends Readonly<React.PropsWithChildren>` would be easy to add though...

# Important Notes
- There should be no logic changes, so QA shouldn't need to test anything in particular.
2024-02-07 11:26:59 +00:00
somebody1234
41c7b5afb4
Version panel (#8746)
- Closes https://github.com/enso-org/cloud-v2/issues/784
- Add version panel

# Important Notes
- The backend sends an `isLatest` field in the response, but this is currently *not* shown in the UI because I think it isn't particularly useful.
- Versions are displayed in descending order (most recent first)
- Versions have hover effects, but there is not yet any relevant behavior that can be triggered on click.
- The versions breadcrumbs control displays the version number in the Figma design, however it is not yet returned by the cloud backend (and should ideally not take an extra request)
2024-02-01 08:47:43 +00:00
somebody1234
cbf6d41e4c
More E2E tests; export default classes from modules (#8730)
This is a prerequisite for adding a CI action for E2E tests.

- Fix E2E tests
- Remove visual regression testing (VRT) and associated fixtures (screenshots) for now
- Switch dashboard almost fully to Vite, from ESBuild, to match GUI2's build tooling.
- Add some new E2E tests:
- Creating assets
- Deleting assets
- Creating assets from the samples on the home page
- Sort assets
- Includes fixes for sorting:
- Group sorted assets by type again (regression) (see https://github.com/enso-org/cloud-v2/issues/554)
- Make sorting by title, case insensitive. This is because it is more intuitive for non-programmers if all items with uppercase names *aren't* separated from those with lowercase names - especially since the Windows FS is case-insensitive.
- Normalization of Unicode letters is *not* currently being done. It can potentially be added later.
- Double-clicking *anywhere* on a directory row now expands it. Previously it was only being expanded when double clicking
- Add recursive label adding/removal to mirror backend
- Note: The current implementation is not exactly the same as the backend's implementation.
- Fix https://github.com/enso-org/cloud-v2/issues/872
- Unset "saved project details" (for opening the last open project) if fetching it produces an error.

# Important Notes
- All tests pass. (run `npm run test:e2e` in `app/ide-desktop/lib/dashboard`)
- All `npm` commands should be run in `app/ide-desktop/lib/dashboard`. `dashboard:*` npm scripts have been removed from `app/ide-desktop` to prevent a mess.
- `npm run dev` confirmed to still work. Note that it has not been changed as it was already using Vite.
- `npm run build` now uses `vite build`. This has been tested using a local HTTP server that supports `404.html`.
- Other cases have been tested:
- `npm run test:e2e` works (all tests pass)
- `./run ide build` works
- `./run ide watch` works
- `./run ide2 build` works
- `./run gui watch` works
2024-01-31 11:35:41 +00:00
somebody1234
899f7e4e61
Fix offline detection (#8829)
- Closes https://github.com/enso-org/cloud-v2/issues/860

# Important Notes
None
2024-01-25 06:36:03 +00:00
somebody1234
8597de1d43
Re-organize lib/dashboard/ (#8587)
- Significantly flattens directory structure of `lib/dashboard/`

# Important Notes
- Basic testing done on:
- dashboard's `npm run dev` which (since quite recently) uses Vite.
- specifically: `npm run dev` in `app/ide-desktop/lib/dashboard`, OR `npm run dashboard:dev` in `app/ide-desktop`
- dashboard's bundle script (`npm run build`) which uses ESBuild.
- GUI2's own entry point (GUI2's `npm run dev`).
- `./run ide build`
- `./run ide watch`
- `./run ide2 build`
- `./run gui watch`
2024-01-10 16:22:11 +00:00
somebody1234
496822b564
Add button to toggle whether passwords are visible (#8414)
- Closes https://github.com/enso-org/cloud-v2/issues/785

# Important Notes
- Added to (and hence should be tested on):
- Login screen
- Registration screen
- "Change password" modal
- Reset password screen
2023-12-06 07:50:44 +00:00
somebody1234
405f4be605
Project Description/Settings sidebar (#7612)
- Closes https://github.com/enso-org/cloud-v2/issues/629
- Project Description/Settings sidebar

# Important Notes
⚠️ This is blocked by backend support for asset descriptions.

When the sidebar is opening, there is one jumpy animation:
- The search bar switches from being centered in the screen, to having an equal gap between itself and its siblings
2023-11-30 12:40:01 +00:00
somebody1234
3c31155fe9
Dashboard tests (#7656)
- Implements https://github.com/enso-org/cloud-v2/issues/631
- Tests for dashboard (`app/ide-desktop/lib/dashboard/`):
- End-to-end tests
- Unit tests
- Component tests

The purpose of this PR is to introduce the testing framework - more tests can be added later in separate PRs.

# Important Notes
To test, run `npm run test` in `app/ide-desktop`, or `app/ide-desktop/lib/dashboard/`. All tests should pass.

Individual test types can be run using `npm run test-unit`, `npm run test-component` and `npm run test-e2e` in `app/ide-desktop/lib/dashboard/`.
Individual end-to-end tests can be run using `npx playwright test -c playwright-e2e.config.ts test-e2e/<file name>.spec.ts` in `app/ide-desktop/lib/dashboard/`.

End-to-end tests require internet access to pass (for things like fonts).

This PR *does* check in screenshots to guard against visual regessions (and/or to make visual changes obvious)
2023-10-11 10:24:33 +00:00
somebody1234
a7c2e7590a
Trash and Recent categories (#7682)
- Closes https://github.com/enso-org/cloud-v2/issues/617
- Trash category
- Do not open "confirm delete" modal when on remote (cloud) backend
- Permanent deletion has been superseded by the trash category
- Save current category to `localStorage`
- Also implements "Recent" category. Differences to Home category:
- Hides sort indicators
- Disables sorting

Other fixes:
- Allow overriding cloud environment through environment variable
- Prevent triggering rename on click when multiple items are selected
- Remove "move to trash" context menu option when user is not owner

# Important Notes
- This registers the "Ctrl + R" (Cmd + R) shortcut for restoring an item from trash. This is the same shortcut used for renaming, however I think it is fine because items in trash cannot be renamed.
(As usual though, this is very simple to remove/change so it's not a big deal to remove/change it.)

- The "Recent" category lacks backend support - so it falls back to the default category, as the deserialization of unknown values falls back to the default category.
2023-09-27 07:22:48 +00:00
Paweł Grabarz
226c5cf7c7
Revert "Handle wasm panics, display a message and allow a restart (#7507)" (#7708) 2023-08-31 13:30:01 +02:00
Paweł Grabarz
c834847c48
Handle wasm panics, display a message and allow a restart (#7507) 2023-08-30 13:31:08 +02:00
somebody1234
704ddff624
Disable opening projects that are already opened by other users (#7660)
- Closes https://github.com/enso-org/cloud-v2/issues/568
- Disable project with an `openedBy` that is not the current user

Fixes other issues:
- Fixes freshly restored saved projects not being unset when clicking stop before the editor first opens
- Changes "unable to" in errors to "could not", for consistency
- Users with insufficient permissions now see a network (node graph) icon instead of a play button:

![image](https://github.com/enso-org/enso/assets/4046547/0464ae66-4da7-4374-a4aa-80dd74fa1dc0)

# Important Notes
None
2023-08-28 13:21:36 +00:00
somebody1234
af0e738dec
New sharing menu (#7406)
- Closes https://github.com/enso-org/cloud-v2/issues/561
- New "Invite" modal
- Change autocomplete multi-select behavior
- Fix scrolling for autocomplete
- Scrolling when there are many users with permissions
- New backend permissions

- ⚠️ Intentional differences from Figma design:
- The permission type selector (the secondary modal) is slightly wider. This is because of minor changes to the text - check thread for details.
- The permission type selector for sharing with new users (the top one, next to the input) is vertically offset 4px more than usual. This is intentional; it means there is roughly the same spacing on either side of the input's border, and also means there is spacing between the "invite" button and the permission type selector
- Many buttons are faded out (`opacity-50`) when they are not interactable.
- Text changes
- "Invite" changes to "Share" in blue button
- "File" changes to "<asset type>" in permission type selector

# Important Notes
Some options don't work because the backend representation for permissions is currently different - in particular, the `admin`, `edit`, and `read` permissions, and the `docs` sub-permission.

ℹ️ Currently only works with new backend permissions - i.e. `ENVIRONMENT` must be `'pbuchu'` in `config.ts`.
2023-08-10 09:09:31 +00:00
somebody1234
0e20644e47
Upload and download .enso-projects from the local backend (PM backend) (#7305)
- Closes https://github.com/enso-org/cloud-v2/issues/478
- Download local project as `.enso-project` archive
- Requires latest nightly version of Project Manager
- Closes https://github.com/enso-org/cloud-v2/issues/510
- Allow uploading `.enso-project` to local backend
- Closes https://github.com/enso-org/cloud-v2/issues/477
- Promote local project to cloud
- Currently errors with 500 (when uploading a small bundle) or 413 (when uploading a large bundle). May be fixed soon

# Important Notes
The "upload project to cloud" context menu action does not currently have an entry in the new context menu, so that will probably need an official design at some point
2023-08-09 09:30:40 +00:00
somebody1234
e4357f8890
Background translucency (#7386)
* Set translucency options

* Vibrancy on Windows

* Use explicit background image instead of vibrancy

* Attempt to fix `ide build`

* Fix lint warning

* Remove background from authentication flow

* Fix background image and position

---------

Co-authored-by: Paweł Buchowski <pawel.buchowski@enso.org>
2023-07-27 10:53:00 +02:00
somebody1234
b62c3d7867
Update assets table design (#7377)
* wip: refactor all tables into one single `AssetsTable`

* wip: Continue merging the four asset tables; make files type-error-free

* Get table working again

* Prepare for nested directories; insert new items at correct position

* Save extra columns state; minor style fixes

* Make tab toggle bar sticky

* Rename array.withItemsInsertedAtBoundary

* Fix minor bug; adjust dropzone appearance

* Indentation for nested assets; fetching nested assets; svg color changes

* New appearances for permission display; minor fixes for "shared with" modal

* Address issues

* Minor bug fixes

* New assets upload bar

* Adjust permission display and table cell borders

* Adjust styling

* Change `toastAndLog` to a hook

* Address issues

* Make table full-width

---------

Co-authored-by: Paweł Buchowski <pawel.buchowski@enso.org>
2023-07-26 14:59:48 +02:00
somebody1234
ce33af82f7
Split dashboard.tsx into smaller components (#6546)
* Consistent order for statements in `dashboard.tsx`; change functions back to lambdas

* Create convenience aliases for each asset type

* Remove obsolete FIXME

* Refactor out column renderers into components

* Enable `prefer-const` lint

* Remove hardcoded product name

* Add fixme

* Enable `react-hooks` lints (not working for some reason)

* Consistent messages for naming-convention lint overrides

* Enable `react` lints

* Extract out tables for each asset type

* Refactor out column display mode switcher to a file

* Switch VM check state to use an enum

* Fix lint errors

* Minor section change

* Fix position of create forms

* Fix bugs; improve debugging QoL

* Add documentation for new components

* Refactor out drive bar

* Refactor out event handlers to variables

* Minor clarifications

* Refactor out directory view; some fixes; improve React DX

There are still many issues when switching backends

* Add `assert`

* Use `backend.platform` instead of checking for properties

* Fix errors when switching backend

* Minor style changes; fix lint errors

* Fix assert behavior

* Change `Rows` to `Table`

* Fixes

* Fix lint errors

* Fix "show dashboard" button

* Implement click to rename

* Fix lint errors

* Fix lint errors (along with a bug in `devServiceWorker`)

* Enable dev-mode on `ide watch`

* Fix bug in `useAsyncEffect` introduced during merge

* More fixes; new debug hooks; fix infinite loop in `auth.tsx`

* Inline Cognito methods

* Remove redundant `Promise.resolve`s

* Fix column display

* Fixes

* Simplify modal type

* Fix bug when opening IDE

* Shift+click to select a range of table items

* Implement delete multiple

* Fixes

* Tick and cross for rename input; fixes

* Implement rename and delete directory and multi-delete directory; fixes

* Optimize modal re-rendering

* Make some internal `Props` private

* Remove old asset selection code

* Eliminate re-renders when clicking document body

* Fix name flickering when renaming

* Use static placeholders

* Avoid refreshing entire directory on rename

* Use asset name instead of ID in error messages

* QoL improvements

* Enable react lints and `strict-boolean-expressions`

* Extract dashboard feature flags to its own module

* Feature flag to show more toasts; minimize calls to `listDirectory`

* Deselect selection on delete; hide unused features; add exception to PascalCase lint

* Fix projects disappearing after being created

* Fix name of `projectEvent` module imports

* Re-disable delete when project is being closed

* Fix assets refreshing when adding new projects

* Refactor row state into `Table`; fix delete not being disabled again

* Address review

* Implement shortcut registry

* Fix stop icon spinning when switching backends (ported from #6919)

* Give columns names

* Immediately show project as opening

* Replace `asNewtype` with constructor functions

* Address review

* Minor bugfixes

* Prepare for optimistically updated tables

* wip 2

* Fix type errors

* Remove indirect usages of `doRefresh`

Updating the lists of items will need to be re-added later

* Remove `toastPromise`

* Fix `New_Directory_-Infinity` bug

* wip

* WIP: Begin restoring functionality to rows

* Fix most issues with DirectoriesTable

* Port optimistic UI from `DirectoriesTable` to all other asset tables

* Fix bugs in item list events for asset tables

* Merge `projectActionButton` into `projectsTable`

* Remove `RenameModal`; minor context menu bugfixes

* Fix bugs

* Remove small default user icon

* Fix more bugs

* Fix bugs

* Fix type error

* Address review and QA

* Fix optimistic UI for "manage permissions" modal

* Fix "share with" modal

* Fix template spinner disappearing

* Allow multiple projects to be opened on local backend; fix version lifecycle returned by local backend

* Fix minor bug when closing local project

---------

Co-authored-by: Paweł Buchowski <pawel.buchowski@enso.org>
2023-07-19 11:48:39 +02:00
somebody1234
457d0986b6
Help chat (#7151)
* wip

* wip 2

* wip

* Copy types from bot

* wip

* Send and display messages

* wip: shadow

* Copy styles from design screenshot

* Fix "create new thread" button

* Fix switching threads

* wip

* Scrollback

* Reactions

* Fix issues with chat input sizing

* Update changelog

* Fix bugs; add scroll to thread list

* Use types from backend definitions

* Update git commit of chat backend; remove stray file path

* hotfix: fix "edit thread" shortcut on macos

* Address issues

* Extract chat header to separate component

* Begin matching appearance with Figma

* Show reaction bar on hover

* fix small scrollbar appear next to the message input

* Disallow sending empty messages

* Add chat URL to config - production URL will be added soon

* add production chat url

* fix linters

---------

Co-authored-by: Paweł Buchowski <pawel.buchowski@enso.org>
2023-07-18 13:23:41 +02:00
somebody1234
af03938305
"Share with" button (#7100)
* Add backend endpoints for "share with" button

* wip

* Fix bugs

* Invite user to organization if email is not found

* Minor fix for error message

* Address review

* Address issues

* Fix React error about identical keys

* Fix "share with" modal z-index; filter out users with permissions on asset

* Fix errors; address comment

* Fix

* Change submit button text to "Already has access" when appropriate

* Address review

* Show email on hover

* Finish renaming "share with" modal

* Select multiple for "share with" modal

* Minor style changes

* Deselect other permissions when "own" permission is selected

* Fix deselecting permissions

* Remove unused svg

---------

Co-authored-by: Paweł Buchowski <pawel.buchowski@enso.org>
2023-07-12 10:12:39 +02:00
somebody1234
c276bc035c
Enable React and strict-boolean-expressions lints (#7023)
* QoL improvements

* Enable react lints and `strict-boolean-expressions`

* Address review

* Minor bugfixes

---------

Co-authored-by: Paweł Buchowski <pawel.buchowski@enso.org>
2023-07-06 13:52:32 +02:00
somebody1234
b4d0a40c7d
(even more) Dashboard fixes (#6919)
* Change cdn domain

Fixes cloud-v2/#484

* Remove modal from file upload flow

Fixes part of cloud-v2/#483

* Add optimistic UI; add more toast messages

Fixes part of cloud-v2/#483

* Handle `authentication` and `new-dashboard` flags correctly

Fixes cloud-v2/#481

* Fix bugs

* Use offline mode when `-authentication=false`

* Stop row from resizing when loading permissions

* Fix issues

* Navigate back to login screen on registration success

* Prevent scrollbar flickering

The scrollbar still blinks when switching backends, but it now does not resize. The blinking seems to be very difficult to avoid.

* Stop modal close button from overlapping text

* Fix stop icon spinning when switching backends

Remote backend not tested

* Remove modal from files table plus button

* Scrollbar-aware column count
2023-06-28 14:35:20 +02:00
somebody1234
74527eaa8f
Extract SVGs to files (#7076)
* Extract SVGs to individual files

Probably not working for cloud frontend (`watch-dashboard`, `build-dashboard`) yet

Dynamic SVGs were not extracted out

* Make file SVGs work for `watch-dashboard` and `build-dashboard`

* Document SVG loaders

* Address QA issues
2023-06-23 10:47:04 +02:00
somebody1234
191f445304
QoL code improvements for dashboard (#7022) 2023-06-19 01:02:08 +02:00
somebody1234
5cc21001b1
Save backend type in localStorage, and automatically open projects when ready (#6728)
* Save backend type; fix `-startup.project`

* Attempt to fix for cloud

* Fix for cloud and implement automatic opening

* Fixes

* Add missing functionality

* Switch default backend to local backend

* Fix type error

* Fix saving backend

* Make loading message appear instantly

* Fix context menu positioning

* Fixes and QoL improvements

* Style scrollbar on `document.body`

* Fix `-startup.project`; other minor fixes

* Open project immediately when creating from template; minor fix

* Finally fix spinner bugs

* Fix some minor bugs

* Fix bugs when closing project

* Disallow deleting local projects while they are still running

* Close modals when buttons are clicked
2023-06-06 14:00:07 +02:00
somebody1234
cd7cb0bda5
Offline mode (#6870)
* Dashboard and authentication changes

* wip

* Replace `useNavigate` with a wrapper

* Fixes

* Fix flipped boolean

* QoL improvement for request blocking

* Add service worker to cache dependencies
2023-06-02 11:05:37 +02:00
somebody1234
658395e011
Enable require-jsdoc lint and add two lints related to React (#6403)
- Enables the `require-jsdoc` lint
- Fixes all lint errors caused by enabling this lint.

# Important Notes
- There is no option to require JSDoc for other constructs, like top-level constants.
2023-05-19 19:55:29 +00:00
Michał Wawrzyniec Urbańczyk
6ce0b4daa1
IDE's logging to a file (#6478)
This PR makes the IDE main process to write its logs to a file.

This is meant to allow debugging in cases where stdout logs would be otherwise unobservable, like when IDE is spawned by the OS as a handle for a given file extension or URL protocol.

This is not integrated in any way with the renderer's process logs, or anything that is printed within the content's dev console. This can be provided in the future if deemed useful.
2023-05-03 03:30:13 +02:00
somebody1234
a1d48e7d0c
Cloud/desktop mode switcher (#6448)
This is a re-creation of #6308.
Creates buttons to switch between cloud and local backends for listing directories, opening projects etc.

# Important Notes
The desktop backend currently uses a hardcoded list of templates, mostly because they look better because they have background images. However, it can easily be changed to use `listSamples` endpoint and switched to the default grey background.
2023-05-02 17:48:07 +00:00
Wojciech Daniło
d0e1dd582e
Revert "Cloud/desktop mode switcher (#6308)" (#6444) 2023-04-26 23:21:24 +02:00
somebody1234
400cdbe893
Cloud/desktop mode switcher (#6308)
* fixmes

* fixmes

* fixmes

* fixmes

* fixmes

* fixes for e-hern's comments

* use abortcontroller

* add docs

* fixes

* revert craco, fix windows build

* remove from gitignore

* remove unnecessary check

* tmp

* augment window

* tmptmp

* split errors back up

* tmp

* tmp

* prettier

* fix

* Fix lints

* Prepare for addition for `as T` lint

* Add lint for early returns

* Address review issues

* Fix lints

* remove withrouter

* fix file length

* fixes

* fixes

* remove dashboard

* fix

* use switch

* prettier

* fixes

* prettier

* fixes

* run prettier

* run prettier

* run prettier

* fix main page url

* allow node.js debugging

* fix lints

* change not equal

* prettier

* Remove references to withRouter; fix lints

* Run prettier

* Add cloud endpoints

* Add JSON-RPC endpoints

* Add dashboard skeleton

* Add components and edit dashboard

* Run prettier

* (WIP) Add cloud endpoints

* Add rpc endpoints

* Address review issues

* Formatting and minor fixes for `newtype.ts`

* Address review issues

* Rename `Brand` to `NewtypeVariant`

* Rename `Brand` to `NewtypeVariant`

* Fix formatting in `newtype.ts`

* Switch dashboard to esbuild

* Minor fixes; move Tailwind generation into esbuild-config

* Fix watching `content/` and `client/`

* Bump esbuild binary versions; minor dependency list fixes

* Add dashboard skeleton

* Run prettier

* Fixes; rename "npm run dev" to "npm run watch-dashboard"

* Avoid writing esbuild outputs to disk for `dashboard/`

* Convert watch-dashboard to be fully in-memory; rebuild css files on change

* Remove obsolete FIXME

* Remove unused constants

* Run prettier

* add missing styles

* Fixes

* Fix the fixes

* Run prettier

* Fixes; use nesting plugin to wrap tailwind preflight

* Remove testing flag from client/watch

* Minor fixes

* Run prettier

* Export newtypes

* Make css rebuild when tailwind config changes

* Fix endpoints

* Finish copying changes over

* Remove duplicate type definitions

* Feat: top-bar styles and changePassword feature

* Fix: remove eslint disable comments

* Fix bundling for dashboard

* Fix dashboard/bundle.ts erroring when build directory does not exist

* Move CSS to Tailwind config

* Run prettier

* Copy changes from old branch

* Update endpoints

* Fix esbuild binary package names

* Remove redundant "npx" prefix from build scripts

* Remove unused dependency

* workaround for mac freeze

* Fix bug

* add missing sections

* Fix: bug

* Address review issue

* Fix prettier config; run prettier

* Fix live-reload of `npm run watch-dashboard`

* Fix service worker for client-side routing

* Remove workaround for backend bug when listing directories

* Fix sizing

* Fix spacing, add fixed paths

* Address review issues; minor fixes

* Fix authentication on desktop IDE

* Run prettier

* Allow unused locals and parameters in tsconfig.json

* Run prettier

* Fix TypeScript errors

* Run prettier

* Fix eslint errors, restructure code

* Minor fixes and other changes

* Revert incorrect change to `cognito/changePassword`

* Remove unused file

* Run prettier

* Merge with top bar; implement switching between IDE and dashboard

* Animate project switcher (WIP)

* Fix IDE and project switcher animation

* Fix eslint errors

* Change `#dashboard` to `.dashboard` for Tailwind

* Split `-authentication` option into `-cloud.authentication` and `-cloud.dashboard`

* Address review issues

* Add description for cloud option group

* Extract custom CSS values into Tailwind config; use ModalProvider

* Hide topbar in IDE view

* Add project manager backend service

* Begin fixing IDE open

* (WIP)

* Clean up unused code

* Minor fixes

* Fix

* Fix local backend's usage of project manager (WIP)

* WIP

* Minor fixes

* Fix scrollbar showing because of margins

* Expose `runProject` instead of `main`

* Keep persistent websocket to Project Manager

* Fix spinner state bug

* Fix race condition when switching between backends

* Fix loading local projects

* Make switching local projects work

* Fix opening cloud projects

* Add shortcut to switch back to dashboard

* Fix templates for desktop; other fixes

* Fix status check polling in `ProjectActionButton` not being stopped

* Run prettier

* Retry reconnecting to Project Manager

* fix back to dashboard shortcut on macOS

* Fixes

* More fixes

* Rename `backendModule` to `cloudService`

---------

Co-authored-by: Nikita Pekin <nikita@frecency.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Paweł Buchowski <pawel.buchowski@enso.org>
Co-authored-by: Nctdtman <137032445@qq.com>
2023-04-26 16:59:39 +02:00
somebody1234
3d045a7ceb
Dashboard directory interactivity (#6279)
* turn object into var

* add todo

* fix style

* fixes

* remove forgot password + reset password

* remove signout

* remove setusername

* remove login

* remove registration

* fix comments

* re-enable flag

* rename div

* add comment

* fix lints

* remove tailwind conf

* Revert "remove registration"

This reverts commit 02439c9b70.

* Revert "remove login"

This reverts commit 8e6f9c1112.

* Revert "remove setusername"

This reverts commit 84721bcccd.

* Revert "remove signout"

This reverts commit 08a96d3796.

* Revert "remove forgot password + reset password"

This reverts commit e52f51a762.

* remove opener

* move opener

* tmp

* prettier

* expand docs

* tmp

* replace react-scripts with craco

* add tailwindcss

* switch to brands

* tmp

* tmp

* tmp

* fixmes

* fixmes

* fixmes

* fixmes

* fixmes

* fixes for e-hern's comments

* use abortcontroller

* add docs

* fixes

* revert craco, fix windows build

* remove from gitignore

* remove unnecessary check

* tmp

* augment window

* tmptmp

* split errors back up

* tmp

* tmp

* prettier

* fix

* Fix lints

* Prepare for addition for `as T` lint

* Add lint for early returns

* Address review issues

* Fix lints

* remove withrouter

* fix file length

* fixes

* fixes

* remove dashboard

* fix

* use switch

* prettier

* fixes

* prettier

* fixes

* run prettier

* run prettier

* run prettier

* fix main page url

* allow node.js debugging

* fix lints

* change not equal

* prettier

* Remove references to withRouter; fix lints

* Run prettier

* Add cloud endpoints

* Add JSON-RPC endpoints

* Add dashboard skeleton

* Add components and edit dashboard

* Run prettier

* (WIP) Add cloud endpoints

* Add rpc endpoints

* Address review issues

* Formatting and minor fixes for `newtype.ts`

* Address review issues

* Rename `Brand` to `NewtypeVariant`

* Rename `Brand` to `NewtypeVariant`

* Fix formatting in `newtype.ts`

* Switch dashboard to esbuild

* Minor fixes; move Tailwind generation into esbuild-config

* Fix watching `content/` and `client/`

* Bump esbuild binary versions; minor dependency list fixes

* Add dashboard skeleton

* Run prettier

* Fixes; rename "npm run dev" to "npm run watch-dashboard"

* Avoid writing esbuild outputs to disk for `dashboard/`

* Convert watch-dashboard to be fully in-memory; rebuild css files on change

* Remove obsolete FIXME

* Remove unused constants

* Run prettier

* add missing styles

* Fixes

* Fix the fixes

* Run prettier

* Fixes; use nesting plugin to wrap tailwind preflight

* Remove testing flag from client/watch

* Minor fixes

* Run prettier

* Export newtypes

* Make css rebuild when tailwind config changes

* Fix endpoints

* Finish copying changes over

* Remove duplicate type definitions

* Fix bundling for dashboard

* Fix dashboard/bundle.ts erroring when build directory does not exist

* Move CSS to Tailwind config

* Run prettier

* Update endpoints

* Fix esbuild binary package names

* Remove redundant "npx" prefix from build scripts

* Remove unused dependency

* Begin adding interactivity

* workaround for mac freeze

* Fix modal bugs

* Begin implementing forms, split forms and modals into new files

* Get form UI working

* add missing sections

* Minor fixes, save current directory to localStorage

* Fixes for drop-to-upload

Note: currently it is opening in a new tab instead of actually uploading

* Address review issue

* Fix prettier config; run prettier

* Fix live-reload of `npm run watch-dashboard`

* (WIP)

* Fix service worker for client-side routing

* Add close button to asset creation forms; fix saving directory to localStorage

* Remove workaround for backend bug when listing directories

* Fix drop-to-upload

* Fix sizing

* Fix spacing, add fixed paths

* WIP: fix toast notification styles, begin adding context menu

* WIP: Add context menu, minor fixes

* Fix authentication on desktop IDE

* Allow unused locals and parameters in tsconfig.json

* Run prettier

* Fix TypeScript errors

* Fix modals; minor refactor

* Implement context menus for labels; fixes

* Add modal provider and switch all modals to provider; fixes

* Fix modals and user icon size

* Fixes

* Remove obsolete files from incorrect merge

* Address review issues

* Fix type error

* Stop removing `#root`

* Fixes for cloud

* Implement search on frontend side

* Fix race condition related to `directoryId`

* Hide directories, files and secrets tables on desktop IDE

* Fix lint errors

* Properly update visible projects when a project is created

* Pass directory id to create project

* Hide column display switcher; remove placeholder column data

---------

Co-authored-by: Nikita Pekin <nikita@frecency.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Paweł Buchowski <pawel.buchowski@enso.org>
2023-04-26 11:52:13 +02:00
Michał Wawrzyniec Urbańczyk
19203427e0
URL handling (#6243)
This PR fixes #5239 by supporting the Windows-style of URL handling to support deep linking.

Windows spawns a new process for each URL, rather than sending a 'open-url' event to the existing process. Now the differences between the two platforms should be abstracted away.
2023-04-24 16:12:30 +02:00
somebody1234
3e5a3dc468
Fix all eslint errors (#6267)
Fixes all eslint errors - now `npx eslint .` in `app/ide-desktop` should show no errors and no warnings.
Also fixes an incorrect lint rule (the rule to catch early returns (?) did not work properly for `try-catch`)

# Important Notes
This changes quite a few files (unfortunately) so QA should be done to check all affected files
2023-04-24 12:56:26 +00:00
somebody1234
72ae10c8e2
Add dashboard table view (#6015)
- Adds dummy views for all asset types (project, directory, secret, file)
- The backend metadata does not exist for many of these columns.

# Important Notes
To do:
- [x] figure out the best way to add the custom classes - tailwind likes to avoid custom classes whenever possible
2023-04-13 15:17:32 +00:00
somebody1234
37d820c764
Fix ./run gui watch (#6212)
- Fixes #6168
- Removes `enso-copy-plugin` in favor of an inline plugin
- It was only used in one place anyway
- It is probably necessary since I've "fixed" it by adding all files as entrypoints (I'm not quite sure why it wasn't working with the fix with `enso-copy-plugin`...)
- Adds live reload (back) to `content/`

# Important Notes
To QA:
Mandatory:
- `./run gui watch --skip-version-check --skip-wasm-opt`

Recommended:
- `npm run watch-dashboard`
- `./run ide watch --skip-version-check --skip-wasm-opt --backend-source release --backend-release latest`
- and with `--ide-option -authentication`
- `./run ide build --skip-version-check --skip-wasm-opt --backend-source release --backend-release latest`
- `Enso` and `Enso -authentication`
2023-04-11 06:04:27 +00:00