Skip to content

Commit

Permalink
♻️ (ContentKit): Change visibility to visible to avoid public/private
Browse files Browse the repository at this point in the history
- change model
- change jtd schema
- change authors.yml
  • Loading branch information
ladislas committed Feb 9, 2024
1 parent 673f333 commit 3454c55
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 23 deletions.
8 changes: 4 additions & 4 deletions Modules/ContentKit/Resources/Content/authors/authors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
version: 1.0.0
list:
- id: aurore_kiesler
visibility: public
visible: true
name: Aurore Kiesler
website: https://www.autismes-aujourdhui.fr/
email: [email protected]
Expand All @@ -24,10 +24,10 @@ list:
She is the one you should contact if you have any questions!
- id: julie_tuil
visibility: public
visible: true
name: Julie Tuil
website: https://www.julietuil.com/
email:
email: ''
professions:
- speech_language_therapist
- aba_therapist
Expand All @@ -41,7 +41,7 @@ list:
Julie Tuil is an autism specialist in France with over 20 years of experience. She offers training and programs based on Applied Behavior Analysis (ABA) to support autistic children and their families, focusing on enhancing communication and behavior management.
- id: leka
visibility: public
visible: true
name: Leka
website: https://leka.io
email: [email protected]
Expand Down
13 changes: 2 additions & 11 deletions Modules/ContentKit/Sources/Models/Authors.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public struct Author: Codable, Identifiable {
public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
self.id = try container.decode(String.self, forKey: .id)
self.visibility = try container.decode(Visibility.self, forKey: .visibility)
self.visible = try container.decode(Bool.self, forKey: .visible)
self.name = try container.decode(String.self, forKey: .name)
self.website = try container.decode(String.self, forKey: .website)
self.email = try container.decode(String.self, forKey: .email)
Expand All @@ -82,7 +82,7 @@ public struct Author: Codable, Identifiable {
// MARK: Public

public let id: String
public let visibility: Visibility
public let visible: Bool
public let name: String
public let website: String
public let email: String
Expand All @@ -94,15 +94,6 @@ public struct Author: Codable, Identifiable {
private let l10n: [Localization]
}

// MARK: Author.Visibility

public extension Author {
enum Visibility: String, Codable {
case `public`
case `private`
}
}

// MARK: Author.Localization

public extension Author {
Expand Down
13 changes: 5 additions & 8 deletions Specs/jtd/authors.jtd.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,22 @@
"id": {
"type": "string"
},
"visibility": {
"ref": "$visibility"
"visible": {
"type": "boolean"
},
"name": {
"type": "string"
},
"website": {
"type": "string",
"nullable": true
"type": "string"
},
"email": {
"type": "string",
"nullable": true
"type": "string"
},
"professions": {
"elements": {
"type": "string"
},
"nullable": true
}
},
"l10n": {
"elements": {
Expand Down

0 comments on commit 3454c55

Please sign in to comment.