Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update audit table API permissions so unpublished routes can render PlanningConstraints #2392

Merged
merged 3 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading