-
Notifications
You must be signed in to change notification settings - Fork 641
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
Embedded license preview when uploading a package through UI #6807
Conversation
Some node-related changes that will happen sooner or later.
catch (Exception ex) | ||
{ | ||
_telemetryService.TraceException(ex); | ||
return View(model); |
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.
We have a validationErrorMessage
above for some error cases, should we have the same thing here?
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 is the case when someone comes to the upload page, but they had incomplete package upload from earlier. Our code tries to recover that incomplete upload, tries to extract the license file if one exists and fails bad enough so that exception is thrown. The whole scenario is complicated so I am hesitant to bubble up any error to the user at this point, anyway, the only way for them to "recover" is to reupload the file, and that's exactly what's going to be prompted from them.
I think it would be more consistent to linkify the license expression. Could we get a PM's insight on this? @anangaur, @karann-msft |
Agree! Hope this can be done easily. |
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.
Nice 👍
Addresses #6531
VerifyPackageRequest
view model was extended with two properties:LicenseExpression
andLicenseFileContents
which are when set cause "License expression" and "License file" items to appear on verify package page.Two code paths cause verify package page to be presented to the user: regular upload and picking up the past upload, so you can find two calls to
GetLicenseFileContentsAsync
.License file contents is presented through
<pre>
to preserve formatting of the original text file as much as possible, yet some styling changes were made to make long lines to properly wrap.Introduced the
@default-margin-bottom
to have the variable containing the defaultmargin-bottom
value forp
elements (used to introduce white space between metadata items on verify package page), so that custom items that display the license information are also spaced properly, since they don't use the same template as other elements.Changes to
bootstrap.js
andpackage-lock.json
happened automagically while building the .less files and probably should be ignored (I can revert, but they'll come back next time someone runsgrunt
).License expression preview:
License file preview with word wrapping:
Long license file preview with keeping text file formatting:
(no secondary scrolls, full text is completely displayed on the page increasing its height)