Skip to content

Commit

Permalink
ref: Indentation, pass authManager and eventId in test, make webAppGe…
Browse files Browse the repository at this point in the history
…nerator env variable flat instead of nested, replace noopener with noreferrer in rel, update local docs for changes in env variables, remove webAppGenerator from env.example as it is not a major integration
  • Loading branch information
dhruvjain99 committed Nov 10, 2020
1 parent 001ed94 commit 4d6886b
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
3 changes: 1 addition & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
GOOGLE_API_KEY="Sample Key"
API_HOST=https://open-event-api-dev.herokuapp.com
MAP_DISPLAY=embed
FASTBOOT_DISABLED=true
WEB_APP_GENERATOR_HOST=https://open-event-wsgen-dev.herokuapp.com
FASTBOOT_DISABLED=true
7 changes: 2 additions & 5 deletions app/components/events/view/overview/event-apps.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@ import ENV from 'open-event-frontend/config/environment';
@classic
@classNames('ui', 'fluid', 'card')
export default class EventApps extends Component {
@computed('eventId')
@computed('eventId')
get webAppGeneratorUrl() {
if (this.authManager.currentUser) {
return `${ENV.appGenerator.webHost}/?email=${this.authManager.currentUser.email}&apiendpoint=${ENV.APP.apiHost}/${ENV.APP.apiNamespace}/events/${this.eventId}`;
}
return '#';
return `${ENV.webAppGenerator}/?email=${this.authManager.currentUser.email}&apiendpoint=${ENV.APP.apiHost}/${ENV.APP.apiNamespace}/events/${this.eventId}`;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<button class="ui button">{{t 'Generate Android App'}}</button>
</div>
<div class="column eight wide center aligned">
<a href="{{this.webAppGeneratorUrl}}" target="_blank" class="ui button" rel="noopener">{{t 'Generate Web App'}}</a>
<a href="{{this.webAppGeneratorUrl}}" target="_blank" class="ui button" rel="noreferrer">{{t 'Generate Web App'}}</a>
</div>
</div>
</div>
4 changes: 1 addition & 3 deletions config/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,7 @@ module.exports = function(environment) {

torii: {},

appGenerator: {
webHost: process.env.WEB_APP_GENERATOR_HOST || (environment === 'production' ? 'https://open-event-wsgen.herokuapp.com' : 'https://open-event-wsgen-dev.herokuapp.com')
}
webAppGenerator: process.env.WEB_APP_GENERATOR_HOST || (environment === 'production' ? 'https://open-event-wsgen.herokuapp.com' : 'https://open-event-wsgen-dev.herokuapp.com')
};

if (environment === 'production') {
Expand Down
3 changes: 2 additions & 1 deletion docs/installation/local.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ brew link --force gettext

- By default, the `.env.example` file specifies the `API_HOST` as `https://open-event-api-dev.herokuapp.com` which is a test deployment of the open-event-server. If you intend to work on just the frontend, this is sufficient. **If however, you intend to work on issues which involve both the frontend and the backend, you must have the [open-event-server](https://github.com/fossasia/open-event-server) already up and running. Please install and set it up first before changing the URL for `API_HOST` to `http://localhost:5000` and proceeding to run the frontend.**

- By default, the `.env.example` file specifies the `WEB_APP_GENERATOR_HOST` as `https://open-event-wsgen-dev.herokuapp.com` which is a test deployment of the open-event-wsgen. If you intend to work on just the frontend, this is sufficient. **If however, you intend to work on issues which involve both the frontend and the website generator, you must have the [open-event-wsgen](https://github.com/fossasia/open-event-wsgen) already up and running. Please install and set it up first before changing the URL for `WEB_APP_GENERATOR_HOST` to `http://localhost:5000` and proceeding to run the frontend.**
- By default, the `environment.js` file specifies the `webAppGenerator` as `https://open-event-wsgen-dev.herokuapp.com` which is a test deployment of the open-event-wsgen. If you intend to work on just the frontend, this is sufficient. **If however, you intend to work on issues which involve both the frontend and the website generator, you must have the [open-event-wsgen](https://github.com/fossasia/open-event-wsgen) already up and running. Please install and set it up first before creating a constant URL for `WEB_APP_GENERATOR_HOST` to `http://localhost:5000` in .env and proceeding to run the frontend.**

## Running / Development

* `yarn start`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@ import { hbs } from 'ember-cli-htmlbars';
import { module, test } from 'qunit';
import { setupIntegrationTest } from 'open-event-frontend/tests/helpers/setup-integration-test';
import { render } from '@ember/test-helpers';
import EmberObject from '@ember/object';

module('Integration | Component | events/view/overview/event apps', function(hooks) {
setupIntegrationTest(hooks);

const currentUser = EmberObject.create({ email: 'test1@gmail.com' });
const authManager = EmberObject.create({ currentUser });
test('it renders', async function(assert) {
await render(hbs`{{events/view/overview/event-apps}}`);
this.set('authManager', authManager);
this.set('eventId', 'e123');
await render(hbs`{{events/view/overview/event-apps authManager=authManager eventId=eventId}}`);
assert.ok(this.element.innerHTML.trim().includes('Apps'));
});
});

0 comments on commit 4d6886b

Please sign in to comment.