Skip to content

Commit

Permalink
Merge pull request #1372 from flanksource/1365-rename-config-catalog
Browse files Browse the repository at this point in the history
1365-rename-config-catalog
  • Loading branch information
moshloop authored Sep 12, 2023
2 parents c671bc4 + cbf6dd3 commit 602b182
Show file tree
Hide file tree
Showing 35 changed files with 79 additions and 59 deletions.
9 changes: 6 additions & 3 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ const navigation: NavigationItems = [
resourceName: tables.incident
},
{
name: "Config",
href: "/configs",
name: "Catalog",
href: "/catalog",
icon: VscJson,
featureName: features.config,
resourceName: tables.database
Expand Down Expand Up @@ -368,7 +368,10 @@ export function IncidentManagerRoutes({ sidebar }: { sidebar: ReactNode }) {
/>
</Route>

<Route path="configs" element={sidebar}>
{/* Redirect configs to catalog */}
<Route path="configs" element={<Navigate to="/catalog" />} />

<Route path="catalog" element={sidebar}>
<Route
index
element={withAccessCheck(<ConfigListPage />, tables.database, "read")}
Expand Down
2 changes: 1 addition & 1 deletion src/components/BreadcrumbNav/ConfigsDetailsBreadCrumb.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function ConfigsDetailsBreadcrumbNav({ configId, config }: Props) {
return (
<BreadcrumbNav
list={[
<BreadcrumbRoot link="/configs">Config</BreadcrumbRoot>,
<BreadcrumbRoot link="/catalog">Catalog</BreadcrumbRoot>,
isLoading && !configItem ? (
<TextSkeletonLoader />
) : (
Expand Down
4 changes: 2 additions & 2 deletions src/components/ConfigAnalysis/ConfigInsightsColumns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const ConfigInsightsColumns: ColumnDef<
any
>[] = [
{
header: "Config",
header: "Catalog",
id: "config",
aggregatedCell: "",
size: 100,
Expand All @@ -23,7 +23,7 @@ export const ConfigInsightsColumns: ColumnDef<
<div className="flex max-w-full truncate">
<Link
className="space-x-2 items-center"
to={`/configs/${config?.id}`}
to={`/catalog/${config?.id}`}
>
<Icon
className="w-4 h-4"
Expand Down
4 changes: 2 additions & 2 deletions src/components/ConfigBreadcrumb/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function ConfigBreadcrumb({ setTitle }: ConfigBreadcrumbProps) {

useEffect(() => {
if (!id) {
setTitle(<BreadcrumbNav list={["Config"]} />);
setTitle(<BreadcrumbNav list={["Catalog"]} />);
return;
}

Expand All @@ -23,7 +23,7 @@ export function ConfigBreadcrumb({ setTitle }: ConfigBreadcrumbProps) {
setTitle(
<BreadcrumbNav
list={[
{ to: "/configs", title: "Config" },
{ to: "/catalog", title: "Catalog" },
<span>
<Icon
name={data?.type}
Expand Down
2 changes: 1 addition & 1 deletion src/components/ConfigChangeHistory/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const columns: ColumnDef<ConfigTypeChanges>[] = [

const configLinkCol: ColumnDef<ConfigTypeChanges>[] = [
{
header: "Config",
header: "Catalog",
accessorKey: "config_id",
cell: function ConfigLinkCell({ row, column }) {
const config = row.original.config;
Expand Down
2 changes: 1 addition & 1 deletion src/components/ConfigLink/ConfigLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default function ConfigLink({
return (
<Link
to={{
pathname: `/configs/${configId}`
pathname: `/catalog/${configId}`
}}
className={clsx("flex flex-row space-x-1", className)}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function ConfigListToggledDeletedItems() {
setHideDeletedConfigs("no");
}
}}
label="Hide Deleted Configs"
label="Hide Deleted Catalog"
value={hideDeletedConfigs === "yes"}
/>
</div>
Expand Down
12 changes: 6 additions & 6 deletions src/components/ConfigsPage/ConfigTabsLinks.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { useParams } from "react-router-dom";

export const configTabsLists = [
{ label: "Config", path: "/configs" },
{ label: "Changes", path: "/configs/changes" },
{ label: "Insights", path: "/configs/insights" }
{ label: "Catalog", path: "/catalog" },
{ label: "Changes", path: "/catalog/changes" },
{ label: "Insights", path: "/catalog/insights" }
];

export function useConfigDetailsTabs() {
const { id } = useParams<{ id: string }>();

return [
{ label: "Config", path: `/configs/${id}` },
{ label: "Changes", path: `/configs/${id}/changes` },
{ label: "Insights", path: `/configs/${id}/insights` }
{ label: "Catalog", path: `/catalog/${id}` },
{ label: "Changes", path: `/catalog/${id}/changes` },
{ label: "Insights", path: `/catalog/${id}/insights` }
];
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { useForm } from "react-hook-form";
import { AddResponderFormValues } from "../../AddResponders/AddResponder";
import { AwsServiceRequest } from "./index";
import { ComponentStory, StoryFn } from "@storybook/react";
import { ComponentProps } from "react";

export default {
title: "AwsServiceRequest",
Expand Down Expand Up @@ -56,7 +58,7 @@ const FormContainer = () => {
);
};

const Template = (arg) => <FormContainer {...arg} />;
const Template: StoryFn = (arg) => <FormContainer {...arg} />;

export const Variant1 = Template.bind({});
Variant1.args = {};
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useForm } from "react-hook-form";
import { AddResponderFormValues } from "../../AddResponders/AddResponder";
import { AwsSupport } from "./index";
import { StoryFn } from "@storybook/react";

export default {
title: "AwsSupport",
Expand Down Expand Up @@ -52,7 +53,7 @@ const FormContainer = () => {
);
};

const Template = (arg) => <FormContainer {...arg} />;
const Template: StoryFn = (arg) => <FormContainer {...arg} />;

export const Variant1 = Template.bind({});
Variant1.args = {};
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useForm } from "react-hook-form";
import { AddResponderFormValues } from "../../AddResponders/AddResponder";
import { CA } from "./index";
import { StoryFn } from "@storybook/react";

export default {
title: "CA",
Expand Down Expand Up @@ -52,7 +53,7 @@ const FormContainer = () => {
);
};

const Template = (arg) => <FormContainer {...arg} />;
const Template: StoryFn = (arg) => <FormContainer {...arg} />;

export const Variant1 = Template.bind({});
Variant1.args = {};
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useForm } from "react-hook-form";
import { AddResponderFormValues } from "../../AddResponders/AddResponder";
import { Email } from "./index";
import { StoryFn } from "@storybook/react";

export default {
title: "Email",
Expand Down Expand Up @@ -52,7 +53,7 @@ const FormContainer = () => {
);
};

const Template = (arg) => <FormContainer {...arg} />;
const Template: StoryFn = (arg) => <FormContainer {...arg} />;

export const Variant1 = Template.bind({});
Variant1.args = {};
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useForm } from "react-hook-form";
import { AddResponderFormValues } from "../../AddResponders/AddResponder";
import { Jira } from "./index";
import { StoryFn } from "@storybook/react";

export default {
title: "Jira",
Expand Down Expand Up @@ -39,7 +40,7 @@ const FormContainer = () => {
};
return (
<div className="flex flex-col">
<Jira control={control} errors={errors} setValue={setValue} />
<Jira control={control} errors={errors} setValue={setValue} teamId="" />
<div className="flex flex-row">
<button className="btn-secondary p-2 m-2" onClick={(e) => reset()}>
reset
Expand All @@ -52,7 +53,7 @@ const FormContainer = () => {
);
};

const Template = (arg) => <FormContainer {...arg} />;
const Template: StoryFn = (arg) => <FormContainer {...arg} />;

export const Variant1 = Template.bind({});
Variant1.args = {};
6 changes: 3 additions & 3 deletions src/components/IncidentDetails/ResponderTypes/Jira/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useEffect, useRef, useState } from "react";
import {
Control,
Controller,
FieldErrors,
FieldErrorsImpl,
UseFormSetValue
} from "react-hook-form";
import { searchConfigs } from "../../../../api/services/configs";
Expand All @@ -14,7 +14,7 @@ import { AddResponderFormValues } from "../../AddResponders/AddResponder";
type JiraProps = {
teamId: string;
control: Control;
errors: FieldErrors;
errors: FieldErrorsImpl<AddResponderFormValues>;
setValue: UseFormSetValue<AddResponderFormValues>;
defaultValues?: { [key: string]: any } | undefined;
values?: { [key: string]: any } | undefined;
Expand Down Expand Up @@ -91,7 +91,7 @@ export const Jira = ({
}}
label={
<label className="block text-sm font-bold text-gray-700 mb-2">
Jira Config Type
Jira Instance
</label>
}
value={jiraProjectType}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useForm } from "react-hook-form";
import { AddResponderFormValues } from "../../AddResponders/AddResponder";
import { MicrosoftPlanner } from "./index";
import { StoryFn } from "@storybook/react";

export default {
title: "MicrosoftPlanner",
Expand Down Expand Up @@ -39,7 +40,12 @@ const FormContainer = () => {
};
return (
<div className="flex flex-col">
<MicrosoftPlanner control={control} errors={errors} setValue={setValue} />
<MicrosoftPlanner
teamId=""
control={control}
errors={errors}
setValue={setValue}
/>
<div className="flex flex-row">
<button className="btn-secondary p-2 m-2" onClick={(e) => reset()}>
reset
Expand All @@ -52,7 +58,7 @@ const FormContainer = () => {
);
};

const Template = (arg) => <FormContainer {...arg} />;
const Template: StoryFn = (arg) => <FormContainer {...arg} />;

export const Variant1 = Template.bind({});
Variant1.args = {};
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export const MicrosoftPlanner = ({
}}
label={
<label className="block text-sm font-bold text-gray-700 mb-2">
MSPlanner Config Type
Microsoft Planner Instance
</label>
}
value={msProjectType}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useForm } from "react-hook-form";
import { AddResponderFormValues } from "../../AddResponders/AddResponder";
import { Oracle } from "./index";
import { StoryFn } from "@storybook/react";

export default {
title: "Oracle",
Expand Down Expand Up @@ -52,7 +53,7 @@ const FormContainer = () => {
);
};

const Template = (arg) => <FormContainer {...arg} />;
const Template: StoryFn = (arg) => <FormContainer {...arg} />;

export const Variant1 = Template.bind({});
Variant1.args = {};
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useForm } from "react-hook-form";
import { AddResponderFormValues } from "../../AddResponders/AddResponder";
import { Person } from "./index";
import { StoryFn } from "@storybook/react";

export default {
title: "Person",
Expand Down Expand Up @@ -52,7 +53,7 @@ const FormContainer = () => {
);
};

const Template = (arg) => <FormContainer {...arg} />;
const Template: StoryFn = (arg) => <FormContainer {...arg} />;

export const Variant1 = Template.bind({});
Variant1.args = {};
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useForm } from "react-hook-form";
import { AddResponderFormValues } from "../../AddResponders/AddResponder";
import { Redhat } from "./index";
import { StoryFn } from "@storybook/react";

export default {
title: "Redhat",
Expand Down Expand Up @@ -52,7 +53,7 @@ const FormContainer = () => {
);
};

const Template = (arg) => <FormContainer {...arg} />;
const Template: StoryFn = (arg) => <FormContainer {...arg} />;

export const Variant1 = Template.bind({});
Variant1.args = {};
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useForm } from "react-hook-form";
import { AddResponderFormValues } from "../../AddResponders/AddResponder";
import { ServiceNow } from "./index";
import { StoryFn } from "@storybook/react";

export default {
title: "ServiceNow",
Expand Down Expand Up @@ -52,7 +53,7 @@ const FormContainer = () => {
);
};

const Template = (arg) => <FormContainer {...arg} />;
const Template: StoryFn = (arg) => <FormContainer {...arg} />;

export const Variant1 = Template.bind({});
Variant1.args = {};
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useForm } from "react-hook-form";
import { AddResponderFormValues } from "../../AddResponders/AddResponder";
import { VMWare } from "./index";
import { StoryFn } from "@storybook/react";

export default {
title: "VMWare",
Expand Down Expand Up @@ -52,7 +53,7 @@ const FormContainer = () => {
);
};

const Template = (arg) => <FormContainer {...arg} />;
const Template: StoryFn = (arg) => <FormContainer {...arg} />;

export const Variant1 = Template.bind({});
Variant1.args = {};
2 changes: 1 addition & 1 deletion src/components/JobsHistory/Filters/JobsHistoryFilters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const jobHistoryResourceTypes = [
value: "topology"
},
{
label: "Config Scraper",
label: "Catalog Scraper",
value: "config_scraper"
}
];
Expand Down
2 changes: 1 addition & 1 deletion src/components/Playbooks/Settings/PlaybookSpecsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const playbookSpecsTableColumns: ColumnDef<PlaybookSpec>[] = [
size: 150
},
{
header: "Source Config",
header: "Source",
accessorKey: "source",
id: "source",
size: 150
Expand Down
2 changes: 1 addition & 1 deletion src/components/SchemaResourcePage/SchemaResourceEdit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ export function SchemaResourceEdit({
</h2>
{!!source && (
<div className="px-2">
<a href={`${source}`}>Config source</a>
<a href={`${source}`}>Catalog source</a>
</div>
)}
</div>
Expand Down
Loading

0 comments on commit 602b182

Please sign in to comment.