Skip to content
This repository was archived by the owner on Oct 11, 2022. It is now read-only.
Merged

2.4.3 #3233

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
4338ce9
Dont show deleted threads in notifications dropdown
brianlovin May 4, 2018
91abaf1
Update banning-users.md to include mutations to disable feature flags…
johnnynotsolucky May 7, 2018
21638c5
Use correct filter for private channels
johnnynotsolucky May 7, 2018
15e2741
WIP: Add hover profile to mentions
mxstbr May 11, 2018
dc444a0
Merge branch 'alpha' of github.com:withspectrum/spectrum into dont-no…
brianlovin May 15, 2018
3eeca34
Support mulit-thread notification cases where individual ones are del…
brianlovin May 15, 2018
3443214
fix upload images tooltip hover state
alejandronanez May 19, 2018
4fed75c
Show login as first view on desktop startup
mxstbr May 30, 2018
05ee051
Add desktop to deployment options
mxstbr May 30, 2018
c5ab598
Merge pull request #3117 from alejandronanez/hover-upload-images
brianlovin May 30, 2018
7398ac8
refactoring
meme-content May 31, 2018
640a811
Merge pull request #3219 from yakotika/alpha
mxstbr May 31, 2018
ee3de44
Add desktop deployment docs
mxstbr May 31, 2018
5b04e7a
Run desktop CD from the alpha branch
mxstbr May 31, 2018
193ef66
Make yarn run dev:desktop auto-restart Electron process
mxstbr May 31, 2018
581100e
Fix desktop auto updating maybe
mxstbr May 31, 2018
6f6f4a9
Persist desktop app window state on reopen
mxstbr May 31, 2018
8cf5a85
Merge branch 'alpha' into show-login-on-desktop
mxstbr May 31, 2018
c698087
Merge pull request #3027 from withspectrum/dont-notify-deleted-threads
mxstbr May 31, 2018
cf922c2
Merge branch 'alpha' into add-hover-profile-to-mentions
mxstbr May 31, 2018
e79f784
Remove console.log
mxstbr May 31, 2018
19eca73
Fix hover profile positioning
mxstbr May 31, 2018
633d7fb
Fix flow
mxstbr May 31, 2018
31b5502
Fix focussing body when pressing enter in title in composer
mxstbr May 31, 2018
c198331
Don't server-side render for desktop app
mxstbr May 31, 2018
2c066b6
Merge pull request #3226 from withspectrum/fix-focus
brianlovin May 31, 2018
e1be17a
Merge pull request #3069 from withspectrum/add-hover-profile-to-mentions
brianlovin May 31, 2018
e2b40d3
Merge pull request #3039 from johnnynotsolucky/banning-user-docs
brianlovin May 31, 2018
9126836
Merge pull request #3222 from withspectrum/desktop-auto-updating
brianlovin May 31, 2018
f727b2e
Merge pull request #3220 from withspectrum/desktop-deployment-docs
brianlovin May 31, 2018
53e843e
Merge pull request #3221 from withspectrum/fix-desktop-cd
brianlovin May 31, 2018
862f1c0
Merge pull request #3227 from withspectrum/serve-client-side-for-desk…
brianlovin May 31, 2018
8348c87
Merge branch 'alpha' of github.com:withspectrum/spectrum into show-lo…
brianlovin May 31, 2018
33f1ee5
Merge branch 'show-login-on-desktop' of github.com:withspectrum/spect…
brianlovin May 31, 2018
87797a0
Merge alpha and fix conflict
brianlovin May 31, 2018
0cec257
Merge pull request #3223 from withspectrum/persist-window-state-desktop
brianlovin May 31, 2018
a19986c
Merge pull request #3198 from withspectrum/show-login-on-desktop
brianlovin May 31, 2018
73c73d5
Bump desktop version
brianlovin May 31, 2018
c0fcbef
Merge pull request #3232 from withspectrum/bump-desktop-version
brianlovin May 31, 2018
583995b
Merge branch 'alpha' of github.com:withspectrum/spectrum into 2.4.3
brianlovin May 31, 2018
547c1fa
version
brianlovin May 31, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,11 @@ workflows:
test:
jobs:
- checkout_environment

# Testing
- test_mobile_js:
requires:
- checkout_environment

# Disabled as Expo is fixing their critical issue with Detox
# - test_mobile_native:
# requires:
Expand All @@ -215,6 +216,8 @@ workflows:
- test_static_js:
requires:
- checkout_environment

# Deployment
- deploy_alpha:
requires:
- test_static_js
Expand All @@ -228,4 +231,4 @@ workflows:
- test_web
filters:
branches:
only: production
only: alpha
4 changes: 1 addition & 3 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
**Deploy after merge (delete what needn't be deployed)**
- api
- hyperion (frontend)
- desktop
- athena
- vulcan
- mercury
Expand All @@ -20,11 +21,8 @@ YES

**Release notes for users (delete if codebase-only change)**
-

<!--

If your pull request introduces changes to the user interface on Spectrum, please share before and after screenshots of the changes (gifs or videos are encouraged for interaction changes). Please include screenshots of desktop and mobile viewports to ensure that all responsive cases are reviewed.

-->

**Related issues (delete if you don't know any existing issue(s) that could be related to this PR)**
Expand Down
2 changes: 1 addition & 1 deletion config-overrides.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ module.exports = function override(config, env) {
config.plugins.push(
new webpack.optimize.CommonsChunkPlugin({
names: ['bootstrap'],
filename: './static/js/[name].js',
filename: 'static/js/[name].js',
minChunks: Infinity,
})
);
Expand Down
29 changes: 29 additions & 0 deletions desktop/deployment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Desktop App Deployment

We have semi-continuous deployment set up for the desktop app. Here's how it works:

## Automatic

1. We merge the latest changes from `alpha` to `production`
2. This prompts a CircleCI build, which packages the desktop app for all operating systems and uploads them to GitHub as a draft release. That looks something like this:

![screen shot 2018-05-30 at 15 42 22](https://user-images.githubusercontent.com/7525670/40724411-4b5fe9ec-6421-11e8-8e4b-d0df96b46f72.png)

3. Go to that draft release, download the build for your OS and test the new version locally.

4. If you're happy with how it works, click the "Edit" button on the draft release and you get to this screen:

![screenshot-2018-5-30 withspectrum spectrum](https://user-images.githubusercontent.com/7525670/40724488-77256642-6421-11e8-9911-999ed0fa5957.png)

4. Fill out the title and release notes of the release (like it's already done above), then click "Publish release".

As soon as it's published, the app will prompt existing users to upgrade to the newest version and download and install it for them.

## Manual

You can also do a manual deploy of the desktop apps. You will need to get a GitHub token from your personal GitHub settings, then run the following command:

```
GH_TOKEN=asdf123 yarn run release:desktop
```

16 changes: 12 additions & 4 deletions desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,23 @@
"email": "hey@spectrum.chat"
},
"repository": "https://github.com/withspectrum/spectrum",
"version": "1.0.0-beta.2",
"version": "1.0.1",
"main": "src/main.js",
"private": true,
"dependencies": {
"electron-is-dev": "^0.3.0",
"electron-log": "^2.2.14",
"electron-updater": "^2.21.4"
"electron-updater": "^2.21.4",
"electron-window-state": "^4.1.1"
},
"devDependencies": {
"electron": "^1.8.4",
"electron-builder": "^20.8.1",
"nodemon": "^1.17.5",
"rimraf": "^2.6.2"
},
"scripts": {
"dev": "electron ./src/main.js",
"dev": "nodemon --exec \"electron ./src/main.js\" -w ./src",
"prepackage": "rimraf release",
"package": "build",
"package:mac": "yarn run package --mac",
Expand All @@ -34,7 +36,13 @@
"productName": "Spectrum",
"appId": "chat.spectrum",
"copyright": "Copyright © 2018 Space Program Inc.",
"publish": "github",
"publish": [
{
"provider": "github",
"repo": "spectrum",
"owner": "withspectrum"
}
],
"releaseInfo": {
"releaseName": "${name} Desktop App v${version}"
},
Expand Down
62 changes: 3 additions & 59 deletions desktop/src/autoUpdate.js
Original file line number Diff line number Diff line change
@@ -1,63 +1,7 @@
// @flow
const { app, dialog } = require('electron');
const { autoUpdater } = require('electron-updater');
const log = require('electron-log');

// Setup logger
autoUpdater.logger = log;
autoUpdater.logger.transports.file.level = 'info';

log.info('App starting...');

// Setup update event
autoUpdater.on('checking-for-update', () => {
log.info('Checking for update... Please wait.');
});
autoUpdater.on('update-available', info => {
log.info('Update available.');
log.info('Vesrion', info.version);
log.info('Release date', info.releaseDate);
});
autoUpdater.on('update-not-available', info => {
log.info('Update not available.');
});
autoUpdater.on('download-progress', progress => {
log.info(`Download progress: ${Math.floor(progress.percent)}`);
});
autoUpdater.on('update-downloaded', info => {
log.info('Update downloaded');
});
autoUpdater.on('error', error => {
log.info('Update error', error);
});

function updateDownloaded() {
// Ask user to update the app
dialog.showMessageBox(
{
type: 'question',
message: 'A new version of ' + app.getName() + ' has been downloaded',
buttons: ['Install and Relaunch', 'Later'],
defaultId: 0,
},
response => {
if (response === 1) {
dialog.showMessageBox({
title: 'Installing Later',
message: 'Update will be installed when you exit the app',
});
} else {
autoUpdater.quitAndInstall();
}
}
);
}

function checkForUpdates() {
autoUpdater.on('update-downloaded', updateDownloaded);

// init for updates
autoUpdater.checkForUpdates();
}

module.exports = checkForUpdates;
module.exports = function checkForUpdates() {
return autoUpdater.checkForUpdatesAndNotify();
};
6 changes: 4 additions & 2 deletions desktop/src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@ const { resolve } = require('path');
module.exports = {
APP_NAME: 'Spectrum',
APP_VERSION: app.getVersion(),
APP_REMOTE_URL: 'https://spectrum.chat/',
APP_DEV_URL: 'http://localhost:3000',
APP_REMOTE_URL: 'https://spectrum.chat/login',
APP_DEV_URL: 'http://localhost:3000/login',

GITHUB_URL: 'https://github.com/withspectrum/spectrum',
GITHUB_URL_LICENSE:
'https://github.com/withspectrum/spectrum/blob/alpha/LICENSE',
GITHUB_URL_ISSUES: 'https://github.com/withspectrum/spectrum/issues',

WINDOW_DEFAULT_HEIGHT: 800,
WINDOW_DEFAULT_WIDTH: 1300,
WINDOW_MIN_HEIGHT: 500,
WINDOW_MIN_WIDTH: 770,
WINDOW_BG_COLOR: '#F5F8FC',
Expand Down
20 changes: 17 additions & 3 deletions desktop/src/main.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
// @flow
const electron = require('electron');
const windowStateKeeper = require('electron-window-state');
const { app, BrowserWindow } = electron;
const isDev = require('electron-is-dev');

const FIFTEEN_MINUTES = 900000;

const checkForUpdates = require('./autoUpdate');
const buildMenu = require('./menu');
const CONFIG = require('./config');
Expand All @@ -17,16 +20,26 @@ const startUrl = isDev ? CONFIG.APP_DEV_URL : CONFIG.APP_REMOTE_URL;

function createWindow() {
if (!isDev) {
// trigger autoupdate check
// Check for updates on startup and then every 15 minutes
checkForUpdates();
setInterval(() => {
checkForUpdates();
}, FIFTEEN_MINUTES);
}

const { width, height } = electron.screen.getPrimaryDisplay().workAreaSize;
let mainWindowState = windowStateKeeper({
defaultWidth: CONFIG.WINDOW_DEFAULT_WIDTH,
defaultHeight: CONFIG.WINDOW_DEFAULT_HEIGHT,
});

const { width, height, x, y } = mainWindowState;

// Create the main browser window.
mainWindow = new BrowserWindow({
width,
height,
x,
y,
titleBarStyle: 'hiddenInset',
minHeight: CONFIG.WINDOW_MIN_HEIGHT,
minWidth: CONFIG.WINDOW_MIN_WIDTH,
Expand Down Expand Up @@ -57,9 +70,10 @@ function createWindow() {

// if main window is ready to show, show up the main window
mainWindow.once('ready-to-show', () => {
mainWindow && mainWindow.maximize();
mainWindow && mainWindow.show();
});

mainWindowState.manage(mainWindow);
}

// This method will be called when Electron has finished
Expand Down
19 changes: 18 additions & 1 deletion desktop/src/menu.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
// @flow
const { dialog, Menu, shell } = require('electron');
const { dialog, Menu, MenuItem, shell } = require('electron');
const checkForUpdates = require('./autoUpdate');

const CONFIG = require('./config');

const UpdateMenuItem = new MenuItem({
label: 'Check for updates',
click() {
this.enabled = false;
checkForUpdates().then(() => {
this.enabled = true;
});
},
});

/**
* Applications menu
**/
Expand All @@ -24,6 +35,7 @@ const template = [
shell.openExternal(CONFIG.GITHUB_URL_LICENSE);
},
},
UpdateMenuItem,
{ type: 'separator' },
{ role: 'hide' },
{ role: 'quit' },
Expand Down Expand Up @@ -90,6 +102,11 @@ const template = [
accelerator: 'CmdOrCtrl+R',
role: 'reload',
},
{
label: 'Force Reload',
accelerator: 'CmdOrCtrl+Shift+R',
role: 'forceReload',
},
{
label: 'Close',
accelerator: 'CmdOrCtrl+W',
Expand Down
Loading