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

[ProjectLanguages] Add new analysis language or select new default #751

Merged
merged 26 commits into from
Dec 15, 2020

Conversation

imnasnainaec
Copy link
Collaborator

@imnasnainaec imnasnainaec commented Oct 8, 2020

Resolves #712 (or at least the first two items).

Projects have 1 analysis language on creation. In project setting, this pr adds a + button to reveal the language picker and add a secondary analysis language.
Screen Shot 2020-11-24 at 14 34 02
Screen Shot 2020-11-24 at 14 34 54

The top language in the list is the primary/default associated with new entries, so this pr also adds a ↑ button by all secondary analysis languages allow it to be selected as the new default.
Screen Shot 2020-11-24 at 14 53 53
Screen Shot 2020-11-24 at 14 35 20


This change is Reviewable

@imnasnainaec imnasnainaec self-assigned this Oct 8, 2020
@codecov-io
Copy link

codecov-io commented Oct 8, 2020

Codecov Report

Merging #751 (07b8265) into master (9bcf24c) will increase coverage by 0.05%.
The diff coverage is 64.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #751      +/-   ##
==========================================
+ Coverage   51.64%   51.69%   +0.05%     
==========================================
  Files         242      242              
  Lines        6628     6652      +24     
  Branches      422      422              
==========================================
+ Hits         3423     3439      +16     
- Misses       2894     2903       +9     
+ Partials      311      310       -1     
Flag Coverage Δ
backend 56.41% <ø> (ø)
frontend 47.10% <64.00%> (+0.14%) ⬆️

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

Impacted Files Coverage Δ
...jectSettings/ProjectLanguages/ProjectLanguages.tsx 66.66% <64.00%> (-33.34%) ⬇️
.../MergeDupGoal/MergeDupStep/MergeDupStepReducer.tsx 51.94% <0.00%> (+1.29%) ⬆️

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 9bcf24c...07b8265. Read the comment docs.

@sillsdev sillsdev deleted a comment from lgtm-com bot Oct 8, 2020
@imnasnainaec

This comment has been minimized.

@imnasnainaec imnasnainaec requested review from 14JAW and jasonleenaylor and removed request for 14JAW November 24, 2020 19:59
@jasonleenaylor
Copy link
Contributor


src/components/ProjectSettings/ProjectLanguages/ProjectLanguages.tsx, line 55 at r5 (raw file):

      font: this.state.font,
    };
    this.props.project.analysisWritingSystems.push(ws);

I think we need to handle the case where a user accidentally adds a language they already have.

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: 0 of 3 files reviewed, 1 unresolved discussion (waiting on @jasonleenaylor)


src/components/ProjectSettings/ProjectLanguages/ProjectLanguages.tsx, line 55 at r5 (raw file):

Previously, jasonleenaylor (Jason Naylor) wrote…

I think we need to handle the case where a user accidentally adds a language they already have.

The submit button is disabled if isNewWritingSystem (below) returns false. Let me know if you want redundant safe-guards, in this function or via a comment somewhere.

@jasonleenaylor
Copy link
Contributor


src/components/ProjectSettings/ProjectLanguages/ProjectLanguages.tsx, line 55 at r5 (raw file):

Previously, imnasnainaec (D. Ror.) wrote…

The submit button is disabled if isNewWritingSystem (below) returns false. Let me know if you want redundant safe-guards, in this function or via a comment somewhere.

Sorry that I didn't see that. We don't need the redundant safeguard, but we should have a unit test for it.

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: 0 of 3 files reviewed, 1 unresolved discussion (waiting on @jasonleenaylor)


src/components/ProjectSettings/ProjectLanguages/ProjectLanguages.tsx, line 55 at r5 (raw file):

Previously, jasonleenaylor (Jason Naylor) wrote…

Sorry that I didn't see that. We don't need the redundant safeguard, but we should have a unit test for it.

Added.

Copy link
Contributor

@jasonleenaylor jasonleenaylor left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 3 files at r5, 1 of 1 files at r6.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@imnasnainaec imnasnainaec merged commit 90bb2cb into master Dec 15, 2020
@imnasnainaec imnasnainaec deleted the change-analysis-language branch December 15, 2020 19:21
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.

[ProjectSettings] Modify list of analysis languages
4 participants