Skip to content

Commit

Permalink
Merge pull request #47 from cometchat/v4
Browse files Browse the repository at this point in the history
merging v4 in master
  • Loading branch information
birendraprasad-gupta authored Dec 18, 2023
2 parents 392f248 + 0132f8e commit c28ce4a
Show file tree
Hide file tree
Showing 43 changed files with 1,646 additions and 494 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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"
Expand Down
10 changes: 5 additions & 5 deletions src/MetaInfo.ts
Original file line number Diff line number Diff line change
@@ -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',
};
103 changes: 71 additions & 32 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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,
Expand All @@ -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',
Expand Down Expand Up @@ -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 {}
54 changes: 47 additions & 7 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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,
Expand All @@ -43,8 +71,13 @@ import { MessageInformationDemoComponent } from './messages/message-information-
MessageComposerDemoComponent,
MessageHeaderDemoComponent,
ContactsDemoComponent,
MessageInformationDemoComponent

MessageInformationDemoComponent,
CallLogsDemoComponent,
CallLogsWithDetailsDemoComponent,
CallLogDetailsDemoComponent,
CallLogParticipantsDemoComponent,
CallLogRecordingsDemoComponent,
CallLogHistoryDemoComponent,
],
imports: [
BrowserModule,
Expand All @@ -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 {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<cometchat-call-log-details
[user]="user!"
[call]="call"
*ngIf="user && call"
></cometchat-call-log-details>
Empty file.
Original file line number Diff line number Diff line change
@@ -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<CallLogDetailsDemoComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ CallLogDetailsDemoComponent ]
})
.compileComponents();
});

beforeEach(() => {
fixture = TestBed.createComponent(CallLogDetailsDemoComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -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();
});
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<cometchat-call-log-history
[user]="user!"
*ngIf="user || group"
></cometchat-call-log-history>
Empty file.
Loading

0 comments on commit c28ce4a

Please sign in to comment.