[#2762] Fixed onboarding bugs

- The arrow in select chat name was not
  from StatusQ
- The text in case of password missmatch
  was wrongly displayed
- The loading icon color was not from StatusQ

Closes #2762
This commit is contained in:
Alexandra Betouni 2021-07-23 12:22:14 +03:00 committed by Iuri Matias
parent 58506fbd97
commit 3576cbc229
4 changed files with 5 additions and 47 deletions

View File

@ -267,44 +267,25 @@ QtObject {
function formatShortDateStr(longStr) {
const dmKeys = {
// Days
//% "Sun"
Sunday: qsTrId("sun"),
//% "Mon"
Monday: qsTrId("mon"),
//% "Tue"
Tuesday: qsTrId("tue"),
//% "Wed"
Wednesday: qsTrId("wed"),
//% "Thu"
Thursday: qsTrId("thu"),
//% "Fri"
Friday: qsTrId("fri"),
//% "Sat"
Saturday: qsTrId("sat"),
// Months
//% "Jan"
January: qsTrId("jan"),
//% "Feb"
February: qsTrId("feb"),
//% "Mar"
March: qsTrId("mar"),
//% "Apr"
April: qsTrId("apr"),
//% "May"
May: qsTrId("may"),
//% "Jun"
June: qsTrId("jun"),
//% "Jul"
July: qsTrId("jul"),
//% "Aug"
August: qsTrId("aug"),
//% "Sep"
September: qsTrId("sep"),
//% "Oct"
October: qsTrId("oct"),
//% "Nov"
November: qsTrId("nov"),
//% "Dec"
December: qsTrId("dec")
};
@ -332,22 +313,14 @@ QtObject {
if (now.toDateString() === messageDate.toDateString()) {
return (hours < 10 ? "0" + hours : hours) + ":" + (minutes < 10 ? "0" + minutes : minutes)
} else if (yesterday.toDateString() === messageDate.toDateString()) {
//% "Yesterday"
return qsTrId("yesterday")
} else if (lastWeek.getTime() < messageDate.getTime()) {
//% "Sunday"
let days = [qsTrId("sunday"),
//% "Monday"
qsTrId("monday"),
//% "Tuesday"
qsTrId("tuesday"),
//% "Wednesday"
qsTrId("wednesday"),
//% "Thursday"
qsTrId("thursday"),
//% "Friday"
qsTrId("friday"),
//% "Saturday"
qsTrId("saturday")];
return days[messageDate.getDay()];
} else {
@ -405,7 +378,6 @@ QtObject {
}
if (index > -1) {
const pk = link.substring(index + 3)
//% "Start a 1 on 1 chat with %1"
result.title = qsTrId("start-a-1-on-1-chat-with--1").arg(utilsModel.generateAlias(pk))
result.callback = function () {
chatsModel.channelView.joinPrivateChat(pk, "");
@ -428,7 +400,6 @@ QtObject {
return result
}
//% "Join the %1 community"
result.title = qsTrId("join-the--1-community").arg(communityName)
result.communityId = communityId
result.callback = function () {
@ -486,7 +457,6 @@ QtObject {
const result = getLinkTitleAndCb(link)
return {
//% "Status app link"
site: qsTrId("status-app-link"),
title: result.title,
communityId: result.communityId,
@ -534,17 +504,11 @@ QtObject {
function getNetworkName(network){
switch(network){
//% "Mainnet with upstream RPC"
case Constants.networkMainnet: return qsTrId("mainnet-with-upstream-rpc")
//% "POA Network"
case Constants.networkPOA: return qsTrId("poa-network")
//% "xDai Chain"
case Constants.networkXDai: return qsTrId("xdai-chain")
//% "Goerli with upstream RPC"
case Constants.networkGoerli: return qsTrId("goerli-with-upstream-rpc")
//% "Rinkeby with upstream RPC"
case Constants.networkRinkeby: return qsTrId("rinkeby-with-upstream-rpc")
//% "Ropsten with upstream RPC"
case Constants.networkRopsten: return qsTrId("ropsten-with-upstream-rpc")
default: return network
}
@ -554,20 +518,17 @@ QtObject {
switch (item) {
case "first":
if (firstPasswordField.text === "") {
//% "You need to enter a password"
return [false, qsTrId("you-need-to-enter-a-password")];
} else if (firstPasswordField.text.length < 6) {
return [false, qsTrId("Password needs to be 6 characters or more")];
return [false, qsTr("Password needs to be 6 characters or more")];
}
return [true, ""];
case "repeat":
if (repeatPasswordField.text === "") {
//% "You need to repeat your password"
return [false, qsTrId("you-need-to-repeat-your-password")];
} else if (repeatPasswordField.text !== firstPasswordField.text) {
//% "Passwords don't match"
return [false, qsTrId("passwords-don-t-match")];
return [false, qsTr("Passwords don't match")];
}
return [true, ""];
@ -633,17 +594,14 @@ QtObject {
}
if(validation & Utils.Validate.TextLength && str.length > limit) {
//% "The %1 cannot exceed %2 characters"
errMsg = qsTrId("the--1-cannot-exceed--2-characters").arg(fieldName, limit)
}
if(validation & Utils.Validate.TextHexColor && !isHexColor(str)) {
//% "Must be an hexadecimal color (eg: #4360DF)"
errMsg = qsTrId("must-be-an-hexadecimal-color--eg---4360df-")
}
if(validation & Utils.Validate.TextLowercaseLettersNumberAndDashes && !isValidChannelName(str)) {
//% "Use only lowercase letters (a to z), numbers & dashes (-). Do not use chat keys."
errMsg = qsTrId("use-only-lowercase-letters--a-to-z---numbers---dashes------do-not-use-chat-keys-")
}

View File

@ -16,7 +16,7 @@ lupdate_only{
SOURCES = *.qml \
app/*.qml \
shared/*.qml \
import/*.qml \
imports/*.qml \
shared/status/*.qml \
onboarding/*.qml \
onboarding/Login/*.qml \

View File

@ -1,9 +1,9 @@
import QtQuick 2.13
import QtQuick.Controls 2.13
import QtQuick.Dialogs 1.3
import StatusQ.Controls 0.1
import "../imports"
import "../shared"
import "../shared/status"
ModalPopup {
property bool loading: false

View File

@ -1,9 +1,9 @@
import QtQuick 2.13
import QtQuick.Controls 2.13
import QtGraphicalEffects 1.13
import StatusQ.Controls 0.1
import "../imports"
import "../shared"
import "../shared/status"
import "./Login"
ModalPopup {