From e6a16e843e13744c952aea76a0e57d35029e9b19 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Wed, 25 Oct 2017 17:12:46 +0200 Subject: A login error view --- components/kube/contents/ui/LogView.qml | 49 +++++++++++++++++++++++++++++---- 1 file changed, 43 insertions(+), 6 deletions(-) (limited to 'components') diff --git a/components/kube/contents/ui/LogView.qml b/components/kube/contents/ui/LogView.qml index 2ffa978c..4d6035c0 100644 --- a/components/kube/contents/ui/LogView.qml +++ b/components/kube/contents/ui/LogView.qml @@ -143,26 +143,25 @@ Controls.SplitView { Loader { id: detailsLoader + visible: message != "" + clip: true anchors { fill: parent margins: Kube.Units.largeSpacing } property date timestamp: details.timestamp property string message: details.message - property string resourceId: details.resourceid + property string resourceId: details.resourceId property string accountId: retriever.currentData ? retriever.currentData.accountId : "" property string accountName: retriever.currentData ? retriever.currentData.name : "" - sourceComponent: detailsComponent + sourceComponent: details.subtype == Kube.Notifications.loginError ? loginErrorComponent : detailsComponent } - } Component { id: detailsComponent Rectangle { - visible: message != "" - clip: true color: Kube.Colors.viewBackgroundColor GridLayout { id: gridLayout @@ -170,8 +169,8 @@ Controls.SplitView { anchors { top: parent.top left: parent.left + right: parent.right } - width: parent.width columns: 2 Kube.Label { text: qsTr("Account:") @@ -232,4 +231,42 @@ Controls.SplitView { } } } + + Component { + id: loginErrorComponent + Item { + Column { + anchors { + top: parent.top + left: parent.left + right: parent.right + } + spacing: Kube.Units.largeSpacing + Column { + Kube.Heading { + id: heading + text: qsTr("Failed to login") + color: Kube.Colors.warningColor + } + + Kube.Label { + id: subHeadline + text: accountName + ": " + qsTr("Please check your credentials.") + color: Kube.Colors.disabledTextColor + wrapMode: Text.Wrap + } + } + Kube.Button { + anchors { + right: parent.right + } + text: qsTr("Change Password") + onClicked: { + Kube.Fabric.postMessage(Kube.Messages.componentDone, {}) + Kube.Fabric.postMessage(Kube.Messages.requestLogin, {}) + } + } + } + } + } } -- cgit v1.2.3