-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature][Calling][CSS] Call history (#610)
- Loading branch information
1 parent
90e1653
commit 2ed8e5c
Showing
23 changed files
with
504 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
AzureCommunicationUI/AzureCommunicationUIDemoApp/Sources/Views/CallingDemoViewModel.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
// | ||
|
||
import Foundation | ||
#if DEBUG | ||
@testable import AzureCommunicationUICalling | ||
#else | ||
import AzureCommunicationUICalling | ||
#endif | ||
|
||
class CallingDemoViewModel: ObservableObject { | ||
lazy var dateFormatter: DateFormatter = { | ||
let dateFormatter = DateFormatter() | ||
dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss" | ||
return dateFormatter | ||
}() | ||
|
||
var callHistoryTitle: String { | ||
return "Total calls: \(callHistory.count)" | ||
} | ||
|
||
var callHistoryMessage: String { | ||
var callHistoryMessage = "Last Call: none" | ||
if let lastHistoryRecord = callHistory.last { | ||
let formattedDate = dateFormatter.string(from: lastHistoryRecord.callStartedOn) | ||
callHistoryMessage = "Last Call: \(formattedDate)\n" | ||
callHistoryMessage += "Call Ids:\n" | ||
callHistoryMessage += lastHistoryRecord.callIds.joined(separator: "\n") | ||
} | ||
return callHistoryMessage | ||
} | ||
|
||
var callHistory: [CallHistoryRecord] { | ||
let callComposite = CallComposite() | ||
let debugInfo = callComposite.debugInfo | ||
let callHistory = debugInfo.callHistoryRecords | ||
return callHistory | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,4 +83,4 @@ SPEC CHECKSUMS: | |
|
||
PODFILE CHECKSUM: dba06e7567902f624b6be4dac963332e701eb372 | ||
|
||
COCOAPODS: 1.11.3 | ||
COCOAPODS: 1.12.0 |
Oops, something went wrong.