Skip to content

Commit

Permalink
fix: update audit table API permissions so unpublished routes can ren…
Browse files Browse the repository at this point in the history
…der PlanningConstraints (#2392)
  • Loading branch information
jessicamcinchak authored Nov 7, 2023
1 parent ea59dce commit 3a64aef
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ export function PlanningConstraintsContent(
refreshConstraints={refreshConstraints}
/>
)}
{positiveConstraints.length > 0 && (
{!showError && positiveConstraints.length > 0 && (
<>
<Typography variant="h3" component="h2" gutterBottom>
These are the planning constraints we think apply to this property
Expand All @@ -283,31 +283,33 @@ export function PlanningConstraintsContent(
<PlanningConditionsInfo />
</>
)}
{positiveConstraints.length === 0 && negativeConstraints.length > 0 && (
<>
<Typography variant="h3" component="h2">
It looks like there are no constraints on this property
</Typography>
<Typography variant="body2">
Based on the information you've given it looks like there are no
planning constraints on your property that might limit what you can
do.
</Typography>
<Typography variant="body2">
Continue with your application to tell us more about your project.
</Typography>
<SimpleExpand
id="negative-constraints-list"
buttonText={{
open: "Show the things we checked",
closed: "Hide constraints that don't apply",
}}
>
<ConstraintsList data={negativeConstraints} metadata={metadata} />
</SimpleExpand>
<PlanningConditionsInfo />
</>
)}
{!showError &&
positiveConstraints.length === 0 &&
negativeConstraints.length > 0 && (
<>
<Typography variant="h3" component="h2">
It looks like there are no constraints on this property
</Typography>
<Typography variant="body2">
Based on the information you've given it looks like there are no
planning constraints on your property that might limit what you
can do.
</Typography>
<Typography variant="body2">
Continue with your application to tell us more about your project.
</Typography>
<SimpleExpand
id="negative-constraints-list"
buttonText={{
open: "Show the things we checked",
closed: "Hide constraints that don't apply",
}}
>
<ConstraintsList data={negativeConstraints} metadata={metadata} />
</SimpleExpand>
<PlanningConditionsInfo />
</>
)}
</Card>
);
}
Expand Down
10 changes: 10 additions & 0 deletions hasura.planx.uk/metadata/tables.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1003,6 +1003,16 @@
- destination_url
- session_id
- created_at
select_permissions:
- role: api
permission:
columns:
- id
- response
- destination_url
- session_id
- created_at
filter: {}
- table:
schema: public
name: project_types
Expand Down
4 changes: 2 additions & 2 deletions hasura.planx.uk/tests/planning_constraints_requests.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ describe("planning_constraints_requests", () => {
i = await introspectAs("api");
});

test("cannot query planning_constraints_requests", () => {
expect(i.queries).not.toContain("planning_constraints_requests");
test("can query planning_constraints_requests", () => {
expect(i.queries).toContain("planning_constraints_requests");
})

test("can insert planning_constraints_requests", () => {
Expand Down

0 comments on commit 3a64aef

Please sign in to comment.