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

responding to comments

Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
Roman 2021-11-25 17:20:11 +02:00
parent 03847fcd55
commit 2549c16402
3 changed files with 7 additions and 12 deletions

View File

@ -356,7 +356,7 @@ export async function attemptInstallByInfo({ name, version, requireConfirmation
return attemptInstall({ fileName, dataP }, disposer);
}
async function attemptInstall(request: InstallRequest, d?: ExtendableDisposer): Promise<void> {
async function attemptInstall(request: InstallRequest, d?: ExtendableDisposer): Promise<void | (() => void)> {
const dispose = disposer(ExtensionInstallationStateStore.startPreInstall(), d);
const validatedRequest = await createTempFilesAndValidate(request);
@ -416,7 +416,7 @@ async function attemptInstall(request: InstallRequest, d?: ExtendableDisposer):
}
async function attemptInstalls(filePaths: string[]): Promise<void> {
const promises: Promise<void>[] = [];
const promises: Promise<any>[] = [];
for (const filePath of filePaths) {
promises.push(attemptInstall({

View File

@ -116,13 +116,8 @@ export class CreateResource extends React.Component<Props> {
const creatingResources = resources.map(async (resource: string) => {
try {
const data: KubeJsonApiData = await resourceApplierApi.update(resource);
const resourceName = data.metadata.name;
const resourceLink = apiManager.lookupApiLink({
kind: data.kind,
apiVersion: data.apiVersion,
name: resourceName,
namespace: data.metadata.namespace,
});
const { kind, apiVersion, metadata: { name, namespace }} = data;
const resourceLink = apiManager.lookupApiLink({ kind, apiVersion, name, namespace });
const showDetails = () => {
navigate(getDetailsUrl(resourceLink));
@ -131,7 +126,7 @@ export class CreateResource extends React.Component<Props> {
const close = Notifications.ok(
<p>
Resource <a onClick={prevDefault(showDetails)}>{resourceName}</a> successfully created.
{kind} <a onClick={prevDefault(showDetails)}>{name}</a> successfully created.
</p>,
);
} catch (error) {

View File

@ -43,7 +43,7 @@ export class Notifications extends React.Component {
}
static error(message: NotificationMessage, customOpts: Partial<Notification> = {}) {
notificationsStore.add({
return notificationsStore.add({
message,
timeout: 10_000,
status: NotificationStatus.ERROR,
@ -52,7 +52,7 @@ export class Notifications extends React.Component {
}
static shortInfo(message: NotificationMessage, customOpts: Partial<Notification> = {}) {
this.info(message, {
return this.info(message, {
timeout: 5_000,
...customOpts,
});