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

👻 Adds missing dependency link to app drawer #1429

Merged
merged 1 commit into from
Oct 9, 2023
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 @@ -11,15 +11,19 @@ import {
TabTitleText,
Spinner,
Bullseye,
Button,
List,
ListItem,
} from "@patternfly/react-core";
import spacing from "@patternfly/react-styles/css/utilities/Spacing/spacing";
import { Application, Task } from "@app/api/models";
import {
IPageDrawerContentProps,
PageDrawerContent,
} from "@app/components/PageDrawerContext";
import { getIssuesSingleAppSelectedLocation } from "@app/pages/issues/helpers";
import {
getDependenciesUrlFilteredByAppName,
getIssuesSingleAppSelectedLocation,
} from "@app/pages/issues/helpers";
import { ApplicationBusinessService } from "../application-business-service";
import { ApplicationTags } from "../application-tags";

Expand Down Expand Up @@ -83,11 +87,28 @@ export const ApplicationDetailDrawer: React.FC<
>
<TextContent className={`${spacing.mtMd} ${spacing.mbMd}`}>
<Text component="small">{application?.description}</Text>
{application ? (
<Link to={getIssuesSingleAppSelectedLocation(application.id)}>
Issues
</Link>
) : null}
<List isPlain>
{application ? (
<>
<ListItem>
<Link
to={getIssuesSingleAppSelectedLocation(application.id)}
>
Issues
</Link>
</ListItem>
<ListItem>
<Link
to={getDependenciesUrlFilteredByAppName(
application?.name
)}
>
Dependencies
</Link>
</ListItem>
</>
) : null}
</List>
<Title headingLevel="h3" size="md">
{t("terms.businessService")}
</Title>
Expand Down
13 changes: 13 additions & 0 deletions client/src/app/pages/issues/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,19 @@ export const getBackToAllIssuesUrl = ({
})}`;
};

export const getDependenciesUrlFilteredByAppName = (appName: string) => {
const baseUrl = Paths.dependencies;
const filterParams = serializeFilterUrlParams({
"application.name": [appName],
});
const urlParams = trimAndStringifyUrlParams({
newPrefixedSerializedParams: {
filters: filterParams.filters,
},
});
return `${baseUrl}?${urlParams}`;
};

// When selecting an application, we want to preserve any issue filters that might be present.
export const getIssuesSingleAppSelectedLocation = (
applicationId: number,
Expand Down
Loading