Skip to content

Commit

Permalink
fix(activity-log): activity log tab in inbox right sidebar
Browse files Browse the repository at this point in the history
close #2068
  • Loading branch information
batamar committed Jun 19, 2020
1 parent 3e8658e commit b7600bf
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 13 deletions.
6 changes: 3 additions & 3 deletions ui/src/modules/activityLogs/components/ActivityItem.tsx
Expand Up @@ -20,7 +20,7 @@ import SegmentLog from './items/SegmentLog';

type Props = {
activity: IActivityLog;
currenUser: IUser;
currentUser: IUser;
};

class ActivityItem extends React.Component<Props> {
Expand All @@ -44,7 +44,7 @@ class ActivityItem extends React.Component<Props> {
}

render() {
const { activity, currenUser } = this.props;
const { activity, currentUser } = this.props;
const { _id, contentType, action } = activity;

switch ((action && action) || contentType) {
Expand All @@ -54,7 +54,7 @@ class ActivityItem extends React.Component<Props> {
<InternalNote
noteId={_id}
activity={activity}
currenUser={currenUser}
currentUser={currentUser}
/>
);
case 'conversation':
Expand Down
2 changes: 1 addition & 1 deletion ui/src/modules/activityLogs/components/ActivityList.tsx
Expand Up @@ -16,7 +16,7 @@ type Props = {
class ActivityList extends React.Component<Props> {
renderItem(data) {
return data.map((item, index) => (
<ActivityItem key={index} activity={item} currenUser={this.props.user} />
<ActivityItem key={index} activity={item} currentUser={this.props.user} />
));
}

Expand Down
10 changes: 5 additions & 5 deletions ui/src/modules/activityLogs/components/items/InternalNote.tsx
Expand Up @@ -21,7 +21,7 @@ type Props = {
remove: () => void;
internalNote: IInternalNote;
isLoading: boolean;
currenUser: IUser;
currentUser: IUser;
};

class InternalNote extends React.Component<Props, { editing: boolean }> {
Expand Down Expand Up @@ -55,9 +55,9 @@ class InternalNote extends React.Component<Props, { editing: boolean }> {
};

renderContent() {
const { internalNote, isLoading, edit, currenUser } = this.props;
const { internalNote, isLoading, edit, currentUser } = this.props;
const { content } = internalNote;
const isCurrentUserNote = currenUser._id === internalNote.createdUser._id;
const isCurrentUserNote = currentUser._id === internalNote.createdUser._id;

if (this.state.editing) {
return (
Expand All @@ -80,8 +80,8 @@ class InternalNote extends React.Component<Props, { editing: boolean }> {
}

render() {
const { internalNote, remove, currenUser } = this.props;
const isCurrentUserNote = currenUser._id === internalNote.createdUser._id;
const { internalNote, remove, currentUser } = this.props;
const isCurrentUserNote = currentUser._id === internalNote.createdUser._id;

return (
<LogWrapper>
Expand Down
Expand Up @@ -16,7 +16,7 @@ import { graphql } from 'react-apollo';
type Props = {
activity: any;
noteId: string;
currenUser: IUser;
currentUser: IUser;
};

type FinalProps = {
Expand Down
Expand Up @@ -3,6 +3,7 @@ import Sidebar from 'modules/layout/components/Sidebar';
import React from 'react';
import { BasicInfo, TabContent } from './styles';

import { IUser } from 'modules/auth/types';
import asyncComponent from 'modules/common/components/AsyncComponent';
import Box from 'modules/common/components/Box';
import { __ } from 'modules/common/utils';
Expand Down Expand Up @@ -74,6 +75,7 @@ const ConversationDetails = asyncComponent(
);

type IndexProps = {
currentUser: IUser;
conversation: IConversation;
customer: ICustomer;
loading: boolean;
Expand Down Expand Up @@ -136,6 +138,7 @@ class Index extends React.Component<IndexProps, IndexState> {
const { currentSubTab } = this.state;

const {
currentUser,
taggerRefetchQueries,
conversation,
customer,
Expand Down Expand Up @@ -172,7 +175,11 @@ class Index extends React.Component<IndexProps, IndexState> {

if (currentSubTab === 'activity') {
return (
<SidebarActivity customer={customer} currentSubTab={currentSubTab} />
<SidebarActivity
currentUser={currentUser}
customer={customer}
currentSubTab={currentSubTab}
/>
);
}

Expand Down
Expand Up @@ -25,6 +25,7 @@ class SidebarActivity extends React.Component<Props> {
currentUser,
currentSubTab
} = this.props;

const hasActivity = hasAnyActivity(activityLogsCustomer);

return (
Expand Down
@@ -1,6 +1,8 @@
import client from 'apolloClient';
import gql from 'graphql-tag';
import * as compose from 'lodash.flowright';
import withCurrentUser from 'modules/auth/containers/withCurrentUser';
import { IUser } from 'modules/auth/types';
import DumbSidebar from 'modules/inbox/components/conversationDetail/sidebar/Sidebar';
import { queries } from 'modules/inbox/graphql';
import React from 'react';
Expand All @@ -17,7 +19,10 @@ type Props = {
conversation: IConversation;
};

type FinalProps = { customerDetailQuery: CustomerDetailQueryResponse } & Props;
type FinalProps = {
customerDetailQuery: CustomerDetailQueryResponse;
currentUser: IUser;
} & Props;

type State = {
customer: ICustomer;
Expand Down Expand Up @@ -117,5 +122,5 @@ export default withProps<Props>(
})
}
)
)(Sidebar)
)(withCurrentUser(Sidebar))
);

0 comments on commit b7600bf

Please sign in to comment.