Skip to content

Commit

Permalink
Merge pull request #2969 from the-deep/feature/no-af-in-project
Browse files Browse the repository at this point in the history
Add info message for projects with no analysis framework
  • Loading branch information
AdityaKhatri authored Jul 18, 2024
2 parents f3cbace + acdd553 commit eadfb75
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
15 changes: 15 additions & 0 deletions app/views/Sources/SourcesTable/Actions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
IoChevronUpOutline,
IoChevronDownOutline,
IoWarningOutline,
IoInformation,
} from 'react-icons/io5';
import { _cs, isDefined } from '@togglecorp/fujs';
import { MdModeEdit } from 'react-icons/md';
Expand All @@ -15,6 +16,7 @@ import {
useConfirmation,
Button,
RowExpansionContext,
Tooltip,
useModalState,
useAlert,
} from '@the-deep/deep-ui';
Expand Down Expand Up @@ -209,9 +211,22 @@ function Actions<T extends string>(props: Props<T>) {
: entriesCount < 1;
const noOfEntries = filteredEntriesCount ?? entriesCount;

const projectHasFramework = isDefined(project?.analysisFramework?.id);

return (
<div className={_cs(styles.actions, className)}>
<div className={styles.row}>
{!projectHasFramework && (
<div className={styles.info}>
<IoInformation />
<Tooltip>
Looks like you have not chosen a framework for your project.
Please edit your project or ask your admin to select a
framework and start tagging.
</Tooltip>
</div>

)}
{canEditSource && (
<QuickActionButton
className={styles.button}
Expand Down
9 changes: 9 additions & 0 deletions app/views/Sources/SourcesTable/Actions/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@
justify-content: flex-end;
gap: var(--dui-spacing-small);

.info {
display: flex;
align-items: center;
justify-content: center;
border: var(--dui-width-separator-thin) solid var(--dui-color-separator);
border-radius: 50%;
padding: var(--dui-spacing-extra-small);
}

.button {
flex-shrink: 0;
}
Expand Down

0 comments on commit eadfb75

Please sign in to comment.