Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
Revert "add emoji input functionality to model chat crowdsourcing task (
Browse files Browse the repository at this point in the history
#4666)" (#4934)

This reverts commit 2f42a5b.
  • Loading branch information
mojtaba-komeili authored Jan 19, 2023
1 parent f249627 commit cb369e9
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import React from "react";

import InputEmoji from 'react-input-emoji'
import { Button, Col, ControlLabel, Form, FormControl, FormGroup } from "react-bootstrap";


Expand Down Expand Up @@ -161,7 +160,7 @@ function FinalSurvey({ taskConfig, onMessageSend, active, currentCheckboxes }) {
}
}

function CheckboxTextResponse({ onMessageSend, taskConfig, active, currentCheckboxes }) {
function CheckboxTextResponse({ onMessageSend, active, currentCheckboxes }) {
const [textValue, setTextValue] = React.useState("");
const [sending, setSending] = React.useState(false);

Expand Down Expand Up @@ -197,56 +196,32 @@ function CheckboxTextResponse({ onMessageSend, taskConfig, active, currentCheckb
[tryMessageSend]
);

if (taskConfig.emoji_picker){
return (
<div className="response-type-module">
<div className="response-bar">
<InputEmoji
value={textValue}
className="response-text-input"
onEnter={(e) => handleKeyPress(e)}
onChange={setTextValue}
placeholder="Please enter here..."
/>
<Button
className="btn btn-primary submit-response"
id="id_send_msg_button"
disabled={textValue === "" || !active || sending}
onClick={() => tryMessageSend()}
>
Send
</Button>
</div>
</div>
);
} else {
return (
<div className="response-type-module">
<div className="response-bar">
return (
<div className="response-type-module">
<div className="response-bar">
<FormControl
type="text"
className="response-text-input"
inputRef={(ref) => {
inputRef.current = ref;
}}
value={textValue}
placeholder="Please enter here..."
onKeyPress={(e) => handleKeyPress(e)}
onChange={(e) => setTextValue(e.target.value)}
disabled={!active || sending}
/>
<Button
className="btn btn-primary submit-response"
id="id_send_msg_button"
disabled={textValue === "" || !active || sending}
onClick={() => tryMessageSend()}
>
Send
</Button>
</div>
type="text"
className="response-text-input"
inputRef={(ref) => {
inputRef.current = ref;
}}
value={textValue}
placeholder="Please enter here..."
onKeyPress={(e) => handleKeyPress(e)}
onChange={(e) => setTextValue(e.target.value)}
disabled={!active || sending}
/>
<Button
className="btn btn-primary submit-response"
id="id_send_msg_button"
disabled={textValue === "" || !active || sending}
onClick={() => tryMessageSend()}
>
Send
</Button>
</div>
);
}
</div>
);
}

function ResponseComponent({ taskConfig, appSettings, onMessageSend, active }) {
Expand All @@ -272,7 +247,6 @@ function ResponseComponent({ taskConfig, appSettings, onMessageSend, active }) {
return (
<CheckboxTextResponse
onMessageSend={onMessageSend}
taskConfig={taskConfig}
active={computedActive}
currentCheckboxes={lastMessageAnnotations}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ mephisto:
conversation_start_mode: 'hi'
annotation_question: Does this comment from your partner have any of the following attributes? (Check all that apply)
conversations_needed_string: "blender_90M:10"
emoji_picker: false
task:
allowed_concurrent: 1
assignment_duration_in_seconds: 600
Expand Down
5 changes: 0 additions & 5 deletions parlai/crowdsourcing/tasks/model_chat/model_chat_blueprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,6 @@ class BaseModelChatBlueprintArgs(ParlAIChatBlueprintArgs):
"in order to override the parlai parser defaults."
},
)
emoji_picker: bool = field(
default=False,
metadata={"help": "Show emoji picker."},
)


class BaseModelChatBlueprint(ParlAIChatBlueprint, ABC):
Expand Down Expand Up @@ -299,7 +295,6 @@ def get_frontend_args(self) -> Dict[str, Any]:
"frame_height": 650,
"final_rating_question": self.args.blueprint.final_rating_question,
"block_mobile": True,
"emoji_picker": self.args.blueprint.emoji_picker,
}


Expand Down

0 comments on commit cb369e9

Please sign in to comment.