Conversation
ce042ad to
71536c2
Compare
|
Katie and I discussed the changes from the initial mockup to the current example shown in the screenshots. Upon seeing the mockup text in the context of the actual website, there were clearly some changes and improvements that could be made – so those changes have been made as part of this PR. |
@KatieB5 or @tomodwyer could you please explain what these changes were? The screenshot in the PR description looks very similar to the mockup from #5444:
Did I miss some details? Or maybe you updated the mockup? |
There was a problem hiding this comment.
Thanks Katie and Thomas, this looks great and just like the mockup. I have just some minor questions on a couple points.
There is also a conflict to resolve, main adds some tests about Slack messages to test_projectcreate_post_success.
Minor observations
Also some small observations on the commit message. It is very detailed and comprehensive, which is useful. However don't feel obliged to put so much detail. For example, adding a link to the Django documentation that is the first hit when searching for "DetailView" is a nice thing to do, but not required.
Used a class-based view to match the pattern of other views in staff/views/projects.py.
That is a good reason but I think the bigger reason is that this use perfectly matches the designed use case of the class and saves us some boilerplate. We should also feel empowered to sometimes break convention if we have a good reason. Though consistency is also very valuable, whether to use a class based view depends on goodness of fit to the job at hand. Consistency is not the primary concern for this question.
The URL and redirect use the project slug:
- An alternative would have been to use the pk but a slug was used in the mock-ups
Similarly, that is a good reason, but the overall reason the mockups were like that is that the slug is intended to allow for more human-readable URLs. There is also a stronger consistency point here - we use the slug for all other project-related URLs and have no particular reason to change that here.
To be clear, not suggesting you need change the commit message unless you really feel like it, more of a comment on thought processes in case that is useful for the future.
templates/staff/project/created.html
Outdated
| <li><a href={{project.get_staff_url}}>View project in the Staff Area</a></li> | ||
| </ul> | ||
| <p>You can now add users to the project.</p> | ||
| <p>We have sent these links to the copilot Slack channel, so they can begin the project set up process.</p> |
There was a problem hiding this comment.
Question: #5640 has only sent the staff pages project link to users. Is this sufficient? And is this text accurate enough then? We did not actually send the main page link (tho you can get to it easily from the staff page). We can easily change the Slack message also if that is needed.
Maybe it does not matter much.
There was a problem hiding this comment.
hm, I'm not sure; I wasn't part of the discussions to create the mock-ups so I don't know if the service team specifically requested that the link to the main site project page was added. If it was, we should keep it, and add the additional link to the Slack message we send to the copilot channel. If not, I think we could remove it from the Project created page and update the test (these links --> this link).
Either way, it would be nice to make sure what we're communicating accurately reflects the behaviour of the process we've set up :)
There was a problem hiding this comment.
I think we should keep both links on the success page, I think they were asked for as part of possible follow-on actions. We could adjust the Slack message or how we describe it here.
I asked in Slack.
I think my preferred option is changing the message on the success page to be sightly less specific: "We sent a notification about the new project to the #co-pilot-support Slack channel so they can begin the project setup process".
The success page does not seem to need detail about what exactly was sent to the copilots to get the point across. And not mentioning detail means we don't need to keep them in sync. What do you think?
Either way, would be nice to mention the actual name of the channel for clarity.
There was a problem hiding this comment.
Update: this text has been updated in line with discussions in the TeamREX Slack channel (here).
| assert new_project.updated_by == user | ||
|
|
||
|
|
||
| def test_projectcreatesuccess_authorised(rf): |
There was a problem hiding this comment.
Testing completeness: these are good but I think we may also be able to test now that the test_projectcreate_post_success unit test redirects to the right page / URL? It already tests for status code.
There was a problem hiding this comment.
I agree, I'll add an assertion to test_projectcreate_post_success.
Would it also make sense to rename the tests that check the new view from test_projectcreatesuccess_authorised to test_projectcreated_authorised? To me this is more in keeping with the naming convention we have for our tests (test_name-of-thing-under-test_part-we-are-testing).
There was a problem hiding this comment.
Yes, that makes sense, we have been casually calling it the success page, but the test name should match the view name, if that is what it is testing.
I think you can make what seem like clear improvements like this without checking, if you feel confident you are on the right track, maybe mentioning in a comment that you did so. Sometimes EAFP!
|
Thanks very much for the review and feedback Mike :)
The changes were moving the project number and project title to the hero title section (under Project created) rather than below the card title (Next steps) and having the additional breadcrumb, Project created: . I'd originally matched the mock-ups, but after seeing the implementation in code and how that looked in the UI, Thomas suggested an alternative which was cleaner and looked nicer in my opinion, so we went ahead with that instead. The discussion Thomas and I had is in a thread in our TeamREX Slack channel here. Apologies, it would probably have been helpful to reference that in the PR description. We didn't update the mock-ups; I think Thomas' subscription may have expired now, meaning we couldn't make any updates without paying perhaps ( @tomodwyer , please correct me if I'm wrong on that).
The feedback on what to include in the commit message is useful; writing good commit messages and PR descriptions is a craft and I'd like to get better at it, so if there are ways I can improve I want to know. It's also good to have some guidance on what should drive design choices too; I'll keep this in mind in future. |
4a3c473 to
148c771
Compare
148c771 to
1c6619e
Compare
- Add ProjectCreated(DetailView), url and template.
- Update ProjectCreate.form_valid() to redirect to the new confirmation page.
- Add unit tests asserting authorised and unauthorised access to the Project created page.
Design notes / rationale:
- Used a class-based view to match the pattern of other views in staff/
views/projects.py, and subclassed DetailView to get automatic object
lookup via slug and to have access to the new project instance in the view
- The URL and redirect use the project slug:
- An alternative would have been to use the pk but a slug was used in
the mock-ups (#5444), and we use the slug for all other project URLs
- The Project model save() method makes sure a slug exists when a new
project is created.
- No integration test was added, as this will be addressed in a
separate unit of work to test the full create-a-project flow.
Co-authored-by: Thomas O'Dwyer <thomas.odwyer@thedatalab.org>
1c6619e to
f8afb24
Compare

Closes #5619
This PR introduces a dedicated 'Project created' confirmation page to route users to following successful project creation. Design of this page is based on the mock-ups (#5444).
Summary of work:
ProjectCreated(DetailView), url and template.ProjectCreate.form_valid()to redirect to the new confirmation page.Note: Did not add an integration test, as this will be addressed in a separate unit of work testing the full create-a-project flow (#5621).
Testing
just testandjust test-ci(all tests passed locally)just run)ServiceAdministratorrole (Users > searched for myself > Edit roles)Screenshot
Project created page:
