Skip to content

Commit

Permalink
#768 Commit reverts back to old acctypes
Browse files Browse the repository at this point in the history
  • Loading branch information
lawal-olaotan committed Aug 9, 2023
1 parent 78a8b3d commit 5ad84bc
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,11 @@ const exampleQuery = function()
var isGeneListRestricted = userAccess.isLimitEnforced();

/* TODO: too messed-up, See #768 */
if(isQueryRestricted && isGeneListRestricted){
if(!isQueryRestricted){
queryRestriction = `<a class='query-restriction-text' onclick="loginModalInit()">(Login)</a>`;
}else{
}

if(isGeneListRestricted && accType == 'pro'){
queryRestriction = `<a class='query-restriction-text' href="https://knetminer.com/pricing-plans" target="_blank" >(Upgrade)</a>`;
}

Expand All @@ -251,8 +253,6 @@ const exampleQuery = function()
})
}



return{
setQueryData:setQueryData,
populateQueryValues:populateQueryValues,
Expand Down
11 changes: 5 additions & 6 deletions client-base/src/main/webapp/html/javascript/user-access.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
class UserAccessManager{

#current = 'free';
#current = 'guest';
#defaultGeneLimit = 20;
#isGeneLimitEnforced = true;

Expand All @@ -24,7 +24,7 @@ class UserAccessManager{
headers: { "Accept": "application/json; charset=utf-8", "Content-Type": "application/json; charset=utf-8" },
success: function (data) {
if( ! typeof data.id == 'undefined') return (data.plan.name).toLowerCase();
return
return null
},

});
Expand Down Expand Up @@ -70,8 +70,8 @@ class UserAccessManager{
class UserRole {
#level = null

static FREE = new UserRole ( 1000 )
static REGISTERED = new UserRole ( 500 )
static GUEST = new UserRole ( 1000 )
static FREE = new UserRole ( 500 )
static PRO = new UserRole ( 100 )

constructor(level){
Expand Down Expand Up @@ -100,8 +100,7 @@ class UserRole {
* Param can be a UserRole or a string.
*/
static can ( role,queryRole )
{

{
return UserRole.compare(role,queryRole) >= 0;
}

Expand Down
2 changes: 1 addition & 1 deletion client-base/src/main/webapp/html/javascript/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ $(document).ready (
initResetButton();
showToolTips();
intialiseFeedbackCtaConfig();
setupGenesSearch
setupGenesSearch()

// Do this as last step, so that it doesn't track in
// case of failure
Expand Down
20 changes: 10 additions & 10 deletions datasets/poaceae-test/config/sample-queries.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@
<query>
<description>Keyword search (AND)</description>
<term>"seed germination" AND flavon*</term>
<minimumUserRole>free</minimumUserRole>
<minimumUserRole>guest</minimumUserRole>
</query>

<query>
<description>Keyword search (OR)</description>
<term>dormancy OR anthocyanin</term>
<minimumUserRole>guest</minimumUserRole>
<!--
TODO:
- The common convention for these is all lower case, free and not free.
- The common convention for these is all lower case, guest and not guest.
Then, they're usually checked case-insensitive, as it is already implemented, to that's to be kept
- minimumUserRole is a poor name for a config file like this. What does it mean? Accession? Access?
Expand All @@ -28,15 +29,14 @@
Let's discuss the last two at some point.
-->
<minimumUserRole>free</minimumUserRole>
</query>

<query>
<description>Gene names</description>
<term>drought OR heat OR frost</term>
<gene>TPS*</gene>
<gene>TPP?</gene>
<minimumUserRole>free</minimumUserRole>
<minimumUserRole>guest</minimumUserRole>
</query>

<!-- Wheat queries -->
Expand All @@ -48,7 +48,7 @@
<gene>TRAESCS3D03G0544800</gene>
<gene>TaSIZ1</gene>
<gene>CDC5</gene>
<minimumUserRole>registered</minimumUserRole>
<minimumUserRole>guest</minimumUserRole>
</query>

<query>
Expand All @@ -75,7 +75,7 @@
<gene>TRAESCS4A02G206800</gene>
<gene>TRAESCS3B02G006100</gene>
<gene>TRAESCS3A02G464900</gene>
<minimumUserRole>registered</minimumUserRole>
<minimumUserRole>free</minimumUserRole>
</query>

<query>
Expand All @@ -94,7 +94,7 @@
<gene>TraesCS3D02G468400</gene>
<gene>TraesCS3B02G280700</gene>
<gene>TraesCS2D02G493400</gene>
<minimumUserRole>registered</minimumUserRole>
<minimumUserRole>free</minimumUserRole>
</query>

<query>
Expand Down Expand Up @@ -145,7 +145,7 @@
<description>FLC gene expression</description>
<taxId>3702</taxId>
<term>flowering FLC FT</term>
<minimumUserRole>registered</minimumUserRole>
<minimumUserRole>free</minimumUserRole>
</query>

<query>
Expand All @@ -160,7 +160,7 @@
<label>Petal size</label>
</region>
<gene>At4g18330</gene>
<minimumUserRole>registered</minimumUserRole>
<minimumUserRole>free</minimumUserRole>
</query>

<query>
Expand All @@ -179,7 +179,7 @@
<gene>Os12g0484900</gene>
<gene>OsGRF7</gene>
<gene>GRF7</gene>
<minimumUserRole>registered</minimumUserRole>
<minimumUserRole>free</minimumUserRole>
</query>

<query>
Expand Down

0 comments on commit 5ad84bc

Please sign in to comment.