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: preview assessment from assessments page #604

Open
wants to merge 5 commits into
base: staging
Choose a base branch
from

Conversation

joyce-shi
Copy link
Contributor

@joyce-shi joyce-shi commented Oct 24, 2023

Notion ticket link

Preview Assessment button in popover menu

Implementation description

  • Preview assessment from popover button (do we want to be able to click on the row to preview the assessment? we can talk about this during Sunday work session)
  • Route from assessment editor to separate preview assessment page so that it can be reused

@joyce-shi joyce-shi temporarily deployed to staging October 24, 2023 14:56 — with GitHub Actions Inactive
@joyce-shi joyce-shi temporarily deployed to staging October 24, 2023 14:57 — with GitHub Actions Inactive
@github-actions
Copy link

github-actions bot commented Oct 24, 2023

Visit the preview URL for this PR (updated for commit dc9b93f):

https://jump-math-staging--pr604-joyce-preview-2irnaz1r.web.app

(expires Sun, 17 Dec 2023 17:28:52 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: c42d8d0d853b05885664a2dd73f8245f4333ae51

@joyce-shi joyce-shi temporarily deployed to staging October 24, 2023 15:08 — with GitHub Actions Inactive
assessmentId,
}: {
assessmentId?: string;
}) => "/admin/assessment/" + assessmentId + "/preview";
Copy link
Contributor Author

@joyce-shi joyce-shi Oct 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be kind of nice to overload the route here... i.e /admin/assessments/ + assessmentId + /preview, but I can't figure out why that isn't working & doesn't seem like a big enough issue to be a blocker... let me know if you have thoughts (:

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah routing is tricky for this page... Happy to pair at some point if that would help. Or I can look into what's happening later this week

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yah, we can pair on Sunday? This PR isn't a blocker so I don't mind leaving it open

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, we resolved this synchronously right? 😅

@joyce-shi joyce-shi temporarily deployed to staging October 24, 2023 15:10 — with GitHub Actions Inactive
@joyce-shi joyce-shi marked this pull request as ready for review October 24, 2023 15:15
@@ -272,22 +271,6 @@ const AssessmentEditor = ({ state }: AssessmentEditorProps): ReactElement => {
</VStack>
</VStack>
</Route>
<Route
Copy link
Contributor

@jfdoming jfdoming Oct 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering why this change to remove the routes here was necessary? I think this might be the cause of the routing woes from your other comment. In particular, my understanding is that the AssessmentEditor component "owns" the route /admin/assessments/, which makes it capture all sub-routes. We could potentially rename the "owner" component to something more generic?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jfdoming I can't recall exactly, but we resolved this discussion synchronously right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know something wasn't working that did require a code change. Did you commit that change?

assessmentId,
}: PreviewButtonProps): React.ReactElement => {
const history = useHistory();
const { data } = useQuery<{ test: TestResponse }>(GET_TEST, {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Iirc the tests table already loads this data for each row. Is there any way you could reuse that instead? Otherwise each user will be hammering the backend twice for each test that exists in the database

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm, but does it? Because the table runs the GET_ALL_TESTS query, right? Which is all the test metadata without the specific questions.

Here, we call GET_TEST which queries for the test metadata + questions for one specific test. I think this is similar to the implementation of EditButton.

Let me know if I am misunderstanding your comment here!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. I'm wondering if it would be better to just add the additional data to the GET_ALL_TESTS query? Since imho our concern here might not be bandwidth but compute scale, since we have a single-replica base tier backend

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess I'm also thinking that EditButton could use a different implementation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants