feat(@desktop/keycard): unlock keycard flow added to the flows which are using it
- factory reset flow updated with unlock keycard flow - setup new keycard (keycard migrate) flow updated with unlock keycard flow - authenticate flow updated with unlock keycard flow
This commit is contained in:
parent
d985e347ce
commit
10c3b66336
|
@ -28,6 +28,15 @@ method onSharedKeycarModuleFlowTerminated*(self: AccessInterface, lastStepInTheC
|
||||||
method runSetupKeycardPopup*(self: AccessInterface) {.base.} =
|
method runSetupKeycardPopup*(self: AccessInterface) {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
|
method runUnlockKeycardPopup*(self: AccessInterface) {.base.} =
|
||||||
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
|
method runDisplayKeycardContentPopup*(self: AccessInterface) {.base.} =
|
||||||
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
|
method runFactoryResetPopup*(self: AccessInterface) {.base.} =
|
||||||
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
|
|
||||||
# View Delegate Interface
|
# View Delegate Interface
|
||||||
# Delegate for the view must be declared here due to use of QtObject and multi
|
# Delegate for the view must be declared here due to use of QtObject and multi
|
||||||
|
|
|
@ -95,11 +95,26 @@ method onSharedKeycarModuleFlowTerminated*(self: Module, lastStepInTheCurrentFlo
|
||||||
self.keycardSharedModule.delete
|
self.keycardSharedModule.delete
|
||||||
self.keycardSharedModule = nil
|
self.keycardSharedModule = nil
|
||||||
|
|
||||||
|
method onDisplayKeycardSharedModuleFlow*(self: Module) =
|
||||||
|
self.view.emitDisplayKeycardSharedModuleFlow()
|
||||||
|
|
||||||
method runSetupKeycardPopup*(self: Module) =
|
method runSetupKeycardPopup*(self: Module) =
|
||||||
self.createSharedKeycardModule()
|
self.createSharedKeycardModule()
|
||||||
if self.keycardSharedModule.isNil:
|
if self.keycardSharedModule.isNil:
|
||||||
return
|
return
|
||||||
self.keycardSharedModule.runFlow(keycard_shared_module.FlowType.SetupNewKeycard)
|
self.keycardSharedModule.runFlow(keycard_shared_module.FlowType.SetupNewKeycard)
|
||||||
|
|
||||||
method onDisplayKeycardSharedModuleFlow*(self: Module) =
|
method runUnlockKeycardPopup*(self: Module) =
|
||||||
self.view.emitDisplayKeycardSharedModuleFlow()
|
self.createSharedKeycardModule()
|
||||||
|
if self.keycardSharedModule.isNil:
|
||||||
|
return
|
||||||
|
self.keycardSharedModule.runFlow(keycard_shared_module.FlowType.UnlockKeycard)
|
||||||
|
|
||||||
|
method runDisplayKeycardContentPopup*(self: Module) =
|
||||||
|
info "TODO: Run display keycard content..."
|
||||||
|
|
||||||
|
method runFactoryResetPopup*(self: Module) =
|
||||||
|
self.createSharedKeycardModule()
|
||||||
|
if self.keycardSharedModule.isNil:
|
||||||
|
return
|
||||||
|
self.keycardSharedModule.runFlow(keycard_shared_module.FlowType.FactoryReset)
|
|
@ -33,3 +33,12 @@ QtObject:
|
||||||
|
|
||||||
proc runSetupKeycardPopup*(self: View) {.slot.} =
|
proc runSetupKeycardPopup*(self: View) {.slot.} =
|
||||||
self.delegate.runSetupKeycardPopup()
|
self.delegate.runSetupKeycardPopup()
|
||||||
|
|
||||||
|
proc runUnlockKeycardPopup*(self: View) {.slot.} =
|
||||||
|
self.delegate.runUnlockKeycardPopup()
|
||||||
|
|
||||||
|
proc runDisplayKeycardContentPopup*(self: View) {.slot.} =
|
||||||
|
self.delegate.runDisplayKeycardContentPopup()
|
||||||
|
|
||||||
|
proc runFactoryResetPopup*(self: View) {.slot.} =
|
||||||
|
self.delegate.runFactoryResetPopup()
|
|
@ -13,7 +13,7 @@ method getNextPrimaryState*(self: MaxPairingSlotsReachedState, controller: Contr
|
||||||
self.flowType == FlowType.SetupNewKeycard:
|
self.flowType == FlowType.SetupNewKeycard:
|
||||||
return createState(StateType.FactoryResetConfirmation, self.flowType, self)
|
return createState(StateType.FactoryResetConfirmation, self.flowType, self)
|
||||||
if self.flowType == FlowType.Authentication:
|
if self.flowType == FlowType.Authentication:
|
||||||
debug "Run Unlock Keycard flow... (not developed yet)"
|
controller.runSharedModuleFlow(FlowType.UnlockKeycard)
|
||||||
return nil
|
return nil
|
||||||
|
|
||||||
method executeTertiaryCommand*(self: MaxPairingSlotsReachedState, controller: Controller) =
|
method executeTertiaryCommand*(self: MaxPairingSlotsReachedState, controller: Controller) =
|
||||||
|
|
|
@ -9,12 +9,16 @@ proc delete*(self: MaxPinRetriesReachedState) =
|
||||||
self.State.delete
|
self.State.delete
|
||||||
|
|
||||||
method getNextPrimaryState*(self: MaxPinRetriesReachedState, controller: Controller): State =
|
method getNextPrimaryState*(self: MaxPinRetriesReachedState, controller: Controller): State =
|
||||||
if self.flowType == FlowType.FactoryReset or
|
if self.flowType == FlowType.FactoryReset:
|
||||||
self.flowType == FlowType.SetupNewKeycard:
|
controller.runSharedModuleFlow(FlowType.UnlockKeycard)
|
||||||
debug "Run Unlock Keycard flow... (not developed yet)"
|
if self.flowType == FlowType.SetupNewKeycard:
|
||||||
|
let currValue = extractPredefinedKeycardDataToNumber(controller.getKeycardData())
|
||||||
|
if (currValue and PredefinedKeycardData.UseUnlockLabelForLockedState.int) > 0:
|
||||||
|
controller.runSharedModuleFlow(FlowType.UnlockKeycard)
|
||||||
|
return nil
|
||||||
return createState(StateType.FactoryResetConfirmation, self.flowType, self)
|
return createState(StateType.FactoryResetConfirmation, self.flowType, self)
|
||||||
if self.flowType == FlowType.Authentication:
|
if self.flowType == FlowType.Authentication:
|
||||||
debug "Run Unlock Keycard flow... (not developed yet)"
|
controller.runSharedModuleFlow(FlowType.UnlockKeycard)
|
||||||
return nil
|
return nil
|
||||||
|
|
||||||
method executeTertiaryCommand*(self: MaxPinRetriesReachedState, controller: Controller) =
|
method executeTertiaryCommand*(self: MaxPinRetriesReachedState, controller: Controller) =
|
||||||
|
|
|
@ -13,7 +13,7 @@ method getNextPrimaryState*(self: MaxPukRetriesReachedState, controller: Control
|
||||||
self.flowType == FlowType.SetupNewKeycard:
|
self.flowType == FlowType.SetupNewKeycard:
|
||||||
return createState(StateType.FactoryResetConfirmation, self.flowType, self)
|
return createState(StateType.FactoryResetConfirmation, self.flowType, self)
|
||||||
if self.flowType == FlowType.Authentication:
|
if self.flowType == FlowType.Authentication:
|
||||||
debug "Run Unlock Keycard flow... (not developed yet)"
|
controller.runSharedModuleFlow(FlowType.UnlockKeycard)
|
||||||
if self.flowType == FlowType.UnlockKeycard:
|
if self.flowType == FlowType.UnlockKeycard:
|
||||||
return createState(StateType.EnterSeedPhrase, self.flowType, self)
|
return createState(StateType.EnterSeedPhrase, self.flowType, self)
|
||||||
|
|
||||||
|
|
|
@ -9,4 +9,16 @@ QtObject {
|
||||||
function runSetupKeycardPopup() {
|
function runSetupKeycardPopup() {
|
||||||
root.keycardModule.runSetupKeycardPopup()
|
root.keycardModule.runSetupKeycardPopup()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function runUnlockKeycardPopup() {
|
||||||
|
root.keycardModule.runUnlockKeycardPopup()
|
||||||
|
}
|
||||||
|
|
||||||
|
function runDisplayKeycardContentPopup() {
|
||||||
|
root.keycardModule.runDisplayKeycardContentPopup()
|
||||||
|
}
|
||||||
|
|
||||||
|
function runFactoryResetPopup() {
|
||||||
|
root.keycardModule.runFactoryResetPopup()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -167,7 +167,7 @@ SettingsContentBase {
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
onClicked: {
|
onClicked: {
|
||||||
console.warn("TODO: Check what’s on a Keycard...")
|
root.keycardStore.runDisplayKeycardContentPopup()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -182,7 +182,7 @@ SettingsContentBase {
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
onClicked: {
|
onClicked: {
|
||||||
console.warn("TODO: Factory reset a Keycard...")
|
root.keycardStore.runFactoryResetPopup()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue