diff --git a/package.json b/package.json index c487ffff..5c141cd8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cometchat-chat-sample-app-angular", - "version": "4.0.1", + "version": "4.1.0", "license": "SEE LICENSE IN LICENSE.md", "scripts": { "ng": "ng", @@ -19,8 +19,8 @@ "@angular/platform-browser": "~13.3.0", "@angular/platform-browser-dynamic": "~13.3.0", "@angular/router": "~13.3.0", - "@cometchat/calls-sdk-javascript": "^4.0.4", - "@cometchat/chat-uikit-angular":"~4.0.2", + "@cometchat/calls-sdk-javascript": "^4.0.6", + "@cometchat/chat-uikit-angular": "^4.1.0", "rxjs": "~7.5.0", "tslib": "^2.3.0", "zone.js": "~0.11.4" diff --git a/src/MetaInfo.ts b/src/MetaInfo.ts index 4840330f..af49c2bf 100644 --- a/src/MetaInfo.ts +++ b/src/MetaInfo.ts @@ -1,6 +1,6 @@ export const MetaInfo = { - name:"cometchat-chat-sample-app-angular", - version:"4.0.2", - type:"sample", - platform:"Angular" -} + name: 'cometchat-chat-sample-app-angular', + version: '4.1.0', + type: 'sample', + platform: 'Angular', +}; diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index f8dffc1d..958ab6cf 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -1,6 +1,10 @@ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; -import { CometChatContacts, CometChatConversationsWithMessages, CometChatConversationsWithMessagesComponent } from '@cometchat/chat-uikit-angular'; +import { + CometChatContacts, + CometChatConversationsWithMessages, + CometChatConversationsWithMessagesComponent, +} from '@cometchat/chat-uikit-angular'; import { ChatsComponent } from './chats/chats.component'; import { ConversationsDemoComponent } from './chats/conversations-demo/conversations-demo.component'; import { ConversationsWithMessagesDemoComponent } from './chats/conversations-with-messages-demo/conversations-with-messages-demo.component'; @@ -32,9 +36,16 @@ import { CallsComponent } from './calls/calls.component'; import { CallButtonsDemoComponent } from './calls/call-buttons-demo/call-buttons-demo.component'; import { ContactsDemoComponent } from './chats/contacts-demo/contacts-demo.component'; import { MessageInformationDemoComponent } from './messages/message-information-demo/message-information-demo.component'; +import { CallLogsComponent } from './call-logs/call-logs.component'; +import { CallLogsWithDetailsDemoComponent } from './call-logs/call-logs-with-details-demo/call-logs-with-details-demo.component'; +import { CallLogDetailsDemoComponent } from './call-logs/call-log-details-demo/call-log-details-demo.component'; +import { CallLogsDemoComponent } from './call-logs/call-logs-demo/call-logs-demo.component'; +import { CallLogParticipantsDemoComponent } from './call-logs/call-log-participants-demo/call-log-participants-demo.component'; +import { CallLogRecordingsDemoComponent } from './call-logs/call-log-recordings-demo/call-log-recordings-demo.component'; +import { CallLogHistoryDemoComponent } from './call-logs/call-log-history-demo/call-log-history-demo.component'; const routes: Routes = [ - { path: '', redirectTo: "login", pathMatch: "full" }, + { path: '', redirectTo: 'login', pathMatch: 'full' }, { path: 'login', component: LoginComponent, @@ -46,29 +57,40 @@ const routes: Routes = [ { path: 'home', component: HomeComponent, - children:[ + children: [ { - path : '', - component: ChatsComponent}, + path: '', + component: ChatsComponent, + }, { - path : 'shared-module', - component: SharedComponent}, - { - path : 'users-module', - component: UsersComponent}, - { - path : 'groups-module', - component: GroupsComponent}, - { - path : 'chats-module', - component: ChatsComponent}, - { - path : 'messages-module', - component: MessagesComponent}, - { - path : 'calls-module', - component: CallsComponent}, - ] + path: 'shared-module', + component: SharedComponent, + }, + { + path: 'users-module', + component: UsersComponent, + }, + { + path: 'groups-module', + component: GroupsComponent, + }, + { + path: 'chats-module', + component: ChatsComponent, + }, + { + path: 'messages-module', + component: MessagesComponent, + }, + { + path: 'calls-module', + component: CallsComponent, + }, + { + path: 'call-logs-module', + component: CallLogsComponent, + }, + ], }, { path: 'conversations-with-messages', @@ -125,41 +147,58 @@ const routes: Routes = [ { path: 'join-group', component: JoinGroupDemoComponent, - }, { path: 'group-members', component: GroupMembersDemoComponent, - }, { path: 'add-member', component: AddMembersDemoComponent, - }, { path: 'transfer-ownership', component: TransferOwnershipDemoComponent, - }, { path: 'banned-members', component: BannedMembersDemoComponent, - }, { path: 'details', component: DetailsDemoComponent, - }, { path: 'call-buttons', component: CallButtonsDemoComponent, }, - + { + path: 'call-logs', + component: CallLogsDemoComponent, + }, + { + path: 'call-logs-with-details', + component: CallLogsWithDetailsDemoComponent, + }, + { + path: 'call-log-details', + component: CallLogDetailsDemoComponent, + }, + { + path: 'call-log-participants', + component: CallLogParticipantsDemoComponent, + }, + { + path: 'call-log-recordings', + component: CallLogRecordingsDemoComponent, + }, + { + path: 'call-log-history', + component: CallLogHistoryDemoComponent, + }, ]; @NgModule({ imports: [RouterModule.forRoot(routes)], - exports: [RouterModule] + exports: [RouterModule], }) -export class AppRoutingModule { } +export class AppRoutingModule {} diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 07f3c20c..344aff32 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -1,12 +1,33 @@ import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; -import { BrowserAnimationsModule } from "@angular/platform-browser/animations"; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; import { FormsModule } from '@angular/forms'; import { LoginComponent } from './login/login.component'; import { SignUpComponent } from './sign-up/sign-up.component'; -import { CometChatContacts, CometChatConversations, CometChatConversationsWithMessages, CometChatGroups, CometChatGroupsWithMessages, CometChatIncomingCall, CometChatMessageBubble, CometChatMessageComposer, CometChatMessageHeader, CometChatMessageInformation, CometChatMessageList, CometChatMessages, CometChatUsers, CometChatUsersWithMessages } from '@cometchat/chat-uikit-angular'; +import { + CometChatCallLogDetails, + CometChatCallLogHistory, + CometChatCallLogParticipants, + CometChatCallLogRecordings, + CometChatCallLogs, + CometChatCallLogsWithDetails, + CometChatContacts, + CometChatConversations, + CometChatConversationsWithMessages, + CometChatGroups, + CometChatGroupsWithMessages, + CometChatIncomingCall, + CometChatMessageBubble, + CometChatMessageComposer, + CometChatMessageHeader, + CometChatMessageInformation, + CometChatMessageList, + CometChatMessages, + CometChatUsers, + CometChatUsersWithMessages, +} from '@cometchat/chat-uikit-angular'; import { RouterModule } from '@angular/router'; import { MessagesDemoComponent } from './messages/messages-demo/messages-demo.component'; import { GroupsDemoComponent } from './groups/groups-demo/groups-demo.component'; @@ -27,6 +48,13 @@ import { HomeModule } from './home/home.module'; import { CallsModule } from './calls/calls.module'; import { ContactsDemoComponent } from './chats/contacts-demo/contacts-demo.component'; import { MessageInformationDemoComponent } from './messages/message-information-demo/message-information-demo.component'; +import { CallLogsModule } from './call-logs/call-logs.module'; +import { CallLogsDemoComponent } from './call-logs/call-logs-demo/call-logs-demo.component'; +import { CallLogsWithDetailsDemoComponent } from './call-logs/call-logs-with-details-demo/call-logs-with-details-demo.component'; +import { CallLogDetailsDemoComponent } from './call-logs/call-log-details-demo/call-log-details-demo.component'; +import { CallLogParticipantsDemoComponent } from './call-logs/call-log-participants-demo/call-log-participants-demo.component'; +import { CallLogRecordingsDemoComponent } from './call-logs/call-log-recordings-demo/call-log-recordings-demo.component'; +import { CallLogHistoryDemoComponent } from './call-logs/call-log-history-demo/call-log-history-demo.component'; @NgModule({ declarations: [ AppComponent, @@ -43,8 +71,13 @@ import { MessageInformationDemoComponent } from './messages/message-information- MessageComposerDemoComponent, MessageHeaderDemoComponent, ContactsDemoComponent, - MessageInformationDemoComponent - + MessageInformationDemoComponent, + CallLogsDemoComponent, + CallLogsWithDetailsDemoComponent, + CallLogDetailsDemoComponent, + CallLogParticipantsDemoComponent, + CallLogRecordingsDemoComponent, + CallLogHistoryDemoComponent, ], imports: [ BrowserModule, @@ -68,14 +101,21 @@ import { MessageInformationDemoComponent } from './messages/message-information- ChatsModule, GroupsModule, CallsModule, + CallLogsModule, FormsModule, CometChatIncomingCall, CometChatContacts, CometChatMessageInformation, - CometChatMessageBubble + CometChatMessageBubble, + CometChatCallLogs, + CometChatCallLogsWithDetails, + CometChatCallLogDetails, + CometChatCallLogParticipants, + CometChatCallLogRecordings, + CometChatCallLogHistory, ], providers: [], bootstrap: [AppComponent], - schemas:[CUSTOM_ELEMENTS_SCHEMA] + schemas: [CUSTOM_ELEMENTS_SCHEMA], }) -export class AppModule { } +export class AppModule {} diff --git a/src/app/call-logs/call-log-details-demo/call-log-details-demo.component.html b/src/app/call-logs/call-log-details-demo/call-log-details-demo.component.html new file mode 100644 index 00000000..8d95cad6 --- /dev/null +++ b/src/app/call-logs/call-log-details-demo/call-log-details-demo.component.html @@ -0,0 +1,5 @@ + diff --git a/src/app/call-logs/call-log-details-demo/call-log-details-demo.component.scss b/src/app/call-logs/call-log-details-demo/call-log-details-demo.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/src/app/call-logs/call-log-details-demo/call-log-details-demo.component.spec.ts b/src/app/call-logs/call-log-details-demo/call-log-details-demo.component.spec.ts new file mode 100644 index 00000000..599fc371 --- /dev/null +++ b/src/app/call-logs/call-log-details-demo/call-log-details-demo.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CallLogDetailsDemoComponent } from './call-log-details-demo.component'; + +describe('CallLogDetailsDemoComponent', () => { + let component: CallLogDetailsDemoComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ CallLogDetailsDemoComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(CallLogDetailsDemoComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/call-logs/call-log-details-demo/call-log-details-demo.component.ts b/src/app/call-logs/call-log-details-demo/call-log-details-demo.component.ts new file mode 100644 index 00000000..609a43a2 --- /dev/null +++ b/src/app/call-logs/call-log-details-demo/call-log-details-demo.component.ts @@ -0,0 +1,69 @@ +import { + Component, + HostListener, + Input, + OnInit, + ChangeDetectorRef, +} from '@angular/core'; +import { Router, ActivatedRoute } from '@angular/router'; +import { CometChat } from '@cometchat/chat-sdk-javascript'; +import { + CometChatLocalize, + CometChatTheme, + CometChatThemeService, + CometChatUIKitCalls, + CometChatUIKitConstants, + fontHelper, +} from '@cometchat/chat-uikit-angular'; +import { ListItemStyle } from '@cometchat/uikit-elements'; + +@Component({ + selector: 'call-log-details-demo', + templateUrl: './call-log-details-demo.component.html', + styleUrls: ['./call-log-details-demo.component.scss'], +}) +export class CallLogDetailsDemoComponent implements OnInit { + public user!: CometChat.User | null; + group!: CometChat.Group; + public loggedInUSer!: CometChat.User | null; + call: any; + constructor( + private router: Router, + private route: ActivatedRoute, + private themeService: CometChatThemeService, + private ref: ChangeDetectorRef + ) { + this.route.queryParams.subscribe((params) => {}); + } + + ngOnInit(): void { + CometChat.getLoggedinUser() + .then((user: CometChat.User | null) => { + this.loggedInUSer = user; + CometChat.getUser('superhero1') + .then((user: CometChat.User) => { + this.user = user; + }) + .catch((error: CometChat.CometChatException) => { + console.log(error); + }); + this.fetchCallLog(); + }) + .catch((error: CometChat.CometChatException) => { + console.log(error); + }); + } + + fetchCallLog() { + let callsRequest = new CometChatUIKitCalls.CallLogRequestBuilder() + .setLimit(1) + .setCallCategory('call') + .setAuthToken(this.loggedInUSer?.getAuthToken()) + .build(); + + callsRequest?.fetchNext().then((res: any) => { + this.call = res[0]; + this.ref.detectChanges(); + }); + } +} diff --git a/src/app/call-logs/call-log-history-demo/call-log-history-demo.component.html b/src/app/call-logs/call-log-history-demo/call-log-history-demo.component.html new file mode 100644 index 00000000..fbcf75b9 --- /dev/null +++ b/src/app/call-logs/call-log-history-demo/call-log-history-demo.component.html @@ -0,0 +1,4 @@ + diff --git a/src/app/call-logs/call-log-history-demo/call-log-history-demo.component.scss b/src/app/call-logs/call-log-history-demo/call-log-history-demo.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/src/app/call-logs/call-log-history-demo/call-log-history-demo.component.spec.ts b/src/app/call-logs/call-log-history-demo/call-log-history-demo.component.spec.ts new file mode 100644 index 00000000..696f7fa0 --- /dev/null +++ b/src/app/call-logs/call-log-history-demo/call-log-history-demo.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CallLogHistoryDemoComponent } from './call-log-history-demo.component'; + +describe('CallLogHistoryDemoComponent', () => { + let component: CallLogHistoryDemoComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ CallLogHistoryDemoComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(CallLogHistoryDemoComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/call-logs/call-log-history-demo/call-log-history-demo.component.ts b/src/app/call-logs/call-log-history-demo/call-log-history-demo.component.ts new file mode 100644 index 00000000..04d76787 --- /dev/null +++ b/src/app/call-logs/call-log-history-demo/call-log-history-demo.component.ts @@ -0,0 +1,23 @@ +import { Component, OnInit } from '@angular/core'; +import { CometChat } from '@cometchat/chat-sdk-javascript'; + +@Component({ + selector: 'call-log-history-demo', + templateUrl: './call-log-history-demo.component.html', + styleUrls: ['./call-log-history-demo.component.scss'], +}) +export class CallLogHistoryDemoComponent implements OnInit { + constructor() {} + public user!: CometChat.User | null; + group!: CometChat.Group; + + ngOnInit(): void { + CometChat.getUser('superhero1') + .then((user: CometChat.User) => { + this.user = user; + }) + .catch((error: CometChat.CometChatException) => { + console.log(error); + }); + } +} diff --git a/src/app/call-logs/call-log-participants-demo/call-log-participants-demo.component.html b/src/app/call-logs/call-log-participants-demo/call-log-participants-demo.component.html new file mode 100644 index 00000000..61e8271d --- /dev/null +++ b/src/app/call-logs/call-log-participants-demo/call-log-participants-demo.component.html @@ -0,0 +1,4 @@ + diff --git a/src/app/call-logs/call-log-participants-demo/call-log-participants-demo.component.scss b/src/app/call-logs/call-log-participants-demo/call-log-participants-demo.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/src/app/call-logs/call-log-participants-demo/call-log-participants-demo.component.spec.ts b/src/app/call-logs/call-log-participants-demo/call-log-participants-demo.component.spec.ts new file mode 100644 index 00000000..f38f01ac --- /dev/null +++ b/src/app/call-logs/call-log-participants-demo/call-log-participants-demo.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CallLogParticipantsDemoComponent } from './call-log-participants-demo.component'; + +describe('CallLogParticipantsDemoComponent', () => { + let component: CallLogParticipantsDemoComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ CallLogParticipantsDemoComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(CallLogParticipantsDemoComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/call-logs/call-log-participants-demo/call-log-participants-demo.component.ts b/src/app/call-logs/call-log-participants-demo/call-log-participants-demo.component.ts new file mode 100644 index 00000000..e6ad8883 --- /dev/null +++ b/src/app/call-logs/call-log-participants-demo/call-log-participants-demo.component.ts @@ -0,0 +1,38 @@ +import { Component, OnInit } from '@angular/core'; +import { CometChatUIKitCalls, States } from '@cometchat/chat-uikit-angular'; +import { CometChat } from '@cometchat/chat-sdk-javascript'; + +@Component({ + selector: 'call-log-participants-demo', + templateUrl: './call-log-participants-demo.component.html', + styleUrls: ['./call-log-participants-demo.component.scss'], +}) +export class CallLogParticipantsDemoComponent implements OnInit { + public loggedInUSer!: CometChat.User | null; + group!: CometChat.Group; + call: any; + constructor() {} + + ngOnInit(): void { + CometChat.getLoggedinUser() + .then((user: CometChat.User | null) => { + this.loggedInUSer = user; + this.fetchCallLog(); + }) + .catch((error: CometChat.CometChatException) => { + console.log(error); + }); + } + + fetchCallLog() { + let callsRequest = new CometChatUIKitCalls.CallLogRequestBuilder() + .setLimit(1) + .setCallCategory('call') + .setAuthToken(this.loggedInUSer?.getAuthToken()) + .build(); + + callsRequest?.fetchNext().then((res: any) => { + this.call = res[0]; + }); + } +} diff --git a/src/app/call-logs/call-log-recordings-demo/call-log-recordings-demo.component.html b/src/app/call-logs/call-log-recordings-demo/call-log-recordings-demo.component.html new file mode 100644 index 00000000..8ff56aca --- /dev/null +++ b/src/app/call-logs/call-log-recordings-demo/call-log-recordings-demo.component.html @@ -0,0 +1,4 @@ + diff --git a/src/app/call-logs/call-log-recordings-demo/call-log-recordings-demo.component.scss b/src/app/call-logs/call-log-recordings-demo/call-log-recordings-demo.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/src/app/call-logs/call-log-recordings-demo/call-log-recordings-demo.component.spec.ts b/src/app/call-logs/call-log-recordings-demo/call-log-recordings-demo.component.spec.ts new file mode 100644 index 00000000..473c0d2f --- /dev/null +++ b/src/app/call-logs/call-log-recordings-demo/call-log-recordings-demo.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CallLogRecordingsDemoComponent } from './call-log-recordings-demo.component'; + +describe('CallLogRecordingsDemoComponent', () => { + let component: CallLogRecordingsDemoComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ CallLogRecordingsDemoComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(CallLogRecordingsDemoComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/call-logs/call-log-recordings-demo/call-log-recordings-demo.component.ts b/src/app/call-logs/call-log-recordings-demo/call-log-recordings-demo.component.ts new file mode 100644 index 00000000..0829b6b3 --- /dev/null +++ b/src/app/call-logs/call-log-recordings-demo/call-log-recordings-demo.component.ts @@ -0,0 +1,105 @@ +import { Component, OnInit, ChangeDetectorRef } from '@angular/core'; +import { CallLog, CallUser } from '@cometchat/calls-sdk-javascript'; +import { CometChat } from '@cometchat/chat-sdk-javascript'; +import { CometChatUIKitCalls, States } from '@cometchat/chat-uikit-angular'; + +@Component({ + selector: 'call-log-recordings-demo', + templateUrl: './call-log-recordings-demo.component.html', + styleUrls: ['./call-log-recordings-demo.component.scss'], +}) +export class CallLogRecordingsDemoComponent implements OnInit { + constructor(private ref: ChangeDetectorRef) {} + public loggedInUSer!: CometChat.User | null; + group!: CometChat.Group; + call: any; + dummyCallObject: any; + public state: States = States.loading; + + ngOnInit(): void { + CometChat.getLoggedinUser() + .then((user: CometChat.User | null) => { + this.loggedInUSer = user; + this.fetchCallLog(); + }) + .catch((error: CometChat.CometChatException) => { + console.log(error); + }); + } + + fetchCallLog() { + this.state = States.loading; + this.ref.detectChanges(); + let callsRequest = new CometChatUIKitCalls.CallLogRequestBuilder() + .setLimit(100) + .setCallCategory('call') + .setAuthToken(this.loggedInUSer?.getAuthToken()) + .build(); + + callsRequest?.fetchNext().then((res: any) => { + let filterList = res.filter((recording: any) => { + return 'recordings' in recording; + }); + this.call = filterList[0]; + + if (!this.call) { + this.call = this.getDummyCallObject(); + } + }); + } + + getDummyCallObject() { + const initiator = this.loggedInUSer; + const receiver = CallUser.getUserFromJson({ + name: 'Kevin', + avatar: + 'https://data-us.cometchat.io/assets/images/avatars/spiderman.png', + uid: 'UID233', + }); + const call = CallLog.callLogFromJson({ + initiator, + receiver, + participants: [ + { + uid: this.loggedInUSer?.getUid(), + avatar: this.loggedInUSer?.getAvatar(), + name: this.loggedInUSer?.getName(), + totalAudioMinutes: 120, + totalDurationInMinutes: 120, + totalVideoMinutes: 60, + }, + { + uid: 'UID233', + avatar: + 'https://data-us.cometchat.io/assets/images/avatars/spiderman.png', + name: 'Kevin', + totalAudioMinutes: 120, + totalDurationInMinutes: 120, + totalVideoMinutes: 60, + }, + ], + recordings: [ + { + startTime: 101, + rid: 'Recordings', + recordingUrl: + 'https://cdn-icons-png.flaticon.com/512/1752/1752772.png', + endTime: 101, + duration: 100, + }, + ], + totalDurationInMinutes: 0.6833333333333333, + totalParticipants: 2, + type: 'audio', + mid: 'dcb170b0-99da-4beb-b65a8-86e48c89ef18', + startedAt: 1697458341, + endedAt: 1697458382, + totalAudioMinutes: 0.6833333333333333, + totalVideoMinutes: 0, + totalDuration: '00:00:41', + hasRecording: true, + initiatedAt: 1697458328, + }); + return call; + } +} diff --git a/src/app/call-logs/call-logs-demo/call-logs-demo.component.html b/src/app/call-logs/call-logs-demo/call-logs-demo.component.html new file mode 100644 index 00000000..07a5e606 --- /dev/null +++ b/src/app/call-logs/call-logs-demo/call-logs-demo.component.html @@ -0,0 +1 @@ + diff --git a/src/app/call-logs/call-logs-demo/call-logs-demo.component.scss b/src/app/call-logs/call-logs-demo/call-logs-demo.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/src/app/call-logs/call-logs-demo/call-logs-demo.component.spec.ts b/src/app/call-logs/call-logs-demo/call-logs-demo.component.spec.ts new file mode 100644 index 00000000..9f79ad6d --- /dev/null +++ b/src/app/call-logs/call-logs-demo/call-logs-demo.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CallLogsDemoComponent } from './call-logs-demo.component'; + +describe('CallLogsDemoComponent', () => { + let component: CallLogsDemoComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ CallLogsDemoComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(CallLogsDemoComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/call-logs/call-logs-demo/call-logs-demo.component.ts b/src/app/call-logs/call-logs-demo/call-logs-demo.component.ts new file mode 100644 index 00000000..6afac806 --- /dev/null +++ b/src/app/call-logs/call-logs-demo/call-logs-demo.component.ts @@ -0,0 +1,12 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'call-logs-demo', + templateUrl: './call-logs-demo.component.html', + styleUrls: ['./call-logs-demo.component.scss'], +}) +export class CallLogsDemoComponent implements OnInit { + constructor() {} + + ngOnInit(): void {} +} diff --git a/src/app/call-logs/call-logs-with-details-demo/call-logs-with-details-demo.component.html b/src/app/call-logs/call-logs-with-details-demo/call-logs-with-details-demo.component.html new file mode 100644 index 00000000..1d459669 --- /dev/null +++ b/src/app/call-logs/call-logs-with-details-demo/call-logs-with-details-demo.component.html @@ -0,0 +1,4 @@ + diff --git a/src/app/call-logs/call-logs-with-details-demo/call-logs-with-details-demo.component.scss b/src/app/call-logs/call-logs-with-details-demo/call-logs-with-details-demo.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/src/app/call-logs/call-logs-with-details-demo/call-logs-with-details-demo.component.spec.ts b/src/app/call-logs/call-logs-with-details-demo/call-logs-with-details-demo.component.spec.ts new file mode 100644 index 00000000..2f816b04 --- /dev/null +++ b/src/app/call-logs/call-logs-with-details-demo/call-logs-with-details-demo.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CallLogsWithDetailsDemoComponent } from './call-logs-with-details-demo.component'; + +describe('CallLogsWithDetailsDemoComponent', () => { + let component: CallLogsWithDetailsDemoComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ CallLogsWithDetailsDemoComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(CallLogsWithDetailsDemoComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/call-logs/call-logs-with-details-demo/call-logs-with-details-demo.component.ts b/src/app/call-logs/call-logs-with-details-demo/call-logs-with-details-demo.component.ts new file mode 100644 index 00000000..20f5232d --- /dev/null +++ b/src/app/call-logs/call-logs-with-details-demo/call-logs-with-details-demo.component.ts @@ -0,0 +1,63 @@ +import { Component, HostListener, Input, OnInit } from '@angular/core'; +import { CometChatTheme, CometChatThemeService, fontHelper } from '@cometchat/chat-uikit-angular'; + + +@Component({ + selector: 'call-logs-with-details-demo', + templateUrl: './call-logs-with-details-demo.component.html', + styleUrls: ['./call-logs-with-details-demo.component.scss'] +}) +export class CallLogsWithDetailsDemoComponent implements OnInit { + + withMessagesStyle:any={ + width: "100%", + height: "100%", + background: "transparent", + borderRadius: "none", + border: "none", + messageTextColor: "rgba(20, 20, 20, 0.33)", + messageTextFont: "700 22px Inter", + } + + constructor(private themeService:CometChatThemeService) { + + + } + + ngOnInit(): void { + + + this.setTheme() + this.onResize() + } + innerWidth!: number; + isMobileView: boolean=false; + /** + * Checks when window size is changed in realtime + */ + @HostListener("window:resize", []) + onResize(): boolean { + try { + this.innerWidth = window.innerWidth; + if ( + this.innerWidth >= 320 && + this.innerWidth <= 760 + ) { + this.isMobileView = true; + } else { + this.isMobileView = false + } + } catch (error) { + + } + return true; + } + setTheme(){ + this.withMessagesStyle.background = this.themeService.theme.palette.getBackground(); + this.withMessagesStyle.messageTextFont = fontHelper(this.themeService.theme.typography.heading); + this.withMessagesStyle.messageTextColor = this.themeService.theme.palette.getAccent400(); + + + } + +} diff --git a/src/app/call-logs/call-logs.component.html b/src/app/call-logs/call-logs.component.html new file mode 100644 index 00000000..756f0606 --- /dev/null +++ b/src/app/call-logs/call-logs.component.html @@ -0,0 +1,121 @@ +
+
+ Call Logs +
+
+
+
+
+ Call Logs +
+ CometChatCallLogs is an independent component used to show call Logs + of Loggedin User. +
+
+
+
+
+
+ Call Logs With Details +
+ CometChatCallLogsWithDetails is an independent component used to show + Call logs and Details of the user. +
+
+
+
+
+
+ Call Log Details +
+ CometChatCallLogDetails is an independent component used to show + Details of the call. +
+
+
+
+
+
+ Call Log Participants + +
+ CometChatCallLogParticipants is an independent component used to + display list of participants for a particular Call. +
+
+
+
+
+
+ Call Log Recordings +
+ CometChatCallLogRecordings is an independent component used to display + list of participants for a particular Call. +
+
+
+
+
+
+ Call Log History +
+ CometChatCallLogHistory is an independent component used to display + list of call history for a particular User or Group. +
+
+
+
+
diff --git a/src/app/call-logs/call-logs.component.scss b/src/app/call-logs/call-logs.component.scss new file mode 100644 index 00000000..bc6aa8db --- /dev/null +++ b/src/app/call-logs/call-logs.component.scss @@ -0,0 +1,70 @@ +.call-logs__wrapper { + height: 100%; + width: 100%; + background: transparent; + padding: 8px; + overflow-y: scroll; + display: flex; + flex-direction: column; + .call-logs__header { + flex-basis: 3%; + display: flex; + padding-left: 8px; + align-items: center; + } +} +.call-logs__wrapper::-webkit-scrollbar { + background: transparent; + width: 8px; +} +.call-logs__wrapper::-webkit-scrollbar-thumb { + background: rgb(232, 229, 229); + border-radius: 8px; +} +.card__content { + display: grid; + grid-template-columns: auto auto auto; + height: fit-content; + width: 100%; +} + +.cards { + display: flex; + min-height: 120px; + height: fit-content; + // justify-content: space-between; + justify-content: space-around; + cursor: pointer; + margin: 14px 8px; + padding: 10px 8px; + border-radius: 12px; + .right__content { + flex-basis: 85%; + .card__description { + text-align: left; + margin: 8px 0; + } + } + .card__icon { + flex-basis: 34px; + } +} + +@media (min-width: 320px) and (max-width: 895px) { + .cards { + justify-content: space-evenly; + height: fit-content; + min-height: fit-content; + } + .card__content { + grid-template-columns: auto; + } +} +@media (min-width: 895px) and (max-width: 1260px) { + .card__content { + grid-template-columns: auto auto; + } + .cards { + justify-content: space-between; + } +} diff --git a/src/app/call-logs/call-logs.component.spec.ts b/src/app/call-logs/call-logs.component.spec.ts new file mode 100644 index 00000000..2235e92c --- /dev/null +++ b/src/app/call-logs/call-logs.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CallLogsComponent } from './call-logs.component'; + +describe('CallLogsComponent', () => { + let component: CallLogsComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ CallLogsComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(CallLogsComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/call-logs/call-logs.component.ts b/src/app/call-logs/call-logs.component.ts new file mode 100644 index 00000000..d04fe98c --- /dev/null +++ b/src/app/call-logs/call-logs.component.ts @@ -0,0 +1,91 @@ +import { Component, HostListener, Input, OnInit } from '@angular/core'; +import { ActivatedRoute, NavigationExtras, Router } from '@angular/router'; +import { + CometChatLocalize, + CometChatTheme, + CometChatThemeService, + fontHelper, + localize, +} from '@cometchat/chat-uikit-angular'; + +@Component({ + selector: 'call-logs', + templateUrl: './call-logs.component.html', + styleUrls: ['./call-logs.component.scss'], +}) +export class CallLogsComponent implements OnInit { + public localize: any = localize; + public logoutIconURL: string = 'assets/logout.svg'; + + public callLogsIconURL: string = 'assets/call-logs.svg'; + public callLogDetailsIconURL: string = 'assets/call-log-detail.svg'; + public callLogHistoryIconURL: string = 'assets/call-history.svg'; + public callLogRecordingsIconURL: string = 'assets/call-log-recording.svg'; + public callLogParticipantsIconURL: string = 'assets/call-participants.svg'; + + constructor( + private router: Router, + private route: ActivatedRoute, + private themeService: CometChatThemeService + ) {} + ngOnInit(): void {} + + redirect(name: string) { + this.router.navigate([name]); + } + // styles + style: any = { + sidebarStyle: () => { + return { + background: this.themeService.theme.palette.getSecondary(), + }; + }, + headerTitleStyle: () => { + return { + font: fontHelper(this.themeService.theme.typography.heading), + color: this.themeService.theme.palette.getAccent(), + }; + }, + cardTitleStyle: () => { + return { + font: fontHelper(this.themeService.theme.typography.title2), + color: this.themeService.theme.palette.getAccent(), + }; + }, + cardStyle: () => { + return { + background: this.themeService.theme.palette.getBackground(), + boxShadow: `${this.themeService.theme.palette.getAccent400()} 0px 0px 5px`, + }; + }, + iconStyle: (icon: string) => { + return { + WebkitMask: `url(${icon}) center center no-repeat`, + background: this.themeService.theme.palette.getAccent(), + height: '28px', + width: 'fit-content', + }; + }, + cardDescriptionStyle: () => { + return { + font: fontHelper(this.themeService.theme.typography.subtitle2), + color: this.themeService.theme.palette.getAccent600(), + }; + }, + footerStyle: () => { + return { + font: fontHelper(this.themeService.theme.typography.subtitle2), + color: this.themeService.theme.palette.getAccent500(), + }; + }, + + logoutIoncStyle: () => { + return { + WebkitMask: `url(${this.logoutIconURL}) center center no-repeat`, + background: 'black', + height: '24px', + width: '24px', + }; + }, + }; +} diff --git a/src/app/call-logs/call-logs.module.ts b/src/app/call-logs/call-logs.module.ts new file mode 100644 index 00000000..c16a0b79 --- /dev/null +++ b/src/app/call-logs/call-logs.module.ts @@ -0,0 +1,33 @@ +import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; +import { BrowserModule } from '@angular/platform-browser'; +import { BrowserAnimationsModule } from "@angular/platform-browser/animations"; +import { FormsModule } from '@angular/forms'; +import { RouterModule } from '@angular/router'; +import { CometChatCallLogDetails, CometChatCallLogHistory, CometChatCallLogParticipants, CometChatCallLogRecordings, CometChatCallLogs, CometChatCallLogsWithDetails, CometChatContacts, CometChatConversations, CometChatConversationsWithMessages } from '@cometchat/chat-uikit-angular'; +import { SharedModule } from '../shared/shared.module'; +import { CallLogsComponent } from './call-logs.component'; + +@NgModule({ + declarations: [ + CallLogsComponent, + ], + imports: [ + BrowserModule, + BrowserAnimationsModule, + RouterModule, + FormsModule, + CometChatCallLogs, + CometChatCallLogsWithDetails, + CometChatCallLogDetails, + CometChatCallLogParticipants, + CometChatCallLogRecordings, + CometChatCallLogHistory, + + SharedModule, + + ], + providers: [], + bootstrap: [CallLogsComponent], + schemas:[CUSTOM_ELEMENTS_SCHEMA] +}) +export class CallLogsModule { } diff --git a/src/app/home/home.component.html b/src/app/home/home.component.html index 6937ca19..f646b205 100644 --- a/src/app/home/home.component.html +++ b/src/app/home/home.component.html @@ -1,93 +1,199 @@
-
-