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

feat: Setup routing, queries, and permissions for /:flow/feeback #3158

Merged
merged 5 commits into from
May 17, 2024

Conversation

DafyddLlyr
Copy link
Contributor

@DafyddLlyr DafyddLlyr commented May 17, 2024

What does this PR do?

image

Next steps

  • Display data in table
  • Get more detailed info to a user - either CSV download per-row, or established accordion pattern maybe? I've included a function to fetch this data and we can have a think about this one.

Questions

My intention here is to display a small subset of the data - are these minimal columns the most relevant ones?

- Rename team -> team_slug
- Add team relationship
- Add permissions
Copy link

github-actions bot commented May 17, 2024

🤖 Hasura Change Summary compared a subset of table metadata including permissions:

Updated Tables (1)

  • public.feedback_summary permissions:

    insert select update delete
    platformAdmin
    teamEditor
    42 added column permissions
    insert select update
    platformAdmin ➕ address
    ➕ created_at
    ➕ device
    ➕ feedback_id
    ➕ feedback_type
    ➕ help_definition
    ➕ help_sources
    ➕ help_text
    ➕ intersecting_constraints
    ➕ node_data
    ➕ node_id
    ➕ node_text
    ➕ node_title
    ➕ node_type
    ➕ project_type
    ➕ service_slug
    ➕ status
    ➕ team_slug
    ➕ uprn
    ➕ user_comment
    ➕ user_context
    teamEditor

Copy link

github-actions bot commented May 17, 2024

Removed vultr server and associated DNS entries

Comment on lines +72 to +75
const { url } = useCurrentRoute();
const rootPath = rootFlowPath();

const isActive = (route: string) => lastChunk.url.pathname.endsWith(route);
const isActive = (route: string) => url.pathname.endsWith(route);
Copy link
Contributor Author

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) => {
Copy link
Contributor Author

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

Comment on lines +271 to +280
object_relationships:
- name: team
using:
manual_configuration:
column_mapping:
team_slug: slug
insertion_order: null
remote_table:
name: teams
schema: public
Copy link
Contributor Author

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.

Comment on lines +332 to +339
filter:
team:
members:
_and:
- user_id:
_eq: x-hasura-user-id
- role:
_eq: teamEditor
Copy link
Contributor Author

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,
Copy link
Contributor Author

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.

@DafyddLlyr DafyddLlyr marked this pull request as ready for review May 17, 2024 09:09
@DafyddLlyr DafyddLlyr requested a review from a team May 17, 2024 09:09
Copy link
Member

@jessicamcinchak jessicamcinchak left a 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 !

@DafyddLlyr DafyddLlyr merged commit 1ae1240 into main May 17, 2024
12 checks passed
@DafyddLlyr DafyddLlyr deleted the dp/feedback-page-per-flow branch May 17, 2024 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants