From f402011c8287ef36a70dfd80021d26c2dc58b607 Mon Sep 17 00:00:00 2001 From: Danny Coates Date: Thu, 10 Jan 2019 16:22:40 -0800 Subject: [PATCH] use custom elements instead of adding css classes for selectors --- app/ui/account.js | 8 ++++---- app/ui/archiveTile.js | 31 ++++++++++++++++-------------- app/ui/copyDialog.js | 6 ++++-- app/ui/intro.js | 4 ++-- app/ui/modal.js | 4 ++-- app/ui/okDialog.js | 4 ++-- app/ui/promo.js | 4 ++-- app/ui/signupDialog.js | 4 ++-- test/integration/download-tests.js | 7 +++---- 9 files changed, 38 insertions(+), 34 deletions(-) diff --git a/app/ui/account.js b/app/ui/account.js index da96a09c..3ddbd83a 100644 --- a/app/ui/account.js +++ b/app/ui/account.js @@ -62,18 +62,18 @@ class Account extends Component { const translate = this.state.translate; if (!this.local.loggedIn) { return html` -
+ -
+ `; } return html` -
+ -
+ `; } } diff --git a/app/ui/archiveTile.js b/app/ui/archiveTile.js index 79886d3d..ccfef97a 100644 --- a/app/ui/archiveTile.js +++ b/app/ui/archiveTile.js @@ -96,7 +96,7 @@ function password(state) { function fileInfo(file, action) { return html` -
+

${file.name}

@@ -106,7 +106,7 @@ function fileInfo(file, action) {

${action} -
`; + `; } function archiveDetails(translate, archive) { @@ -141,7 +141,7 @@ function archiveDetails(translate, archive) { module.exports = function(state, emit, archive) { return html` -

@@ -168,7 +168,7 @@ module.exports = function(state, emit, archive) { ${state.translate('copyUrlHover')} -

`; + `; function copy(event) { event.stopPropagation(); @@ -189,7 +189,10 @@ module.exports = function(state, emit, archive) { module.exports.wip = function(state, emit) { return html` -
+ ${ list( Array.from(state.archive.files) @@ -231,7 +234,7 @@ module.exports.wip = function(state, emit) { > ${state.translate('uploadFilesButton')} -
+ `; function upload(event) { @@ -281,7 +284,7 @@ module.exports.uploading = function(state, emit) { const progressPercent = percent(progress); const archive = state.archive; return html` -

@@ -305,7 +308,7 @@ module.exports.uploading = function(state, emit) { onclick=${cancel}> ${state.translate('uploadingPageCancel')} -

`; + `; function cancel(event) { event.stopPropagation(); @@ -316,7 +319,7 @@ module.exports.uploading = function(state, emit) { module.exports.empty = function(state, emit) { return html` -
+

${archive.name}

@@ -384,7 +387,7 @@ module.exports.preview = function(state, emit) { onclick=${download}> ${state.translate('downloadButtonLabel')} -
`; + `; function download(event) { event.preventDefault(); @@ -398,7 +401,7 @@ module.exports.downloading = function(state, emit) { const progress = state.transfer.progressRatio; const progressPercent = percent(progress); return html` -
+

${archive.name}

@@ -414,7 +417,7 @@ module.exports.downloading = function(state, emit) { onclick=${cancel}> ${state.translate('downloadCancel')} -
`; + `; function cancel(event) { event.preventDefault(); diff --git a/app/ui/copyDialog.js b/app/ui/copyDialog.js index 99df32ab..cc4586f8 100644 --- a/app/ui/copyDialog.js +++ b/app/ui/copyDialog.js @@ -4,7 +4,9 @@ const { copyToClipboard } = require('../utils'); module.exports = function(name, url) { return function(state, emit, close) { return html` -
+

${state.translate('notifyUploadDone')}

${state.translate('copyUrlFormLabelWithName', { filename: name })} @@ -25,7 +27,7 @@ module.exports = function(name, url) { ${state.translate('okButton')} -

+ `; function copy(event) { diff --git a/app/ui/intro.js b/app/ui/intro.js index 0594c5a1..35316797 100644 --- a/app/ui/intro.js +++ b/app/ui/intro.js @@ -3,7 +3,7 @@ const assets = require('../../common/assets'); module.exports = function intro(state) { return html` -
+

${state.translate( @@ -18,5 +18,5 @@ module.exports = function intro(state) { 'uploadPageExplainer' )}

-
`; + `; }; diff --git a/app/ui/modal.js b/app/ui/modal.js index 67e90661..df10ae77 100644 --- a/app/ui/modal.js +++ b/app/ui/modal.js @@ -2,7 +2,7 @@ const html = require('choo/html'); module.exports = function(state, emit) { return html` -
@@ -14,7 +14,7 @@ module.exports = function(state, emit) { ${state.modal(state, emit, close)}
- + `; function close(event) { diff --git a/app/ui/okDialog.js b/app/ui/okDialog.js index f76d9439..d8962791 100644 --- a/app/ui/okDialog.js +++ b/app/ui/okDialog.js @@ -3,7 +3,7 @@ const html = require('choo/html'); module.exports = function(message) { return function(state, emit, close) { return html` -
+
${message}
-
+ `; }; }; diff --git a/app/ui/promo.js b/app/ui/promo.js index de9d5fc6..13059a32 100644 --- a/app/ui/promo.js +++ b/app/ui/promo.js @@ -13,7 +13,7 @@ class Promo extends Component { createElement() { return html` -
@@ -31,7 +31,7 @@ class Promo extends Component { >
-
+ `; } } diff --git a/app/ui/signupDialog.js b/app/ui/signupDialog.js index 2587288c..489d5536 100644 --- a/app/ui/signupDialog.js +++ b/app/ui/signupDialog.js @@ -8,7 +8,7 @@ module.exports = function() { document.getElementById('email-input').focus(); }); return html` -
+

${state.translate('accountBenefitTitle')}

    @@ -40,7 +40,7 @@ module.exports = function() { title="${state.translate('deletePopupCancel')}" onclick=${close}>${state.translate('deletePopupCancel')} -
`; + `; function emailish(str) { if (!str) { diff --git a/test/integration/download-tests.js b/test/integration/download-tests.js index 908cb29c..b20e77b1 100644 --- a/test/integration/download-tests.js +++ b/test/integration/download-tests.js @@ -36,7 +36,6 @@ describe('Firefox Send', function() { }); it('should update the download count on home page after 1 download', function() { - const expectedExpiresAfterText = 'Expires after 1 download'; browser.chooseFile( homePage.uploadInput, `${testFilesPath}/${testFiles[0]}` @@ -51,10 +50,10 @@ describe('Firefox Send', function() { downloadPage.download(); browser.waitForExist(downloadPage.downloadComplete); browser.back(); - browser.waitForExist(`#archive-${downloadPage.fileId}`); + browser.waitForExist('send-archive'); assert.equal( - browser.getText(`#archive-${downloadPage.fileId} > div`).substring(0, 24), - expectedExpiresAfterText + browser.getText('send-archive > div').substring(0, 24), + 'Expires after 1 download' ); }); });