Lokavaluto / monujo

GNU Affero General Public License v3.0
2 stars 4 forks source link

Change signup button #386

Closed SeddikKadi closed 10 months ago

github-actions[bot] commented 10 months ago

:x: translation needs update

PO file needs a simple update (no fuzzy entries found). Please run the command \`npm run gettext:extract\` before pushing the code to ensure that all necessary translations are included and the PO file is up-to-date.

1 file changed, 2 insertions(+)

```diff 1 src/components/TheBankAccountList.vue 1 src/components/TransactionListModal.vue ```

:x: code style needs update

It seems your code wasn't properly formatted using our current rules.

Please run src/App.vue 481ms src/assets/custom-variables.scss 45ms src/assets/datepicker.scss 3ms src/assets/fonts/roboto/style.css 30ms src/assets/main.scss 57ms src/assets/native.scss 4ms src/assets/switch-prefs.scss 10ms src/components/AboutModal.vue 88ms src/components/AuthChallenge.vue 62ms src/components/AuthChallengeDirect.vue 37ms src/components/AuthChallengePin.vue 46ms src/components/AuthChallengeRetention.vue 23ms src/components/AuthPref.vue 97ms src/components/AuthPrefDirect.vue 8ms src/components/AuthPrefPin.vue 69ms src/components/AuthPrefRetention.vue 14ms src/components/AuthPrefs.vue 45ms src/components/BankAccountItem.vue 63ms src/components/BiometryPrefs.vue 41ms src/components/ConfirmPaymentModal.vue 91ms src/components/CreateAccount.vue 133ms src/components/Dialog.vue 31ms src/components/LangPrefs.vue 33ms src/components/Modal.vue 14ms src/components/MoneyCreditModal.vue 120ms src/components/MoneyTransferModal.vue 193ms src/components/PendingTopUp.vue 49ms src/components/QrCodeModal.vue 39ms src/components/RecipientItem.vue 32ms src/components/ScanQrCode.vue 16ms src/components/TheBankAccountList.vue 91ms src/components/TheDashboardFooter.vue 48ms src/components/TheNavBar.vue 110ms src/components/TheTransactionList.vue 23ms src/components/TransactionItem.vue 32ms src/components/TransactionListModal.vue 231ms src/components/TransactionListRecent.vue 48ms src/exception.ts 14ms src/main.ts 69ms src/plugins/loading.ts 15ms src/plugins/vue-loading-overlay.d.ts 3ms src/polyfill.ts 4ms src/router/index.ts 16ms src/services/AuthService.ts 55ms src/services/Biometry.ts 12ms src/services/DatePicker.ts 17ms src/services/Dialog.ts 4ms src/services/ExportService.ts 10ms src/services/Gettext.ts 21ms src/services/lokapiService.ts 37ms src/services/PrefsService.ts 10ms src/services/QrCodeService.ts 26ms src/services/secret.ts 9ms src/services/toastService.ts 6ms src/services/UseBatchLoading.ts 9ms src/services/UseModal.ts 20ms src/shims-vue.d.ts 4ms src/store/index.ts 13ms src/store/lokapi.ts 34ms src/store/prefs.ts 4ms src/utils/fonts.ts 6ms src/utils/password.ts 6ms src/utils/vuex.ts 5ms src/views/admin/PendingAccounts.vue 72ms src/views/admin/PendingCredits.vue 98ms src/views/Carto.vue 15ms src/views/CreateMyAccount.vue 5ms src/views/Dashboard.vue 28ms src/views/Login.vue 70ms src/views/Prefs.vue 20ms src/views/ResetPassword.vue 34ms src/views/Signup.vue 104ms on your code before submitting the PR. You can amend this current PR.

17 files changed, 6 insertions(+), 47 deletions(-)

```diff diff --git a/src/App.vue b/src/App.vue index 56d1d38..8f8fb36 100644 --- a/src/App.vue +++ b/src/App.vue @@ -23,7 +23,6 @@ await StatusBar.setStyle({ style: Style.Light }) } CapacitorApp.addListener("backButton", ({ canGoBack }) => { - // XXXvlab: will need a back button service to insert these if (this.$qrCode.isActive()) return if (this.$modal.isActive.value) { this.$modal.back() diff --git a/src/components/AuthChallenge.vue b/src/components/AuthChallenge.vue index 38a8343..5557b3a 100644 --- a/src/components/AuthChallenge.vue +++ b/src/components/AuthChallenge.vue @@ -73,7 +73,6 @@ hide() { this.visible = false - // Destroys in memory previous challenge structure this.handler = false }, diff --git a/src/components/AuthChallengeRetention.vue b/src/components/AuthChallengeRetention.vue index 55b2f99..a8aecc5 100644 --- a/src/components/AuthChallengeRetention.vue +++ b/src/components/AuthChallengeRetention.vue @@ -36,14 +36,12 @@ }, async mounted() { this.subState = this.state - // Do we have some credential saved in store ? if (await this.handler.checkUserInput()) { if (this.state === "firstTry") { const lastCredsInput = await this.handler.inferKey() this.submitInput(lastCredsInput) return } - // Uh-oh, these weren't valid credentials this.handler.constructor.flush() this.subState = "firstTry" } diff --git a/src/components/AuthPref.vue b/src/components/AuthPref.vue index ac871de..f573313 100644 --- a/src/components/AuthPref.vue +++ b/src/components/AuthPref.vue @@ -102,13 +102,8 @@ } return true }, - /** - * Trigger direct default challenge an disable any retention - */ triggerDefaultChallenge() { return this.triggerChallenge(async (state: any, userAccount: any) => { - // By not asking the specific userAccount's auth, we remove - // any retention mecanism aspect. const accountAuthService = await this.$auth.getAccountAuth() return await accountAuthService.requestCredentials(state) }) @@ -128,7 +123,6 @@ setUseSimplifiedAuth(value: any) { this.useSimplifiedAuth = value this.$refs.checkbox.checked = value - // XXXvlab: nextTick didn't work. setTimeout(() => { this.$refs.checkbox.checked = value }, 0) @@ -136,12 +130,7 @@ async switchSimplifiedAuth(e: any) { e.preventDefault() if (this.useSimplifiedAuth) { - // Was on, switching off if (!(await this.triggerDefaultChallenge())) { - // XXXvlab: vuejs won't see any changes so won't force - // the checkbox to be unchecked. But it is automatically checked - // despite the preventDefault. - // this.useSimplifiedAuth = true this.setUseSimplifiedAuth(true) return } @@ -152,12 +141,7 @@ this.$forceUpdate() return } - // ``useSimplifiedAuth`` was off, switching on if (!(await this.triggerDefaultChallenge())) { - // XXXvlab: vuejs won't see any changes so won't force - // the checkbox to be unchecked. But it is automatically checked - // despite the preventDefault. - // this.useSimplifiedAuth = false this.setUseSimplifiedAuth(false) return } diff --git a/src/components/AuthPrefs.vue b/src/components/AuthPrefs.vue index fd7a48d..0659350 100644 --- a/src/components/AuthPrefs.vue +++ b/src/components/AuthPrefs.vue @@ -38,9 +38,6 @@ const $auth = this.$auth const moreThanOneUserAccount = userAccounts.length !== 1 - // XXXvlab: typeforcing to 'any' as typescript doesn't seem to - // understand that a 'allSettled' is actually a Promise of an - // array. const preparedTemplateDataPromises = (await Promise.allSettled( userAccounts.map(async (userAccount: any) => ({ name: diff --git a/src/components/BiometryPrefs.vue b/src/components/BiometryPrefs.vue index 730ae43..e5ab210 100644 --- a/src/components/BiometryPrefs.vue +++ b/src/components/BiometryPrefs.vue @@ -62,7 +62,6 @@ setUseBiometry(value: any) { this.setUserBiometry(value) this.useBiometry = value - // XXXvlab: nextTick didn't work. setTimeout(() => { this.$refs.biometryCheckbox.checked = value }, 0) diff --git a/src/components/ConfirmPaymentModal.vue b/src/components/ConfirmPaymentModal.vue index 77347a4..939d324 100644 --- a/src/components/ConfirmPaymentModal.vue +++ b/src/components/ConfirmPaymentModal.vue @@ -183,8 +183,6 @@ }, methods: { payTopUpRequest(): void { - // XXXvlab: we would need to launch regular checks - // here to acknowledge the payment window.open( this.$modal.args?.value[0].transaction.jsonData.odoo.order_url, "_blank" @@ -206,8 +204,6 @@ this.closeAndRefresh() } }, - // XXXvlab: the refresh is unnecessary in most case, and - // should occur only when needed. closeAndRefresh(): void { this.$modal.close("refreshTopUpList") this.$lokapi.flushBackendCaches() diff --git a/src/components/CreateAccount.vue b/src/components/CreateAccount.vue index 755fb14..5b61cdb 100644 --- a/src/components/CreateAccount.vue +++ b/src/components/CreateAccount.vue @@ -292,7 +292,7 @@ this.$gettext("Please try again or contact your administrator") ) - return // stay on page + return } this.$msg.warning(this.$gettext("Wallet already created")) } diff --git a/src/components/LangPrefs.vue b/src/components/LangPrefs.vue index 17a7b16..0e7cb3c 100644 --- a/src/components/LangPrefs.vue +++ b/src/components/LangPrefs.vue @@ -65,7 +65,6 @@ setUseCustomLanguage(value: any) { this.setCustomLanguage(value ? this.userLanguage : null) this.useCustomLanguage = value - // XXXvlab: nextTick didn't work. setTimeout(() => { this.$refs.langCheckbox.checked = value }, 0) diff --git a/src/components/MoneyCreditModal.vue b/src/components/MoneyCreditModal.vue index 8d2a529..07a1b2f 100644 --- a/src/components/MoneyCreditModal.vue +++ b/src/components/MoneyCreditModal.vue @@ -261,7 +261,6 @@ this.selectedCreditAccount = account }, async newLinkTab() { - // This to ensure we are left with 2 decimals only this.amount = this.amount.toFixed(2) try { if (!this.selectedCreditAccount) { diff --git a/src/components/MoneyTransferModal.vue b/src/components/MoneyTransferModal.vue index 861c0e6..8432a25 100644 --- a/src/components/MoneyTransferModal.vue +++ b/src/components/MoneyTransferModal.vue @@ -261,7 +261,6 @@ account = account._obj.parent } this.account = account - // No need to declare in data, no live mechanism required here this.selectedBackend = account.parent this.recipientBatchLoader = UseBatchLoading({ @@ -374,7 +373,6 @@ this.transferOngoing = false return } - // This to ensure we are left with 2 decimals only this.amount = parseFloat(this.amount).toFixed(2) let dateBegin = Date.now() let payment @@ -400,7 +398,6 @@ return } if (err.message === "User canceled the dialog box") { - // A warning message should have already been sent return } this.$msg.error( @@ -448,8 +445,6 @@ try { await this.selectedRecipient.toggleFavorite() } catch (err) { - // XXXvlab: using ``.then`` makes it trigger outside of - // view js grasp. this.$errorHandler(err) return } diff --git a/src/components/QrCodeModal.vue b/src/components/QrCodeModal.vue index 63e043a..f032b6b 100644 --- a/src/components/QrCodeModal.vue +++ b/src/components/QrCodeModal.vue @@ -71,8 +71,8 @@ methods: { async downloadQrCodePdf() { let svgQrCode = this.$refs.qrCode.firstChild.outerHTML - const finalSizeMm = 120 // mm of final printed QrCode - const resolution = 5 // px/mm + const finalSizeMm = 120 + const resolution = 5 svgQrCode = svgQrCode.replace( 'width="200"', @@ -94,7 +94,6 @@ const imgData = canvas.toDataURL("image/png") - // Generate PDF let pdf = new jsPDF("p", "mm", "a4") await pdf.addImage( diff --git a/src/components/TransactionListRecent.vue b/src/components/TransactionListRecent.vue index 1e1e268..25dbd97 100644 --- a/src/components/TransactionListRecent.vue +++ b/src/components/TransactionListRecent.vue @@ -87,7 +87,7 @@ @Options({ name: "TransactionListRecent", props: { - refreshToggle: Boolean, // change of this props requests a refresh + refreshToggle: Boolean, account: Object, }, components: { diff --git a/src/views/Dashboard.vue b/src/views/Dashboard.vue index 571e64e..c091798 100644 --- a/src/views/Dashboard.vue +++ b/src/views/Dashboard.vue @@ -57,7 +57,6 @@ }, methods: { refreshTransaction() { - // This change is propagated through props to children components this.refreshToggle = !this.refreshToggle }, accountSelected(account: any) { diff --git a/src/views/Login.vue b/src/views/Login.vue index 9b095fd..2b13697 100644 --- a/src/views/Login.vue +++ b/src/views/Login.vue @@ -94,8 +94,8 @@ password: "", fail: "", success: "", - biometryEnabled: false, // User preference - biometryAvailable: false, // Biometry available and credential saved + biometryEnabled: false, + biometryAvailable: false, canResetPassword: false, canSignup: false, } @@ -159,7 +159,6 @@ this.$router.push({ name: "dashboard" }) this.$persistentStore.set("loginEmail", this.email) } catch (e) { - // { APIRequestFailed, InvalidCredentials } if (e instanceof RestExc.APIRequestFailed) { this.fail = this.$gettext( "Request refused by remote server. Contact your administrator" @@ -213,7 +212,6 @@ prefs.biometryEnabled = true await this.$localSettings.save(prefs) } - // biometryEnabled is true const hasCredentialsAvailable = await this.$biometry.hasCredentialsAvailable("login") console.log("has", hasCredentialsAvailable) diff --git a/src/views/admin/PendingAccounts.vue b/src/views/admin/PendingAccounts.vue index 4a4e2f4..abfedf4 100644 --- a/src/views/admin/PendingAccounts.vue +++ b/src/views/admin/PendingAccounts.vue @@ -138,7 +138,6 @@ } catch (err: any) { this.isWaitingForValidation = false if (err.message === "User canceled the dialog box") { - // A warning message should have already been sent return } diff --git a/src/views/admin/PendingCredits.vue b/src/views/admin/PendingCredits.vue index b89bf69..27759a6 100644 --- a/src/views/admin/PendingCredits.vue +++ b/src/views/admin/PendingCredits.vue @@ -161,7 +161,6 @@ await request.validate() } catch (err: any) { if (err.message === "User canceled the dialog box") { - // A warning message should have already been sent return } this.$msg.error( ```

github-actions[bot] commented 10 months ago

:evergreen_tree: test report

Passes: 18, failures: 2, pending: 0, skipped: 0, other: 0. | State | Description | | ----- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | fail | **Filepath**: tests/e2e/spec.cy.ts
**Title**: General processes when logged in Send money process
**Error**: AssertionError: Timed out retrying after 15000ms: Expected to find element: `.custom-card > :nth-child(1) >> .recipient-name`, but never found it. | | fail | **Filepath**: tests/e2e/spec.cy.ts
**Title**: General processes when logged in Send money process
**Error**: AssertionError: Timed out retrying after 15000ms: Expected to find element: `.custom-card > :nth-child(1) >> .recipient-name`, but never found it. |
vaab commented 10 months ago

These are actual fixups. Live reviewed, and fixed up.