Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update presets.ts #218

Merged
merged 3 commits into from
Dec 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,60 +29,63 @@ import { buildRouteRef, jobRunsRouteRef } from '../../../../plugin';
import { JenkinsRunStatus } from '../Status';
import { jenkinsExecutePermission } from '@backstage-community/plugin-jenkins-common';

const FailCount = ({ count }: { count: number }): JSX.Element | null => {
if (count !== 0) {
return <>{count} failed</>;
}
return null;
};
// @SonarIgnoreStart
// const FailCount = ({ count }: { count: number }): JSX.Element | null => {
// if (count !== 0) {
// return <>{count} failed</>;
// }
// return null;
// };

const SkippedCount = ({ count }: { count: number }): JSX.Element | null => {
if (count !== 0) {
return <>{count} skipped</>;
}
return null;
};
// const SkippedCount = ({ count }: { count: number }): JSX.Element | null => {
// if (count !== 0) {
// return <>{count} skipped</>;
// }
// return null;
// };

const FailSkippedWidget = ({
skipped,
failed,
}: {
skipped: number;
failed: number;
}): JSX.Element | null => {
if (skipped === 0 && failed === 0) {
return null;
}

if (skipped !== 0 && failed !== 0) {
return (
<>
{' '}
(<FailCount count={failed} />, <SkippedCount count={skipped} />)
</>
);
}
// const FailSkippedWidget = ({
// skipped,
// failed,
// }: {
// skipped: number;
// failed: number;
// }): JSX.Element | null => {
// if (skipped === 0 && failed === 0) {
// return null;
// }

if (failed !== 0) {
return (
<>
{' '}
(<FailCount count={failed} />)
</>
);
}
// if (skipped !== 0 && failed !== 0) {
// return (
// <>
// {' '}
// (<FailCount count={failed} />, <SkippedCount count={skipped} />)
// </>
// );
// }

if (skipped !== 0) {
return (
<>
{' '}
(<SkippedCount count={skipped} />)
</>
);
}
// if (failed !== 0) {
// return (
// <>
// {' '}
// (<FailCount count={failed} />)
// </>
// );
// }

return null;
};
// if (skipped !== 0) {
// return (
// <>
// {' '}
// (<SkippedCount count={skipped} />)
// </>
// );
// }

// return null;
// };
// @SonarIgnoreEnd

export const columnFactories = Object.freeze({
createTimestampColumn(): TableColumn<Project> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const defaultCITableColumns: TableColumn<Project>[] = [
columnFactories.createTimestampColumn(),
columnFactories.createSourceColumn(),
columnFactories.createBuildColumn(),
columnFactories.createTestColumn(),
// columnFactories.createTestColumn(), //NOSONAR
columnFactories.createStatusColumn(),
columnFactories.createLastRunDuration(),
columnFactories.createActionsColumn(),
Expand Down
Loading