Skip to content

Commit

Permalink
Add invalidate & update template
Browse files Browse the repository at this point in the history
  • Loading branch information
ibolton336 committed Nov 21, 2023
1 parent d69e399 commit 54da7a5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
8 changes: 3 additions & 5 deletions client/public/template_application_import.csv
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
Record Type,Application Name,Description,Comments,Business Service,Dependency,Dependency Direction,Binary Group,Binary Artifact,Binary Version,Binary Packaging,Repository Type,Repository URL,Repository Branch,Repository Path,Owner,Contributors,Tag Category 1,Tag 1,Tag Category 2,Tag 2,Tag Category 3,Tag 3,Tag Category 4,Tag 4,Tag Category 5,Tag 5,Tag Category 6,Tag 6,Tag Category 7,Tag 7,Tag Category 8,Tag 8,Tag Category 9,Tag 9,Tag Category 10,Tag 10,Tag Category 11,Tag 11,Tag Category 12,Tag 12,Tag Category 13,Tag 13,Tag Category 14,Tag 14,Tag Category 15,Tag 15,Tag Category 16,Tag 16,Tag Category 17,Tag 17,Tag Category 18,Tag 18,Tag Category 19,Tag 19,Tag Category 20,Tag 20
1,Customers,Legacy Customers management service,,Retail,,,corp.acme.demo,customers-tomcat,0.0.1-SNAPSHOT,war,git,https://git-acme.local/customers.git,,,"Alex Johnson <[email protected]>", "Sam Taylor <[email protected]>, Jamie Lee <[email protected]>",Operating System,RHEL 8,Database,Oracle,Language,Java,Runtime,Tomcat,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
1,Inventory,Inventory service,,Retail,,,corp.acme.demo,inventory,0.1.1-SNAPSHOT,war,git,https://git-acme.local/inventory.git,,,"Morgan Bailey <[email protected]>", "Casey Jordan <[email protected]>, Taylor Kim <[email protected]>",Operating System,RHEL 8,Database,Postgresql,Language,Java,Runtime,Quarkus,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
1,Gateway,API Gateway,,Retail,,,corp.acme.demo,gateway,0.1.1-SNAPSHOT,war,git,https://git-acme.local/gateway.git,,,"Jordan Parker <[email protected]>", "Dana Murphy <[email protected]>, Alex Smith <[email protected]>",Operating System,RHEL 8,,,Language,Java,Runtime,Spring Boot,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
2,Gateway,,,,Inventory,southbound,,,
2,Gateway,,,,Customers,southbound,,,
1,Customer Management,Legacy Customers management service,,Retail,,,corp.acme.demo,customers-tomcat,0.0.1-SNAPSHOT,war,git,https://git-acme.local/customers.git,,,"Alex Johnson <[email protected]>", "Sam Taylor <[email protected]>, Jamie Lee <[email protected]>",Operating System,RHEL 8,Database,Oracle,Language,Java,Runtime,Tomcat,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
1,Inventory Tracker,Inventory service,,Retail,,,corp.acme.demo,inventory,0.1.1-SNAPSHOT,war,git,https://git-acme.local/inventory.git,,,"Morgan Bailey <[email protected]>", "Casey Jordan <[email protected]>, Taylor Kim <[email protected]>",Operating System,RHEL 8,Database,Postgresql,Language,Java,Runtime,Quarkus,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
1,API Gateway Service,API Gateway,,Retail,,,corp.acme.demo,gateway,0.1.1-SNAPSHOT,war,git,https://git-acme.local/gateway.git,,,"Jordan Parker <[email protected]>", "Dana Murphy <[email protected]>, Alex Smith <[email protected]>",Operating System,RHEL 8,,,Language,Java,Runtime,Spring Boot,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export const ManageImports: React.FC = () => {

const { importSummaries, isFetching, fetchError, refetch } =
useFetchImportSummaries();

const [importSummaryToDelete, setImportSummaryToDelete] =
useState<ApplicationImportSummary>();

Expand Down Expand Up @@ -318,8 +319,10 @@ export const ManageImports: React.FC = () => {
</Td>
<Td width={10}>{importSummary.validCount}</Td>
<Td width={10}>
{importSummary.invalidCount > 0 && (
{importSummary.invalidCount > 0 ? (
<span>{importSummary.invalidCount}</span>
) : (
<span>-</span>
)}
</Td>
<Td width={10}>
Expand Down
6 changes: 4 additions & 2 deletions client/src/app/queries/imports.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useMutation, useQuery } from "@tanstack/react-query";
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";

import {
deleteApplicationImportSummary,
Expand Down Expand Up @@ -49,7 +49,7 @@ export const useFetchImportSummaryById = (id: number | string) => {
queryFn: () => getApplicationImportSummaryById(id),
onError: (error) => console.log(error),
});

return {
importSummary: data,
isFetching: isLoading,
Expand All @@ -62,10 +62,12 @@ export const useDeleteImportSummaryMutation = (
onSuccess: () => void,
onError: (err: Error | null) => void
) => {
const queryClient = useQueryClient();
return useMutation({
mutationFn: deleteApplicationImportSummary,
onSuccess: () => {
onSuccess && onSuccess();
queryClient.invalidateQueries([ImportSummariesQueryKey]);
},
onError: (err: Error) => {
onError && onError(err);
Expand Down

0 comments on commit 54da7a5

Please sign in to comment.