improvements: final feedback

This commit is contained in:
Scott Wilson
2025-03-12 11:28:38 -07:00
parent 667580546b
commit 0cc3240956
8 changed files with 15 additions and 8 deletions

View File

@@ -680,7 +680,7 @@ export const registerProjectRouter = async (server: FastifyZodProvider) => {
server.route({
method: "GET",
url: "/:workspaceId/folders/environment-folder-tree",
url: "/:workspaceId/environment-folder-tree",
config: {
rateLimit: readLimit
},

View File

@@ -24,7 +24,7 @@ interface AccessTreeProviderProps {
}
export const AccessTreeProvider: React.FC<AccessTreeProviderProps> = ({ children }) => {
const [secretName, setSecretName] = useState("*");
const [secretName, setSecretName] = useState("");
const [viewMode, setViewMode] = useState(ViewMode.Docked);
const value = useMemo(

View File

@@ -126,7 +126,11 @@ export const PermissionSimulation = ({
{subject === ProjectPermissionSub.Secrets && (
<div>
<FormLabel label="Secret Name" />
<Input value={secretName} onChange={(e) => setSecretName(e.target.value)} />
<Input
placeholder="*"
value={secretName}
onChange={(e) => setSecretName(e.target.value)}
/>
</div>
)}
</>

View File

@@ -103,7 +103,7 @@ export const createFolderNode = ({
if (hasPermission) {
// we want to show yellow/conditional access if user hasn't specified secret name to fully resolve access
if (
(!secretName || secretName === "*") &&
!secretName &&
actionRuleMap.some((el) => {
// we only show conditional if secretName/secretTags are present - environment and path can be directly determined
if (!el[action]?.conditions?.secretName && !el[action]?.conditions?.secretTags)

View File

@@ -56,7 +56,7 @@ export const useListProjectEnvironmentsFolders = (
queryKey: folderQueryKeys.getProjectEnvironmentsFolders(projectId),
queryFn: async () => {
const { data } = await apiRequest.get<TProjectEnvironmentsFolders>(
`/api/v1/workspace/${projectId}/folders/environment-folder-tree`
`/api/v1/workspace/${projectId}/environment-folder-tree`
);
return data;
},

View File

@@ -46,7 +46,8 @@ export const GeneralPermissionConditions = ({ position = 0, isDisabled, type }:
<div className="mt-6 border-t border-t-mineshaft-600 bg-mineshaft-800 pt-2">
<p className="mt-2 text-gray-300">Conditions</p>
<p className="mb-2 text-sm text-mineshaft-400">
When this policy should apply (always if no conditions are added).
When this policy should apply (always if no conditions are added). All conditions must
evaluate to true for the policy to take effect.
</p>
<div className="mt-2 flex flex-col space-y-2">
{items.fields.map((el, index) => {

View File

@@ -40,7 +40,8 @@ export const IdentityManagementPermissionConditions = ({ position = 0, isDisable
<div className="mt-6 border-t border-t-mineshaft-600 bg-mineshaft-800 pt-2">
<p className="mt-2 text-gray-300">Conditions</p>
<p className="mb-2 text-sm text-mineshaft-400">
When this policy should apply (always if no conditions are added).
When this policy should apply (always if no conditions are added). All conditions must
evaluate to true for the policy to take effect.
</p>
<div className="mt-2 flex flex-col space-y-2">
{items.fields.map((el, index) => {

View File

@@ -44,7 +44,8 @@ export const SecretPermissionConditions = ({ position = 0, isDisabled }: Props)
<div className="mt-6 border-t border-t-mineshaft-600 bg-mineshaft-800 pt-2">
<p className="mt-2 text-gray-300">Conditions</p>
<p className="mb-2 text-sm text-mineshaft-400">
When this policy should apply (always if no conditions are added).
When this policy should apply (always if no conditions are added). All conditions must
evaluate to true for the policy to take effect.
</p>
<div className="mt-2 flex flex-col space-y-2">
{items.fields.map((el, index) => {