Skip to content

Commit

Permalink
Allow to set all edit action unique style
Browse files Browse the repository at this point in the history
  • Loading branch information
e-marchand committed Nov 8, 2023
1 parent 9ea6acc commit 032b379
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Sources/Model/Action/Action.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import Foundation
import Prephirences

/// Represent a mobile action sent 4D server.
public struct Action {
Expand Down Expand Up @@ -85,7 +86,7 @@ public struct Action {

/// Return `true` if must be unique ie. if one not send yet, do not create another one..
public var isUnique: Bool {
return self.style?.isUnique ?? false
return self.style?.isUnique ?? (self.preset == .edit && Prephirences.Action.editAreUnique)
}

/// Return the url for `openURL`.
Expand All @@ -95,6 +96,14 @@ public struct Action {
}
}

extension Prephirences {

public struct Action: Prephirencable {
public static let editAreUnique: Bool = instance["editAreUnique"] as? Bool ?? false
}

}

/// Action preset that could change the default behaviour.
public enum ActionPreset: String, Codable {
/// Attempt to create a new record/entity
Expand Down

0 comments on commit 032b379

Please sign in to comment.