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:
parent
bba4d96386
commit
86ac718ee9
@ -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 (
|
||||
|
||||
@ -23,7 +23,7 @@ html {
|
||||
&--is-disabled {
|
||||
opacity: .75;
|
||||
cursor: not-allowed;
|
||||
pointer-events: auto;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
&__control {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user