Skip to content
Snippets Groups Projects
Commit 62b238f1 authored by raghosh's avatar raghosh
Browse files

#43: synced request can not be reverted back by anyone. Fixed some small...

#43: synced request can not be reverted back by anyone. Fixed some small errors. Added coloured badges for status for better visual representations.
parent 91d54e19
No related branches found
No related tags found
No related merge requests found
const path = require('path');
module.exports = ({ env }) => ({
connection: {
client: 'postgres',
connection: {
host: env('DATABASE_HOST', '127.0.0.1'),
port: env.int('DATABASE_PORT', 5432),
database: env('DATABASE_NAME', 'ddcode'),
user: env('DATABASE_USERNAME', 'strapi'),
password: env('DATABASE_PASSWORD', 'strapi'),
schema: env('DATABASE_SCHEMA', 'public'), // Not required
},
debug: false,
},
});
// Uncomment for using SQLite instead of postgres
// module.exports = ({ env }) => ({
// connection: {
// client: 'sqlite',
// client: 'postgres',
// connection: {
// filename: path.join(__dirname, '..', env('DATABASE_FILENAME', '.tmp/data.db')),
// host: env('DATABASE_HOST', '127.0.0.1'),
// port: env.int('DATABASE_PORT', 5432),
// database: env('DATABASE_NAME', 'ddcode'),
// user: env('DATABASE_USERNAME', 'strapi'),
// password: env('DATABASE_PASSWORD', 'strapi'),
// schema: env('DATABASE_SCHEMA', 'public'), // Not required
// },
// useNullAsDefault: true,
// debug: false,
// },
// });
// Uncomment for using SQLite instead of postgres
module.exports = ({ env }) => ({
connection: {
client: 'sqlite',
connection: {
filename: path.join(__dirname, '..', env('DATABASE_FILENAME', '.tmp/data.db')),
},
useNullAsDefault: true,
},
});
......@@ -416,7 +416,7 @@
<label class="control-label col-sm-2" for="keyword"
>Reason</label
>
<div class="col-sm-4">
<div class="col-sm-8">
<textarea
class="
form-control
......
......@@ -72,6 +72,26 @@ export default {
{
title: "Status",
data: "attributes.Status",
// render: function(row, data, index){
// console.log("in color new", data);
// if(data.attributes.Status === 'rejected'){
// console.log("working in rejected");
// $(row).find('td:eq(3)').css('color', 'red');
// }
// }
fnCreatedCell: (nTd, sData, oData) => {
if(sData==='synced'){
$(nTd).html(`<div class="rounded-full px-4 mr-2 bg-gray-500 text-white p-2 rounded flex items-center justify-center">${sData}</div>`);
} else if(sData==='accepted'){
$(nTd).html(`<div class="rounded-full px-4 mr-2 bg-green-500 text-white p-2 rounded flex items-center justify-center">${sData}</div>`);
}else if(sData==='rejected'){
$(nTd).html(`<div class="rounded-full px-4 mr-2 bg-red-500 text-white p-2 rounded flex items-center justify-center">${sData}</div>`);
}else if(sData==='requested'){
$(nTd).html(`<div class="rounded-full px-4 mr-2 bg-yellow-500 text-white p-2 rounded flex items-center justify-center">${sData}</div>`);
}
},
},
{
title: "Submitted at",
......@@ -169,6 +189,8 @@ export default {
const tableBody = `${tableId} tbody`;
$(tableBody).on("click", "tr td a.edit-link", (e) => {
e.preventDefault();
const tr = $(e.target).parent().parent();
......
......@@ -68,6 +68,18 @@ export default {
{
title: "Status",
data: "attributes.Status",
fnCreatedCell: (nTd, sData, oData) => {
if(sData==='synced'){
$(nTd).html(`<div class="rounded-full px-4 mr-2 bg-gray-500 text-white p-2 rounded flex items-center justify-center">${sData}</div>`);
} else if(sData==='accepted'){
$(nTd).html(`<div class="rounded-full px-4 mr-2 bg-green-500 text-white p-2 rounded flex items-center justify-center">${sData}</div>`);
}else if(sData==='rejected'){
$(nTd).html(`<div class="rounded-full px-4 mr-2 bg-red-500 text-white p-2 rounded flex items-center justify-center">${sData}</div>`);
}else if(sData==='requested'){
$(nTd).html(`<div class="rounded-full px-4 mr-2 bg-yellow-500 text-white p-2 rounded flex items-center justify-center">${sData}</div>`);
}
},
},
{
title: "Submitted at",
......
......@@ -136,7 +136,7 @@
"
@click="deleteUniprotIdReq"
>
Yes, I'm sure
Confirm
</button>
<button
type="button"
......@@ -158,7 +158,7 @@
"
@click="close"
>
No, cancel
Cancel
</button>
</div>
</div>
......
......@@ -73,6 +73,18 @@ export default {
{
title: "Status",
data: "attributes.Status",
fnCreatedCell: (nTd, sData, oData) => {
if(sData==='synced'){
$(nTd).html(`<div class="rounded-full px-4 mr-2 bg-gray-500 text-white p-2 rounded flex items-center justify-center">${sData}</div>`);
} else if(sData==='accepted'){
$(nTd).html(`<div class="rounded-full px-4 mr-2 bg-green-500 text-white p-2 rounded flex items-center justify-center">${sData}</div>`);
}else if(sData==='rejected'){
$(nTd).html(`<div class="rounded-full px-4 mr-2 bg-red-500 text-white p-2 rounded flex items-center justify-center">${sData}</div>`);
}else if(sData==='requested'){
$(nTd).html(`<div class="rounded-full px-4 mr-2 bg-yellow-500 text-white p-2 rounded flex items-center justify-center">${sData}</div>`);
}
},
},
{
title: "Submitted at",
......
export const host = '/api';
export const devHost = '/api';
export const apiHost = '/cms';
export const devApiHost = '/cms';
export const devHost = 'https://dev.ddcode.org/api';
// export const apiHost = '/cms';
// export const devApiHost = '/cms';
// export const devHost = 'https://dev.ddcode.org/api';
// export const devHost = 'http://localhost:5001';
// export const apiHost = 'http://localhost:1337';
// export const devApiHost = 'http://localhost:1337';
export const apiHost = 'http://localhost:1337';
export const devApiHost = 'http://localhost:1337';
// apikey should be give here:
export const apikey = process.env.VUE_APP_API_KEY;
......@@ -9,7 +9,7 @@
size="lg"
/>
<h4>Sign up request successful. An activation link has been sent to the email {{email}}. Please click the link to activate your account.</h4>
<h4>Sign up request successful. An activation link has been sent to the email <span> <a class="text-blue-900" href="">{{email}}</a> </span> . Please click the link to activate your account.</h4>
<button class="btn btn-outline" @click="hideDialog">
<font-awesome-icon icon="fa-regular fa-circle-xmark" size="2x" />
</button>
......
......@@ -15,7 +15,7 @@
</div>
</base-toaster>
<div class="flex items-center justify-center">
<h3 v-show="error" class="text-2xl text-red-500">{{ errorMsg }}</h3>
<h3 v-show="error && !jwt" class="text-2xl text-red-500">{{ errorMsg }}</h3>
<div v-if="item === 'new' || loaded" class="md:flex w-3/5 card p-2 mt-5">
<div
class="p-5 mx-auto text-left font-raleway container max-w-screen-md"
......@@ -239,14 +239,17 @@
</div>
<div class="md:w-2/3">
<p
:class="colorChange"
class="rounded-full mt-3 px-4 mr-2 w-40 text-white p-2 rounded flex items-center justify-center"
v-if="
(userRole === 'Contributor' ||
userRole === 'Maintainer' ||
userRole === 'Administrator') &&
itemId !== 'new'
"
class="mt-3"
>
<!-- <div class="rounded-full px-4 mr-2 bg-gray-500 text-white p-2 rounded flex items-center justify-center">${sData}</div> -->
{{ status }}
</p>
</div>
......@@ -305,7 +308,7 @@
<div
v-if="
userRole === 'Maintainer' &&
item !== 'new'
item !== 'new' && status!='synced'
"
class="mt-10"
>
......@@ -338,27 +341,30 @@
v-model="reviewerStatus"
class="
w-full
rounded-lg
py-2
text-gray-700
outline-none
border
bg-transparent
border-b
border-gray-500
hover:border-gray-700
focus:bg-gray-200 focus:border-gray-700
"
id="inline-status"
>
<option value="Select" selected disabled>Select</option>
<!-- <option value="Select" selected disabled>Select</option>
<option>accepted</option>
<option>rejected</option>
<option>rejected</option> -->
<option v-for="action in reqActions" :key="action" :value="action">{{action}}</option>
</select>
<h3
<p
v-if="error && statusErrMsg"
class="text-2xl text-red-500"
class="text-2xl p-2 text-red-500"
>
{{ statusErrMsg }}
</h3>
</p>
</div>
</div>
</div>
......@@ -382,24 +388,26 @@
bg-white
w-full
py-2
px-2
rounded-lg
text-gray-700
outline-none
border
bg-transparent
border-b
border-gray-500
hover:border-gray-700
focus:bg-gray-200 focus:border-gray-700
"
id="inline-reviewer-comment"
type="text"
placeholder="reviewer comments here"
placeholder="Reviewer comments here"
></textarea>
</div>
<h3
<p
v-if="error && reviewerCmtErrMsg"
class="text-2xl text-red-500"
>
{{ reviewerCmtErrMsg }}
</h3>
</p>
</div>
</div>
......@@ -421,7 +429,7 @@
<div class="flex space-x-4">
<button
v-if=" userRole === 'Maintainer' &&
item !== 'new'"
item !== 'new' && status!='synced'"
type="submit"
:disabled="entityId.length < 3"
class="bg-green-400 font-bold rounded-lg p-5 text-white"
......@@ -481,7 +489,7 @@ export default {
// condensate_protein: confidence_score, pubmed_ids
attributeValue: "", // the value of the attribute to be updated. Could be "null" for add/remove operations. The data type is dynamic
status: "requested", // 1. requested, 2. accepted, 3. rejected, 4. synced
reviewerStatus: "",
reviewerStatus: "Choose an action",
submittedBy: "",
submittedAt: "", // datetime
submissionComments: "",
......@@ -498,7 +506,9 @@ export default {
reviewerCmtErrMsg: "",
isLoading: false,
toasterIsOpen: false,
actionErrMsg:"",
isDev: process.env.NODE_ENV === "development",
reqActions:["Choose an action","accepted", "rejected"]
};
},
computed: {
......@@ -511,6 +521,19 @@ export default {
userRole: function () {
return this.$store.getters["User/userRole"];
},
colorChange(){
if(this.status==='rejected'){
return `bg-red-500`
}else if(this.status==='requested'){
return `bg-yellow-500`
}
else if(this.status==='synced'){
return `bg-gray-500`
}else if(this.status==='accepted'){
return `bg-green-500`
}
return ''
}
},
methods: {
showDialog() {
......@@ -662,14 +685,20 @@ vm.isLoading=false;
vm.loaded = false;
return;
}
if (!this.reviewerStatus || this.reviewerStatus === "Select") {
if (!this.reviewerStatus || this.reviewerStatus === "Choose an action") {
console.log("in update review true");
this.error = true;
this.statusErrMsg =
"Please change the status to either ACCEPTED or REJECTED!";
"Please select an action.";
return;
} else if (!this.reviewComments) {
}else if (this.reviewerStatus===this.status) {
this.error = true;
this.statusErrMsg =
"The new change status is same as previous. Please select another value.";
return;
}
else if (!this.reviewComments) {
this.error = true;
this.reviewerCmtErrMsg = "Comment should not be empty!";
return;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment