* Implement a lot of technical requirements for behavioural unit tests
Note: the crux of this was to make routing env-agnostic, and not based on URLs as magic strings, but instead something type-enforced.
Note: extension-based routes comply to same exact interface by "late-registering" their routes when installed. Routes are just injectables.
Note: another chunk of global shared state is no more.
Note: a lot of explicit side effects have been cornered to injectables.
Note: a lot of stuff has become reactive as part if this.
Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Make a directory commonly available
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
* Require id for <Select /> to prevent non-deterministic renders
This was caused by global state in a 3rd party lib: "react-select".
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
* Specify id for all <Select /> to satisfy previous commit
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
* Prevent explicit side effect in component by using existing dependency instead
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
* Extract instantiation of "conf" as injectables for causing side effects
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
* Introduce a legacy-helper to make gradual refactoring of inheritors of Singleton easier
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
* Make legacy unit tests for hotbar green and more simple by using the new legacy helper
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
* Temporarily kludge all unit tests green with a disclaimer about allowing side-effects
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
* Remove kludge in previous commit by explicitly permitting specific side effects where old unit tests require it
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
* Prevent old unit test with side effects from accessing file system
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
* Migrate to actual typing for di.permitSideEffects
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
* Prevent unit tests from failing because of non-standard method of HTML-element not present in js-dom
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
* Adapt integration tests to recent changes
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
* Fix code style
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
* Fix artifact from bad rebase
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
* Add a deprecation from a review comment
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
* Remove change that is not required
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Remove redundant comment
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Fix code style
Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Remove redundant file
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Fix bad merge
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
* Improve variable name
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
* Tweak logger interface to be more descriptive
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Make injecting legacy singleton always provide new instance
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Remove conditional typing when not needed
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Improve naming of variable
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Remove unnecessary code style changes
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Remove flag for causing side effects from too broad scope
Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Override side-effects in unit test using injectable instead of monkey patching
Co-authored-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
* Flag some side-effects and add general overrides
Co-authored-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
* Fix unit tests in CI by removing explicit side-effect
Co-authored-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
* Remove explicit side-effect from getting default shell
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Introduce abstraction for getting absolute paths
Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Switch to using abstraction for getting absolute path to control explicit side effect
Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Introduce abstraction for joining paths
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Switch to using abstraction for joining paths to control explicit side effect
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Fix fake implementation for join paths
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Fix test after removing explicit side effect
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Remove explicit side effects from kubeconfig-syncs
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Fix arguments after removing explicit side effect
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Make registrators not async for not being needed anymore
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Make generalCatalogEntities non-observable, as there is no requirement
Co-authored-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
* Remove redundant code
Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
* Simplify logic for registering general catalog entity sources
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Add TODO
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Replace function for getting application menu items with reactive solution
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Fix typo in interface name
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Remove global shared state usages of hot bar store
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Remove redundant enum
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
Co-authored-by: Janne Savolainen <janne.savolainen@live.fi>
Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>
Co-authored-by: Sebastian Malton <sebastian@malton.name>
Co-authored-by: Janne Savolainen <janne.savolainen@live.fi>
* Making cluster area hoverable
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Move sidebar cluster block to separate component
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Clean up
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Add keyboard support
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Adding tests
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Cleaning up
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* monaco editor refactoring
Signed-off-by: Roman <ixrock@gmail.com>
* clean up / responding to comments
Signed-off-by: Roman <ixrock@gmail.com>
* move custom monaco themes to own folder
Signed-off-by: Roman <ixrock@gmail.com>
* fix lint
Signed-off-by: Roman <ixrock@gmail.com>
* removed unused rules from webpack's config (renderer)
Signed-off-by: Roman <ixrock@gmail.com>
* Stop using remote to obtain app.getPath()
- Initialize entire map in bootstrap()
- Updated unit tests
Signed-off-by: Sebastian Malton <sebastian@malton.name>
* Resolve PR comments
Signed-off-by: Sebastian Malton <sebastian@malton.name>
* Fix test
Signed-off-by: Sebastian Malton <sebastian@malton.name>
* Fix build
Signed-off-by: Sebastian Malton <sebastian@malton.name>
* Ensure that init can only be called once and catch errors
Signed-off-by: Sebastian Malton <sebastian@malton.name>
* Replace basically all uses of app.getPath() with AppPaths.get()
Signed-off-by: Sebastian Malton <sebastian@malton.name>
* Fix unit tests
Signed-off-by: Sebastian Malton <sebastian@malton.name>
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
Co-authored-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
Co-authored-by: Sebastian Malton <sebastian@malton.name>
Upgrade to electron 12 and Node 14
- Compute cluster ID for tests
- Switch to temporary appData path while testing
Signed-off-by: Sebastian Malton <sebastian@malton.name>
Co-authored-by: Sebastian Malton <smalton@mirantis.com>
Co-authored-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
* Using RemovableItem for items in Kubernetes page
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Helm Charts empty state
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Empty state for kubeconfig sync list
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Remove unused styles
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Fixing tests
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Kubeconfig syncs from Catalog
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Allow to select directory to sync
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Convert Preferences to Route-based component
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Jump from notification to Preferences
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Adding navigateWithoutHistoryChange() method
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Cleaning up
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Fixing integration tests (no check for Telemetry tab)
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Fixing tests harder
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
- Make mockWindow a function and call it when needed
- Change timeouts so that better error messages happen more often in
integration tests
Signed-off-by: Sebastian Malton <sebastian@malton.name>
* Adding General Entities and General Category
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Usign material icons for general entities
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Setting background for hotbar icon explicitly
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Adding Catalog initially to first hotbar
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Tuning hotbar store tests
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Changing type from GeneralEntity to General
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Search for catalog hotbar item in tests
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Removing Catalog link from bottom bar
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Waiting for hotbar catalog entity
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Opening cluster list by data-testId
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Replacing types on interfaces
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Fixing integration tests
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Adding general entities throught initializers
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Removing icon refs from CatalogEntitySpec
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Setting up tailwind and css modules env
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Using tailwind with scss files also
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Introducing react-table
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Spread extensions to smaller components
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Add table sorting
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Fixing inputs line-height
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Fine-tuning page view
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Align table rows
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Adding extension notice
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Fine-tuning overall styling
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Adding a extensions placeholder
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Updating MaterialIcons font
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Aligning not found state
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Making extension components observable
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Fixing search input cross icon
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Fix drag-n-drop indication
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Fixing extension name sorting
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Fix linter
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Fixing tests
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Ignoring ts files to tailwind purge
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Cleaning up
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Renaming Table -> ReactTable
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Fixing integration tests
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Moving tailwind imports into app.scss
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Moving userExtensionList() out from extension-loader
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Transform extension list to array
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
* Expand install input placeholder a bit
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
- Removed `getFreePort` as its use is always a race condition. Change
all uses of it to retrive the port after listening
- Added `getPortFrom` as a helper function to read a port from a stream
- Remove `Cluster.ownerRef` as it is outdated and no longer needed for 5.0
- Remove `Cluster.enabled`, no longer needed because of above
- Removed `Cluster.init`, moved its contents into `Cluster.constructor`
as nothing in that function is asyncronous. Currently only being run
on `main` as a stop gap until `renderer` gets its own version of
`Cluster`
- Refactored `LensProxy` so as to prevent `pty.node` (a NodeJS
extension) being included in `webpack.extension.ts`'s run
- Removed the passing around of the proxy port as that can now be
accessed from an instance of `LensProxy`
- purge ContextHandler's cache on disconnect
Co-authored-by: Sebastian Malton <sebastian@malton.name>
* Add the ability to sync kube config files
- Will update when the files changes
- add KUBECONFIG_SYNC label
- fix rebase and change to addObservableSource
- move UI to user settings
- support shallow folder watching
- add some unit tests for the diff-er
Signed-off-by: Sebastian Malton <sebastian@malton.name>
* responding to review comments
Signed-off-by: Sebastian Malton <sebastian@malton.name>
* fix tests and add try/catch
Signed-off-by: Sebastian Malton <sebastian@malton.name>
* always sync c&p folder, remove bad rebase
Signed-off-by: Sebastian Malton <sebastian@malton.name>
* fix preferences
Signed-off-by: Sebastian Malton <sebastian@malton.name>
* Fix settings saving and catalog view
Signed-off-by: Sebastian Malton <sebastian@malton.name>
* fix unit tests
Signed-off-by: Sebastian Malton <sebastian@malton.name>
* fix synced clusters not connectable
Signed-off-by: Sebastian Malton <sebastian@malton.name>
* change to non-complete shallow watching
Signed-off-by: Sebastian Malton <sebastian@malton.name>
* fix sizing
Signed-off-by: Sebastian Malton <sebastian@malton.name>
* Catch readStream errors
Signed-off-by: Sebastian Malton <sebastian@malton.name>
* don't clear UserStore on non-existant preference field, fix unlinking not removing items from source
Signed-off-by: Sebastian Malton <sebastian@malton.name>
* change label to file
Signed-off-by: Sebastian Malton <sebastian@malton.name>
- Add distinction between `getInstance` and `getInstanceOrCreate` since
it is not always possible to create an instance (since you might not
know the correct arguments)
- Remove all the `export const *Store = *Store.getInstance<*Store>();`
calls as it defeats the purpose of `Singleton`. Plus with the typing
changes the appropriate `*Store.getInstance()` is "short enough".
- Special case the two extension export facades to not need to use
`getInstanceOrCreate`. Plus since they are just facades it is always
possible to create them.
- Move some other types to be also `Singleton`'s: ExtensionLoader,
ExtensionDiscovery, ThemeStore, LocalizationStore, ...
- Fixed dev-run always using the same port with electron inspect
- Update Store documentation with new recommendations about creating
instances of singletons
- Fix all unit tests to create their dependent singletons
Signed-off-by: Sebastian Malton <sebastian@malton.name>