Skip to content

Commit

Permalink
fix: make peer id visibility toggle icon responsive to small resolutions
Browse files Browse the repository at this point in the history
Merge pull request ambianic#514 from vickywane/updates/mask-peerid
  • Loading branch information
Ivelin Ivanov authored Feb 8, 2021
2 parents 6e972c4 + 3aea4a0 commit 1bba341
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 25 deletions.
28 changes: 26 additions & 2 deletions cypress/integration/ambianic-tests/remote-connection.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@

/// <reference types="cypress" />

context('RemoteConnections', () => {
const checkViewPort = (cy, device) => {
cy.viewport(device)
cy.get('#toggle-visibility').should('be.visible')
cy.get('#peerId-container').should('be.visible')
}

context('RemoteConnections', () => {
beforeEach(() => {
cy.visit('http://localhost:8080/settings')
})
Expand All @@ -28,4 +34,22 @@ context('RemoteConnections', () => {
cy.get('#toggle-visibility').click()
cy.get('#peerId-container').should('have.value', '917d5f0a-6469-4d33-b5c2-efd858118b74')
})
})

it('Displays elements in smaller viewports', () => {
cy.get('#remotePeerID').type('917d5f0a-6469-4d33-b5c2-efd858118b74')
cy.get('#btn-sendRemotePeerID').click()

// ensure elements are shown on smaller viewports
checkViewPort(cy, 'iphone-5')
checkViewPort(cy, 'iphone-6')
checkViewPort(cy, 'samsung-s10')
checkViewPort(cy, 'samsung-note9')
checkViewPort(cy, 'iphone-x')
checkViewPort(cy, 'iphone-xr')

checkViewPort(cy, 'ipad-mini')
checkViewPort(cy, 'ipad-2')
checkViewPort(cy, 'macbook-11')
checkViewPort(cy, 'macbook-13')
})
})
41 changes: 22 additions & 19 deletions src/components/shared/ListItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
</v-icon>
</v-list-item-icon>
<v-list-item-content v-if="sensitiveField">
<div style="display : flex; justify-content: space-between">
<div style="display : flex; flex-direction: column">
<v-row dense>
<v-col>
<v-list-item-title class="headline">
<input
:value="title"
:placeholder="title"
disabled
style="color: #000;"
id="peerId-container"
:type="sensitive ? 'password' : 'text'"
>
Expand All @@ -24,24 +25,26 @@
{{ subtitle }}
</v-list-item-subtitle>
</div>
</div>
</v-col>

<v-icon
style="padding-bottom: 15px"
v-if="sensitive"
id="toggle-visibility"
@click="sensitive = false"
>
mdi-eye
</v-icon>
<v-icon
style="padding-bottom: 15px"
v-else
@click="sensitive = true"
>
mdi-eye-off-outline
</v-icon>
</div>
<v-col>
<v-icon
style="padding-bottom: 14px"
v-if="sensitive"
id="toggle-visibility"
@click="sensitive = false"
>
mdi-eye
</v-icon>
<v-icon
style="padding-bottom: 15px"
v-else
@click="sensitive = true"
>
mdi-eye-off-outline
</v-icon>
</v-col>
</v-row>
</v-list-item-content>

<v-list-item-content v-else>
Expand Down
7 changes: 3 additions & 4 deletions src/views/Onboarding.vue
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,7 @@

<div class="message-container">
<v-card-text class="step-text">
Hi Blob, please send me an access invitation to your
Ambianic Edge Device.
{{ invitationMessage }}
<br>
</v-card-text>
</div>
Expand Down Expand Up @@ -620,6 +619,7 @@ export default {
stepLevel: localStorage.getItem('lastOnboardingStage') || 1,
stepContentName: localStorage.getItem('lastOnboardingStep') || '',
isInstallingApp: false,
invitationMessage: 'Hi ____, please send me an access invitation to your Ambianic Edge Device.',
appInstallationComplete: false,
completedSteps: [],
sendRequestDialog: false,
Expand Down Expand Up @@ -693,8 +693,7 @@ export default {
if (navigator.share) {
navigator.share({
title: 'Ambianic Edge Device Access Request',
text:
'Hi Blob, please send me an access invitation to your Ambianic Edge Device'
text: this.invitationMessage
})
} else {
this.sendRequestDialog = state
Expand Down

0 comments on commit 1bba341

Please sign in to comment.