-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: Setup routing, queries, and permissions for /:flow/feeback
#3158
Conversation
- Rename team -> team_slug - Add team relationship - Add permissions
🤖 Hasura Change Summary compared a subset of table metadata including permissions: Updated Tables (1)
|
Removed vultr server and associated DNS entries |
const { url } = useCurrentRoute(); | ||
const rootPath = rootFlowPath(); | ||
|
||
const isActive = (route: string) => lastChunk.url.pathname.endsWith(route); | ||
const isActive = (route: string) => url.pathname.endsWith(route); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change was required as the /feedback
route (in its own file) ended with a /
})), | ||
|
||
mount({ | ||
"/": route(async (req) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's the /
that necessitated the change in EditorMenu.tsx
object_relationships: | ||
- name: team | ||
using: | ||
manual_configuration: | ||
column_mapping: | ||
team_slug: slug | ||
insertion_order: null | ||
remote_table: | ||
name: teams | ||
schema: public |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This adds a relationship between feedback_summary.team_slug
and team.slug
.
This is required to correctly scope permissions - teamEditors can only access feedback for their own teams, platformAdmins can access everything.
filter: | ||
team: | ||
members: | ||
_and: | ||
- user_id: | ||
_eq: x-hasura-user-id | ||
- role: | ||
_eq: teamEditor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Permission model copied from team_themes
table.
CREATE OR REPLACE VIEW "public"."feedback_summary" AS | ||
SELECT | ||
fb.id AS feedback_id, | ||
t.slug AS team_slug, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies for the churn in this view recently, I've renamed team
to the more explicit and correct team.slug
so that the relationship can just be called team
in Hasura.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me - initiial set of data fields seems sensible until we hear otherwise !
What does this PR do?
feedback_summary
viewNext steps
Questions
My intention here is to display a small subset of the data - are these minimal columns the most relevant ones?