Changed requested changes

This commit is contained in:
oobjectt 2022-12-10 21:06:56 +01:00
parent e03fa83bf7
commit 22696b93b9
5 changed files with 19 additions and 11 deletions

View File

@ -93,7 +93,7 @@ export const GuideToolOngoingView: FC<GuideToolOngoingViewProps> = props =>
<Text bold>{ userName }</Text> <Text bold>{ userName }</Text>
<Text>{ LocalizeText('guide.help.request.user.ongoing.guide.desc') }</Text> <Text>{ LocalizeText('guide.help.request.user.ongoing.guide.desc') }</Text>
</Column> } </Column> }
<Button variant="danger" disabled={ messageGroups.length === 0 } onClick={ () => report(ReportType.IM, { reportedUserId: userId }) }>{ LocalizeText('guide.help.common.report.link') }</Button> <Button variant="danger" disabled={ messageGroups.length === 0 } onClick={ () => report(ReportType.GUIDE, { reportedUserId: userId }) }>{ LocalizeText('guide.help.common.report.link') }</Button>
</Flex> </Flex>
<Column overflow="hidden" gap={ 1 } className="bg-muted rounded chat-messages p-2"> <Column overflow="hidden" gap={ 1 } className="bg-muted rounded chat-messages p-2">
<Column overflow="auto"> <Column overflow="auto">

View File

@ -16,13 +16,15 @@ export const GuideToolUserFeedbackView: FC<GuideToolUserFeedbackViewProps> = pro
return ( return (
<Column> <Column>
<Flex justifyContent="between" gap={ 1 } className="bg-muted p-2 rounded"> { userName && (userName.length > 0) &&
<Column gap={ 0 }> <Flex justifyContent="between" gap={ 1 } className="bg-muted p-2 rounded">
<Text bold>{ userName }</Text> <Column gap={ 0 }>
<Text>{ LocalizeText('guide.help.request.user.feedback.guide.desc') }</Text> <Text bold>{ userName }</Text>
</Column> <Text>{ LocalizeText('guide.help.request.user.feedback.guide.desc') }</Text>
<Button variant="danger" disabled>{ LocalizeText('guide.help.common.report.link') }</Button> </Column>
</Flex> <Button variant="danger" disabled>{ LocalizeText('guide.help.common.report.link') }</Button>
</Flex>
}
<Column gap={ 1 }> <Column gap={ 1 }>
<Text bold>{ LocalizeText('guide.help.request.user.feedback.closed.title') }</Text> <Text bold>{ LocalizeText('guide.help.request.user.feedback.closed.title') }</Text>
<Text>{ LocalizeText('guide.help.request.user.feedback.closed.desc') }</Text> <Text>{ LocalizeText('guide.help.request.user.feedback.closed.desc') }</Text>

View File

@ -1,4 +1,4 @@
import { CallForHelpFromForumMessageMessageComposer, CallForHelpFromForumThreadMessageComposer, CallForHelpFromIMMessageComposer, CallForHelpFromPhotoMessageComposer, CallForHelpMessageComposer } from '@nitrots/nitro-renderer'; import { CallForHelpFromForumMessageMessageComposer, CallForHelpFromForumThreadMessageComposer, CallForHelpFromIMMessageComposer, CallForHelpFromPhotoMessageComposer, CallForHelpMessageComposer, GuideSessionReportMessageComposer } from '@nitrots/nitro-renderer';
import { FC } from 'react'; import { FC } from 'react';
import { GetSessionDataManager, LocalizeText, ReportType, SendMessageComposer } from '../../../api'; import { GetSessionDataManager, LocalizeText, ReportType, SendMessageComposer } from '../../../api';
import { Button, Column, Text } from '../../../common'; import { Button, Column, Text } from '../../../common';
@ -14,6 +14,7 @@ export const ReportSummaryView: FC<{}> = props =>
switch(activeReport.reportType) switch(activeReport.reportType)
{ {
case ReportType.BULLY: case ReportType.BULLY:
case ReportType.EMERGENCY: case ReportType.EMERGENCY:
case ReportType.ROOM: { case ReportType.ROOM: {
@ -38,6 +39,11 @@ export const ReportSummaryView: FC<{}> = props =>
case ReportType.PHOTO: case ReportType.PHOTO:
SendMessageComposer(new CallForHelpFromPhotoMessageComposer(activeReport.extraData, activeReport.cfhTopic, activeReport.roomId, GetSessionDataManager().userId, activeReport.roomObjectId)); SendMessageComposer(new CallForHelpFromPhotoMessageComposer(activeReport.extraData, activeReport.cfhTopic, activeReport.roomId, GetSessionDataManager().userId, activeReport.roomObjectId));
break; break;
case ReportType.GUIDE:
activeReport.reportedChats.forEach(entry => chats.push(entry.webId, entry.message));
SendMessageComposer(new GuideSessionReportMessageComposer(activeReport.message));
break;
} }
setActiveReport(null); setActiveReport(null);

View File

@ -18,6 +18,7 @@ export const SelectReportedChatsView: FC<{}> = props =>
case ReportType.EMERGENCY: case ReportType.EMERGENCY:
return chatHistory.filter(chat => (chat.type === ChatEntryType.TYPE_CHAT) && (chat.webId === activeReport.reportedUserId) && (chat.entityType === RoomObjectType.USER)); return chatHistory.filter(chat => (chat.type === ChatEntryType.TYPE_CHAT) && (chat.webId === activeReport.reportedUserId) && (chat.entityType === RoomObjectType.USER));
case ReportType.IM: case ReportType.IM:
case ReportType.GUIDE:
return messengerHistory.filter(chat => (chat.webId === activeReport.reportedUserId) && (chat.type === ChatEntryType.TYPE_IM)); return messengerHistory.filter(chat => (chat.webId === activeReport.reportedUserId) && (chat.type === ChatEntryType.TYPE_IM));
} }

View File

@ -35,6 +35,7 @@ const useHelpState = () =>
case ReportType.BULLY: case ReportType.BULLY:
case ReportType.EMERGENCY: case ReportType.EMERGENCY:
case ReportType.IM: case ReportType.IM:
case ReportType.GUIDE:
newReport.reportedUserId = options.reportedUserId; newReport.reportedUserId = options.reportedUserId;
newReport.currentStep = ReportState.SELECT_CHATS; newReport.currentStep = ReportState.SELECT_CHATS;
break; break;
@ -56,8 +57,6 @@ const useHelpState = () =>
break; break;
case ReportType.PHOTO: case ReportType.PHOTO:
break; break;
case ReportType.GUIDE:
break;
} }
setActiveReport(newReport); setActiveReport(newReport);