-
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 branch 'develop' into ocrsegcat1
- Loading branch information
Showing
26 changed files
with
608 additions
and
348 deletions.
There are no files selected for viewing
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"]; |
125 changes: 87 additions & 38 deletions
125
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,91 @@ | ||
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; | ||
|
||
console.log(taskId); | ||
this.payload = { | ||
// task_ids: Array.isArray(taskId) ? taskId.map(id => parseInt(id)) : [parseInt(taskId)], | ||
|
||
task_ids: taskId.split(',').map(i => parseInt(i)), | ||
}; | ||
const baseEndpoint = `${super.apiEndPointAuto()}/${ENDPOINTS.getProjects}${projectId}/`; | ||
|
||
const endpointMap = { | ||
annotation: 'unassign_tasks/', | ||
review: `unassign_review_tasks/`, | ||
superChecker: 'unassign_supercheck_tasks/', | ||
}; | ||
|
||
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
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.