From 2fc61d2c96f30d7f9beb49a60d9b3511fe9ffa3f Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Tue, 17 Nov 2020 09:09:04 +1100 Subject: [PATCH] cleanup expired template from html files --- background.html | 10 ----- background_test.html | 10 ----- js/views/inbox_view.js | 77 --------------------------------- stylesheets/_global.scss | 21 --------- stylesheets/_theme_dark.scss | 21 --------- test/index.html | 4 +- test/views/inbox_view_test.js | 68 ----------------------------- ts/state/ducks/conversations.ts | 3 +- 8 files changed, 2 insertions(+), 212 deletions(-) delete mode 100644 js/views/inbox_view.js delete mode 100644 test/views/inbox_view_test.js diff --git a/background.html b/background.html index 4a26917c6..fda485b7b 100644 --- a/background.html +++ b/background.html @@ -34,15 +34,6 @@ - - - - diff --git a/background_test.html b/background_test.html index 5bf9defd6..2bd814539 100644 --- a/background_test.html +++ b/background_test.html @@ -35,15 +35,6 @@ - - - - diff --git a/js/views/inbox_view.js b/js/views/inbox_view.js deleted file mode 100644 index 825f7f7ae..000000000 --- a/js/views/inbox_view.js +++ /dev/null @@ -1,77 +0,0 @@ -/* - global - ConversationController, - extension, - ConversationController - getInboxCollection, - i18n, - Whisper, -*/ - -// eslint-disable-next-line func-names -(function() { - 'use strict'; - - window.Whisper = window.Whisper || {}; - - Whisper.InboxViewWhisper = Whisper.View.extend({ - templateName: 'two-column', - className: 'inbox index', - initialize(options = {}) { - this.ready = false; - this.render(); - this.$el.attr('tabindex', '1'); - // ConversationCollection - - extension.expired(expired => { - if (expired) { - const banner = new Whisper.ExpiredAlertBanner().render(); - banner.$el.prependTo(this.$el); - this.$el.addClass('expired'); - } - }); - - this.openSettings = this.openSettings.bind(this); - this.openSessionConversation = this.openSessionConversation.bind(this); - // FIXME: Fix this for new react views - this.setupLeftPane(); - }, - - onEmpty() { - const view = this.appLoadingScreen; - if (view) { - this.appLoadingScreen = null; - view.remove(); - } - }, - async openConversation(id, messageId) { - // If we call this to create a new conversation, it can only be private - // (group conversations are created elsewhere) - const conversation = await ConversationController.getOrCreateAndWait( - id, - 'private' - ); - - if (this.openConversationAction) { - this.openConversationAction(id, messageId); - } - - if (conversation) { - conversation.updateProfileName(); - } - - this.open(conversation); - }, - }); - - Whisper.ExpiredAlertBanner = Whisper.View.extend({ - templateName: 'expired_alert', - className: 'expiredAlert', - render_attributes() { - return { - expiredWarning: i18n('expiredWarning'), - upgrade: i18n('upgrade'), - }; - }, - }); -})(); diff --git a/stylesheets/_global.scss b/stylesheets/_global.scss index 9d742c87f..3013d62e4 100644 --- a/stylesheets/_global.scss +++ b/stylesheets/_global.scss @@ -251,27 +251,6 @@ $loading-height: 16px; } } -.expiredAlert { - background: #f3f3a7; - padding: 10px; - - button { - float: right; - border: none; - border-radius: $border-radius; - color: white; - font-weight: bold; - line-height: 36px; - padding: 0 20px; - background: $blue; - margin-inline-start: 20px; - } - - .message { - padding: 10px 0; - } -} - @keyframes loading { 50% { transform: scale(1); diff --git a/stylesheets/_theme_dark.scss b/stylesheets/_theme_dark.scss index e541285b3..9e955a5cb 100644 --- a/stylesheets/_theme_dark.scss +++ b/stylesheets/_theme_dark.scss @@ -121,27 +121,6 @@ } } - // banner shown when app version expired and must be updated - .expiredAlert { - background: $session-color-green; - color: black; - /* biggest we can make the font without wrapping the current text at minimum app width */ - font-family: $session-font-accent; - font-size: 16px; - height: 60px; - - span { - line-height: 45px; - } - - button { - font-size: 14px; - height: 36px; - color: white; - background: #474646; - } - } - .tool-bar { color: $color-dark-05; diff --git a/test/index.html b/test/index.html index 44eda5088..e33c22085 100644 --- a/test/index.html +++ b/test/index.html @@ -215,11 +215,10 @@ - - + @@ -240,7 +239,6 @@ - diff --git a/test/views/inbox_view_test.js b/test/views/inbox_view_test.js deleted file mode 100644 index 18a411e60..000000000 --- a/test/views/inbox_view_test.js +++ /dev/null @@ -1,68 +0,0 @@ -/* global storage, libsignal, ConversationController, textsecure, Whisper */ - -describe('InboxView', () => { - let inboxView; - let conversation; - let identityKey; - - before(async () => { - ConversationController.reset(); - identityKey = { - pubKey: libsignal.crypto.getRandomBytes(33), - privKey: libsignal.crypto.getRandomBytes(32), - }; - storage.put('identityKey', identityKey); - await ConversationController.load(); - await textsecure.storage.user.setNumberAndDeviceId( - '18005554444', - 1, - 'Home Office' - ); - await ConversationController.getOrCreateAndWait( - textsecure.storage.user.getNumber(), - 'private' - ); - inboxView = new Whisper.InboxView({ - model: {}, - window, - initialLoadComplete() {}, - }).render(); - - conversation = new Whisper.Conversation({ - id: '1234', - type: 'private', - }); - }); - - describe('the conversation stack', () => { - it('should be rendered', () => { - assert.ok(inboxView.length === 1); - }); - - describe('opening a conversation', () => { - let triggeredOpenedCount = 0; - - before(() => { - conversation.on('opened', () => { - triggeredOpenedCount += 1; - }); - - inboxView.open(conversation); - }); - - it('should trigger an opened event', () => { - assert.ok(triggeredOpenedCount === 1); - }); - - describe('and then opening it again immediately', () => { - before(() => { - inboxView.open(conversation); - }); - - it('should trigger the opened event again', () => { - assert.ok(triggeredOpenedCount === 2); - }); - }); - }); - }); -}); diff --git a/ts/state/ducks/conversations.ts b/ts/state/ducks/conversations.ts index 090c9e002..66e833836 100644 --- a/ts/state/ducks/conversations.ts +++ b/ts/state/ducks/conversations.ts @@ -419,8 +419,7 @@ export function reducer( return getEmptyState(); } if (action.type === 'MESSAGE_EXPIRED') { - // FIXME - console.warn('EXPIRED'); + // nothing to do here } if (action.type === 'SELECTED_CONVERSATION_CHANGED') { const { payload } = action;