diff --git a/Modules/MeetupIdX/MeetupId.yml b/Modules/MeetupIdX/MeetupId.yml index 4bd933d..56f4e94 100644 --- a/Modules/MeetupIdX/MeetupId.yml +++ b/Modules/MeetupIdX/MeetupId.yml @@ -1,6 +1,7 @@ version: 2 model: + join: [Bool, false] textApp: [String, ""] textUI: [String, ""] @@ -8,9 +9,11 @@ service: actions: busModel pipes: + join: [toggle, K.join] textApp: [recent, K.textApp] textUI: [recent, K.textUI] world: + join: [ps] textApp: [ps] textUI: [ps] diff --git a/Modules/MeetupIdX/src/MeetupId.Generated.swift b/Modules/MeetupIdX/src/MeetupId.Generated.swift index 40dd6a2..cb17ecd 100644 --- a/Modules/MeetupIdX/src/MeetupId.Generated.swift +++ b/Modules/MeetupIdX/src/MeetupId.Generated.swift @@ -12,6 +12,7 @@ import UIKit // MARK: - Context public protocol MeetupIdContext { + var join: Bool { get } var textApp: MPAK.Recent { get } var textUI: MPAK.Recent { get } } @@ -34,6 +35,7 @@ extension MeetupId { // MARK: - Model public struct Model: MeetupIdContext { + public var join: Bool = false public var textApp: MPAK.Recent = .init("") public var textUI: MPAK.Recent = .init("") } @@ -57,6 +59,7 @@ extension MeetupId { // MARK: - World public struct World { + let join = PassthroughSubject() let textApp = PassthroughSubject() let textUI = PassthroughSubject() @@ -87,10 +90,23 @@ extension MeetupId { // MARK: - SectionGenerated Service Pipes + ctrl.pipe( + dbg: "join", + sub: nil, + Bus.events.compactMap { Bus.convertKeyValue(K.join, $0) }.map { (k: String, v: Bool) in v }.eraseToAnyPublisher(), + { $0.join = true }, + { $0.join = false } + ) + + + + + + ctrl.pipeValue( dbg: "textA", sub: nil, - Bus.events.compactMap { Bus.convertKeyValue(K.textApp, $0) }.map { (k: String, v: String) in v }.eraseToAnyPublisher().eraseToAnyPublisher(), + Bus.events.compactMap { Bus.convertKeyValue(K.textApp, $0) }.map { (k: String, v: String) in v }.eraseToAnyPublisher(), { $0.textApp.value = $1 $0.textApp.isRecent = true @@ -103,7 +119,7 @@ extension MeetupId { ctrl.pipeValue( dbg: "textUI", sub: nil, - Bus.events.compactMap { Bus.convertKeyValue(K.textUI, $0) }.map { (k: String, v: String) in v }.eraseToAnyPublisher().eraseToAnyPublisher(), + Bus.events.compactMap { Bus.convertKeyValue(K.textUI, $0) }.map { (k: String, v: String) in v }.eraseToAnyPublisher(), { $0.textUI.value = $1 $0.textUI.isRecent = true diff --git a/Modules/MeetupIdX/src/MeetupId.Shoulds.swift b/Modules/MeetupIdX/src/MeetupId.Shoulds.swift index d9bf1da..929d147 100644 --- a/Modules/MeetupIdX/src/MeetupId.Shoulds.swift +++ b/Modules/MeetupIdX/src/MeetupId.Shoulds.swift @@ -2,6 +2,23 @@ import Foundation public extension MeetupId { static func shouldEnableJoin(_ c: MeetupIdContext) -> Bool? { + guard + c.textUI.isRecent || + c.join + else { + return nil + } + + + if onlyFormat(c.textUI.value) == "123"{ + /**/print("ИГР MeetupI.shouldEJ-1") + return true + } + + if c.join { + return false + } + return nil } } diff --git a/Utilities/platform/2/generation/pipeSource.py b/Utilities/platform/2/generation/pipeSource.py index 3743322..251eb89 100644 --- a/Utilities/platform/2/generation/pipeSource.py +++ b/Utilities/platform/2/generation/pipeSource.py @@ -18,7 +18,7 @@ def pipeSource(name, entity, structure): elif src.startswith("K."): busKey = src busValueType = structure.model.fields[name][0] - src = "Bus.events.compactMap { Bus.convertKeyValue(" + busKey + ", $0) }.map { (k: String, v: " + busValueType + ") in v }.eraseToAnyPublisher()" + src = "Bus.events.compactMap { Bus.convertKeyValue(" + busKey + ", $0) }.map { (k: String, v: " + busValueType + ") in v }" # Значение по умолчанию. elif src == default: return default + "." + name