- 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>
* add no-unused-vars and no-unused-imports
* added quotes: double, and remove ignore pattern
* move itif and describeif into utils
Signed-off-by: Sebastian Malton <sebastian@malton.name>
* Add @testing-library/jest-dom and @testing-library/react for writing test cases
* Make eslint check __mocks__/*.ts files
* Mock electron.ipcRenderer.on to prevent errors in React compoment test cases
* Mock <Trans /> from @lingui/macro as a component simplely returns children components
* Use optional chaining operator (?.) to avoid TypeError: Cannot read property 'replicas' of undefined
* Add jest-fetch-mock for mocking global.fetch, activate for all test cases in jest.setup.ts
* Add basic tests for <DeploymentScaleDialog /> to ensure it initialises/renders without errors
* Add +/- button for changing desired replicas, and its test cases
* Adjust the styles of +/- buttons container to make sure it aligns with the slider
* Refactor after rebase from master
* Use var defined in vars.scss
* Add flex align-center to slider-container and remove margin-top: -4px
* Use <Icon /> to replace <i/>
* Add flex gaps to plus-minus-container
Signed-off-by: Hung-Han (Henry) Chen <1474479+chenhunghan@users.noreply.github.com>
Signed-off-by: Roman <ixrock@gmail.com>
Co-authored-by: Sebastian Malton <sebastian@malton.name>
Co-authored-by: Sebastian Malton <smalton@mirantis.com>
Co-authored-by: Lauri Nevala <lauri.nevala@gmail.com>
Co-authored-by: Alex Andreev <alex.andreev.email@gmail.com>