@@ -224,7 +224,7 @@ export const ComparisonStatusIcon = ({
status,
resource,
label,
- noSpin
+ noSpin,
}: {
status: appModels.SyncStatusCode;
resource?: {requiresPruning?: boolean};
@@ -316,18 +316,18 @@ export const deletePodAction = async (pod: appModels.Pod, appContext: AppContext
} catch (e) {
appContext.apis.notifications.show({
content:
,
- type: NotificationType.Error
+ type: NotificationType.Error,
});
}
- }
- }
+ },
+ },
);
};
export const deletePopup = async (ctx: ContextApis, resource: ResourceTreeNode, application: appModels.Application, appChanged?: BehaviorSubject
) => {
const isManaged = !!resource.status;
const deleteOptions = {
- option: 'foreground'
+ option: 'foreground',
};
function handleStateChange(option: string) {
deleteOptions.option = option;
@@ -371,7 +371,7 @@ export const deletePopup = async (ctx: ContextApis, resource: ResourceTreeNode,
{
validate: vals =>
isManaged && {
- resourceName: vals.resourceName !== resource.name && 'Enter the resource name to confirm the deletion'
+ resourceName: vals.resourceName !== resource.name && 'Enter the resource name to confirm the deletion',
},
submit: async (vals, _, close) => {
const force = deleteOptions.option === 'force';
@@ -385,13 +385,13 @@ export const deletePopup = async (ctx: ContextApis, resource: ResourceTreeNode,
} catch (e) {
ctx.notifications.show({
content: ,
- type: NotificationType.Error
+ type: NotificationType.Error,
});
}
- }
+ },
},
{name: 'argo-icon-warning', color: 'warning'},
- 'yellow'
+ 'yellow',
);
};
@@ -414,11 +414,11 @@ function getResourceActionsMenuItems(resource: ResourceTreeNode, metadata: model
} catch (e) {
apis.notifications.show({
content: ,
- type: NotificationType.Error
+ type: NotificationType.Error,
});
}
- }
- } as MenuItem)
+ },
+ }) as MenuItem,
);
})
.catch(() => [] as MenuItem[]);
@@ -430,7 +430,7 @@ function getActionItems(
tree: appModels.ApplicationTree,
apis: ContextApis,
appChanged: BehaviorSubject,
- isQuickStart: boolean
+ isQuickStart: boolean,
): Observable {
const isRoot = resource.root && nodeKey(resource.root) === nodeKey(resource);
const items: MenuItem[] = [
@@ -438,8 +438,8 @@ function getActionItems(
{
title: 'Sync',
iconClassName: 'fa fa-fw fa-sync',
- action: () => showDeploy(nodeKey(resource), null, apis)
- }
+ action: () => showDeploy(nodeKey(resource), null, apis),
+ },
]) ||
[]),
{
@@ -447,14 +447,14 @@ function getActionItems(
iconClassName: 'fa fa-fw fa-times-circle',
action: async () => {
return deletePopup(apis, resource, application, appChanged);
- }
- }
+ },
+ },
];
if (!isQuickStart) {
items.unshift({
title: 'Details',
iconClassName: 'fa fa-fw fa-info-circle',
- action: () => apis.navigation.goto('.', {node: nodeKey(resource)})
+ action: () => apis.navigation.goto('.', {node: nodeKey(resource)}),
});
}
@@ -462,7 +462,7 @@ function getActionItems(
items.push({
title: 'Logs',
iconClassName: 'fa fa-fw fa-align-left',
- action: () => apis.navigation.goto('.', {node: nodeKey(resource), tab: 'logs'}, {replace: true})
+ action: () => apis.navigation.goto('.', {node: nodeKey(resource), tab: 'logs'}, {replace: true}),
});
}
@@ -473,14 +473,14 @@ function getActionItems(
const execAction = services.authService
.settings()
.then(async settings => {
- const execAllowed = await services.accounts.canI('exec', 'create', application.spec.project + '/' + application.metadata.name);
+ const execAllowed = settings.execEnabled && (await services.accounts.canI('exec', 'create', application.spec.project + '/' + application.metadata.name));
if (resource.kind === 'Pod' && settings.execEnabled && execAllowed) {
return [
{
title: 'Exec',
iconClassName: 'fa fa-fw fa-terminal',
- action: async () => apis.navigation.goto('.', {node: nodeKey(resource), tab: 'exec'}, {replace: true})
- } as MenuItem
+ action: async () => apis.navigation.goto('.', {node: nodeKey(resource), tab: 'exec'}, {replace: true}),
+ } as MenuItem,
];
}
return [] as MenuItem[];
@@ -498,8 +498,8 @@ function getActionItems(
title: link.title,
iconClassName: `fa fa-fw ${link.iconClass ? link.iconClass : 'fa-external-link'}`,
action: () => window.open(link.url, '_blank'),
- tooltip: link.description
- } as MenuItem)
+ tooltip: link.description,
+ }) as MenuItem,
);
})
.catch(() => [] as MenuItem[]);
@@ -508,7 +508,7 @@ function getActionItems(
from([items]), // this resolves immediately
concat([[] as MenuItem[]], resourceActions), // this resolves at first to [] and then whatever the API returns
concat([[] as MenuItem[]], execAction), // this resolves at first to [] and then whatever the API returns
- concat([[] as MenuItem[]], links) // this resolves at first to [] and then whatever the API returns
+ concat([[] as MenuItem[]], links), // this resolves at first to [] and then whatever the API returns
).pipe(map(res => ([] as MenuItem[]).concat(...res)));
}
@@ -518,7 +518,7 @@ export function renderResourceMenu(
tree: appModels.ApplicationTree,
apis: ContextApis,
appChanged: BehaviorSubject,
- getApplicationActionMenu: () => any
+ getApplicationActionMenu: () => any,
): React.ReactNode {
let menuItems: Observable;
@@ -593,7 +593,7 @@ export function renderResourceButtons(
application: appModels.Application,
tree: appModels.ApplicationTree,
apis: ContextApis,
- appChanged: BehaviorSubject
+ appChanged: BehaviorSubject,
): React.ReactNode {
let menuItems: Observable;
menuItems = getActionItems(resource, application, tree, apis, appChanged, true);
@@ -613,12 +613,7 @@ export function renderResourceButtons(
}
}}
icon={item.iconClassName}
- tooltip={
- item.title
- .toString()
- .charAt(0)
- .toUpperCase() + item.title.toString().slice(1)
- }
+ tooltip={item.title.toString().charAt(0).toUpperCase() + item.title.toString().slice(1)}
/>
))}
@@ -810,13 +805,13 @@ export const getAppOperationState = (app: appModels.Application): appModels.Oper
message: (app.status && app.status.operationState && app.status.operationState.message) || 'waiting to start',
startedAt: new Date().toISOString(),
operation: {
- sync: {}
- }
+ sync: {},
+ },
} as appModels.OperationState;
} else if (app.metadata.deletionTimestamp) {
return {
phase: appModels.OperationPhases.Running,
- startedAt: app.metadata.deletionTimestamp
+ startedAt: app.metadata.deletionTimestamp,
} as appModels.OperationState;
} else {
return app.status.operationState;
@@ -952,7 +947,7 @@ export const getPodReadinessGatesState = (pod: appModels.State): {nonExistingCon
if (!pod.spec?.readinessGates?.length) {
return {
nonExistingConditions: [],
- notPassedConditions: []
+ notPassedConditions: [],
};
}
@@ -991,7 +986,7 @@ export const getPodReadinessGatesState = (pod: appModels.State): {nonExistingCon
return {
nonExistingConditions,
- notPassedConditions: failedConditions
+ notPassedConditions: failedConditions,
};
};
@@ -1160,7 +1155,7 @@ export function handlePageVisibility