improvements: address feedback

This commit is contained in:
Scott Wilson
2025-09-12 19:07:54 -07:00
parent 93e5cf4b2b
commit 8fee3c3882
7 changed files with 31 additions and 44 deletions

View File

@@ -135,6 +135,18 @@ Below is a comprehensive list of all available project-level subjects and their
| `edit` | Modify token properties |
| `delete` | Revoke or remove service tokens |
#### Subject: `app-connections`
Supports conditions and permission inversion
| Action | Description |
| ------------------------- | ---------------------------------- |
| `read-app-connections` | View app connection configurations |
| `create-app-connections` | Create new app connections |
| `edit-app-connections` | Modify existing app connections |
| `delete-app-connections` | Remove app connections |
| `connect-app-connections` | Use app connections |
### Secrets Management
#### Subject: `secrets`

View File

@@ -107,7 +107,7 @@ export const SecretRotationV2ConnectionField = ({ onChange: callback, isUpdate }
{!isUpdate && !isPending && !availableConnections?.length && !canCreateConnection && (
<p className="-mt-2.5 mb-2.5 text-xs text-yellow">
<FontAwesomeIcon className="mr-1" size="xs" icon={faInfoCircle} />
You do not have access to any ${appName} Connections. Contact an admin to create one.
You do not have access to any {appName} Connections. Contact an admin to create one.
</p>
)}
<AddAppConnectionModal

View File

@@ -108,7 +108,7 @@ export const SecretScanningDataSourceConnectionField = ({
{!isUpdate && !isPending && !availableConnections?.length && !canCreateConnection && (
<p className="-mt-2.5 mb-2.5 text-xs text-yellow">
<FontAwesomeIcon className="mr-1" size="xs" icon={faInfoCircle} />
You do not have access to any ${connectionName} Connections. Contact an admin to create
You do not have access to any {connectionName} Connections. Contact an admin to create
one.
</p>
)}

View File

@@ -91,7 +91,7 @@ export const SecretSyncConnectionField = ({ onChange: callback }: Props) => {
{!isPending && !availableConnections?.length && !canCreateConnection && (
<p className="-mt-2.5 mb-2.5 text-xs text-yellow">
<FontAwesomeIcon className="mr-1" size="xs" icon={faInfoCircle} />
You do not have access to any ${appName} Connections. Contact an admin to create one.
You do not have access to any {appName} Connections. Contact an admin to create one.
</p>
)}
<AddAppConnectionModal

View File

@@ -6,7 +6,6 @@ import {
TAppConnectionResponse,
TCreateAppConnectionDTO,
TDeleteAppConnectionDTO,
TMigrateAppConnectionDTO,
TUpdateAppConnectionDTO
} from "@app/hooks/api/appConnections/types";
@@ -62,21 +61,3 @@ export const useDeleteAppConnection = () => {
}
});
};
export const useMigrateAppConnection = () => {
const queryClient = useQueryClient();
return useMutation({
mutationFn: async ({ connectionId, app }: TMigrateAppConnectionDTO) => {
const { data } = await apiRequest.post(
`/api/v1/app-connections/${app}/${connectionId}/migrate`
);
return data;
},
onSuccess: ({ projectId, app }) => {
queryClient.invalidateQueries({ queryKey: appConnectionKeys.list(projectId) });
queryClient.invalidateQueries({ queryKey: appConnectionKeys.listAvailable(app, projectId) });
// queryClient.invalidateQueries({ queryKey: appConnectionKeys.byId(app, connectionId) });
}
});
};

View File

@@ -1,5 +1,3 @@
import { ProjectType } from "@app/hooks/api/workspace/types";
import { AppConnection } from "../enums";
import { TOnePassConnection } from "./1password-connection";
import { TAppConnectionOption } from "./app-options";
@@ -196,22 +194,18 @@ export type TDeleteAppConnectionDTO = {
// [AppConnection.Okta]: TOktaConnection;
// };
export type TMigrateAppConnectionDTO = {
app: AppConnection;
connectionId: string;
};
export type AppConnectionUsage = {
projects: Array<{
id: string;
name: string;
slug: string;
type: ProjectType;
resources: {
secretSyncs: Array<{ id: string; name: string }>;
externalCas: Array<{ id: string; name: string }>;
secretRotations: Array<{ id: string; name: string }>;
dataSources: Array<{ id: string; name: string }>;
};
}>;
};
// scott: we will need this once we have individual app connection page
// export type AppConnectionUsage = {
// projects: Array<{
// id: string;
// name: string;
// slug: string;
// type: ProjectType;
// resources: {
// secretSyncs: Array<{ id: string; name: string }>;
// externalCas: Array<{ id: string; name: string }>;
// secretRotations: Array<{ id: string; name: string }>;
// dataSources: Array<{ id: string; name: string }>;
// };
// }>;
// };

View File

@@ -31,7 +31,7 @@ const Content = ({ onComplete, projectId, projectType, app }: ContentProps) => {
return (
<AppConnectionForm
onComplete={onComplete}
onBack={() => setSelectedApp(null)}
onBack={app ? undefined : () => setSelectedApp(null)}
app={(app ?? selectedApp)!}
projectId={projectId}
/>