Skip to content

Commit

Permalink
fix(ui): remove accidentally rendered semi-colon (#12060)
Browse files Browse the repository at this point in the history
Signed-off-by: Anton Gilgur <[email protected]>
  • Loading branch information
Anton Gilgur authored Oct 21, 2023
1 parent 03a6168 commit 7567775
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import * as models from '../../../../models';
import {CronWorkflow, Link, Workflow} from '../../../../models';
import {uiUrl} from '../../../shared/base';
import {ErrorNotice} from '../../../shared/components/error-notice';
import {openLinkWithKey} from '../../../shared/components/links';
import {Loading} from '../../../shared/components/loading';
import {useCollectEvent} from '../../../shared/components/use-collect-event';
import {ZeroState} from '../../../shared/components/zero-state';
Expand All @@ -20,7 +21,7 @@ import {CronWorkflowEditor} from '../cron-workflow-editor';
require('../../../workflows/components/workflow-details/workflow-details.scss');
require('./cron-workflow-details.scss');

export const CronWorkflowDetails = ({match, location, history}: RouteComponentProps<any>) => {
export function CronWorkflowDetails({match, location, history}: RouteComponentProps<any>) {
// boiler-plate
const {navigation, notifications, popup} = useContext(Context);
const queryParams = new URLSearchParams(location.search);
Expand Down Expand Up @@ -107,14 +108,6 @@ export const CronWorkflowDetails = ({match, location, history}: RouteComponentPr
disabled: !cronWorkflow || !cronWorkflow.spec.suspend || edited
};

const openLink = (link: Link) => {
if ((window.event as MouseEvent).ctrlKey || (window.event as MouseEvent).metaKey) {
window.open(link.url, '_blank');
} else {
document.location.href = link.url;
}
};

const getItems = () => {
const items = [
{
Expand Down Expand Up @@ -193,7 +186,7 @@ export const CronWorkflowDetails = ({match, location, history}: RouteComponentPr
items.push({
title: templateLink.name,
iconClassName: icon,
action: () => openLink(templateLink)
action: () => openLinkWithKey(templateLink.url)
});
}

Expand Down Expand Up @@ -262,4 +255,4 @@ export const CronWorkflowDetails = ({match, location, history}: RouteComponentPr
</>
</Page>
);
};
}
2 changes: 1 addition & 1 deletion ui/src/app/reports/components/reports.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export function Reports({match, location, history}: RouteComponentProps<any>) {
<ReportFilters namespace={namespace} labels={labels} onChange={onChange} />
</div>
<div className='columns small-12 xlarge-10'>
<ErrorNotice error={error} />;
<ErrorNotice error={error} />
{!charts ? (
<ZeroState title='Workflow Report'>
<p>
Expand Down

0 comments on commit 7567775

Please sign in to comment.