Simplifying Helm loading state

Signed-off-by: alexfront <alex.andreev.email@gmail.com>
This commit is contained in:
alexfront committed 2020-08-17 12:41:06 +03:00
1 parent bba4d96386
commit 86ac718ee9
2 files changed
+5 -6

No files matched your search

@@ -21,7 +21,6 @@ import { Tooltip } from "../tooltip";
@observer
export class Preferences extends React.Component {
@observable helmLoading = false;
@observable helmUpdating = false;
@observable helmRepos: HelmRepo[] = [];
@observable helmAddedRepos = observable.map<string, HelmRepo>();
@@ -90,9 +89,9 @@ export class Preferences extends React.Component {
Notifications.ok(<Trans>Helm branch <b>{repo.name}</b> already in use</Trans>)
return;
}
this.helmUpdating = false;
this.helmLoading = true;
await this.addRepo(repo);
this.helmUpdating = false;
this.helmLoading = false;
}
formatHelmOptionLabel = ({ value: repo }: SelectOption<HelmRepo>) => {
@@ -135,14 +134,14 @@ export class Preferences extends React.Component {
<Select
placeholder={<Trans>Repositories</Trans>}
isLoading={this.helmLoading}
isDisabled={this.helmUpdating}
isDisabled={this.helmLoading}
options={this.helmOptions}
onChange={this.onRepoSelect}
formatOptionLabel={this.formatHelmOptionLabel}
controlShouldRenderValue={false}
/>
<div className="repos flex gaps column">
{this.helmLoading && <Spinner center />}
{Array.from(this.helmAddedRepos).map(([name, repo]) => {
const tooltipId = `message-${name}`;
return (
+1 -1
View File
@@ -23,7 +23,7 @@ html {
&--is-disabled {
opacity: .75;
cursor: not-allowed;
pointer-events: auto;
pointer-events: none;
}
&__control {