Skip to content

Commit

Permalink
Merge branch 'develop' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
mradkov authored Apr 24, 2020
2 parents 43fe240 + cb66adc commit dd98031
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 60 deletions.
2 changes: 1 addition & 1 deletion src/popup/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@
"edit": "Edit Tip Details",
"whatIsVerifieddUrl": "What is \"Verified\" URL?",
"whatIsNotVerifiedUrl": "What is \"Not verified\" URL?",
"enterUrl": "Enter tip url",
"enterUrl": "Type the URL you want to tip",
"notClaimableUrlInfo": "Third party issues prevent us to ensure that tips will be directly delivered to the URL owner. You are sending the tip at your own risk.",
"notVerifiedUrlInfo": "This URL has not yet been verified. The owner of the URL has to create account to claim their tokens.",
"verifiedUrlInfo": "If a URL is marked as verified, it means the owner of this URL is already a fellow Superhero — and that is awesome! An AE address has been included in the URL and tips can be claimed.",
Expand Down
2 changes: 1 addition & 1 deletion src/popup/router/components/ClaimTips.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default {
throw new Error(this.$t('pages.claim.unknownError'));
else throw new Error(error);
});
await axios.post(`${BACKEND_URL}/cache/invalidate/tip`).catch();
await axios.post(`${BACKEND_URL}/cache/invalidate/tips`).catch();
await axios.post(`${BACKEND_URL}/cache/invalidate/oracle`).catch();
this.$emit('setLoading', false);
this.$store.dispatch('modals/open', { name: 'claim-success', url: tab.url, claimAmount });
Expand Down
6 changes: 4 additions & 2 deletions src/popup/router/components/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,10 @@ export default {
}
.title {
margin-left: auto;
margin-right: auto;
position: absolute;
left: 0;
right: 0;
text-align: center;
font-weight: 500;
}
Expand Down
1 change: 1 addition & 0 deletions src/popup/router/components/Tour.vue
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ export default {
bottom: 0;
left: 0;
right: 0;
z-index: 6;
height: 44px;
cursor: pointer;
Expand Down
2 changes: 1 addition & 1 deletion src/popup/router/components/TransactionItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<span data-cy="amount">{{ txAmount }}</span>
{{ $t('pages.appVUE.aeid') }}
<span class="text" data-cy="currency-amount">
( {{ txAmountToCurrency }} {{ current.currency.toUpperCase() }} )
({{ txAmountToCurrency }} {{ current.currency.toUpperCase() }})
</span>
</span>
<span class="status">{{ status }}</span>
Expand Down
4 changes: 1 addition & 3 deletions src/popup/router/pages/Retip.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
<div class="popup">
<div class="primary-title title-holder">
<div>
{{ $t('pages.tipPage.heading') }}
<span class="secondary-text">{{ $t('pages.appVUE.aeid') }}</span>
{{ $t('pages.tipPage.to') }}
{{ $t('pages.tipPage.url') }}
</div>
<UrlBadge v-if="tip.url" :type="urlVerified ? 'verified' : 'not-verified'" />
</div>
Expand Down
22 changes: 10 additions & 12 deletions src/popup/router/pages/TipPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
</template>
<template v-else>
{{ $t('pages.tipPage.headingSending') }}
<span class="secondary-text" data-cy="tip-amount"
>{{ amount }} {{ $t('pages.appVUE.aeid') }}</span
>
<span class="secondary-text" data-cy="tip-amount">
{{ amount }} {{ $t('pages.appVUE.aeid') }}
</span>
({{ currencyAmount }} {{ currentCurrency }}) {{ $t('pages.tipPage.to') }}
</template>
</p>
Expand All @@ -25,14 +25,11 @@
</template>
<Input
v-else
size="m-0 xsm"
size="m-0 sm"
v-model="url"
:error="url && !validUrl"
:placeholder="$t('pages.tipPage.enterUrl')"
/>
<button v-if="!confirmMode && !editUrl" @click="editUrl = !editUrl" data-cy="edit-url">
<EditIcon v-if="!editUrl" data-cy="confirm-url" />
</button>
</div>
</div>
<div class="popup" data-cy="tip-container">
Expand Down Expand Up @@ -60,7 +57,7 @@
<Button @click="sendTip" :disabled="!tipping" data-cy="confirm-tip">
{{ $t('pages.tipPage.confirm') }}
</Button>
<Button @click="confirmMode = false" data-cy="edit-tip">
<Button @click="toEdit" data-cy="edit-tip">
{{ $t('pages.tipPage.edit') }}
</Button>
</template>
Expand All @@ -80,7 +77,6 @@ import {
getTwitterAccountUrl,
validateUrl,
} from '../../utils/helper';
import EditIcon from '../../../icons/edit-icon.svg?vue-component';
import AmountSend from '../components/AmountSend';
import Textarea from '../components/Textarea';
import Input from '../components/Input';
Expand All @@ -90,7 +86,6 @@ export default {
components: {
AmountSend,
Textarea,
EditIcon,
Input,
UrlBadge,
},
Expand All @@ -104,7 +99,7 @@ export default {
noteError: false,
loading: false,
minCallFee: null,
editUrl: false,
editUrl: true,
verifiedUrls: [],
IS_EXTENSION: process.env.IS_EXTENSION,
RUNNING_IN_TESTS: process.env.RUNNING_IN_TESTS,
Expand Down Expand Up @@ -171,7 +166,6 @@ export default {
// if mobile
if (!this.IS_EXTENSION && !this.RUNNING_IN_TESTS) {
this.url = '';
this.editUrl = true;
}
try {
this.verifiedUrls = (await axios.get(`${BACKEND_URL}/verified`)).data;
Expand Down Expand Up @@ -249,6 +243,10 @@ export default {
this.loading = false;
}
},
toEdit() {
this.confirmMode = false;
this.editUrl = true;
},
},
};
</script>
Expand Down
53 changes: 27 additions & 26 deletions src/redirect/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,35 +30,10 @@ export default {
};
</script>

<style>
<style lang="scss">
body,
html {
background: #16161d !important;
color: #fff;
}
.logo {
margin-bottom: 25px;
}
p {
font-size: 20px;
}
.loader {
border: 8px solid #f3f3f3; /* Light grey */
border-top: 8px solid #ccc; /* Blue */
border-radius: 50%;
width: 70px;
height: 70px;
animation: spin 2s linear infinite;
margin: 0 auto;
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
#info {
Expand All @@ -69,5 +44,31 @@ p {
transform: translate(-50%, -50%);
-webkit-transform: translate(-50%, -50%);
text-align: center;
color: #fff;
.logo {
margin-bottom: 25px;
}
p {
font-size: 20px;
}
.loader {
border: 8px solid #f3f3f3; /* Light grey */
border-top: 8px solid #ccc; /* Blue */
border-radius: 50%;
width: 70px;
height: 70px;
animation: spin 2s linear infinite;
margin: 0 auto;
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
}
</style>
17 changes: 5 additions & 12 deletions tests/e2e/integration/tip.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const tip = { amount: 0.01, note: '#test', url: 'example.com', edit: true };
const tip2 = { amount: 0.01, note: '#test1234', url: 'example.com', onTip: true, edit: true };
const tip = { amount: 0.01, note: '#test', url: 'example.com' };
const tip2 = { amount: 0.01, note: '#test1234', url: 'example.com', onTip: true };

describe('Test cases for tip page', () => {
beforeEach(() => {
Expand All @@ -21,7 +21,7 @@ describe('Test cases for tip page', () => {
cy.openTip()
.get('[data-cy=send-tip]')
.should('be.visible')
.get('[data-cy=tip-url]')
.get('.url-bar')
.should('exist')
.get('[data-cy=textarea]')
.should('be.visible')
Expand All @@ -35,7 +35,7 @@ describe('Test cases for tip page', () => {
it('Validate tip details', () => {
cy.openTip()
.buttonShouldBeDisabled('[data-cy=send-tip]')
.enterTipDetails({ url: tip.url, edit: true })
.enterTipDetails({ url: tip.url })
.buttonShouldBeDisabled('[data-cy=send-tip]')
.enterTipDetails({ amount: tip.amount })
.buttonShouldBeDisabled('[data-cy=send-tip]')
Expand All @@ -49,7 +49,7 @@ describe('Test cases for tip page', () => {
.buttonShouldBeDisabled('[data-cy=send-tip]')
.enterTipDetails({ amount: 0, note: tip.note })
.buttonShouldBeDisabled('[data-cy=send-tip]')
.enterTipDetails({ ...tip, edit: false })
.enterTipDetails({ ...tip })
.buttonShouldNotBeDisabled('[data-cy=send-tip]');
});

Expand All @@ -64,13 +64,6 @@ describe('Test cases for tip page', () => {
.should('have.value', tip.note);
});

it('Edit url disable button', () => {
cy.openTip()
.get('[data-cy=edit-url]')
.click()
.buttonShouldBeDisabled('[data-cy=send-tip]');
});

it('Valid tip details open confirm', () => {
cy.toConfirmTip({ ...tip });
});
Expand Down
3 changes: 1 addition & 2 deletions tests/e2e/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ Cypress.Commands.add('openWithdraw', () => {
.click();
});

Cypress.Commands.add('enterTipDetails', ({ url = '', amount = null, note = '', edit = false }) => {
Cypress.Commands.add('enterTipDetails', ({ url = '', amount = null, note = '' }) => {
cy.get('[data-cy=input-number]').clear();
if (amount || amount === 0) {
cy.get('[data-cy=input-number]').type(amount);
Expand All @@ -191,7 +191,6 @@ Cypress.Commands.add('enterTipDetails', ({ url = '', amount = null, note = '', e
cy.get('[data-cy=textarea]').clear();
if (note) cy.get('[data-cy=textarea]').type(note);

if (edit) cy.get('[data-cy=edit-url]').click();
if (url) {
cy.get('[data-cy=input]')
.clear()
Expand Down

1 comment on commit dd98031

@davidyuk
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.