1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
Commit Graph

1292 Commits

Author SHA1 Message Date
Janne Savolainen
0f4f8dd8d5 Extract menu items as own dependency
Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
2021-12-04 12:22:00 +02:00
Janne Savolainen
667e90ba0e Make component transient
Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
2021-12-04 12:21:46 +02:00
Janne Savolainen
1707a95eef Fix merge conflicts
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
2021-12-04 12:20:42 +02:00
Janne Savolainen
98d63daef6 Update version of injectable for disambiguous typing
Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
2021-12-04 12:20:42 +02:00
Janne Savolainen
d592848a7f Try making UI unit testable in Ubuntu by removing usage of component which uses an experimental browser feature
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
2021-12-04 12:20:42 +02:00
Janne Savolainen
550abfcc0d Organize some interfaces to communicate intent
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
2021-12-04 12:20:42 +02:00
Janne Savolainen
0fc9fe626d Update snapshots
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
2021-12-04 12:20:42 +02:00
Janne Savolainen
53dc2c853d Fix incorrect typing in test
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
2021-12-04 12:20:42 +02:00
Janne Savolainen
7938e9c4ef Demonstrate how InjectNaive could be not naive by using injectables
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
2021-12-04 12:20:42 +02:00
Janne Savolainen
78e1c6357b Improving typing of mock
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
2021-12-04 12:20:42 +02:00
Janne Savolainen
fbabb32dab Switch to using testing library queries from screen export
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
2021-12-04 12:20:42 +02:00
Janne Savolainen
c57473c875 Revert "Try altering cancelIdleCallback stub to see if that makes test deterministic"
This reverts commit d5148b6537944525414e918709d862d0593107d0.

Signed-off-by: Janne Savolainen <janne.savolainen@houston-inc.com>
2021-12-04 12:20:41 +02:00
Janne Savolainen
e793859d82 Try altering cancelIdleCallback stub to see if that makes test deterministic
Signed-off-by: Janne Savolainen <janne.savolainen@houston-inc.com>
2021-12-04 12:20:20 +02:00
Janne Savolainen
4c775256bb Remove prop from wrong place
Signed-off-by: Janne Savolainen <janne.savolainen@houston-inc.com>
2021-12-04 12:20:20 +02:00
Janne Savolainen
3a124a6393 Increase credibility of some unit tests by using actual instance as stub
Signed-off-by: Janne Savolainen <janne.savolainen@houston-inc.com>
2021-12-04 12:20:20 +02:00
Janne Savolainen
76a9973ab1 Fix code style
Signed-off-by: Janne Savolainen <janne.savolainen@houston-inc.com>
2021-12-04 12:20:20 +02:00
Janne Savolainen
f3ef9c50c9 Remove unused data-attribute
Signed-off-by: Janne Savolainen <janne.savolainen@houston-inc.com>
2021-12-04 12:20:20 +02:00
Janne Savolainen
fbeac80fbc Switch to non deprecated prop type
Signed-off-by: Janne Savolainen <janne.savolainen@houston-inc.com>
2021-12-04 12:20:20 +02:00
Mikko Aspiala
bc3a8794cc Add unit test for missing namespace when removing a kube object
We almost forgot to test this, because we started without TDD.

Co-authored-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Mikko Aspiala <mikko.aspiala@houston-inc.com>
2021-12-04 12:20:20 +02:00
Mikko Aspiala
653958d8f9 Tweak UI in a dialog
Co-authored-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Mikko Aspiala <mikko.aspiala@houston-inc.com>
2021-12-04 12:19:43 +02:00
Mikko Aspiala
293cdb87ec Simplify dependencies for a component
Co-authored-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Mikko Aspiala <mikko.aspiala@houston-inc.com>
2021-12-04 12:19:29 +02:00
Mikko Aspiala
cfaf5f9402 Bundle dependencies of a component to a composing object
Co-authored-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Mikko Aspiala <mikko.aspiala@houston-inc.com>
2021-12-04 12:19:12 +02:00
Mikko Aspiala
e0d5c41b3b Add todo for unit testing a weird complication without full understanding
Co-authored-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Mikko Aspiala <mikko.aspiala@houston-inc.com>
2021-12-04 12:18:36 +02:00
Mikko Aspiala
78a989a72a Implement first meaningful unit tests for a complete behavior
Note: in this case, the behavior is even asynchronous, and thus a tool "asyncFn" is used to keep the test as simple as possible.

Co-authored-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Mikko Aspiala <mikko.aspiala@gmail.com>
2021-12-04 12:18:17 +02:00
Janne Savolainen
ec075ad957 Fix code style
Signed-off-by: Janne Savolainen <janne.savolainen@houston-inc.com>
2021-12-04 12:16:33 +02:00
Janne Savolainen
a2f9a76add Kludge first unit test with more than minimal data
This is a kludge because extraction of segregated interface for KubeObject is very difficult. This commit uses actual instance of KubeObject instead as a fake.

Signed-off-by: Janne Savolainen <janne.savolainen@houston-inc.com>
2021-12-04 12:16:33 +02:00
Janne Savolainen
350f07b457 Introduce first unit test made possible because of recently demonstrated changes
Key changes were:
- Introduction of dependencies as interfaces to permit stubbing in general (Dependency Inversion Principle)
- Introduction of segregated interfaces to only require stubbing of minimal stuff (Interface Segregation Principle)

Signed-off-by: Janne Savolainen <janne.savolainen@houston-inc.com>
2021-12-04 12:16:33 +02:00
Janne Savolainen
94d3f6b5fb Make typing of dependency functions more strict
Signed-off-by: Janne Savolainen <janne.savolainen@houston-inc.com>
2021-12-04 12:16:33 +02:00
Janne Savolainen
a0f0d3e811 Improve naming of type parameter
Signed-off-by: Janne Savolainen <janne.savolainen@houston-inc.com>
2021-12-04 12:16:33 +02:00
Janne Savolainen
73e3dd95f4 Make another dependency a segregated interface instead of concrete instance
Notice how interface is in fact segregated, i.e. it only advertises the minimal properties currently required.

With this we satisfy Interface Segregation Principle and thus permit e.g. minimal requirement for stubbing in future unit tests.

Signed-off-by: Janne Savolainen <janne.savolainen@houston-inc.com>
2021-12-04 12:16:33 +02:00
Janne Savolainen
d9e8821d33 Simplify a way of getting cluster name
Signed-off-by: Janne Savolainen <janne.savolainen@houston-inc.com>
2021-12-04 12:16:33 +02:00
Janne Savolainen
29d0634729 Demonstrate even step further to have an interface as dependency instead of concrete instance
Signed-off-by: Janne Savolainen <janne.savolainen@houston-inc.com>
2021-12-04 12:16:33 +02:00
Janne Savolainen
91b14ee3fc Demonstrate a step further to have an interface as dependency instead of concrete instance
With this we get yet closer to satisfaction of Dependency Inversion Principle.

Signed-off-by: Janne Savolainen <janne.savolainen@houston-inc.com>
2021-12-04 12:16:33 +02:00
Janne Savolainen
8d0abcc9d5 Demonstrate naive way to make component not responsible of it's dependencies and not use global shared state
This is to make a step towards satisfaction of Dependency Inversion Principle. It's not fully satisfied because we still depend on concrete instances of classes instead of interfaces.

This will start chain of thought to pursue warm and friendly unit testing and introduction of SOLID principles.

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>
2021-12-04 12:16:33 +02:00
Janne Savolainen
b07b8dc096 Rename method to not be misleading
Signed-off-by: Janne Savolainen <janne.savolainen@houston-inc.com>
2021-12-04 11:55:19 +02:00
Janne Savolainen
10eb95ae67 Implement breadcrumbs for deleting different kube objects
This was done in a naive way by disregarding stuff such as:
- Avoidance of shared global state (dependency inversion principle)
- Unit testing
- Minimal implementation over defensive code (elvis, just in case)
- Full understanding for use cases of all different kube objects

Signed-off-by: Janne Savolainen <janne.savolainen@houston-inc.com>
2021-12-04 11:55:07 +02:00
Sebastian Malton
304941d397
Fix IngressApi being registered with a wrong new apiBase (#4485) 2021-12-03 15:19:01 -05:00
Sebastian Malton
7dfd4d586c
Fix error notifications not being displayed for CreateResource tab (#4502) 2021-12-03 12:49:42 -05:00
Alex Andreev
d73df7fe0d
Show active hotbar on bottom (#4476)
- Extends extension API to support choosing sides for bottom bar entries
2021-12-03 09:41:08 -05:00
dependabot[bot]
8055ba261b
Bump @types/url-parse from 1.4.4 to 1.4.5 (#4494)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sebastian Malton <sebastian@malton.name>
2021-12-03 08:59:18 -05:00
Jim Ehrismann
29c9c73a13
catch app.getPath() errors (#4492)
Signed-off-by: Jim Ehrismann <jehrismann@mirantis.com>
2021-12-02 20:52:03 -05:00
dependabot[bot]
1c16b697ae
Bump joi from 17.4.2 to 17.5.0 (#4486)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sebastian Malton <sebastian@malton.name>
2021-12-02 16:09:38 -05:00
Jim Ehrismann
f78d9c5fc2
add debug for locating startup issues (#4481) 2021-12-02 09:34:06 -05:00
Alex Andreev
6e543961ac
Fixing unexpected avatar width shrink (#4483) 2021-12-02 09:12:44 -05:00
Panu Horsmalahti
696986b7e6
Use PartialDeep for patch type (#4420)
* Use PartialDeep for patch type.

Signed-off-by: Panu Horsmalahti <phorsmalahti@mirantis.com>

* Add test. Fix typing.

Signed-off-by: Panu Horsmalahti <phorsmalahti@mirantis.com>

* Fix lint.

Signed-off-by: Panu Horsmalahti <phorsmalahti@mirantis.com>
2021-12-02 15:28:28 +02:00
Alex Andreev
f02018c1e7
Fix light theme pin icon visibility (#4477)
* Remove what-input dependency

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Use focus-visible prop and color fix in Icon

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
2021-12-02 11:12:16 +03:00
Sebastian Malton
4c16b7020d
Fix KubeApi.create not populating kind and apiVersion (#4478) 2021-12-01 15:57:08 -05:00
Alex Andreev
9ce91884c2
Replacing <Avatar/> component by native one (#4452) 2021-12-01 08:28:56 -05:00
Sebastian Malton
80eeffc229
Log cluster model if adding a cluster fails when syncing from catalog (#4463) 2021-12-01 08:08:48 -05:00
Sebastian Malton
4257fce2f0
Fix NetworkPolicy engresses not having node/pod selectors displayed (#4467) 2021-12-01 08:08:26 -05:00