Commit 7e6a3ddb authored by santhosh's avatar santhosh
Browse files

image upload

No related merge requests found
This commit is part of merge request !2. Comments created here will be created in the context of that merge request.
Showing with 47 additions and 27 deletions
+47 -27
......@@ -164,7 +164,7 @@ export default class AddStory extends Component {
.then((response) => response.json())
.then((responseJson) => {
alert(JSON.stringify(responseJson))
// alert(JSON.stringify(responseJson))
if (responseJson.status === 'True') {
var epicsList = [];
......
......@@ -662,6 +662,11 @@ export default class TaskChat extends Component {
uploadFile(mediaType) {
const message = this.state.message;
const groupId = this.state.subtaskId;
const groupEmail = Array.from(new Set(this.state.groupEmail));
ImagePicker.openPicker({
width: 300,
height: 400,
......@@ -673,6 +678,7 @@ export default class TaskChat extends Component {
this.setState({
image: {
uri: image.path,
width: image.width,
height: image.height,
......@@ -680,25 +686,39 @@ export default class TaskChat extends Component {
},
images: null,
});
AsyncStorage.multiGet(["cropcode", "userToken"], (err, response) => {
const cropcode = response[0][1];
const userToken = response[1][1];
AsyncStorage.getItem("projectId", (err, res) => {
const projectId = res;
this.setState({ itemPressedDisabled: true })
fetch(API + 'user_story_chat1.php',
{
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
file: image.uri,
message: message,
action: 'media',
corp_code: cropcode,
groupId: groupId,
messagedBy: userToken,
api:'https://api-single.agile24x7.com/pg_migration',
groupName: this.state.groupName,
groupEmail: groupEmail,
projectId: projectId,
fetch(API + 'user_story_details1.php',
{
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
action: 'uri',
corp_code: image.uri,
groupId: image.mime
})
})
})
})
})
.catch((e) => {
console.log(e);
Alert.alert(e.message ? e.message : e);
.catch((e) => {
console.log(e);
Alert.alert(e.message ? e.message : e);
});
});
});
};
......@@ -766,10 +786,10 @@ export default class TaskChat extends Component {
<View style={[styles.item, itemStyle]}>
<View style={{ padding: 5, }}>
{itemStyle === styles.itemOut ? left : right}
<Image source={{uri:item.path}} style={item.path.length !== 0 ? styles.imageview : styles.msgview} />
<Image source={{ uri: item.path }} style={item.path.length !== 0 ? styles.imageview : styles.msgview} />
{item.path.length !== 0 ? null : <Text>{item.message}</Text>}
{!inMessage && this.renderDate(item.messagedTime)}
{inMessage && this.renderDate(item.messagedTime)}
</View>
......@@ -853,11 +873,11 @@ const styles = StyleSheet.create({
alignItems: 'baseline',
},
imageview:{
imageview: {
width: 350,
resizeMode: 'contain', height: 200,
},
msgview:{
msgview: {
width: 0, height: 0
},
......
......@@ -1129,7 +1129,7 @@ getActiveSprints() {
Alert.alert(
'Alert..!',
"User has "+inProgressStoryId1+ "(" +story_title+ ")"+" In Progress on "+project_name+" Confirm if you want to User Story into In Progress",
"User has "+inProgressStoryId1+"In Progress on "+project_name+" Confirm if you want to User Story (" +story_title+ ") into In Progress",
[
{
text: 'Cancel',
......@@ -1206,15 +1206,15 @@ getActiveSprints() {
console.warn(responseJson)
// alert( JSON.stringify(responseJson))
if (responseJson.status === 'true') {
alert(responseJson.message)
// alert(responseJson.message)
this.addCommentUserStory(message, item.id, "1")
}
else if (responseJson.status === 'true1') {
// alert(responseJson.message + " in project " + responseJson.project_name);
// alert(responseJson.inprogress_story_title);
// if (responseJson.message === 'Active UserStory is found') {
// alert(responseJson.message)
this.userActiveTaskStatusUpdate1(item.id,responseJson.assignedTo,responseJson.data,responseJson.project_name,responseJson.inprogress_story_title,)
this.userActiveTaskStatusUpdate1(item.id,responseJson.assignedTo,responseJson.data,responseJson.project_name,responseJson.story_title,)
// }
// else {
// this.addCommentUserStory(message, item.id, "1")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment