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:
parent
03847fcd55
commit
2549c16402
@ -356,7 +356,7 @@ export async function attemptInstallByInfo({ name, version, requireConfirmation
|
|||||||
return attemptInstall({ fileName, dataP }, disposer);
|
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 dispose = disposer(ExtensionInstallationStateStore.startPreInstall(), d);
|
||||||
const validatedRequest = await createTempFilesAndValidate(request);
|
const validatedRequest = await createTempFilesAndValidate(request);
|
||||||
|
|
||||||
@ -416,7 +416,7 @@ async function attemptInstall(request: InstallRequest, d?: ExtendableDisposer):
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function attemptInstalls(filePaths: string[]): Promise<void> {
|
async function attemptInstalls(filePaths: string[]): Promise<void> {
|
||||||
const promises: Promise<void>[] = [];
|
const promises: Promise<any>[] = [];
|
||||||
|
|
||||||
for (const filePath of filePaths) {
|
for (const filePath of filePaths) {
|
||||||
promises.push(attemptInstall({
|
promises.push(attemptInstall({
|
||||||
|
|||||||
@ -116,13 +116,8 @@ export class CreateResource extends React.Component<Props> {
|
|||||||
const creatingResources = resources.map(async (resource: string) => {
|
const creatingResources = resources.map(async (resource: string) => {
|
||||||
try {
|
try {
|
||||||
const data: KubeJsonApiData = await resourceApplierApi.update(resource);
|
const data: KubeJsonApiData = await resourceApplierApi.update(resource);
|
||||||
const resourceName = data.metadata.name;
|
const { kind, apiVersion, metadata: { name, namespace }} = data;
|
||||||
const resourceLink = apiManager.lookupApiLink({
|
const resourceLink = apiManager.lookupApiLink({ kind, apiVersion, name, namespace });
|
||||||
kind: data.kind,
|
|
||||||
apiVersion: data.apiVersion,
|
|
||||||
name: resourceName,
|
|
||||||
namespace: data.metadata.namespace,
|
|
||||||
});
|
|
||||||
|
|
||||||
const showDetails = () => {
|
const showDetails = () => {
|
||||||
navigate(getDetailsUrl(resourceLink));
|
navigate(getDetailsUrl(resourceLink));
|
||||||
@ -131,7 +126,7 @@ export class CreateResource extends React.Component<Props> {
|
|||||||
|
|
||||||
const close = Notifications.ok(
|
const close = Notifications.ok(
|
||||||
<p>
|
<p>
|
||||||
Resource <a onClick={prevDefault(showDetails)}>{resourceName}</a> successfully created.
|
{kind} <a onClick={prevDefault(showDetails)}>{name}</a> successfully created.
|
||||||
</p>,
|
</p>,
|
||||||
);
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@ -43,7 +43,7 @@ export class Notifications extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static error(message: NotificationMessage, customOpts: Partial<Notification> = {}) {
|
static error(message: NotificationMessage, customOpts: Partial<Notification> = {}) {
|
||||||
notificationsStore.add({
|
return notificationsStore.add({
|
||||||
message,
|
message,
|
||||||
timeout: 10_000,
|
timeout: 10_000,
|
||||||
status: NotificationStatus.ERROR,
|
status: NotificationStatus.ERROR,
|
||||||
@ -52,7 +52,7 @@ export class Notifications extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static shortInfo(message: NotificationMessage, customOpts: Partial<Notification> = {}) {
|
static shortInfo(message: NotificationMessage, customOpts: Partial<Notification> = {}) {
|
||||||
this.info(message, {
|
return this.info(message, {
|
||||||
timeout: 5_000,
|
timeout: 5_000,
|
||||||
...customOpts,
|
...customOpts,
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user