Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Integrate web app generator with event dashboard #5529

Merged
merged 4 commits into from
Nov 10, 2020
Merged
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
ref: Indentation, pass authManager and eventId in test, make webAppGe…
…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
dhruvjain99 committed Nov 10, 2020

Verified

This commit was signed with the committer’s verified signature. The key has expired.
renovate-bot Mend Renovate
commit b3794b87c48006b892acbd87637ac120454f4319
1 change: 0 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -2,4 +2,3 @@ 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
7 changes: 2 additions & 5 deletions app/components/events/view/overview/event-apps.js
Original file line number Diff line number Diff line change
@@ -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() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indention error

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iamareebjamal I think it is fine because it got automatically indented like this when I did git commit. Let me know how many spaces need to be included.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2

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
@@ -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>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<a href="{{this.webAppGeneratorUrl}}" target="_blank" class="ui button" rel="noreferrer">{{t 'Generate Web App'}}</a>
<a href="{{this.webAppGeneratorUrl}}" target="_blank" class="ui button" rel="noopener 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
@@ -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') {
3 changes: 2 additions & 1 deletion docs/installation/local.md
Original file line number Diff line number Diff line change
@@ -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`
Original file line number Diff line number Diff line change
@@ -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: '[email protected]' });
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'));
});
});