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

Simplifying Helm loading state

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

View File

@ -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 (

View File

@ -23,7 +23,7 @@ html {
&--is-disabled {
opacity: .75;
cursor: not-allowed;
pointer-events: auto;
pointer-events: none;
}
&__control {