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

Topic/disable fuzzy search curator requirement #5283

Merged
merged 6 commits into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions lib/SGN/Controller/AJAX/Accessions.pm
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ sub verify_accession_list_POST : Args(0) {
my @organism_list = $organism_list_json ? @{_parse_list_from_json($c, $organism_list_json)} : [];

my $do_fuzzy_search = $c->req->param('do_fuzzy_search');
if ($user_role ne 'curator' && !$do_fuzzy_search) {
$c->stash->{rest} = {error=>'Only a curator can add accessions without using the fuzzy search!'};
$c->detach();
}
#if ($user_role ne 'curator' && !$do_fuzzy_search) {
# $c->stash->{rest} = {error=>'Only a curator can add accessions without using the fuzzy search!'};
# $c->detach();
#}

if ($do_fuzzy_search) {
$self->do_fuzzy_search($c, \@accession_list, \@organism_list);
Expand Down Expand Up @@ -239,10 +239,10 @@ sub verify_accessions_file_POST : Args(0) {
my $do_fuzzy_search = $user_role eq 'curator' && !$c->req->param('fuzzy_check_upload_accessions') ? 0 : 1;
my $append_synonyms = !$c->req->param('append_synonyms') ? 0 : 1;

if ($user_role ne 'curator' && !$do_fuzzy_search) {
$c->stash->{rest} = {error=>'Only a curator can add accessions without using the fuzzy search!'};
$c->detach();
}
#if ($user_role ne 'curator' && !$do_fuzzy_search) {
# $c->stash->{rest} = {error=>'Only a curator can add accessions without using the fuzzy search!'};
# $c->detach();
#}

# These roles are required by CXGN::UploadFile
if ($user_role ne 'curator' && $user_role ne 'submitter' && $user_role ne 'sequencer' ) {
Expand Down
22 changes: 11 additions & 11 deletions mason/breeders_toolbox/add_accessions_dialogs.mas
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ $editable_stock_props_definitions
<div class="form-group">
<label class="col-sm-4 control-label">Use Fuzzy Search: </label>
<div class="col-sm-8">
% if ( $user_role eq 'curator' ) {
<input type="checkbox" id="fuzzy_check" name="fuzzy_check" checked></input>
% } else {
<input type="checkbox" id="fuzzy_check" name="fuzzy_check" checked disabled></input>
% }
%# if ( $user_role eq 'curator' ) {
<input type="checkbox" id="fuzzy_check" name="fuzzy_check"></input>
%# } else {
%# <input type="checkbox" id="fuzzy_check" name="fuzzy_check" checked disabled></input>
%# }
<br/>
<small>Note: Use the fuzzy search to match similar names to prevent uploading of duplicate accessions. Fuzzy searching is much slower than regular search. Only a curator can disable the fuzzy search.</small>
<small>Note: Use the fuzzy search to match similar names to prevent uploading of duplicate accessions. Fuzzy searching is much slower than regular search. </small>
</div>
</div>
</form>
Expand Down Expand Up @@ -87,11 +87,11 @@ $editable_stock_props_definitions
<div class="form-group">
<label class="col-sm-4 control-label">Use Fuzzy Search: </label>
<div class="col-sm-8">
% if ( $user_role eq 'curator' ) {
<input type="checkbox" id="fuzzy_check_upload_accessions" name="fuzzy_check_upload_accessions" checked></input>
% } else {
<input type="checkbox" id="fuzzy_check_upload_accessions" name="fuzzy_check_upload_accessions" checked disabled></input>
% }
%# if ( $user_role eq 'curator' ) {
<input type="checkbox" id="fuzzy_check_upload_accessions" name="fuzzy_check_upload_accessions"></input>
%# } else {
%# <input type="checkbox" id="fuzzy_check_upload_accessions" name="fuzzy_check_upload_accessions" checked disabled></input>
%# }
<br/>
<small>Note: Use the fuzzy search to match similar names to prevent uploading of duplicate accessions. Fuzzy searching is much slower than regular search. Only a curator can disable the fuzzy search.</small>
</div>
Expand Down
9 changes: 6 additions & 3 deletions t/selenium2/breeders/accessions.t
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@

use strict;

use lib 't/lib';

use Test::More 'tests' => 48;
use Test::More 'tests' => 46;

use SGN::Test::WWW::WebDriver;
use Selenium::Remote::WDKeys 'KEYS';
Expand Down Expand Up @@ -169,8 +172,8 @@ $t->while_logged_in_as("submitter", sub {
$t->find_element_ok("add_accessions_link", "name", "find element add accessions link as submitter")->click();

my $fuzzy_checkbox = $t->find_element_ok("fuzzy_check", "id", "find fuzzy checkbox");
is $fuzzy_checkbox->get_attribute('checked'), 1, 'fuzzy logic checkbox is checked for submitter';
is $fuzzy_checkbox->get_attribute('disabled'), 1, 'fuzzy logic checkbox is disabled for submitter';
# is $fuzzy_checkbox->get_attribute('checked'), 1, 'fuzzy logic checkbox is checked for submitter';
# is $fuzzy_checkbox->get_attribute('disabled'), 1, 'fuzzy logic checkbox is disabled for submitter';
});

$t->driver->close();
Expand Down