diff --git a/Modules/ContentKit/Examples/ContentKitExample/Sources/ActivityDetailsView.swift b/Modules/ContentKit/Examples/ContentKitExample/Sources/ActivityDetailsView.swift index 5d3cd64de3..5d90e9e936 100644 --- a/Modules/ContentKit/Examples/ContentKitExample/Sources/ActivityDetailsView.swift +++ b/Modules/ContentKit/Examples/ContentKitExample/Sources/ActivityDetailsView.swift @@ -49,6 +49,8 @@ struct ActivityDetailsView: View { Section("Information") { RowView(label: "UUID", value: self.activity.id) RowView(label: "Name", value: self.activity.name) + RowView(label: "Created at", value: self.activity.createdAt.description) + RowView(label: "Last edited at", value: self.activity.lastEditedAt.description) RowView(label: "Status", value: self.activity.status == .published ? "published" : "draft") diff --git a/Modules/ContentKit/Sources/Activity/Activity+Mock.swift b/Modules/ContentKit/Sources/Activity/Activity+Mock.swift index 5e38937d51..20f4160df0 100644 --- a/Modules/ContentKit/Sources/Activity/Activity+Mock.swift +++ b/Modules/ContentKit/Sources/Activity/Activity+Mock.swift @@ -18,6 +18,9 @@ public extension Activity { uuid: E7EE9CA4B13B49AF96CD77A9DF90833B name: mock_activity + created_at: 2024-02-28T12:53:48+00:00 + last_edited_at: 2024-02-28T12:53:48+00:00 + status: published authors: diff --git a/Modules/ContentKit/Sources/Activity/Activity.swift b/Modules/ContentKit/Sources/Activity/Activity.swift index a330bd15e2..0a399f3845 100644 --- a/Modules/ContentKit/Sources/Activity/Activity.swift +++ b/Modules/ContentKit/Sources/Activity/Activity.swift @@ -19,6 +19,8 @@ public struct Activity: Decodable, Identifiable { self.uuid = try container.decode(String.self, forKey: .uuid) self.name = try container.decode(String.self, forKey: .name) + self.createdAt = try container.decode(Date.self, forKey: .createdAt) + self.lastEditedAt = try container.decode(Date.self, forKey: .lastEditedAt) self.status = try container.decode(Status.self, forKey: .status) self.authors = try container.decode([String].self, forKey: .authors) @@ -38,6 +40,8 @@ public struct Activity: Decodable, Identifiable { public let uuid: String public let name: String + public let createdAt: Date + public let lastEditedAt: Date public let status: Status public let authors: [String] // TODO: (@ladislas) - implement authors @@ -72,12 +76,14 @@ public struct Activity: Decodable, Identifiable { private enum CodingKeys: String, CodingKey { case uuid case name + case createdAt = "created_at" + case lastEditedAt = "last_edited_at" + case status case authors case skills case hmi case types case tags - case status case locales case l10n case exercicesPayload = "exercises_payload"