...
 
Commits (2)
......@@ -29,6 +29,7 @@ exports[`Activity component renders correctly 1`] = `
"description": "Congratulations! ",
"edited": "",
"guid": "activityguid0",
"isOwner": [Function],
"is_visible": true,
"mature": false,
"mature_visibility": false,
......@@ -36,6 +37,7 @@ exports[`Activity component renders correctly 1`] = `
"ownerObj": UserModel {
"__list": null,
"guid": "824853017709780997",
"isOwner": [Function],
"subtype": false,
"time_created": "1522036284",
"type": "user",
......@@ -87,6 +89,7 @@ exports[`Activity component renders correctly 1`] = `
"description": "Congratulations! ",
"edited": "",
"guid": "activityguid0",
"isOwner": [Function],
"is_visible": true,
"mature": false,
"mature_visibility": false,
......@@ -94,6 +97,7 @@ exports[`Activity component renders correctly 1`] = `
"ownerObj": UserModel {
"__list": null,
"guid": "824853017709780997",
"isOwner": [Function],
"subtype": false,
"time_created": "1522036284",
"type": "user",
......@@ -161,6 +165,7 @@ exports[`Activity component renders correctly 1`] = `
"description": "Congratulations! ",
"edited": "",
"guid": "activityguid0",
"isOwner": [Function],
"is_visible": true,
"mature": false,
"mature_visibility": false,
......@@ -168,6 +173,7 @@ exports[`Activity component renders correctly 1`] = `
"ownerObj": UserModel {
"__list": null,
"guid": "824853017709780997",
"isOwner": [Function],
"subtype": false,
"time_created": "1522036284",
"type": "user",
......@@ -263,6 +269,7 @@ exports[`Activity component renders correctly 1`] = `
"description": "Congratulations! ",
"edited": "",
"guid": "activityguid0",
"isOwner": [Function],
"is_visible": true,
"mature": false,
"mature_visibility": false,
......@@ -270,6 +277,7 @@ exports[`Activity component renders correctly 1`] = `
"ownerObj": UserModel {
"__list": null,
"guid": "824853017709780997",
"isOwner": [Function],
"subtype": false,
"time_created": "1522036284",
"type": "user",
......@@ -332,6 +340,7 @@ exports[`Activity component renders correctly 1`] = `
"description": "Congratulations! ",
"edited": "",
"guid": "activityguid0",
"isOwner": [Function],
"is_visible": true,
"mature": false,
"mature_visibility": false,
......@@ -339,6 +348,7 @@ exports[`Activity component renders correctly 1`] = `
"ownerObj": UserModel {
"__list": null,
"guid": "824853017709780997",
"isOwner": [Function],
"subtype": false,
"time_created": "1522036284",
"type": "user",
......@@ -397,6 +407,7 @@ exports[`Activity component renders correctly 1`] = `
"description": "Congratulations! ",
"edited": "",
"guid": "activityguid0",
"isOwner": [Function],
"is_visible": true,
"mature": false,
"mature_visibility": false,
......@@ -404,6 +415,7 @@ exports[`Activity component renders correctly 1`] = `
"ownerObj": UserModel {
"__list": null,
"guid": "824853017709780997",
"isOwner": [Function],
"subtype": false,
"time_created": "1522036284",
"type": "user",
......@@ -468,6 +480,7 @@ exports[`Activity component renders correctly 1`] = `
"description": "Congratulations! ",
"edited": "",
"guid": "activityguid0",
"isOwner": [Function],
"is_visible": true,
"mature": false,
"mature_visibility": false,
......@@ -475,6 +488,7 @@ exports[`Activity component renders correctly 1`] = `
"ownerObj": UserModel {
"__list": null,
"guid": "824853017709780997",
"isOwner": [Function],
"subtype": false,
"time_created": "1522036284",
"type": "user",
......@@ -532,6 +546,7 @@ exports[`Activity component renders correctly 1`] = `
"description": "Congratulations! ",
"edited": "",
"guid": "activityguid0",
"isOwner": [Function],
"is_visible": true,
"mature": false,
"mature_visibility": false,
......@@ -539,6 +554,7 @@ exports[`Activity component renders correctly 1`] = `
"ownerObj": UserModel {
"__list": null,
"guid": "824853017709780997",
"isOwner": [Function],
"subtype": false,
"time_created": "1522036284",
"type": "user",
......
......@@ -30,6 +30,7 @@ exports[`Activity screen component renders correctly with an entity as param 2`]
"description": "Congratulations! ",
"edited": "",
"guid": "activityguid0",
"isOwner": [Function],
"is_visible": true,
"mature": false,
"mature_visibility": false,
......@@ -37,6 +38,7 @@ exports[`Activity screen component renders correctly with an entity as param 2`]
"ownerObj": UserModel {
"__list": null,
"guid": "824853017709780997",
"isOwner": [Function],
"subtype": false,
"time_created": "1522036284",
"type": "user",
......@@ -79,6 +81,7 @@ exports[`Activity screen component renders correctly with an entity as param 2`]
"description": "Congratulations! ",
"edited": "",
"guid": "activityguid0",
"isOwner": [Function],
"is_visible": true,
"mature": false,
"mature_visibility": false,
......@@ -86,6 +89,7 @@ exports[`Activity screen component renders correctly with an entity as param 2`]
"ownerObj": UserModel {
"__list": null,
"guid": "824853017709780997",
"isOwner": [Function],
"subtype": false,
"time_created": "1522036284",
"type": "user",
......
......@@ -37,6 +37,7 @@ exports[`blog view screen component should renders correctly 1`] = `
"header_bg": "1",
"header_top": "0",
"impressions": 100,
"isOwner": [Function],
"last_save": "1524843907",
"last_updated": "1524838665",
"license": "attribution-noncommercial-cc",
......@@ -79,6 +80,7 @@ exports[`blog view screen component should renders correctly 1`] = `
"guid": 100,
"icontime": "1523515420",
"impressions": 100,
"isOwner": [Function],
"language": "en",
"legacy_guid": false,
"mature": "1",
......@@ -228,6 +230,7 @@ exports[`blog view screen component should renders correctly 1`] = `
"header_bg": "1",
"header_top": "0",
"impressions": 100,
"isOwner": [Function],
"last_save": "1524843907",
"last_updated": "1524838665",
"license": "attribution-noncommercial-cc",
......@@ -270,6 +273,7 @@ exports[`blog view screen component should renders correctly 1`] = `
"guid": 100,
"icontime": "1523515420",
"impressions": 100,
"isOwner": [Function],
"language": "en",
"legacy_guid": false,
"mature": "1",
......@@ -402,6 +406,7 @@ exports[`blog view screen component should renders correctly 1`] = `
"header_bg": "1",
"header_top": "0",
"impressions": 100,
"isOwner": [Function],
"last_save": "1524843907",
"last_updated": "1524838665",
"license": "attribution-noncommercial-cc",
......@@ -444,6 +449,7 @@ exports[`blog view screen component should renders correctly 1`] = `
"guid": 100,
"icontime": "1523515420",
"impressions": 100,
"isOwner": [Function],
"language": "en",
"legacy_guid": false,
"mature": "1",
......@@ -555,6 +561,7 @@ exports[`blog view screen component should renders correctly 1`] = `
"header_bg": "1",
"header_top": "0",
"impressions": 100,
"isOwner": [Function],
"last_save": "1524843907",
"last_updated": "1524838665",
"license": "attribution-noncommercial-cc",
......@@ -597,6 +604,7 @@ exports[`blog view screen component should renders correctly 1`] = `
"guid": 100,
"icontime": "1523515420",
"impressions": 100,
"isOwner": [Function],
"language": "en",
"legacy_guid": false,
"mature": "1",
......@@ -699,6 +707,7 @@ exports[`blog view screen component should renders correctly 1`] = `
"header_bg": "1",
"header_top": "0",
"impressions": 100,
"isOwner": [Function],
"last_save": "1524843907",
"last_updated": "1524838665",
"license": "attribution-noncommercial-cc",
......@@ -741,6 +750,7 @@ exports[`blog view screen component should renders correctly 1`] = `
"guid": 100,
"icontime": "1523515420",
"impressions": 100,
"isOwner": [Function],
"language": "en",
"legacy_guid": false,
"mature": "1",
......
......@@ -94,6 +94,7 @@ exports[`Channel screen component should renders correctly 1`] = `
"guid": 1,
"icontime": "1523515420",
"impressions": 100,
"isOwner": [Function],
"language": "en",
"legacy_guid": false,
"mature": "1",
......@@ -358,6 +359,7 @@ exports[`Channel screen component should renders correctly 1`] = `
"guid": 1,
"icontime": "1523515420",
"impressions": 100,
"isOwner": [Function],
"language": "en",
"legacy_guid": false,
"mature": "1",
......@@ -618,6 +620,7 @@ exports[`Channel screen component should show closed channel message 1`] = `
"guid": 1,
"icontime": "1523515420",
"impressions": 100,
"isOwner": [Function],
"language": "en",
"legacy_guid": false,
"mature": "1",
......@@ -903,6 +906,7 @@ exports[`Channel screen component should show closed channel message 1`] = `
"guid": 1,
"icontime": "1523515420",
"impressions": 100,
"isOwner": [Function],
"language": "en",
"legacy_guid": false,
"mature": "1",
......
......@@ -208,7 +208,7 @@ exports[`channel header component owner should render correctly 1`] = `
}
>
<View
accessibilityLabel="Edit your channel settings"
accessibilityLabel="Subscribe to this channel"
accessible={true}
focusable={true}
isTVSelectable={true}
......@@ -246,7 +246,56 @@ exports[`channel header component owner should render correctly 1`] = `
}
>
Edit
Subscribe
</Text>
</View>
<View
accessibilityLabel="More"
accessible={true}
focusable={true}
isTVSelectable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
style={
Object {
"alignItems": "center",
"backgroundColor": "white",
"borderColor": "#4690D6",
"borderRadius": 20,
"borderWidth": 1,
"flexDirection": "row",
"justifyContent": "center",
"margin": 4,
"opacity": 1,
"padding": 4,
}
}
>
<Text
style={
Array [
Object {
"color": "#4690D6",
},
Array [
Object {
"marginLeft": 5,
},
Object {
"marginRight": 5,
},
],
]
}
>
More
</Text>
</View>
......
......@@ -135,6 +135,7 @@ class Comment extends Component {
</View>
<CommentActionSheet
entity={this.props.entity}
comment={this.props.comment}
onSelection={this.onSelection}
ref={this.actionSheetRef}
......
......@@ -90,6 +90,8 @@ export default class CommentActionSheet extends Component {
} else {
actions.push( i18n.t('removeExplicit') )
}
} else if (this.props.entity.isOwner()) {
actions.push( i18n.t('delete') );
}
actions.push( i18n.t('report') );
......
......@@ -95,6 +95,13 @@ export default class BaseModel {
}
}
/**
* Return if the current user is the owner of the activity
*/
isOwner = () => {
return this.ownerObj && sessionService.guid === this.ownerObj.guid;
}
/**
* Update model data
* @param {Object} data
......
......@@ -104,13 +104,6 @@ export default class ActivityModel extends BaseModel {
FastImage.preload([this.getThumbSource(size)]);
}
/**
* Return if the current user is the owner of the activity
*/
isOwner() {
return sessionService.guid == this.ownerObj.guid;
}
shouldBeBlured() {
const user = sessionService.getUser();
......