Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support to hide Edit log button #931

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/components/CallItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ type CallItemProps = {
onViewSmartNote?: (...args: any[]) => any;
aiNoted: boolean;
showLogButton?: boolean;
hideEditLogButton?: boolean;
logButtonTitle?: string;
};

Expand Down Expand Up @@ -165,6 +166,7 @@ export const CallItem: FunctionComponent<CallItemProps> = ({
externalViewEntity: externalViewEntityProp,
externalHasEntity,
showLogButton,
hideEditLogButton,
logButtonTitle,
isRecording = false,
onViewSmartNote,
Expand Down Expand Up @@ -412,7 +414,11 @@ export const CallItem: FunctionComponent<CallItemProps> = ({
const statusMatch = activityMatches.find(
(activity) => activity.type === 'status',
);
if (showLogButton && !isFax) {
if (
showLogButton &&
!isFax &&
(!isLogged || !hideEditLogButton)
) {
actions.push({
id: 'log',
icon: isLogged ? Edit : NewAction,
Expand Down
3 changes: 3 additions & 0 deletions src/components/CallListV2/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ type CallListV2Props = {
maxExtensionNumberLength: number;
formatPhone: (phoneNumber: string) => string | undefined;
showLogButton: boolean;
hideEditLogButton: boolean;
logButtonTitle: string;
isRecording?: boolean;
onViewSmartNote?: (...args: any[]) => any;
Expand Down Expand Up @@ -141,6 +142,7 @@ export function CallListV2({
maxExtensionNumberLength,
formatPhone,
showLogButton,
hideEditLogButton,
logButtonTitle,
isRecording,
onViewSmartNote,
Expand Down Expand Up @@ -224,6 +226,7 @@ export function CallListV2({
enableCDC={enableCDC}
maxExtensionNumberLength={maxExtensionNumberLength}
showLogButton={showLogButton}
hideEditLogButton={hideEditLogButton}
logButtonTitle={logButtonTitle}
isRecording={isRecording}
onViewSmartNote={onViewSmartNote}
Expand Down
2 changes: 2 additions & 0 deletions src/components/CallsListPanel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export function CallsListPanel({
maxExtensionLength,
showLogButton = false,
logButtonTitle = '',
hideEditLogButton = false,
showMergeCall,
showCallDetail,
onMergeCall,
Expand Down Expand Up @@ -238,6 +239,7 @@ export function CallsListPanel({
enableCDC={enableCDC}
showLogButton={showLogButton}
logButtonTitle={logButtonTitle}
hideEditLogButton={hideEditLogButton}
formatPhone={formatPhone}
isRecording={type === 'recordings'}
onViewSmartNote={onViewSmartNote}
Expand Down
4 changes: 4 additions & 0 deletions src/modules/CallLogger/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,8 @@ export class CallLogger extends CallLoggerBase {
get autoLogOnCallSync() {
return this._deps.thirdPartyService.callLoggerAutoLogOnCallSync;
}

get hideEditLogButton() {
return this._deps.thirdPartyService.callLoggerHideEditLogButton;
}
}
1 change: 1 addition & 0 deletions src/modules/CallsListUI/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ export class CallsListUI extends BaseCallsListUI {
(!composeText || composeText.ready)
),
showLogButton: callLogger.ready,
hideEditLogButton: callLogger.hideEditLogButton,
logButtonTitle: callLogger.logButtonTitle,
showRingoutCallControl,
showTransferCall,
Expand Down
7 changes: 7 additions & 0 deletions src/modules/ThirdPartyService/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@ export default class ThirdPartyService extends RcModuleV2 {
callLoggerAutoSettingReadOnlyReason: service.callLoggerAutoSettingReadOnlyReason,
callLoggerAutoSettingReadOnlyValue: service.callLoggerAutoSettingReadOnlyValue,
callLoggerAutoLogOnCallSync: service.callLoggerAutoLogOnCallSync, // auto log for calls happened when the app is not opened
callLoggerHideEditLogButton: service.callLoggerHideEditLogButton,
});
}

Expand Down Expand Up @@ -1142,6 +1143,10 @@ export default class ThirdPartyService extends RcModuleV2 {
@state
callLoggerAutoLogOnCallSync = false;

@globalStorage
@state
callLoggerHideEditLogButton = false;

@action
_onRegisterCallLogger({
callLoggerTitle,
Expand All @@ -1151,6 +1156,7 @@ export default class ThirdPartyService extends RcModuleV2 {
callLoggerAutoSettingReadOnlyReason,
callLoggerAutoSettingReadOnlyValue,
callLoggerAutoLogOnCallSync,
callLoggerHideEditLogButton = false,
}) {
if (callLoggerTitle) {
this.callLoggerTitle = callLoggerTitle;
Expand All @@ -1166,6 +1172,7 @@ export default class ThirdPartyService extends RcModuleV2 {
}
this.callLoggerRegistered = true;
this.callLoggerAutoLogOnCallSync = !!callLoggerAutoLogOnCallSync;
this.callLoggerHideEditLogButton = !!callLoggerHideEditLogButton;
}

@globalStorage
Expand Down
Loading