Skip to content

Commit

Permalink
Merge pull request #924 from AI4Bharat/develop
Browse files Browse the repository at this point in the history
Shoonya v2.6.2
  • Loading branch information
ishvindersethi22 authored Feb 21, 2024
2 parents f86dff0 + dc2c995 commit 0e1b1c1
Show file tree
Hide file tree
Showing 40 changed files with 3,323 additions and 394 deletions.
39 changes: 39 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"redux-persist": "^6.0.0",
"redux-thunk": "^2.3.0",
"textarea-caret": "^3.1.0",
"wavesurfer.js": "^7.7.1",
"web-vitals": "^2.1.4",
"wfplayer": "^2.2.6"
},
Expand Down
4 changes: 2 additions & 2 deletions src/config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ const configs = {
BASE_URL: "https://backend.prod2.shoonya.ai4bharat.org",
BASE_URL_AUTO: process.env.REACT_APP_APIGW_BASE_URL
? process.env.REACT_APP_APIGW_BASE_URL
:"https://backend.dev.shoonya.ai4bharat.org"
:"https://backend.dev.shoonya.ai4bharat.org"
};

export default configs;
//http://20.51.211.111:8000
//https://backend.shoonya.ai4bharat.org/
// https://backend.dev2.shoonya.ai4bharat.org
//https://backend.prod2.shoonya.ai4bharat.org
//https://backend.prod2.shoonya.ai4bharat.org
1 change: 1 addition & 0 deletions src/config/localisation.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const localisation = {
"label.reviewTasks":"Review Tasks",
"label.allTask ":"All Tasks",
"label.reports":"Reports",
"label.projectanalytics":"Project Analytics",
"label.projects":"Projects",
"label.annotators":"Annotators",
"label.managers":"Managers",
Expand Down
6 changes: 6 additions & 0 deletions src/redux/actions/api/LSFAPI/LSFAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ const postReview = async (


const patchAnnotation = async (
taskId,
result,
annotationID,
load_time,
Expand All @@ -113,6 +114,7 @@ const patchAnnotation = async (
lead_time: (new Date() - load_time) / 1000 + Number(lead_time ?? 0),
annotation_status: annotation_status,
}),
task_id: taskId,
annotation_notes: notes,
...(autoSave && { auto_save: true }),
});
Expand All @@ -123,6 +125,7 @@ const patchAnnotation = async (
};

const patchReview = async (
taskId,
annotationID,
load_time,
lead_time,
Expand All @@ -137,6 +140,7 @@ const patchReview = async (
lead_time: (new Date() - load_time) / 1000 + Number(lead_time ?? 0),
annotation_status: review_status,
result: result,
task_id: taskId,
review_notes: reviewnotes,
...((review_status === "to_be_revised" ||
review_status === "accepted" ||
Expand All @@ -162,6 +166,7 @@ const patchReview = async (


const patchSuperChecker = async (
taskId,
annotationID,
load_time,
lead_time,
Expand All @@ -176,6 +181,7 @@ const patchSuperChecker = async (
await axiosInstance.patch(`/annotation/${annotationID}/`, {
lead_time: (new Date() - load_time) / 1000 + Number(lead_time ?? 0),
annotation_status: review_status,
task_id: taskId,
result: result,
parent_annotation: parentAnnotation,
supercheck_notes: superchecknotes,
Expand Down
42 changes: 42 additions & 0 deletions src/redux/actions/api/Progress/PerformanceAnalytics.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@

import API from "../../../api";
import ENDPOINTS from "../../../../config/apiendpoint";
import constants from "../../../constants";

export default class PerformanceAnalyticsAPI extends API {
constructor(progressObj, OrgId, metaInfo, timeout = 2000) {
super("POST", timeout, false);
this.progressObj = progressObj;
this.type = constants.PERFORMANCE_ANALYTICS_DATA;
this.endpoint = `${super.apiEndPointAuto()}${ENDPOINTS.getOrganizations}${OrgId}/performance_analytics_data/${metaInfo ? "?metainfo=true" : ""}`;
}

processResponse(res) {
super.processResponse(res);
if (res) {
this.PerformanceAnalytics = res;
}
}

apiEndPoint() {
return this.endpoint;
}

getBody() {
return this.progressObj;
}

getHeaders() {
this.headers = {
headers: {
"Content-Type": "application/json",
"Authorization": `JWT ${localStorage.getItem('shoonya_access_token')}`
},
};
return this.headers;
}

getPayload() {
return this.PerformanceAnalytics;
}
}
42 changes: 42 additions & 0 deletions src/redux/actions/api/Tasks/GetQueuedTaskDetails.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/**
* GetTaskDetails
*/

import API from "../../../api";
import ENDPOINTS from "../../../../config/apiendpoint";
import constants from "../../../constants";

export default class GetQueuedTaskDetailsAPI extends API {
constructor(taskId, timeout = 2000) {
super("GET", timeout, false);
this.type = constants.GET_QUEUED_TASK_DETAILS;
this.endpoint = `${super.apiEndPointAuto()}/tasks/get_celery_tasks`;
}

processResponse(res) {
super.processResponse(res);
if (res) {
this.queuedTaskDetails = res;
}
}

apiEndPoint() {
return this.endpoint;
}

getBody() {}

getHeaders() {
this.headers = {
headers: {
"Content-Type": "application/json",
"Authorization":`JWT ${localStorage.getItem('shoonya_access_token')}`
},
};
return this.headers;
}

getPayload() {
return this.queuedTaskDetails
}
}
42 changes: 42 additions & 0 deletions src/redux/actions/api/WorkspaceDetails/GetPerformanceAnalytics.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@

import API from "../../../api";
import ENDPOINTS from "../../../../config/apiendpoint";
import constants from "../../../constants";

export default class WorkspacePerformanceAnalyticsAPI extends API {
constructor(wsId, progressObj, metaInfo, timeout = 2000) {
super("POST", timeout, false);
this.progressObj = progressObj;
this.type = constants.WS_PERFORMANCE_ANALYTICS;
this.endpoint = `${super.apiEndPointAuto()}${ENDPOINTS.getWorkspaces}${wsId}/performance_analytics_data/${metaInfo ? "?metainfo=true" : ""}`;
}

processResponse(res) {
super.processResponse(res);
if (res) {
this.wsPerformanceAnalytics = res;
}
}

apiEndPoint() {
return this.endpoint;
}

getBody() {
return this.progressObj;
}

getHeaders() {
this.headers = {
headers: {
"Content-Type": "application/json",
"Authorization": `JWT ${localStorage.getItem('shoonya_access_token')}`
},
};
return this.headers;
}

getPayload() {
return this.wsPerformanceAnalytics;
}
}
3 changes: 3 additions & 0 deletions src/redux/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const constants = {
GET_ORGANIZATION_USERS:"GET_ORGANIZATION_USERS",
GET_DATASET_LIST:"GET_DATASET_LIST",
GET_TASK_DETAILS:"GET_TASK_DETAILS",
GET_QUEUED_TASK_DETAILS:"GET_QUEUED_TASK_DETAILS",
GET_DATASET_DETAILS:"GET_DATASET_DETAILS",
GET_DATAITEMS_BY_ID:"GET_DATAITEMS_BY_ID",
GET_DATASETS_BY_TYPE:"GET_DATASETS_BY_TYPE",
Expand Down Expand Up @@ -76,6 +77,7 @@ const constants = {
GET_INDIC_TRANS_LANGUAGES: "GET_INDIC_TRANS_LANGUAGES",
CUMULATIVE_TASK_DATA:"CUMULATIVE_TASK_DATA",
PERODICAL_TASK_DATA:"PERODICAL_TASK_DATA",
PERFORMANCE_ANALYTICS_DATA:"PERFORMANCE_ANALYTICS_DATA",
GET_DATASET_LOGS: "GET_DATASET_LOGS",
GET_PROJECT_LOGS: "GET_PROJECT_LOGS",
DOWNLOAD_PROJECT_TSV:"DOWNLOAD_PROJECT_TSV",
Expand All @@ -100,6 +102,7 @@ const constants = {
WS_META_ANALYTICS: "WS_META_ANALYTICS",
WS_PERODICAL_TASK: "WS_PERODICAL_TASK",
WS_TASK_ANALYTICS: "WS_TASK_ANALYTICS",
WS_PERFORMANCE_ANALYTICS: "WS_PERFORMANCE_ANALYTICS",
SEND_ORGANIZATION_USER_REPORTS: "SEND_ORGANIZATION_USER_REPORTS",
SEND_WORKSPACE_USER_REPORTS: "SEND_WORKSPACE_USER_REPORTS",
GET_SCHEDULED_MAILS: "GET_SCHEDULED_MAILS",
Expand Down
4 changes: 4 additions & 0 deletions src/redux/reducers/Progress/MetaAnalytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ const diffAnnotationReview = (payload) => {
review_audio_word_count: (value?.rev_audio_word_count),
diff_annotation_review_audio_word: (value?.ann_audio_word_count - value?.rev_audio_word_count),

ann_ocr_cumulative_word_count: (value?.ann_ocr_cumulative_word_count),
rew_ocr_cumulative_word_count: (value?.rew_ocr_cumulative_word_count),
diff_annotation_review_ocr_word: (value?.ann_ocr_cumulative_word_count - value?.rew_ocr_cumulative_word_count),

annotation_raw_aud_duration:(value?.ann_raw_aud_duration),
review_raw_aud_duration:(value?.rew_raw_aud_duration),
annotation_raw_aud_duration_tohour:(value?.ann_raw_aud_duration?.split(':')?.map(Number)?.[0] * 1 + value?.ann_raw_aud_duration?.split(':')?.map(Number)?.[1]/ 60 + value?.ann_raw_aud_duration?.split(':')?.map(Number)?.[2]/3600),
Expand Down
23 changes: 23 additions & 0 deletions src/redux/reducers/Tasks/GetQueuedTaskDetails.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// import { getUniqueListBy } from "../../../utils/utils";
import constants from "../../constants";

let initialState = {
data:[]
}
const reducer = (state=initialState,action)=>{
switch(action.type){
case constants.GET_QUEUED_TASK_DETAILS:
return {
...state,
data:action.payload
}

default:
return {
...state
}
}

};

export default reducer;
4 changes: 4 additions & 0 deletions src/redux/reducers/WorkspaceDetails/GetMetaAnalytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ const diffAnnotationReview = (payload) => {
review_audio_word_count: (value?.rev_audio_word_count),
diff_annotation_review_audio_word: (value?.ann_audio_word_count - value?.rev_audio_word_count),

ann_ocr_cumulative_word_count: (value?.ann_ocr_cumulative_word_count),
rew_ocr_cumulative_word_count: (value?.rew_ocr_cumulative_word_count),
diff_annotation_review_ocr_word: (value?.ann_ocr_cumulative_word_count - value?.rew_ocr_cumulative_word_count),

annotation_raw_aud_duration:(value?.ann_raw_aud_duration),
review_raw_aud_duration:(value?.rew_raw_aud_duration),
annotation_raw_aud_duration_tohour:(value?.ann_raw_aud_duration?.split(':')?.map(Number)?.[0] * 1 + value?.ann_raw_aud_duration?.split(':')?.map(Number)?.[1]/ 60 + value?.ann_raw_aud_duration?.split(':')?.map(Number)?.[2]/3600),
Expand Down
2 changes: 2 additions & 0 deletions src/redux/reducers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import fetchLanguages from './UserManagement/FetchLanguages';
import getOrganizationUsers from './Organization/GetOragnizationUsers';
import getDatasetList from './Dataset/GetDatasetList';
import getTaskDetails from './Tasks/GetTaskDetails'
import getQueuedTaskDetails from './Tasks/GetQueuedTaskDetails'
import getDatasetDetails from './Dataset/GetDatasetDetails';
import getDataitemsById from './Dataset/GetDataitemsById';
import getArchiveProject from './ProjectDetails/ArchiveProject';
Expand Down Expand Up @@ -116,6 +117,7 @@ const index = {
getOrganizationUsers,
getDatasetList,
getTaskDetails,
getQueuedTaskDetails,
getDatasetList,
getDatasetDetails,
getDataitemsById,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ const SettingsButtonComponent = ({
handleInfoButtonClick,
advancedWaveformSettings,
setAdvancedWaveformSettings,
waveSurfer,
setWaveSurfer,
pauseOnType,
setPauseOnType,
annotationId,
Expand Down Expand Up @@ -185,6 +187,19 @@ const SettingsButtonComponent = ({
}
/>
</MenuItem>
<MenuItem>
<FormControlLabel
label="WaveSurfer"
control={
<Checkbox
checked={waveSurfer}
onChange={() => {
setWaveSurfer(!waveSurfer);
}}
/>
}
/>
</MenuItem>
<MenuItem>
<Popup contentStyle={{
width: "300px",
Expand Down
Loading

0 comments on commit 0e1b1c1

Please sign in to comment.