Skip to content

Commit

Permalink
Use consistent tag name
Browse files Browse the repository at this point in the history
  • Loading branch information
allisonking committed Apr 27, 2023
1 parent 57a3d0b commit 0a4bb46
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 46 deletions.
16 changes: 8 additions & 8 deletions clients/admin-ui/src/features/common/api.slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,27 @@ export const baseApi = createApi({
},
}),
tagTypes: [
"AllowList",
"Allow List",
"Auth",
"ClassifyInstancesDatasets",
"ClassifyInstancesSystems",
"Classify Instances Datasets",
"Classify Instances Systems",
"Connection Type",
"CustomFieldDefinition",
"CustomFields",
"Custom Field Definition",
"Custom Fields",
"Data Categories",
"Datamap",
"Data Subjects",
"Data Qualifiers",
"Data Uses",
"DatastoreConnection",
"Datastore Connection",
"Dataset",
"Datasets",
"LatestScan",
"Latest Scan",
"Managed Systems",
"Notification",
"Organization",
"Plus",
"PrivacyNotices",
"Privacy Notices",
"System",
"Request",
"Roles",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export const datastoreConnectionApi = baseApi.injectEndpoints({
method: "POST",
body: params.body,
}),
invalidatesTags: () => ["DatastoreConnection"],
invalidatesTags: () => ["Datastore Connection"],
}),
createSassConnectionConfig: build.mutation<
CreateSaasConnectionConfigResponse,
Expand All @@ -173,20 +173,20 @@ export const datastoreConnectionApi = baseApi.injectEndpoints({
body: { ...params },
}),
// Creating a connection config also creates a dataset behind the scenes
invalidatesTags: ["DatastoreConnection", "Datasets"],
invalidatesTags: ["Datastore Connection", "Datasets"],
}),
deleteDatastoreConnection: build.mutation({
query: (id) => ({
url: `${CONNECTION_ROUTE}/${id}`,
method: "DELETE",
}),
invalidatesTags: () => ["DatastoreConnection"],
invalidatesTags: () => ["Datastore Connection"],
}),
getAccessManualHook: build.query<GetAccessManualWebhookResponse, string>({
query: (key) => ({
url: `${CONNECTION_ROUTE}/${key}/access_manual_webhook`,
}),
providesTags: () => ["DatastoreConnection"],
providesTags: () => ["Datastore Connection"],
}),
getAllDatastoreConnections: build.query<
DatastoreConnectionsResponse,
Expand All @@ -195,7 +195,7 @@ export const datastoreConnectionApi = baseApi.injectEndpoints({
query: (filters) => ({
url: CONNECTION_ROUTE + mapFiltersToSearchParams(filters),
}),
providesTags: () => ["DatastoreConnection"],
providesTags: () => ["Datastore Connection"],
}),
getAllEnabledAccessManualHooks: build.query<
GetAllEnabledAccessManualWebhooksResponse,
Expand All @@ -204,22 +204,22 @@ export const datastoreConnectionApi = baseApi.injectEndpoints({
query: () => ({
url: `access_manual_webhook`,
}),
providesTags: () => ["DatastoreConnection"],
providesTags: () => ["Datastore Connection"],
}),
getDatastoreConnectionByKey: build.query<DatastoreConnection, string>({
query: (key) => ({
url: `${CONNECTION_ROUTE}/${key}`,
}),
providesTags: (result) => [
{ type: "DatastoreConnection", id: result?.key },
{ type: "Datastore Connection", id: result?.key },
],
keepUnusedDataFor: 1,
}),
getDatasetConfigs: build.query<Page_DatasetConfigSchema_, string>({
query: (key) => ({
url: `${CONNECTION_ROUTE}/${key}/datasetconfig`,
}),
providesTags: () => ["DatastoreConnection"],
providesTags: () => ["Datastore Connection"],
}),
getDatastoreConnectionStatus: build.query<
DatastoreConnectionStatus,
Expand All @@ -228,7 +228,7 @@ export const datastoreConnectionApi = baseApi.injectEndpoints({
query: (id) => ({
url: `${CONNECTION_ROUTE}/${id}/test`,
}),
providesTags: () => ["DatastoreConnection"],
providesTags: () => ["Datastore Connection"],
async onQueryStarted(key, { dispatch, queryFulfilled, getState }) {
try {
await queryFulfilled;
Expand Down Expand Up @@ -274,7 +274,7 @@ export const datastoreConnectionApi = baseApi.injectEndpoints({
method: "PATCH",
body: params.body,
}),
invalidatesTags: () => ["DatastoreConnection"],
invalidatesTags: () => ["Datastore Connection"],
}),
patchDatasetConfigs: build.mutation<
BulkPutDataset,
Expand All @@ -285,7 +285,7 @@ export const datastoreConnectionApi = baseApi.injectEndpoints({
method: "PATCH",
body: params.dataset_pairs,
}),
invalidatesTags: () => ["DatastoreConnection"],
invalidatesTags: () => ["Datastore Connection"],
}),
patchDatastoreConnection: build.mutation<
DatastoreConnectionResponse,
Expand All @@ -296,15 +296,15 @@ export const datastoreConnectionApi = baseApi.injectEndpoints({
method: "PATCH",
body: [params],
}),
invalidatesTags: () => ["DatastoreConnection"],
invalidatesTags: () => ["Datastore Connection"],
}),
patchDatastoreConnections: build.mutation({
query: ({ key, name, disabled, connection_type, access }) => ({
url: CONNECTION_ROUTE,
method: "PATCH",
body: [{ key, name, disabled, connection_type, access }],
}),
invalidatesTags: () => ["DatastoreConnection"],
invalidatesTags: () => ["Datastore Connection"],
}),
updateDatastoreConnectionSecrets: build.mutation<
DatastoreConnectionSecretsResponse,
Expand All @@ -315,7 +315,7 @@ export const datastoreConnectionApi = baseApi.injectEndpoints({
method: "PUT",
body: params.secrets,
}),
invalidatesTags: () => ["DatastoreConnection"],
invalidatesTags: () => ["Datastore Connection"],
}),
}),
});
Expand Down
40 changes: 20 additions & 20 deletions clients/admin-ui/src/features/plus/plus.slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const plusApi = baseApi.injectEndpoints({
method: "POST",
body,
}),
invalidatesTags: ["ClassifyInstancesDatasets"],
invalidatesTags: ["Classify Instances Datasets"],
}),
updateClassifyInstance: build.mutation<
void,
Expand All @@ -75,9 +75,9 @@ const plusApi = baseApi.injectEndpoints({
},
invalidatesTags: (response, errors, args) => {
if (args.resource_type === GenerateTypes.SYSTEMS) {
return ["ClassifyInstancesSystems"];
return ["Classify Instances Systems"];
}
return ["ClassifyInstancesDatasets"];
return ["Classify Instances Datasets"];
},
}),
getAllClassifyInstances: build.query<
Expand All @@ -97,24 +97,24 @@ const plusApi = baseApi.injectEndpoints({
},
providesTags: (response, errors, args) => {
if (args.resource_type === GenerateTypes.SYSTEMS) {
return ["ClassifyInstancesSystems"];
return ["Classify Instances Systems"];
}
return ["ClassifyInstancesDatasets"];
return ["Classify Instances Datasets"];
},
}),
getClassifyDataset: build.query<ClassificationResponse, string>({
query: (dataset_fides_key: string) => ({
url: `plus/classify/details/${dataset_fides_key}`,
params: { resource_type: GenerateTypes.DATASETS },
}),
providesTags: ["ClassifyInstancesDatasets"],
providesTags: ["Classify Instances Datasets"],
}),
getClassifySystem: build.query<ClassifySystem | ClassifyEmpty, string>({
query: (fidesKey: string) => ({
url: `plus/classify/details/${fidesKey}`,
params: { resource_type: GenerateTypes.SYSTEMS },
}),
providesTags: ["ClassifyInstancesSystems"],
providesTags: ["Classify Instances Systems"],
}),

// Kubernetes Cluster Scanner
Expand All @@ -124,15 +124,15 @@ const plusApi = baseApi.injectEndpoints({
params,
method: "PUT",
}),
invalidatesTags: ["ClassifyInstancesSystems", "LatestScan"],
invalidatesTags: ["Classify Instances Systems", "Latest Scan"],
}),
getLatestScanDiff: build.query<SystemsDiff, void>({
query: () => ({
url: `plus/scan/latest`,
params: { diff: true },
method: "GET",
}),
providesTags: ["LatestScan"],
providesTags: ["Latest Scan"],
}),

// Custom Metadata Allow List
Expand All @@ -141,7 +141,7 @@ const plusApi = baseApi.injectEndpoints({
url: `plus/custom-metadata/allow-list`,
params: { show_values },
}),
providesTags: ["AllowList"],
providesTags: ["Allow List"],
transformResponse: (allowList: AllowList[]) =>
allowList.sort((a, b) => (a.name ?? "").localeCompare(b.name ?? "")),
}),
Expand All @@ -150,15 +150,15 @@ const plusApi = baseApi.injectEndpoints({
url: `plus/custom-metadata/allow-list/${id}`,
params: { show_values: true },
}),
providesTags: ["AllowList"],
providesTags: ["Allow List"],
}),
upsertAllowList: build.mutation<AllowList, AllowListUpdate>({
query: (params: AllowListUpdate) => ({
url: `plus/custom-metadata/allow-list`,
method: "PUT",
body: params,
}),
invalidatesTags: ["AllowList"],
invalidatesTags: ["Allow List"],
}),

// Custom Metadata Custom Field
Expand All @@ -167,13 +167,13 @@ const plusApi = baseApi.injectEndpoints({
url: `plus/custom-metadata/custom-field/${id}`,
method: "DELETE",
}),
invalidatesTags: ["CustomFields"],
invalidatesTags: ["Custom Fields"],
}),
getCustomFieldsForResource: build.query<CustomFieldWithId[], string>({
query: (resource_id: string) => ({
url: `plus/custom-metadata/custom-field/resource/${resource_id}`,
}),
providesTags: ["CustomFields"],
providesTags: ["Custom Fields"],
}),
upsertCustomField: build.mutation<CustomFieldWithId, CustomFieldWithId>({
query: (params) => ({
Expand All @@ -186,7 +186,7 @@ const plusApi = baseApi.injectEndpoints({
value: params.value,
},
}),
invalidatesTags: ["CustomFields"],
invalidatesTags: ["Custom Fields"],
}),

getAllCustomFieldDefinitions: build.query<
Expand All @@ -196,7 +196,7 @@ const plusApi = baseApi.injectEndpoints({
query: () => ({
url: `plus/custom-metadata/custom-field-definition`,
}),
providesTags: ["CustomFieldDefinition"],
providesTags: ["Custom Field Definition"],
}),
// Custom Metadata Custom Field Definition
addCustomFieldDefinition: build.mutation<
Expand All @@ -208,7 +208,7 @@ const plusApi = baseApi.injectEndpoints({
method: "POST",
body: params,
}),
invalidatesTags: ["CustomFieldDefinition"],
invalidatesTags: ["Custom Field Definition"],
}),
updateCustomFieldDefinition: build.mutation<
CustomFieldDefinitionWithId,
Expand All @@ -219,14 +219,14 @@ const plusApi = baseApi.injectEndpoints({
method: "PUT",
body: params,
}),
invalidatesTags: ["CustomFieldDefinition"],
invalidatesTags: ["Custom Field Definition"],
}),
deleteCustomFieldDefinition: build.mutation<void, { id: string }>({
query: ({ id }) => ({
url: `plus/custom-metadata/custom-field-definition/${id}`,
method: "DELETE",
}),
invalidatesTags: ["CustomFieldDefinition"],
invalidatesTags: ["Custom Field Definition"],
}),

// Custom Metadata Custom Field Definition By Resource Type
Expand All @@ -237,7 +237,7 @@ const plusApi = baseApi.injectEndpoints({
query: (resource_type: ResourceTypes) => ({
url: `plus/custom-metadata/custom-field-definition/resource-type/${resource_type}`,
}),
providesTags: ["CustomFieldDefinition"],
providesTags: ["Custom Field Definition"],
transformResponse: (list: CustomFieldDefinitionWithId[]) =>
list.sort((a, b) => (a.name ?? "").localeCompare(b.name ?? "")),
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const privacyNoticesApi = baseApi.injectEndpoints({
url: `privacy-notice/`,
params: { ...params, systems_applicable: true, show_disabled: true },
}),
providesTags: () => ["PrivacyNotices"],
providesTags: () => ["Privacy Notices"],
}),
patchPrivacyNotices: build.mutation<
PrivacyNoticeResponse[],
Expand All @@ -49,14 +49,14 @@ const privacyNoticesApi = baseApi.injectEndpoints({
url: `privacy-notice/`,
body: payload,
}),
invalidatesTags: () => ["PrivacyNotices"],
invalidatesTags: () => ["Privacy Notices"],
}),
getPrivacyNoticeById: build.query<PrivacyNoticeResponse, string>({
query: (id) => ({
url: `privacy-notice/${id}`,
}),
providesTags: (result, error, arg) => [
{ type: "PrivacyNotices", id: arg },
{ type: "Privacy Notices", id: arg },
],
}),
postPrivacyNotice: build.mutation<
Expand All @@ -68,7 +68,7 @@ const privacyNoticesApi = baseApi.injectEndpoints({
url: `privacy-notice/`,
body: payload,
}),
invalidatesTags: () => ["PrivacyNotices"],
invalidatesTags: () => ["Privacy Notices"],
}),
}),
});
Expand Down

0 comments on commit 0a4bb46

Please sign in to comment.