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
Fix installation of helm charts #5841
Conversation
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
…nents to be rendered in unit tests Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
|
||
return { | ||
value: computed( | ||
() => state.get() || versionsOfSelectedHelmChart.value.get()[0], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, using ??
is more semantically correct.
@@ -59,7 +61,7 @@ const NonInjectedEditorPanel = observer(({ | |||
autoFocus={autoFocus} | |||
id={tabId} | |||
value={value} | |||
className={cssNames(styles.EditorPanel, className)} | |||
className={cssNames(styles.EditorPanel, className, { hidden })} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems strange, why is this needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because MonacoEditor
works incorrectly
const SomeComponent = observer(({ someProp, value }: Props) => (
<div>
{someProp.get() ? <MonacoEditor value={value.get()} /> : <div>Something else</div>}
</div>
));
someProp.get()
returns truthy value,MonacoEditor
is renderedsomeProp.get()
changes to falsy value,MonacoEditor
is not renderedvalue.get()
changessomeProp.get()
changes back to truthy value,MonacoEditor
renders with old value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then shouldn't we fix MonacoEditor
? That sounds like it isn't checking for an updated value
prop (in componentDidUpdate
or something).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we should. Draw the line here, because there is lot to improve in MonacoEditor
. Issue is that it's calling this.restoreViewState(this.model);
when it creates the editor. Didn't go any deeper than that.
src/renderer/components/dock/install-chart/chart-data/call-for-helm-chart-values.injectable.ts
Show resolved
Hide resolved
const getRandomInstallChartTabIdInjectable = getInjectable({ | ||
id: "get-random-install-chart-tab-id", | ||
instantiate: (di) => di.inject(getRandomIdInjectable), | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is weird, why have this additional level of abstraction?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overriding in test. If I would have overridden getRandomIdInjectable
then all of use places (even the ones not relevant here) would be overridden.
src/renderer/components/dock/install-chart/install-chart-model.injectable.tsx
Outdated
Show resolved
Hide resolved
|
||
instantiate: async (di, tabId: string) => { | ||
const store = di.inject(installChartTabStoreInjectable); | ||
const callForHelmChartValues = di.inject(callForHelmChartValuesInjectable); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment: what is the benefit of naming these sort of injectables with the callFor
prefix? Wouldn't getHelmChartValues
be descriptive enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's just matter of preference and what we're used to.
We've been using callForX
for stuff that needs to be get from somewhere outside of the system. E.g. API call, file system, local storage. getX
doesn't really communicate enough because it could also mean that we are getting some static value from somewhere or e.g. some deeply nested value from the input.
@@ -111,6 +112,9 @@ export const getDiForUnitTesting = (opts: { doGeneralOverrides?: boolean } = {}) | |||
|
|||
di.override(historyInjectable, () => createMemoryHistory()); | |||
di.override(legacyOnChannelListenInjectable, () => () => noop); | |||
|
|||
di.override(storageSaveDelayInjectable, () => 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this override different than that of main
's getDiForUnitTesting
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is used only by createStorage
which is renderer
thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then why should main
even know about it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't?
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
Screen.Recording.2022-07-19.at.8.55.31.AM.movOr maybe this is related to the Upgrade bug |
Yes, this is related to the other issue I created today. #5852 |
The release details page slides in a few extra times (sometimes it doesn't happen till ~30 seconds later) Screen.Recording.2022-07-19.at.10.41.21.PM.mov |
crash after removing a release with an upgrade tab open Screen.Recording.2022-07-19.at.10.59.48.PM.mov |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
approving in case found issues should be fixed in another PR
Fixes #5827
Notice the added behaviours, they describe completely how it should work. There's still lot to improve in the implementation, but that's enough for now.