-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #950 from AI4Bharat/develop
Shoonya v2.6.2 Patch
- Loading branch information
Showing
30 changed files
with
736 additions
and
464 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export const participationType = ["FULL_TIME", "PART_TIME", "NA"]; | ||
export const participationType = ["FULL_TIME", "PART_TIME", "NA", "CONTRACT_BASIS"]; |
122 changes: 84 additions & 38 deletions
122
src/redux/actions/api/ProjectDetails/DeallocationAnnotatorsAndReviewers.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,88 @@ | ||
import API from "../../../api"; | ||
import ENDPOINTS from "../../../../config/apiendpoint"; | ||
import constants from "../../../constants"; | ||
|
||
export default class DeallocationAnnotatorsAndReviewersAPI extends API { | ||
constructor(projectId,radiobutton,annotatorsUser,reviewerssUser,annotationStatus,reviewStatus,superCheckUser,SuperCheckStatus,projectObj, timeout = 2000) { | ||
super("GET", timeout, false); | ||
this.projectObj = projectObj; | ||
const queryString = radiobutton === "annotation" ? `unassign_tasks/?annotator_id=${annotatorsUser}&annotation_status=["${annotationStatus}"]` : radiobutton === "review"? `unassign_review_tasks/?reviewer_id=${reviewerssUser}&review_status=["${reviewStatus}"]`:`unassign_supercheck_tasks/?superchecker_id=${superCheckUser}&supercheck_status=["${SuperCheckStatus}"]`; | ||
console.log(queryString,"queryStringqueryString") | ||
this.endpoint = `${super.apiEndPointAuto()}${ENDPOINTS.getProjects}${projectId}/${queryString}`; | ||
} | ||
|
||
processResponse(res) { | ||
super.processResponse(res); | ||
if (res) { | ||
this.deallocationAnnotatorsAndReviewers= res; | ||
} | ||
} | ||
|
||
apiEndPoint() { | ||
return this.endpoint; | ||
} | ||
getBody() { | ||
return this.projectObj; | ||
} | ||
|
||
getHeaders() { | ||
this.headers = { | ||
headers: { | ||
"Content-Type": "application/json", | ||
"Authorization":`JWT ${localStorage.getItem('shoonya_access_token')}` | ||
}, | ||
}; | ||
return this.headers; | ||
} | ||
|
||
getPayload() { | ||
return this.deallocationAnnotatorsAndReviewers | ||
} | ||
|
||
export class DeallocateTaskById extends API { | ||
constructor(projectId, taskId, selectedUser, timeout = 2000) { | ||
super("POST", timeout, false); | ||
this.projectId = projectId; | ||
|
||
this.payload = { | ||
task_ids: Array.isArray(taskId) ? taskId.map(id => parseInt(id)) : [parseInt(taskId)], | ||
}; | ||
const baseEndpoint = `${super.apiEndPointAuto()}/${ENDPOINTS.getProjects}${projectId}/`; | ||
|
||
const endpointMap = { | ||
annotation: 'unassign_tasks/', | ||
review: `unassign_review_tasks/`, | ||
superChecker: 'unassign_supercheck_task/', | ||
}; | ||
|
||
const selectedUserEndpoint = endpointMap[selectedUser]; | ||
|
||
if (selectedUserEndpoint) { | ||
this.endpoint = baseEndpoint + selectedUserEndpoint; | ||
} else { | ||
console.error('Invalid selectedUser:', selectedUser); | ||
} | ||
} | ||
|
||
processResponse(res) { | ||
super.processResponse(res); | ||
if (res) { | ||
this.deallocateTaskById = res; | ||
} | ||
} | ||
apiEndPoint() { | ||
return this.endpoint; | ||
} | ||
getBody() { | ||
return this.payload; | ||
} | ||
getHeaders() { | ||
return { | ||
"Content-Type": "application/json", | ||
Authorization: `JWT ${localStorage.getItem("shoonya_access_token")}`, | ||
}; | ||
} | ||
getPayload() { | ||
return this.deallocateTaskById; | ||
} | ||
} | ||
|
||
export default class DeallocationAnnotatorsAndReviewersAPI extends API { | ||
constructor(projectId,radiobutton,annotatorsUser,reviewerssUser,annotationStatus,reviewStatus,superCheckUser,SuperCheckStatus,projectObj, timeout = 2000) { | ||
super("POST", timeout, false); | ||
this.projectObj = projectObj; | ||
const queryString = radiobutton === "annotation" ? `unassign_tasks/?annotator_id=${annotatorsUser}&annotation_status=["${annotationStatus}"]` : radiobutton === "review"? `unassign_review_tasks/?reviewer_id=${reviewerssUser}&review_status=["${reviewStatus}"]`:`unassign_supercheck_tasks/?superchecker_id=${superCheckUser}&supercheck_status=["${SuperCheckStatus}"]`; | ||
this.endpoint = `${super.apiEndPointAuto()}${ENDPOINTS.getProjects}${projectId}/${queryString}`; | ||
} | ||
|
||
processResponse(res) { | ||
super.processResponse(res); | ||
if (res) { | ||
this.deallocationAnnotatorsAndReviewers= res; | ||
} | ||
} | ||
|
||
apiEndPoint() { | ||
return this.endpoint; | ||
} | ||
getBody() { | ||
return this.projectObj; | ||
} | ||
|
||
|
||
getHeaders() { | ||
this.headers = { | ||
headers: { | ||
"Content-Type": "application/json", | ||
"Authorization":`JWT ${localStorage.getItem('shoonya_access_token')}` | ||
}, | ||
}; | ||
return this.headers; | ||
} | ||
|
||
getPayload() { | ||
return this.deallocationAnnotatorsAndReviewers | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.