Skip to content

Commit

Permalink
fix: query hasPlanningData on initTeamStore() to see constraints …
Browse files Browse the repository at this point in the history
…in editor sidebar (#3458)
  • Loading branch information
jessicamcinchak authored Jul 25, 2024
1 parent 1703feb commit 836503b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
3 changes: 3 additions & 0 deletions editor.planx.uk/src/pages/FlowEditor/lib/store/team.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ export const teamStore: StateCreator<
}
}
}
integrations {
hasPlanningData: has_planning_data
}
}
}
`,
Expand Down
16 changes: 16 additions & 0 deletions hasura.planx.uk/metadata/tables.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1672,6 +1672,14 @@
- staging_govpay_secret
- power_automate_webhook_url
filter: {}
- role: platformAdmin
permission:
columns:
- has_planning_data
- id
- team_id
filter: {}
comment: ""
- role: public
permission:
columns:
Expand All @@ -1680,6 +1688,14 @@
- team_id
filter: {}
comment: ""
- role: teamEditor
permission:
columns:
- has_planning_data
- id
- team_id
filter: {}
comment: ""
- table:
name: team_members
schema: public
Expand Down
10 changes: 5 additions & 5 deletions hasura.planx.uk/tests/team_integrations.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe("team_integrations", () => {
i = await introspectAs("public");
});

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

Expand Down Expand Up @@ -36,8 +36,8 @@ describe("team_integrations", () => {
i = await introspectAs("platformAdmin");
});

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

test("can create but, cannot update, or delete team_integrations", () => {
Expand All @@ -52,8 +52,8 @@ describe("team_integrations", () => {
i = await introspectAs("teamEditor");
});

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

test("cannot create, update, or delete team_integrations", () => {
Expand Down

0 comments on commit 836503b

Please sign in to comment.