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

Accounts and settings: bug fixes and User Guide fill-in. #889

Merged
merged 7 commits into from
Dec 31, 2020

Conversation

imnasnainaec
Copy link
Collaborator

@imnasnainaec imnasnainaec commented Dec 22, 2020

Fill in content for Account, Project, and Admin pages in the User Guide.
[SiteSettings] Disallow admins deleting other admins (part of #544).
[AvatarUpload] Allow any image type, not just .jpg.
[UserSettings] Add feedback on SAVE, and don't allow saving with taken email address (resolves #888; more to do in #894).


This change is Reviewable

@imnasnainaec imnasnainaec self-assigned this Dec 22, 2020
@imnasnainaec
Copy link
Collaborator Author

imnasnainaec commented Dec 22, 2020

Screenshots of the User Guide content:
Screen Shot 2020-12-22 at 14 49 18
Screen Shot 2020-12-22 at 14 48 57
Screen Shot 2020-12-22 at 18 29 31

@imnasnainaec imnasnainaec added documentation Improvements or additions to documentation frontend security labels Dec 22, 2020
@codecov-io
Copy link

codecov-io commented Dec 22, 2020

Codecov Report

Merging #889 (c5cb3bf) into master (5bd252d) will decrease coverage by 0.04%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #889      +/-   ##
==========================================
- Coverage   50.93%   50.88%   -0.05%     
==========================================
  Files         241      241              
  Lines        6601     6607       +6     
  Branches      421      423       +2     
==========================================
  Hits         3362     3362              
- Misses       2926     2930       +4     
- Partials      313      315       +2     
Flag Coverage Δ
backend 56.15% <ø> (ø)
frontend 45.60% <0.00%> (-0.09%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...components/SiteSettings/UserManagment/UserList.tsx 0.00% <0.00%> (ø)
src/components/UserSettings/AvatarUpload.tsx 20.00% <ø> (ø)
src/components/UserSettings/UserSettings.tsx 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5bd252d...c5cb3bf. Read the comment docs.

@johnthagen
Copy link
Collaborator


src/components/SiteSettings/UserManagment/UserList.tsx, line 36 at r2 (raw file):

}

class UserList extends React.Component<

I realize this is a little out of scope for this PR, but could this component be converted to a functional component?

@johnthagen
Copy link
Collaborator


src/components/UserSettings/AvatarUpload.tsx, line 61 at r2 (raw file):

          <FileInputButton
            updateFile={(file) => updateFile(file)}
            accept="image/*"

This was a good change.

@johnthagen
Copy link
Collaborator


src/components/UserSettings/UserSettings.tsx, line 144 at r2 (raw file):

      });
    } else {
      alert(this.props.translate("login.emailTaken"));

I don't think this is bad per se, but during registration when a username or email is already taken, it highlights the input box red and puts the error in red. In general, I think this is a better UI than alerts because it draws your attention immediately to the incorrect data location.

Can we do something like that in the User Settings?

@johnthagen
Copy link
Collaborator


src/resources/translations.json, line 270 at r2 (raw file):

    "updateSuccess": [
      "Settings successfully updated.",
      "Settings successfully updated.",

I see many of the strings in this file aren't translated yet, but should we translate new one like this when we add them?

@johnthagen
Copy link
Collaborator


user_guide/docs/account.md, line 22 at r2 (raw file):

will be sent to the email address associated with your account.

!!! note

I'd maybe choose the "important" admonition for this one.

@johnthagen
Copy link
Collaborator


user_guide/docs/admin.md, line 10 at r2 (raw file):

Administrators can export or archive/restore any project. Archiving a project makes it invisible and unaccessible to all
users, even the project creator, but any admin can restore the project.

Should we add a note stating explicitly that there is currently no way to permanently delete projects? Someone might want to know that if they were just trying it out and uploaded something they didn't mean to.

@johnthagen
Copy link
Collaborator


user_guide/docs/project.md, line 20 at r2 (raw file):

If you have linguistics data in a [LIFT](https://software.sil.org/lifttools) file (likely exported from The Combine,
WeSay, FLEx, or Lexique Pro), you can hit the BROWSE button next to "Upload .zip project file?" to import the data into

I like that we are adding web links out to other linguistic/SIL tools, could we add links for WeSay, FLEx, and Lexique Pro?

Copy link
Collaborator

@johnthagen johnthagen left a comment

Choose a reason for hiding this comment

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

Reviewed 9 of 9 files at r1, 3 of 3 files at r2.
Reviewable status: all files reviewed, 7 unresolved discussions (waiting on @imnasnainaec and @jasonleenaylor)

@johnthagen
Copy link
Collaborator

  • Disallow admins deleting other admins
  • don't allow saving with taken email address

Fundamentally, I believe we need to enforce this in the backend, not just in the frontend. If someone connects to our API from a client other than our frontend, they could corrupt our database.

  • UserController.Delete or UserApiServices.Delete (not sure where best appropriate) I believe should be updated to enforce that admin users cannot be deleted
  • I think that UserService.Update needs to be updated to enforce that an email address is not updated to one that already exists

Copy link
Collaborator Author

@imnasnainaec imnasnainaec left a comment

Choose a reason for hiding this comment

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

Reviewable status: 9 of 12 files reviewed, 4 unresolved discussions (waiting on @imnasnainaec, @jasonleenaylor, and @johnthagen)


src/components/SiteSettings/UserManagment/UserList.tsx, line 36 at r2 (raw file):

Previously, johnthagen wrote…

I realize this is a little out of scope for this PR, but could this component be converted to a functional component?

The conversion of componentDidUpdate and handleChange may be nontrivial, so that's better for another pr.


src/resources/translations.json, line 270 at r2 (raw file):

Previously, johnthagen wrote…

I see many of the strings in this file aren't translated yet, but should we translate new one like this when we add them?

No, the translation process is to be done in Crowdin--Jason and I have that process mostly setup.


user_guide/docs/account.md, line 22 at r2 (raw file):

Previously, johnthagen wrote…

I'd maybe choose the "important" admonition for this one.

Done.


user_guide/docs/admin.md, line 10 at r2 (raw file):

Previously, johnthagen wrote…

Should we add a note stating explicitly that there is currently no way to permanently delete projects? Someone might want to know that if they were just trying it out and uploaded something they didn't mean to.

Done.


user_guide/docs/project.md, line 20 at r2 (raw file):

Previously, johnthagen wrote…

I like that we are adding web links out to other linguistic/SIL tools, could we add links for WeSay, FLEx, and Lexique Pro?

Done.

@johnthagen
Copy link
Collaborator


src/resources/translations.json, line 270 at r2 (raw file):

Previously, imnasnainaec (D. Ror.) wrote…

No, the translation process is to be done in Crowdin--Jason and I have that process mostly setup.

LGTM.

So are these extra strings redundant now?

Copy link
Collaborator

@johnthagen johnthagen left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 3 files at r3.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @imnasnainaec and @jasonleenaylor)

Copy link
Collaborator Author

@imnasnainaec imnasnainaec left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @jasonleenaylor and @johnthagen)


src/components/UserSettings/UserSettings.tsx, line 144 at r2 (raw file):

Previously, johnthagen wrote…

I don't think this is bad per se, but during registration when a username or email is already taken, it highlights the input box red and puts the error in red. In general, I think this is a better UI than alerts because it draws your attention immediately to the incorrect data location.

Can we do something like that in the User Settings?

#894


src/resources/translations.json, line 270 at r2 (raw file):

Previously, johnthagen wrote…

LGTM.

So are these extra strings redundant now?

They serve as placeholders, so that a non-English user at least gets the English phrase if it hasn't been translated yet.

Copy link
Collaborator

@johnthagen johnthagen left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @jasonleenaylor)

@imnasnainaec imnasnainaec removed the request for review from jasonleenaylor December 31, 2020 15:54
@imnasnainaec imnasnainaec merged commit 9a28ce2 into master Dec 31, 2020
@imnasnainaec imnasnainaec deleted the fill-user-guide branch December 31, 2020 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation frontend security
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[UserSettings] Users can change email address to one already in use.
3 participants