Skip to content

Commit

Permalink
Merge pull request #180 from AI4Bharat/btns
Browse files Browse the repository at this point in the history
fixes
  • Loading branch information
aparna-aa authored Nov 21, 2024
2 parents 6b66ae8 + 1c92522 commit d966ddb
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 7 deletions.
4 changes: 3 additions & 1 deletion src/app/ui/pages/chat/AllTaskPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,9 @@ console.log(annotations);
textAlign: "center",
}}
>
ANNOTATION ID: {annotations[0]?.id}
{annotations[0]?.annotation_type ==1 && `ANNOTATION ID: ${annotations[0]?.id}`}
{annotations[0]?.annotation_type ==2 && `REVIEW ID: ${annotations[0]?.id}`}
{annotations[0]?.annotation_type ==3 && `SUPERCHECK ID: ${annotations[0]?.id}`}
</div>
</div>
}
Expand Down
25 changes: 24 additions & 1 deletion src/app/ui/pages/chat/AnnotatePage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@ const AnnotatePage = () => {
};
}, [taskId]);
const filterAnnotations = (annotations, user) => {
setLoading(true)
let disableSkip = false;
let disableUpdate = false;
let disableDraft = false;
Expand Down Expand Up @@ -642,6 +643,7 @@ const AnnotatePage = () => {
setdisableSkipButton(disableSkip);
setFilterMessage(Message);
console.log(annotations, "hhhh");
setLoading(false)

return [
filteredAnnotations,
Expand Down Expand Up @@ -904,7 +906,28 @@ const AnnotatePage = () => {
}}
>
<Grid item>
<LightTooltip title={assignedUsers ? assignedUsers : ""}>
<LightTooltip title={
<div>
<div>
{Array.isArray(assignedUsers)
? assignedUsers.join(", ")
: assignedUsers || "No assigned users"}
</div>
<div
style={{
marginTop: "4px",
fontWeight: "bold",
textAlign: "center",
}}
>
{annotations[0]?.annotation_type ==1 && `ANNOTATION ID: ${annotations[0]?.id}`}
{annotations[0]?.annotation_type ==2 && `REVIEW ID: ${annotations[0]?.id}`}
{annotations[0]?.annotation_type ==3 && `SUPERCHECK ID: ${annotations[0]?.id}`}

</div>
</div>
}
>
<Button
type="default"
className="lsf-button"
Expand Down
6 changes: 5 additions & 1 deletion src/app/ui/pages/chat/ReviewPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,7 @@ const ReviewPage = () => {
};

const filterAnnotations = (annotations, user, taskData) => {
setLoading(true)
setFilteredReady(true);
let filteredAnnotations = annotations;
let userAnnotation = annotations.find((annotation) => {
Expand Down Expand Up @@ -970,6 +971,7 @@ const ReviewPage = () => {
setFilterMessage(filterMessage);
setAnnotations(filteredAnnotations);
setFilteredReady(false);
setLoading(false)
return [
filteredAnnotations,
disable,
Expand Down Expand Up @@ -1227,7 +1229,9 @@ const ReviewPage = () => {
textAlign: "center",
}}
>
ANNOTATION ID: {annotations[0]?.id}
{annotations[0]?.annotation_type ==1 && `ANNOTATION ID: ${annotations[0]?.id}`}
{annotations[0]?.annotation_type ==2 && `REVIEW ID: ${annotations[0]?.id}`}
{annotations[0]?.annotation_type ==3 && `SUPERCHECK ID: ${annotations[0]?.id}`}
</div>
</div>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@ const PreferenceRanking = ({
if (annotation && annotation[0]?.result) {
const result = annotation?.[0]?.result || [];

const forms = result.map((currentForm) => ({
const forms = result?.map((currentForm) => ({
prompt: currentForm.prompt || "",
model_responses_json: currentForm.model_responses_json.map((modelResponse) => ({
model_responses_json: currentForm.model_responses_json?.map((modelResponse) => ({
...modelResponse,
output: modelResponse.output || "",
model_name: modelResponse.model_name || "",
questions_response: modelResponse.questions_response.map((questionResponse) => ({
questions_response: modelResponse.questions_response?.map((questionResponse) => ({
...questionResponse,
question: questionResponse?.question || {},
response: questionResponse?.response || [],
Expand Down
2 changes: 1 addition & 1 deletion src/firebase.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ const firebaseConfig = {
const app = initializeApp(firebaseConfig);

export const auth=getAuth(app);
export const googleAuthProvider=new GoogleAuthProvider();
export const googleAuthProvider=new GoogleAuthProvider();

0 comments on commit d966ddb

Please sign in to comment.