Skip to content

Conversation

@davidm-m
Copy link
Contributor

@davidm-m davidm-m commented Jun 18, 2021

Adds the edit centre details page to the Tracking System. Includes a new image resize method that ensures no side length of an image exceeds a certain pixel value.
image

@davidm-m
Copy link
Contributor Author

ImageResizeService currently doesn't have CRLF line endings. I've left it for ease of reviewing but please remind me to fix that before merging 🙏

Comment on lines 96 to 97
var ratioX = Math.Min((float)maxSideLengthPx / (float)image.Width, 1);
var ratioY = Math.Min((float)maxSideLengthPx / (float)image.Height, 1);
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 ensures that we don't accidentally enlarge a small logo or signature - I thought that would be the expected behaviour, happy to be corrected though

Copy link
Contributor

Choose a reason for hiding this comment

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

That sounds reasonable to me! 👍

Copy link
Contributor

@DanBloxham-sw DanBloxham-sw left a comment

Choose a reason for hiding this comment

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

Few minor questions. Also looks like there is a small merge conflict around the new Edit button and Preview Certificate button.

davidm-m added 2 commits June 30, 2021 16:25
# Conflicts:
#	DigitalLearningSolutions.Data.Tests/DataServices/CentresDataServiceTests.cs
#	DigitalLearningSolutions.Web/Views/TrackingSystem/CentreConfiguration/_CentreConfigurationCentreDetails.cshtml
Copy link
Contributor

@DanBloxham-sw DanBloxham-sw 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. Looks like the most recent build/test for github was cancelled, might be worth rerunning this.
Also here is a reminder to sort the line endings on that file you mentioned in another comment once it gets through Tech Lead review.

Comment on lines 96 to 97
var ratioX = Math.Min((float)maxSideLengthPx / (float)image.Width, 1);
var ratioY = Math.Min((float)maxSideLengthPx / (float)image.Height, 1);
Copy link
Contributor

Choose a reason for hiding this comment

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

That sounds reasonable to me! 👍

@stellake
Copy link
Contributor

stellake commented Jul 1, 2021

Forgot to mention but I found the preview image & the Incognito mode combo very entertaining 😄

@davidm-m
Copy link
Contributor Author

davidm-m commented Jul 1, 2021

Forgot to mention but I found the preview image & the Incognito mode combo very entertaining 😄

It's not incognito! I just have Firefox in dark mode 😅

private IActionResult AddRegistrationPromptConfigureAnswersPostNext(RegistrationPromptAnswersViewModel model)
{
IgnoreAddNewAnswerValidation();
ModelState.ClearAllErrors();
Copy link
Contributor

Choose a reason for hiding this comment

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

Not your change but is the if-statement below ever true when we clear the errors?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think not. Both this method and EditRegistrationPromptPostSave previously called IgnoreAddNewAnswerValidation before checking ModelState.IsValid which does exactly the same thing as ModelState.ClearAllErrors. I think they might have been holdovers that were never removed, so I'll remove them now. But if they are necessary for some bizarre reason, it will be easy enough to add them back.

Copy link
Contributor

@stellake stellake 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 - just a comment about other bit of the system that we should check 👍

@DanBloxham-sw DanBloxham-sw merged commit 152ca9c into master Jul 15, 2021
@DanBloxham-sw DanBloxham-sw deleted the HEEDLS-374-edit-centre branch July 15, 2021 13:52
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.

3 participants