Merge branch 'main' into connect-command-spawn

This commit is contained in:
Susmitha Girumala authored and GitHub committed 2020-12-10 14:30:42 -05:00
commit b5926882f3
13 files changed
+94 -44

No files matched your search

-2
View File
@@ -47,11 +47,9 @@
}
.ember-notify {
border: 0 !important;
box-sizing: border-box;
display: block;
margin: 10px;
padding-bottom: 0 !important;
position: relative;
width: 300px;
+2 -1
View File
@@ -38,7 +38,6 @@
"broccoli-asset-rev": "^3.0.0",
"clipboard": "^2.0.6",
"core": "*",
"rose": "*",
"doctoc": "^1.4.0",
"ember-a11y-testing": "^3.0.0",
"ember-auto-import": "^1.6.0",
@@ -63,6 +62,7 @@
"ember-load-initializers": "^2.1.1",
"ember-maybe-import-regenerator": "^0.1.6",
"ember-modifier": "^2.1.1",
"ember-notify": "^6.0.0",
"ember-qunit": "^4.6.0",
"ember-resolver": "^8.0.0",
"ember-source": "~3.20.2",
@@ -75,6 +75,7 @@
"npm-run-all": "^4.1.5",
"prettier": "^2.1.2",
"qunit-dom": "^1.2.0",
"rose": "*",
"sass": "^1.29.0",
"sass-lint": "^1.13.1",
"sinon": "^9.2.1"
+30
View File
@@ -0,0 +1,30 @@
import { getOwner } from '@ember/application';
export function initialize(registry) {
// Lookup the application route
const ApplicationRoute = registry.resolveRegistration
? registry.resolveRegistration('route:application')
: registry.resolve('route:application');
ApplicationRoute.reopen({
init() {
this._super(...arguments);
const originalBeforeModel = this.beforeModel;
// Override the beforeModel hook and initialize the origin
this.beforeModel = async function() {
const origin = getOwner(this).lookup('service:origin');
return origin.updateOrigin().then(
() => originalBeforeModel.apply(this, arguments),
() => originalBeforeModel.apply(this, arguments)
);
};
},
});
}
export default {
after: 'ember-simple-auth',
initialize
};
+2 -2
View File
@@ -4,7 +4,7 @@ import { inject as service } from '@ember/service';
export default class IndexRoute extends Route {
// =services
@service session;
@service origin;
// =methods
@@ -12,7 +12,7 @@ export default class IndexRoute extends Route {
* If no origin is specified yet, redirects to origin, otherwise scopes.
*/
redirect() {
const rendererOrigin = this.session.data.origin;
const rendererOrigin = this.origin.rendererOrigin;
if (!rendererOrigin) {
this.replaceWith('origin');
} else {
+3 -3
View File
@@ -8,7 +8,7 @@ export default class OriginService extends Service {
@service ipc;
@service store;
@service session;
@service storage;
// =attributes
@@ -23,14 +23,14 @@ export default class OriginService extends Service {
* @type {?string}
*/
get rendererOrigin() {
return this.session.data.origin;
return this.storage.getItem('origin');
}
/**
* @param {?string} origin
*/
set rendererOrigin(origin) {
this.session.set('data.origin', origin);
this.storage.setItem('origin', origin);
}
/**
-2
View File
@@ -47,11 +47,9 @@
}
.ember-notify {
border: 0 !important;
box-sizing: border-box;
display: block;
margin: 10px;
padding-bottom: 0 !important;
position: relative;
width: 300px;
+7 -1
View File
@@ -1,7 +1,8 @@
'use strict';
const APP_NAME = process.env.APP_NAME || 'Boundary';
const ENABLE_MIRAGE = process.env.ENABLE_MIRAGE === 'false' ? false : true;
const API_HOST = process.env.API_HOST || '';
const ENABLE_MIRAGE = process.env.ENABLE_MIRAGE ? false : true;
module.exports = function (environment) {
let ENV = {
@@ -72,6 +73,11 @@ module.exports = function (environment) {
ENV.notifyTimeout = 0;
ENV.enableConfirmService = false;
// Use in-memory storage
ENV.storage = {
memory: true
};
}
if (environment === 'production') {
+1
View File
@@ -58,6 +58,7 @@
"ember-load-initializers": "^2.1.1",
"ember-maybe-import-regenerator": "^0.1.6",
"ember-modifier": "^2.1.1",
"ember-notify": "^6.0.0",
"ember-qunit": "^4.6.0",
"ember-resolver": "^8.0.0",
"ember-source": "~3.20.2",
@@ -62,9 +62,9 @@ module('Acceptance | authentication', function (hooks) {
};
const setDefaultOrigin = (test) => {
const origin = window.location.origin;
const session = test.owner.lookup('service:session');
session.set('data.origin', origin);
const windowOrigin = window.location.origin;
const origin = test.owner.lookup('service:origin');
origin.rendererOrigin = windowOrigin;
};
hooks.beforeEach(function () {
+4 -4
View File
@@ -60,9 +60,9 @@ module('Acceptance | projects', function (hooks) {
};
const setDefaultOrigin = (test) => {
const origin = window.location.origin;
const session = test.owner.lookup('service:session');
session.set('data.origin', origin);
const windowOrigin = window.location.origin;
const origin = test.owner.lookup('service:origin');
origin.rendererOrigin = windowOrigin;
};
hooks.beforeEach(function () {
@@ -102,7 +102,7 @@ module('Acceptance | projects', function (hooks) {
urls.authenticate.global = `${urls.scopes.global}/authenticate`;
urls.authenticate.methods.global = `${urls.authenticate.global}/${instances.authMethods.global.id}`;
urls.projects = `${urls.scopes.org}/projects`;
class MockIPC {
origin = null;
+4 -4
View File
@@ -61,9 +61,9 @@ module('Acceptance | targets', function (hooks) {
};
const setDefaultOrigin = (test) => {
const origin = window.location.origin;
const session = test.owner.lookup('service:session');
session.set('data.origin', origin);
const windowOrigin = window.location.origin;
const origin = test.owner.lookup('service:origin');
origin.rendererOrigin = windowOrigin;
};
hooks.beforeEach(function () {
@@ -104,7 +104,7 @@ module('Acceptance | targets', function (hooks) {
urls.authenticate.methods.global = `${urls.authenticate.global}/${instances.authMethods.global.id}`;
urls.projects = `${urls.scopes.org}/projects`;
urls.targets = `${urls.projects}/targets`;
class MockIPC {
origin = null;