From 39791d26f1ef156f74e6d48e76069edab841f0bd Mon Sep 17 00:00:00 2001 From: Denis Davidyuk Date: Tue, 4 Feb 2025 22:30:20 +0100 Subject: [PATCH 1/3] chore: setup formatting using prettier --- .prettierignore | 3 +++ .prettierrc | 4 ++++ package-lock.json | 44 ++++++++++++++++++++++++++++++++++++++++---- package.json | 4 +++- 4 files changed, 50 insertions(+), 5 deletions(-) create mode 100644 .prettierignore create mode 100644 .prettierrc diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 000000000..49468a7ea --- /dev/null +++ b/.prettierignore @@ -0,0 +1,3 @@ +www +platforms +plugins diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 000000000..5ac85e271 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,4 @@ +{ + "printWidth": 100, + "singleQuote": true +} diff --git a/package-lock.json b/package-lock.json index 93c29251e..941b1b00b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -69,6 +69,7 @@ "eslint-plugin-vuejs-accessibility": "^2.3.0", "jest": "^29.7.0", "jest-canvas-mock": "^2.5.2", + "prettier": "^3.4.2", "sass": "^1.77.2", "sass-loader": "^14.2.1", "serve": "^14.2.3", @@ -7554,6 +7555,22 @@ "prettier": "^1.18.2 || ^2.0.0" } }, + "node_modules/@vue/compiler-sfc/node_modules/prettier": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", + "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "license": "MIT", + "optional": true, + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/@vue/compiler-sfc/node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -7615,6 +7632,23 @@ "url": "https://opencollective.com/postcss/" } }, + "node_modules/@vue/component-compiler-utils/node_modules/prettier": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", + "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "dev": true, + "license": "MIT", + "optional": true, + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/@vue/component-compiler-utils/node_modules/source-map": { "version": "0.6.1", "dev": true, @@ -24384,14 +24418,16 @@ } }, "node_modules/prettier": { - "version": "2.8.8", + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.2.tgz", + "integrity": "sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==", + "dev": true, "license": "MIT", - "optional": true, "bin": { - "prettier": "bin-prettier.js" + "prettier": "bin/prettier.cjs" }, "engines": { - "node": ">=10.13.0" + "node": ">=14" }, "funding": { "url": "https://github.com/prettier/prettier?sponsor=1" diff --git a/package.json b/package.json index 04dedcde5..24885518c 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "build:cordova": "VUE_APP_CORDOVA=true npm run build", "build:ios": "npm run build:cordova && cordova build ios", "build:android": "npm run build:cordova && cordova build android", - "lint": "NODE_ENV=production vue-cli-service lint . --no-fix", + "format": "prettier . --write", + "lint": "prettier . --check && NODE_ENV=production vue-cli-service lint . --no-fix", "test": "npm run lint && npm run test:unit && npm run test:e2e -- --headless", "test:e2e": "vue-cli-service test:e2e --mode docker", "test:unit": "vue-cli-service test:unit", @@ -79,6 +80,7 @@ "eslint-plugin-vuejs-accessibility": "^2.3.0", "jest": "^29.7.0", "jest-canvas-mock": "^2.5.2", + "prettier": "^3.4.2", "sass": "^1.77.2", "sass-loader": "^14.2.1", "serve": "^14.2.3", From fc6ffcc46feff64964043678a7cb322e6f13080b Mon Sep 17 00:00:00 2001 From: Denis Davidyuk Date: Tue, 11 Feb 2025 22:16:02 +0100 Subject: [PATCH 2/3] style: format using prettier --- .eslintrc.js | 46 +- .github/workflows/_validate-npm.yml | 44 +- .github/workflows/integration.yml | 8 +- .github/workflows/pull-request-cleanup.yml | 12 +- .github/workflows/pull-request.yml | 8 +- .github/workflows/release-please.yml | 4 +- .github/workflows/release.yml | 2 +- README.md | 45 +- babel.config.js | 9 +- backend/src/send-push-notification.js | 3 +- backend/src/server.js | 42 +- backend/src/server.tests.js | 15 +- cypress.config.js | 9 +- docker-compose.yml | 2 +- docker-compose/aeternity.yaml | 4 +- docker-compose/init-state.mjs | 35 +- jest.config.js | 30 +- public/.well-known/assetlinks.json | 4 +- public/index.html | 57 +- src/App.vue | 8 +- src/components/AccountInline.vue | 6 +- src/components/AeAccount.vue | 25 +- src/components/AeAddress.vue | 14 +- src/components/AeButton.vue | 16 +- src/components/AeCard.vue | 15 +- src/components/AeFraction.vue | 2 +- src/components/AeIdenticon.vue | 6 +- src/components/AeInput.vue | 13 +- src/components/AeInputAccount.vue | 47 +- src/components/AeInputAmount.vue | 24 +- src/components/AeInputMnemonic.vue | 9 +- src/components/AeInputPassword.vue | 10 +- src/components/AeInputPlain.vue | 2 +- src/components/AeInputRange.vue | 14 +- src/components/AeInputWrapper.vue | 16 +- src/components/AeLink.vue | 20 +- src/components/AeMenu.vue | 9 +- src/components/AeMenuItem.vue | 6 +- src/components/AeModal.vue | 5 +- src/components/AePopover.vue | 31 +- src/components/AeQrCode.vue | 6 +- src/components/AeRadio.vue | 2 +- src/components/AeSpinner.vue | 22 +- src/components/AeTextarea.vue | 11 +- src/components/AeToolbar.vue | 18 +- src/components/AeToolbarButton.vue | 9 +- src/components/AlertModal.vue | 10 +- src/components/AppShortcut.vue | 11 +- src/components/Balance.vue | 6 +- src/components/ButtonAddFixed.vue | 2 +- src/components/ConfirmAccountAccess.vue | 17 +- src/components/ConnectionStatus.vue | 21 +- src/components/CurrencySwitcher.vue | 12 +- src/components/Guide.vue | 83 ++- src/components/LanguageSwitcher.vue | 12 +- src/components/ListItem.vue | 37 +- src/components/ListItemAccount.vue | 29 +- src/components/ListItemButton.vue | 6 +- src/components/ListItemChoose.vue | 15 +- src/components/ListItemCircle.vue | 6 +- src/components/ListItemSettingsLanguage.vue | 6 +- src/components/ListItemSettingsReset.vue | 14 +- src/components/ListItemTransaction.vue | 16 +- src/components/ModalPlain.vue | 7 +- src/components/NetworkAdd.vue | 7 +- src/components/NetworkSwitcher.vue | 5 +- src/components/Notification.vue | 11 +- src/components/NotificationSpendSuccess.vue | 12 +- .../NotificationUpdateAvailable.vue | 11 +- src/components/Overlay.vue | 9 +- src/components/Page.vue | 41 +- src/components/PageHeader.vue | 50 +- src/components/Progress.vue | 15 +- src/components/ProgressFake.vue | 6 +- src/components/QrCodeReader.vue | 48 +- src/components/SettingsVersion.vue | 6 +- src/components/__tests__/AeInputAccount.js | 327 +++++----- src/components/desktop/AccountSwitcher.vue | 41 +- src/components/desktop/AeAddressPanel.vue | 9 +- src/components/desktop/CancelSignModal.vue | 7 +- src/components/desktop/ConnectGuide.vue | 32 +- src/components/desktop/CreateOrRecover.vue | 22 +- src/components/desktop/Header.vue | 102 ++-- .../desktop/LedgerAccountNotFoundModal.vue | 7 +- .../desktop/LedgerAddressConfirmModal.vue | 21 +- .../LedgerAddressNotConfirmedModal.vue | 7 +- src/components/desktop/LedgerModal.vue | 17 +- src/components/desktop/LedgerModalNanoS.vue | 5 +- src/components/desktop/LedgerModalNote.vue | 10 +- src/components/desktop/LedgerRequestModal.vue | 5 +- .../desktop/LedgerRequestRetryModal.vue | 12 +- .../desktop/LedgerSignTransactionModal.vue | 5 +- .../desktop/LedgerTransactionFeeModal.vue | 14 +- src/components/desktop/Modal.vue | 15 +- src/components/desktop/ModalSpendSuccess.vue | 10 +- src/components/desktop/Sidebar.vue | 42 +- src/components/desktop/SidebarModal.vue | 15 +- src/components/desktop/Step.vue | 5 +- .../mobile/AccountSwitcherModal.vue | 36 +- src/components/mobile/AeAccountReverse.vue | 20 +- src/components/mobile/ButtonMnemonicWord.vue | 6 +- src/components/mobile/ConfirmSignModal.vue | 25 +- .../mobile/ConfirmTransactionSignModal.vue | 76 +-- src/components/mobile/DetailsAmount.vue | 4 +- src/components/mobile/DetailsAmountAndFee.vue | 5 +- .../mobile/DetailsAmountCurrency.vue | 18 +- src/components/mobile/DetailsFeeInput.vue | 11 +- src/components/mobile/DetailsField.vue | 5 +- src/components/mobile/DetailsItem.vue | 2 +- src/components/mobile/DetailsNamePointers.vue | 5 +- src/components/mobile/DetailsRawData.vue | 5 +- src/components/mobile/ListItemAuction.vue | 41 +- src/components/mobile/ListItemBid.vue | 25 +- .../mobile/MnemonicBackupWarning.vue | 6 +- src/components/mobile/Modal.vue | 5 +- src/components/mobile/NameListHeader.vue | 16 +- .../mobile/NotificationMnemonicBackup.vue | 23 +- src/components/mobile/PasswordModal.vue | 26 +- src/components/mobile/PasswordPurpose.vue | 7 +- src/components/mobile/SecurityCourseModal.vue | 14 +- src/components/mobile/TabBar.vue | 4 +- src/components/mobile/Tooltip.vue | 18 +- src/components/mobile/TooltipsModal.vue | 20 +- src/components/mobile/UrlForm.vue | 8 +- src/components/mobile/VaultSignModal.vue | 18 +- src/components/mobile/__tests__/UrlForm.js | 24 +- src/components/mobile/details-fields.js | 24 +- src/directives/copyOnClick.js | 5 +- src/directives/removeSpacesOnCopy.js | 12 +- src/filters/__tests__/formatAddress.js | 39 +- src/filters/prefixedAmount.js | 10 +- src/lib/__tests__/rpc.js | 15 +- src/lib/aes.js | 7 +- src/lib/airGap.js | 12 +- src/lib/constants.js | 11 +- src/lib/localStorageCall.js | 19 +- src/lib/networksRegistry.js | 3 +- src/lib/renderQrCodeSvg.js | 43 +- src/lib/rpc.js | 10 +- src/lib/spendTxFees.js | 5 +- src/lib/utils.js | 20 +- src/lib/withFormatting.js | 92 +-- src/locales/cn.json | 8 +- src/locales/en.json | 8 +- src/locales/es.json | 10 +- src/locales/ru.json | 6 +- src/pages/FullscreenPrompt.vue | 6 +- src/pages/NotFound.vue | 12 +- src/pages/RecoverMixin.js | 2 +- src/pages/StoreLoadError.vue | 3 +- src/pages/aens/AuctionBid.vue | 24 +- src/pages/aens/AuctionDetails.vue | 19 +- src/pages/aens/AuctionList.vue | 35 +- src/pages/aens/NameDetails.vue | 29 +- src/pages/aens/NameList.vue | 21 +- src/pages/aens/NameNew.vue | 25 +- src/pages/aens/NameTransfer.vue | 50 +- src/pages/desktop/Apps.vue | 11 +- src/pages/desktop/Receive.vue | 34 +- src/pages/desktop/Send.vue | 28 +- src/pages/desktop/Settings.vue | 30 +- src/pages/mobile/AddToHomeScreenPrompt.vue | 7 +- src/pages/mobile/AppBrowser.vue | 20 +- src/pages/mobile/Intro.vue | 22 +- src/pages/mobile/Login.vue | 36 +- src/pages/mobile/Onboarding.vue | 25 +- src/pages/mobile/OnboardingAepps.vue | 2 +- src/pages/mobile/OnboardingPage.scss | 10 +- src/pages/mobile/OnboardingSend.vue | 7 +- src/pages/mobile/OnboardingSubaccounts.vue | 7 +- src/pages/mobile/OnboardingWelcome.vue | 7 +- src/pages/mobile/Receive.vue | 19 +- src/pages/mobile/Recover.vue | 22 +- src/pages/mobile/RedeemBalance.vue | 18 +- src/pages/mobile/Send.vue | 34 +- src/pages/mobile/SendAmount.vue | 39 +- src/pages/mobile/Settings.vue | 47 +- src/pages/mobile/SettingsAccountRemove.vue | 13 +- src/pages/mobile/SettingsAppList.vue | 6 +- src/pages/mobile/SettingsCurrency.vue | 12 +- src/pages/mobile/SettingsInfo.vue | 65 +- src/pages/mobile/SettingsMnemonic.vue | 17 +- src/pages/mobile/SettingsMnemonicConfirm.vue | 17 +- .../mobile/SettingsMnemonicConfirmed.vue | 16 +- src/pages/mobile/SettingsMnemonicDeleted.vue | 10 +- src/pages/mobile/SettingsMnemonicShow.vue | 24 +- src/pages/mobile/SettingsPassword.vue | 17 +- src/pages/mobile/SettingsPasswordSet.vue | 33 +- src/pages/mobile/SettingsRemoteConnection.vue | 12 +- .../mobile/SettingsRemoteConnectionNew.vue | 5 +- .../mobile/SettingsSecurityCourseBank.vue | 91 +-- .../mobile/SettingsSecurityCourseIntro.vue | 88 +-- .../mobile/SettingsSecurityCourseLayers.vue | 51 +- .../mobile/SettingsSecurityCourseList.vue | 24 +- .../mobile/SettingsSecurityCoursePrivacy.vue | 12 +- .../mobile/SettingsSecurityCourseWrapper.vue | 18 +- src/pages/mobile/TransactionDetails.vue | 36 +- src/pages/mobile/TransactionList.vue | 53 +- src/pages/mobile/Transfer.vue | 53 +- src/pages/mobile/VaultSetupAnotherDevice.vue | 28 +- .../mobile/VaultSetupAnotherDeviceGuide.vue | 16 +- src/pages/mobile/VaultSetupCompleted.vue | 32 +- src/pages/mobile/VaultSetupMethod.vue | 32 +- src/pages/mobile/VaultSetupSameDevice.vue | 31 +- src/pages/mobile/VaultSetupSameDeviceSync.vue | 40 +- src/pages/mobile/__tests__/AppBrowser.js | 72 ++- .../mobile/settingsSecurityCourseList.js | 19 +- src/popup.js | 51 +- src/router/index.js | 30 +- src/router/modals/index.js | 20 +- src/router/modals/mobile.js | 18 +- src/router/routes/common.js | 147 ++--- src/router/routes/desktop.js | 41 +- src/router/routes/mobile.js | 572 ++++++++++-------- src/router/utils.js | 21 +- src/service-worker.js | 29 +- src/store/index.js | 64 +- src/store/migrations/__tests__/runner.js | 30 +- src/store/migrations/runner.js | 14 +- src/store/modules/accounts/airGap.js | 171 +++--- src/store/modules/accounts/hdWallet.js | 132 ++-- src/store/modules/accounts/hdWalletRemote.js | 35 +- src/store/modules/accounts/index.js | 47 +- src/store/modules/accounts/ledger.js | 202 ++++--- src/store/modules/accounts/utils.js | 36 +- src/store/modules/mobile.js | 14 +- src/store/modules/root.js | 32 +- src/store/utils.js | 5 +- src/styles/variables.scss | 72 +-- tests/e2e/.eslintrc.js | 4 +- .../state-created-mnemonic-not-backup.json | 4 +- .../e2e/fixtures/state-created-mnemonic.json | 4 +- tests/e2e/fixtures/state-created.json | 72 +-- tests/e2e/fixtures/state-encrypted-test.json | 96 +-- tests/e2e/fixtures/state-encrypted.json | 96 +-- tests/e2e/specs/browser/index.cy.js | 12 +- tests/e2e/specs/intro.cy.js | 22 +- tests/e2e/specs/load-error.cy.js | 16 +- tests/e2e/specs/names/auctions.cy.js | 13 +- tests/e2e/specs/names/index.cy.js | 34 +- tests/e2e/specs/names/long-names.cy.js | 41 +- tests/e2e/specs/settings/index.cy.js | 12 +- tests/e2e/specs/settings/mnemonic.cy.js | 28 +- tests/e2e/specs/settings/network.cy.js | 19 +- tests/e2e/specs/settings/password.cy.js | 20 +- .../e2e/specs/settings/security-courses.cy.js | 8 +- tests/e2e/specs/transfer/index.cy.js | 20 +- tests/e2e/specs/transfer/send-coins.cy.js | 17 +- .../e2e/specs/transfer/sign-transaction.cy.js | 208 ++++--- .../specs/transfer/transaction-history.cy.js | 11 +- tests/e2e/support/commands.js | 190 +++--- tests/e2e/support/index.js | 27 +- tests/e2e/utils.js | 16 +- .../cordova-android-bridge-access/index.html | 74 ++- vue.config.js | 220 ++++--- 255 files changed, 3392 insertions(+), 4107 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index cfdfc58bf..498aa3a05 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -7,11 +7,7 @@ module.exports = { ENV_MOBILE_DEVICE: true, }, ignorePatterns: ['dist', 'platforms', 'plugins', 'www'], - extends: [ - 'plugin:vue/recommended', - 'plugin:@intlify/vue-i18n/recommended', - '@vue/airbnb', - ], + extends: ['plugin:vue/recommended', 'plugin:@intlify/vue-i18n/recommended', '@vue/airbnb'], rules: { 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', @@ -20,13 +16,16 @@ module.exports = { 'vue/block-spacing': 'error', 'vue/brace-style': 'error', 'vue/camelcase': ['error', { properties: 'never' }], - 'vue/comma-dangle': ['error', { - arrays: 'always-multiline', - objects: 'always-multiline', - imports: 'always-multiline', - exports: 'always-multiline', - functions: 'always-multiline', - }], + 'vue/comma-dangle': [ + 'error', + { + arrays: 'always-multiline', + objects: 'always-multiline', + imports: 'always-multiline', + exports: 'always-multiline', + functions: 'always-multiline', + }, + ], 'vue/component-name-in-template-casing': 'error', 'vue/eqeqeq': 'error', 'vue/key-spacing': 'error', @@ -50,18 +49,21 @@ module.exports = { parserOptions: { parser: '@babel/eslint-parser', }, - overrides: [{ - files: '**/__tests__/*', - env: { - jest: true, + overrides: [ + { + files: '**/__tests__/*', + env: { + jest: true, + }, }, - }, { - files: 'backend/**', - rules: { - 'import/no-extraneous-dependencies': ['error', { packageDir: 'backend' }], - 'import/extensions': ['error', 'ignorePackages'], + { + files: 'backend/**', + rules: { + 'import/no-extraneous-dependencies': ['error', { packageDir: 'backend' }], + 'import/extensions': ['error', 'ignorePackages'], + }, }, - }], + ], settings: { 'vue-i18n': { localeDir: './src/locales/*.json', diff --git a/.github/workflows/_validate-npm.yml b/.github/workflows/_validate-npm.yml index 3e99ec785..ca42544f4 100644 --- a/.github/workflows/_validate-npm.yml +++ b/.github/workflows/_validate-npm.yml @@ -5,25 +5,25 @@ jobs: build_test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - with: - ref: ${{ github.head_ref }} - - uses: actions/setup-node@v4 - with: - node-version: 20.x - cache: npm - - run: npm ci - working-directory: 'backend' - - run: npm test - working-directory: 'backend' - - run: npm ci --legacy-peer-deps # TODO: remove --legacy-peer-deps after updating dependencies - - run: docker compose up middleware -d --wait --quiet-pull - - run: ./docker-compose/init-state.mjs - - run: npm test - - uses: stefanzweifel/git-auto-commit-action@v5 - if: failure() - with: - commit_message: "fixme: update e2e screenshots" - file_pattern: 'tests/e2e/*.png' - - run: docker compose logs - if: always() + - uses: actions/checkout@v4 + with: + ref: ${{ github.head_ref }} + - uses: actions/setup-node@v4 + with: + node-version: 20.x + cache: npm + - run: npm ci + working-directory: 'backend' + - run: npm test + working-directory: 'backend' + - run: npm ci --legacy-peer-deps # TODO: remove --legacy-peer-deps after updating dependencies + - run: docker compose up middleware -d --wait --quiet-pull + - run: ./docker-compose/init-state.mjs + - run: npm test + - uses: stefanzweifel/git-auto-commit-action@v5 + if: failure() + with: + commit_message: 'fixme: update e2e screenshots' + file_pattern: 'tests/e2e/*.png' + - run: docker compose logs + if: always() diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 1cd74af1a..105476fcc 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -2,14 +2,14 @@ name: integration on: push: - branches: [ develop ] + branches: [develop] jobs: validate: uses: ./.github/workflows/_validate-npm.yml publish: uses: aeternity/github-actions/.github/workflows/_publish-ecr.yml@v2.3.1 - needs: [ validate ] + needs: [validate] secrets: inherit with: BUILD_ARGS: REVISION=${{ github.sha }} @@ -19,6 +19,6 @@ jobs: secrets: inherit with: DEPLOY_ENV: stg - DEPLOY_APP: "${{ github.event.repository.name }}" + DEPLOY_APP: '${{ github.event.repository.name }}' DEPLOY_VERSION: develop - DEPLOY_SUBDOMAIN: "base" + DEPLOY_SUBDOMAIN: 'base' diff --git a/.github/workflows/pull-request-cleanup.yml b/.github/workflows/pull-request-cleanup.yml index aee94cd6b..96f0f240d 100644 --- a/.github/workflows/pull-request-cleanup.yml +++ b/.github/workflows/pull-request-cleanup.yml @@ -2,8 +2,8 @@ name: pull-request-cleanup on: pull_request: - branches: [ master, develop ] - types: [ closed ] + branches: [master, develop] + types: [closed] jobs: rollback: @@ -12,14 +12,14 @@ jobs: with: DEPLOY_ENV: stg DEPLOY_APP: ${{ github.event.repository.name }} - DEPLOY_VERSION: "pr-${{ github.event.number }}" - DEPLOY_SUBDOMAIN: "pr-${{ github.event.number }}-base" + DEPLOY_VERSION: 'pr-${{ github.event.number }}' + DEPLOY_SUBDOMAIN: 'pr-${{ github.event.number }}-base' delete-tag: uses: aeternity/github-actions/.github/workflows/_delete-tag-ecr.yml@v2.3.1 secrets: inherit with: - TAG: "pr-${{ github.event.number }}" + TAG: 'pr-${{ github.event.number }}' cleanup: uses: aeternity/github-actions/.github/workflows/_cleanup-ecr.yml@v2.3.1 - needs: [ delete-tag ] + needs: [delete-tag] secrets: inherit diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index a6cdd7f4e..5f419823a 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -2,14 +2,14 @@ name: pull-request on: pull_request: - branches: [ master, develop ] + branches: [master, develop] jobs: validate: uses: ./.github/workflows/_validate-npm.yml publish: uses: aeternity/github-actions/.github/workflows/_publish-ecr.yml@v2.3.1 - needs: [ validate ] + needs: [validate] secrets: inherit with: BUILD_ARGS: REVISION=${{ github.sha }} @@ -20,5 +20,5 @@ jobs: with: DEPLOY_ENV: stg DEPLOY_APP: ${{ github.event.repository.name }} - DEPLOY_VERSION: "pr-${{ github.event.number }}" - DEPLOY_SUBDOMAIN: "pr-${{ github.event.number }}-base" + DEPLOY_VERSION: 'pr-${{ github.event.number }}' + DEPLOY_SUBDOMAIN: 'pr-${{ github.event.number }}-base' diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index ba85fcf53..8f5b8891b 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -2,7 +2,7 @@ name: release-please on: push: - branches: [ master ] + branches: [master] jobs: release-please: @@ -13,5 +13,5 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} release-type: node - package-name: "" + package-name: '' changelog-types: '[{"type":"feat","section":"Features","hidden":false},{"type":"fix","section":"Bug Fixes","hidden":false},{"type":"ci","section":"CI / CD","hidden":false},{"type":"test","section":"Testing","hidden":false},{"type":"refactor","section":"Refactorings","hidden":false},{"type":"chore","section":"Miscellaneous","hidden":false}]' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d6937d554..dcc2163f2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,7 +2,7 @@ name: release on: push: - tags: [ v* ] + tags: [v*] jobs: publish: diff --git a/README.md b/README.md index 451b56db2..f49179bf8 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@ ## How to get the Base æpp -* [Google Play](https://play.google.com/store/apps/details?id=com.aeternity.base) -* [App Store](https://apps.apple.com/app/base-æpp-wallet/id1458655724) -* [Web version](https://base.aepps.com/) +- [Google Play](https://play.google.com/store/apps/details?id=com.aeternity.base) +- [App Store](https://apps.apple.com/app/base-æpp-wallet/id1458655724) +- [Web version](https://base.aepps.com/) Also join our [Telegram channel](https://t.me/aeppbase) and our [Forum](https://forum.aeternity.com/t/base-aepp-wallet-we-would-like-your-feedback/3387). @@ -54,33 +54,40 @@ npm test ## Contributing We use the [gitflow](https://danielkummer.github.io/git-flow-cheatsheet/) workflow [this is also helpful](https://gist.github.com/JamesMGreene/cdd0ac49f90c987e45ac). -* Development of features happens in branches made from **develop** called feature/ like feature/show-token-balance. -* When development is finished a pull request to **develop** is created. At least one person has to review the PR and when everything is fine the PR gets merged. -* The develop branch gets deployed to the [stage environment](https://base.stg.aepps.com) by travis. -* To make a new release create a release branch called release/vX.X.X, also bump the version number in package.json in this branch. -* Create a PR to master which then also has to be accepted. -* Create a tag for this version and push the tag. -* Also merge back the changes (like the version bump) into develop. -* The master branch has to be deployed to the [production environment](https://base.aepps.com/) manually. + +- Development of features happens in branches made from **develop** called feature/ like feature/show-token-balance. +- When development is finished a pull request to **develop** is created. At least one person has to review the PR and when everything is fine the PR gets merged. +- The develop branch gets deployed to the [stage environment](https://base.stg.aepps.com) by travis. +- To make a new release create a release branch called release/vX.X.X, also bump the version number in package.json in this branch. +- Create a PR to master which then also has to be accepted. +- Create a tag for this version and push the tag. +- Also merge back the changes (like the version bump) into develop. +- The master branch has to be deployed to the [production environment](https://base.aepps.com/) manually. ## Deployment We have a stage (develop) and a production (master) branch and environments where these branches will be deployed to. -* [stage environment](https://base.stg.aepps.com) -* [production environment](https://base.aepps.com) + +- [stage environment](https://base.stg.aepps.com) +- [production environment](https://base.aepps.com) ### stage -* Is used to see changes to the code in effect in a "real" environment without the fear of breaking the production environment. + +- Is used to see changes to the code in effect in a "real" environment without the fear of breaking the production environment. ### production -* Is the production environment, code lives in the "master" branch. + +- Is the production environment, code lives in the "master" branch. ### other branches -* Every branch is auto-deployed on `https://pr--base.stg.aepps.com/`, where `` is a number of PR. + +- Every branch is auto-deployed on `https://pr--base.stg.aepps.com/`, where `` is a number of PR. ### unsigned .apk and .app file -* Find `aetenity.app.tar.gz` file in the [latest release](https://github.com/aeternity/aepp-base/releases/latest) -* Find `aeternity.apk` file in the [latest release](https://github.com/aeternity/aepp-base/releases/latest) + +- Find `aetenity.app.tar.gz` file in the [latest release](https://github.com/aeternity/aepp-base/releases/latest) +- Find `aeternity.apk` file in the [latest release](https://github.com/aeternity/aepp-base/releases/latest) ### bundle analyzer report -* Get bundle analyzer report on each domain by adding /report.html. Example [https://base.stg.aepps.com/report.html](https://base.stg.aepps.com/report.html). + +- Get bundle analyzer report on each domain by adding /report.html. Example [https://base.stg.aepps.com/report.html](https://base.stg.aepps.com/report.html). diff --git a/babel.config.js b/babel.config.js index ef06c2e6a..59c5a6e23 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,9 +1,4 @@ module.exports = { - presets: [ - '@vue/cli-plugin-babel/preset', - ], - plugins: [ - '@babel/plugin-syntax-import-attributes', - '@babel/plugin-transform-private-methods', - ], + presets: ['@vue/cli-plugin-babel/preset'], + plugins: ['@babel/plugin-syntax-import-attributes', '@babel/plugin-transform-private-methods'], }; diff --git a/backend/src/send-push-notification.js b/backend/src/send-push-notification.js index 620892256..b056d15e6 100644 --- a/backend/src/send-push-notification.js +++ b/backend/src/send-push-notification.js @@ -6,7 +6,8 @@ export default async (pushApiSubscription) => { } webPush.setVapidDetails( 'https://github.com/aeternity/aepp-base/issues', - process.env.VAPID_PUBLIC_KEY ?? 'BHkQhNWW2TKfKfxo7vAgXkZGcVOXGrjhIZJlN1hKp6abIjWJgO8FYPswXJ35XEuKw46O9yZ-8KmsZ4-TXNBePcw', + process.env.VAPID_PUBLIC_KEY ?? + 'BHkQhNWW2TKfKfxo7vAgXkZGcVOXGrjhIZJlN1hKp6abIjWJgO8FYPswXJ35XEuKw46O9yZ-8KmsZ4-TXNBePcw', process.env.VAPID_PRIVATE_KEY ?? 'mwSZbWF_yU_h1gXlqlBy9cOfkOF-Pa0jhHxbTFXdhFE', ); const subscription = JSON.parse(pushApiSubscription); diff --git a/backend/src/server.js b/backend/src/server.js index 58c67fb27..5428fbdcb 100644 --- a/backend/src/server.js +++ b/backend/src/server.js @@ -9,11 +9,15 @@ export default (port, log = () => {}) => { const server = http.createServer((request, response) => { if (request.url === '/version' && request.method === 'GET') { response.setHeader('Content-Type', 'application/json'); - const json = JSON.stringify({ - version: pkg.version, - revision: process.env.REVISION || 'local', - ...getStats(), - }, null, 2); + const json = JSON.stringify( + { + version: pkg.version, + revision: process.env.REVISION || 'local', + ...getStats(), + }, + null, + 2, + ); response.write(json); response.end(); return; @@ -53,19 +57,22 @@ export default (port, log = () => {}) => { io.on('connection', (socket) => { const { key, pushApiSubscription } = socket.handshake.auth; - socket.on('message-to-all', (message) => socket - .to(getGroupName(pushApiSubscription ? key : leaderKeys[key])) - .emit('message', message)); + socket.on('message-to-all', (message) => + socket.to(getGroupName(pushApiSubscription ? key : leaderKeys[key])).emit('message', message), + ); if (pushApiSubscription) { leaderMessages[key] ??= []; - leaderMessages[key].forEach((messageToLeader) => socket - .emit('message-from-follower', messageToLeader.key, messageToLeader.message)); - log([ - `Connected leader with key ${key}`, - `push api ${pushApiSubscription.slice(0, 30)}`, - `sent ${leaderMessages[key].length} offline messages`, - ].join(', ')); + leaderMessages[key].forEach((messageToLeader) => + socket.emit('message-from-follower', messageToLeader.key, messageToLeader.message), + ); + log( + [ + `Connected leader with key ${key}`, + `push api ${pushApiSubscription.slice(0, 30)}`, + `sent ${leaderMessages[key].length} offline messages`, + ].join(', '), + ); delete leaderMessages[key]; const groupName = getGroupName(key); @@ -104,8 +111,9 @@ export default (port, log = () => {}) => { fn(Object.fromEntries(entries)); }); - socket.on('message-to-follower', (fKey, message) => socket - .to(fKey).emit('message-from-leader', message)); + socket.on('message-to-follower', (fKey, message) => + socket.to(fKey).emit('message-from-leader', message), + ); socket.on('disconnect', () => { socket.to(getGroupName(key)).emit('leader-disconnected'); diff --git a/backend/src/server.tests.js b/backend/src/server.tests.js index de15d1224..b3b9dd0c2 100644 --- a/backend/src/server.tests.js +++ b/backend/src/server.tests.js @@ -1,6 +1,4 @@ -import { - describe, it, beforeEach, afterEach, -} from 'mocha'; +import { describe, it, beforeEach, afterEach } from 'mocha'; import { expect } from 'chai'; import socketIoClient from 'socket.io-client'; import createServer from './server.js'; @@ -35,17 +33,18 @@ afterEach(async () => { }); }); -const getEvent = (socket, eventName) => new Promise((resolve) => { - socket.once(eventName, (...args) => resolve(args)); -}); +const getEvent = (socket, eventName) => + new Promise((resolve) => { + socket.once(eventName, (...args) => resolve(args)); + }); -it('can\'t connect without key', async () => { +it("can't connect without key", async () => { const socket = io(); const [error] = await getEvent(socket, 'connect_error'); expect(error.message).to.be.equal('Key is missed'); }); -it('can\'t connect with the same key', async () => { +it("can't connect with the same key", async () => { io({ key: TEST_KEY }); const socket = io({ key: TEST_KEY }); const [error] = await getEvent(socket, 'connect_error'); diff --git a/cypress.config.js b/cypress.config.js index 15e4b938a..c160e9c44 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -11,9 +11,12 @@ module.exports = defineConfig({ fixturesFolder: 'tests/e2e/fixtures', screenshotsFolder: 'tests/e2e/screenshots', videosFolder: 'tests/e2e/videos', - env: process.env.CI === 'true' ? {} : { - pluginVisualRegressionImagesPath: '{spec_path}/__image_snapshots_local__', - }, + env: + process.env.CI === 'true' + ? {} + : { + pluginVisualRegressionImagesPath: '{spec_path}/__image_snapshots_local__', + }, e2e: { specPattern: 'tests/e2e/specs/**/*.cy.{js,jsx,ts,tsx}', supportFile: 'tests/e2e/support/index.js', diff --git a/docker-compose.yml b/docker-compose.yml index d066ed4c9..4226b6236 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,6 @@ services: middleware: - # TODO: use upstream after merging https://github.com/aeternity/ae_mdw/issues/1758 + # TODO: use upstream after merging https://github.com/aeternity/ae_mdw/issues/1758 image: davidyuk/temp:mdw-dev-mode-1.97.1-oas-fix ports: [4000:4000, 4001:4001, 3013:3013, 3313:3313] volumes: diff --git a/docker-compose/aeternity.yaml b/docker-compose/aeternity.yaml index c22942c3d..dc0c871b6 100644 --- a/docker-compose/aeternity.yaml +++ b/docker-compose/aeternity.yaml @@ -11,8 +11,8 @@ dev_mode: chain: persist: false hard_forks: - "1": 0 - "6": 1 + '1': 0 + '6': 1 genesis_accounts: ak_21A27UVVt3hDkBE5J7rhhqnH5YNb4Y1dqo4PnSybrH85pnWo7E: 1000000000000000000000000 diff --git a/docker-compose/init-state.mjs b/docker-compose/init-state.mjs index fbe36ea6e..eae9cfacd 100755 --- a/docker-compose/init-state.mjs +++ b/docker-compose/init-state.mjs @@ -2,8 +2,13 @@ import { execSync } from 'child_process'; import { - Node, AeSdk, MemoryAccount, generateSaveHDWalletFromSeed, getSaveHDWalletAccounts, - encode, Encoding, + Node, + AeSdk, + MemoryAccount, + generateSaveHDWalletFromSeed, + getSaveHDWalletAccounts, + encode, + Encoding, } from '@aeternity/aepp-sdk-next'; import { mnemonicToSeed } from '@aeternity/bip39'; @@ -11,7 +16,7 @@ import { mnemonicToSeed } from '@aeternity/bip39'; try { execSync( 'docker compose exec middleware ./bin/ae_mdw rpc ":aeplugin_dev_mode_app.start_unlink()"', - { stdio : 'pipe' }, + { stdio: 'pipe' }, ); } catch (error) { if (!error.message.includes('{:error, {:already_started')) throw error; @@ -25,11 +30,15 @@ await (async function rollbackToFirstBlock() { const aeSdk = new AeSdk({ nodes: [{ name: 'testnet', instance: new Node('http://localhost:3013') }], accounts: [ - new MemoryAccount('9ebd7beda0c79af72a42ece3821a56eff16359b6df376cf049aee995565f022f840c974b97164776454ba119d84edc4d6058a8dec92b6edc578ab2d30b4c4200'), + new MemoryAccount( + '9ebd7beda0c79af72a42ece3821a56eff16359b6df376cf049aee995565f022f840c974b97164776454ba119d84edc4d6058a8dec92b6edc578ab2d30b4c4200', + ), ], }); -const seed = mnemonicToSeed('cross cat upper state flame wire inner betray almost party agree endorse'); +const seed = mnemonicToSeed( + 'cross cat upper state flame wire inner betray almost party agree endorse', +); const wallet = generateSaveHDWalletFromSeed(seed, ''); const [{ secretKey }, { secretKey: secretKey2 }] = getSaveHDWalletAccounts(wallet, '', 2); const account1 = new MemoryAccount(secretKey); @@ -56,12 +65,16 @@ await (async function prepareNames() { await aeSdk.aensClaim('мир.chain', 0); await aeSdk.aensClaim('understanding.chain', 0, { onAccount: account1 }); await aeSdk.aensClaim('entertainment.chain', 0, { onAccount: account2 }); - await aeSdk.aensUpdate('entertainment.chain', { - 'account_pubkey': account2.address, - 'contract_pubkey': account1.address.replace('ak_', 'ct_'), - 'second account': account1.address, - 'raw': encode(Buffer.from('test'), Encoding.Bytearray), - }, { onAccount: account2 }); + await aeSdk.aensUpdate( + 'entertainment.chain', + { + account_pubkey: account2.address, + contract_pubkey: account1.address.replace('ak_', 'ct_'), + 'second account': account1.address, + raw: encode(Buffer.from('test'), Encoding.Bytearray), + }, + { onAccount: account2 }, + ); console.log('Names ready'); })(); diff --git a/jest.config.js b/jest.config.js index f7d08d284..696f07ac3 100644 --- a/jest.config.js +++ b/jest.config.js @@ -9,35 +9,25 @@ const packagesToTranspile = [ module.exports = { testEnvironment: 'jsdom', setupFiles: ['jest-canvas-mock', '/config/jest/globals.js'], - moduleFileExtensions: [ - 'js', - 'mjs', - 'jsx', - 'json', - 'vue', - ], + moduleFileExtensions: ['js', 'mjs', 'jsx', 'json', 'vue'], transform: { '^.+\\.vue$': '@vue/vue2-jest', '.+\\.(css|styl|less|sass|scss|png|jpg|svg|ttf|woff|woff2)$': 'jest-transform-stub', '^.+\\.m?jsx?$': 'babel-jest', }, - transformIgnorePatterns: [ - `node_modules/(?!(${packagesToTranspile.join('|')})/)`, - ], + transformIgnorePatterns: [`node_modules/(?!(${packagesToTranspile.join('|')})/)`], moduleNameMapper: { '^.*\\.svg\\?icon-component$': '/config/jest/EmptySvg.vue', // https://github.com/jestjs/jest/issues/10422 - '^@swagger-api/apidom-reference/parse/parsers/binary$': '@swagger-api/apidom-reference/cjs/parse/parsers/binary/index-browser.cjs', - '^@swagger-api/apidom-reference/(.*)/strategies/openapi-3-1$': '@swagger-api/apidom-reference/cjs/$1/strategies/openapi-3-1/index.cjs', - '^@swagger-api/apidom-reference/dereference/strategies/openapi-3-1/selectors/(.*)$': '@swagger-api/apidom-reference/cjs/dereference/strategies/openapi-3-1/selectors/$1/index.cjs', + '^@swagger-api/apidom-reference/parse/parsers/binary$': + '@swagger-api/apidom-reference/cjs/parse/parsers/binary/index-browser.cjs', + '^@swagger-api/apidom-reference/(.*)/strategies/openapi-3-1$': + '@swagger-api/apidom-reference/cjs/$1/strategies/openapi-3-1/index.cjs', + '^@swagger-api/apidom-reference/dereference/strategies/openapi-3-1/selectors/(.*)$': + '@swagger-api/apidom-reference/cjs/dereference/strategies/openapi-3-1/selectors/$1/index.cjs', '^@swagger-api/apidom-reference/(.*)$': '@swagger-api/apidom-reference/cjs/$1.cjs', }, - snapshotSerializers: [ - 'jest-serializer-vue', - ], - testMatch: [ - '**/tests/unit/**/*.spec.(js|jsx|ts|tsx)', - '**/__tests__/*.(js|jsx|ts|tsx)', - ], + snapshotSerializers: ['jest-serializer-vue'], + testMatch: ['**/tests/unit/**/*.spec.(js|jsx|ts|tsx)', '**/__tests__/*.(js|jsx|ts|tsx)'], testURL: 'http://localhost/', }; diff --git a/public/.well-known/assetlinks.json b/public/.well-known/assetlinks.json index ed1f9f077..db62fb6cb 100644 --- a/public/.well-known/assetlinks.json +++ b/public/.well-known/assetlinks.json @@ -1,8 +1,6 @@ [ { - "relation": [ - "delegate_permission/common.handle_all_urls" - ], + "relation": ["delegate_permission/common.handle_all_urls"], "target": { "namespace": "android_app", "package_name": "com.aeternity.base", diff --git a/public/index.html b/public/index.html index d0bbcceae..5bb9ba692 100644 --- a/public/index.html +++ b/public/index.html @@ -1,17 +1,23 @@ - + - - + + Base æpp - - - - + + + + - - + + - - - <% googleFontsUrl = 'https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@300;400;500;600;700&family=Inter:wght@400;500;600;700&display=swap' %> - - + + + <% googleFontsUrl = + 'https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@300;400;500;600;700&family=Inter:wght@400;500;600;700&display=swap' + %> + + @@ -44,8 +59,7 @@ @@ -59,10 +73,11 @@ return; } - document.body.innerHTML = '

' - + 'Base app has failed to run in this browser.' - + '

'; - } + document.body.innerHTML = + '

' + + 'Base app has failed to run in this browser.' + + '

'; + }; <% if (process.env.VUE_APP_CORDOVA) { %> diff --git a/src/App.vue b/src/App.vue index 235f80455..0d92102cf 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,9 +1,6 @@ - + {{ $globals.ENV_MOBILE_DEVICE ? $t('transfer.send.to.paste') : '' }} - + {{ $globals.ENV_MOBILE_DEVICE ? $t('transfer.send.to.scan') : '' }} @@ -80,9 +73,7 @@ const ADDRESS_PREFIX = 'ak_'; const FORMATTED_ADDRESS_REGEXP = /^ak_[1-9A-HJ-NP-Za-km-z ]+$/; const NOT_BASE58_CHARS = /[^1-9A-HJ-NP-Za-km-z]/g; const formatAddress = (address) => { - let res = address - .slice(ADDRESS_PREFIX.length) - .replace(NOT_BASE58_CHARS, ''); + let res = address.slice(ADDRESS_PREFIX.length).replace(NOT_BASE58_CHARS, ''); if (!res) return ADDRESS_PREFIX; @@ -143,9 +134,11 @@ export default { }, }), subscriptions() { - return !ENV_MOBILE_DEVICE && { - accounts: this.$store.state.observables.inactiveAccounts, - }; + return ( + !ENV_MOBILE_DEVICE && { + accounts: this.$store.state.observables.inactiveAccounts, + } + ); }, methods: { setValue(newValue) { @@ -157,17 +150,21 @@ export default { this.showAccountsDropdown = false; }, async readValueFromQrCode() { - this.setValue(await this.$store.dispatch('modals/open', { - name: 'readQrCode', - title: this.$t('transfer.send.to.scan-address'), - })); + this.setValue( + await this.$store.dispatch('modals/open', { + name: 'readQrCode', + title: this.$t('transfer.send.to.scan-address'), + }), + ); }, async readValueFromClipboard() { - this.setValue(await (process.env.VUE_APP_CORDOVA - ? new Promise((...args) => { - window.cordova.plugins.clipboard.paste(...args); - }) - : navigator.clipboard.readText())); + this.setValue( + await (process.env.VUE_APP_CORDOVA + ? new Promise((...args) => { + window.cordova.plugins.clipboard.paste(...args); + }) + : navigator.clipboard.readText()), + ); }, }, }; @@ -178,6 +175,6 @@ export default { .ae-input-address .ae-identicon { height: functions.rem(20px); - vertical-align: -.4em; + vertical-align: -0.4em; } diff --git a/src/components/AeInputAmount.vue b/src/components/AeInputAmount.vue index 3c95f8709..fced61a99 100644 --- a/src/components/AeInputAmount.vue +++ b/src/components/AeInputAmount.vue @@ -1,18 +1,7 @@ diff --git a/src/components/Page.vue b/src/components/Page.vue index 3c0f4d0d2..6df834bbe 100644 --- a/src/components/Page.vue +++ b/src/components/Page.vue @@ -14,10 +14,7 @@ -
+
@@ -49,25 +46,13 @@ export default { props: { headerFill: { type: String, - validator: (value) => [ - 'primary', - 'alternative', - 'neutral', - 'dark', - 'light', - '', - ].includes(value), + validator: (value) => + ['primary', 'alternative', 'neutral', 'dark', 'light', ''].includes(value), default: '', }, fill: { type: String, - validator: (value) => [ - 'primary', - 'alternative', - 'neutral', - 'dark', - 'light', - ].includes(value), + validator: (value) => ['primary', 'alternative', 'neutral', 'dark', 'light'].includes(value), default: 'light', }, hideTabBar: Boolean, @@ -78,11 +63,16 @@ export default { await new Promise((resolve) => { document.addEventListener('deviceready', resolve); }); - this.$watch(({ headerFill, fill }) => headerFill || fill, (fill) => { - const style = ['primary', 'alternative', 'dark'] - .includes(fill) ? 'LightContent' : 'Default'; - window.StatusBar[`style${style}`](); - }, { immediate: true }); + this.$watch( + ({ headerFill, fill }) => headerFill || fill, + (fill) => { + const style = ['primary', 'alternative', 'dark'].includes(fill) + ? 'LightContent' + : 'Default'; + window.StatusBar[`style${style}`](); + }, + { immediate: true }, + ); this.$once('hook:destroyed', () => window.StatusBar.styleDefault()); } }, @@ -171,7 +161,8 @@ export default { } > { - h2, p { + h2, + p { @extend %face-sans-s; } diff --git a/src/components/PageHeader.vue b/src/components/PageHeader.vue index a288ad6d7..572eee919 100644 --- a/src/components/PageHeader.vue +++ b/src/components/PageHeader.vue @@ -1,8 +1,5 @@