Refactoring code
This commit is contained in:
parent
a2172f924d
commit
c1c73e74a1
|
@ -147,20 +147,8 @@ class ReviewChange extends Component {
|
||||||
this.currentUserGroups = arr;
|
this.currentUserGroups = arr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
intersection (arr1, arr2) { //Computes the list of values that are the intersection of all the arrays.
|
|
||||||
const arr = [];
|
|
||||||
arr1.forEach((item1) => {
|
|
||||||
arr2.forEach((item2) => {
|
|
||||||
if (item1 === item2) {
|
|
||||||
arr.push(item2);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
return arr;
|
|
||||||
}
|
|
||||||
checkUserGroups (username) {
|
checkUserGroups (username) {
|
||||||
const groups = AscCommon.UserInfoParser.canEditReview(username);
|
return this.currentUserGroups && AscCommon.UserInfoParser.canEditReview(username);
|
||||||
return this.currentUserGroups && groups && (this.intersection(this.currentUserGroups, (groups.length>0) ? groups : [""]).length>0);
|
|
||||||
}
|
}
|
||||||
dateToLocaleTimeString (date) {
|
dateToLocaleTimeString (date) {
|
||||||
const format = (date) => {
|
const format = (date) => {
|
||||||
|
|
Loading…
Reference in a new issue