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
Show file tree
Hide file tree
Changes from all commits
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
9 changes: 8 additions & 1 deletion app/components/events/view/overview/event-apps.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import classic from 'ember-classic-decorator';
import { classNames } from '@ember-decorators/component';
import Component from '@ember/component';
import { computed } from '@ember/object';
import ENV from 'open-event-frontend/config/environment';

@classic
@classNames('ui', 'fluid', 'card')
export default class EventApps extends Component {}
export default class EventApps extends Component {
@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

return `${ENV.webAppGenerator}/?email=${this.authManager.currentUser.email}&api=${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">
<button class="ui button">{{t 'Generate Web App'}}</button>
<a href="{{this.webAppGeneratorUrl}}" target="_blank" class="ui button" rel="noopener noreferrer">{{t 'Generate Web App'}}</a>
</div>
</div>
</div>
2 changes: 1 addition & 1 deletion app/templates/events/view/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@sort_by={{this.sort_by}}
@sort_dir={{this.sort_dir}}
@filterOptions={{this.filterOptions}} />
<Events::View::Overview::EventApps />
<Events::View::Overview::EventApps @eventId={{this.model.event.id}} />
</div>
<div class="eight wide column">
<Events::View::Overview::GeneralInfo @data={{this.model}} />
Expand Down
4 changes: 3 additions & 1 deletion config/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ module.exports = function(environment) {
hostWhitelist: [/.+/]
},

torii: {}
torii: {},

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: 3 additions & 0 deletions docs/installation/local.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ 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 `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:3000` in .env and proceeding to run the frontend.**

## Running / Development
iamareebjamal marked this conversation as resolved.
Show resolved Hide resolved

* `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'));
});
});