Skip to content

Commit 1ffa0b8

Browse files
Merge branch 'development' into dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-4.8.2
2 parents a2efe58 + 706e01e commit 1ffa0b8

File tree

6 files changed

+136
-57
lines changed

6 files changed

+136
-57
lines changed

.github/workflows/ci.yml

Lines changed: 84 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,96 @@ on:
77
branches: [ development, master ]
88

99
jobs:
10-
build:
11-
10+
install:
11+
name: Install Dependencies
1212
runs-on: ubuntu-latest
13-
1413
steps:
1514
- uses: actions/checkout@v2
16-
- name: Use Node.js 14.x
17-
uses: actions/setup-node@v1
18-
with:
19-
node-version: 14.x
20-
- name: Get yarn cache path
21-
id: yarn-cache-path
22-
run: echo "::set-output name=dir::$(yarn cache dir)"
2315
- uses: actions/cache@v2
24-
id: yarn-cache
16+
id: cache
2517
with:
26-
path: ${{ steps.yarn-cache-path.outputs.dir }}
18+
path: node_modules
2719
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
2820
restore-keys: |
2921
${{ runner.os }}-yarn
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v1
24+
if: steps.cache.outputs.cache-hit != 'true'
25+
with:
26+
node-version: 14.x
3027
- run: yarn
31-
- run: touch .env
32-
- run: yarn l10n:generate
33-
- run: yarn lint
34-
- run: COVERAGE=true yarn test
35-
- run: ROOT_URL=open-event-frontend yarn build -prod
36-
- name: Code Coverage
37-
uses: codecov/codecov-action@v1
28+
if: steps.cache.outputs.cache-hit != 'true'
29+
30+
31+
lint:
32+
name: Lint
33+
needs: install
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v2
37+
with:
38+
fetch-depth: 0
39+
- name: Setup Node.js
40+
uses: actions/setup-node@v1
41+
with:
42+
node-version: 14.x
43+
- uses: actions/cache@v2
44+
id: cache
45+
with:
46+
path: node_modules
47+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
48+
# no restore-keys here, so we only accept this exact version
49+
- run: yarn lint
50+
51+
52+
test:
53+
name: Test
54+
needs: install
55+
runs-on: ubuntu-latest
56+
steps:
57+
- uses: actions/checkout@v2
58+
with:
59+
fetch-depth: 0
60+
- name: Setup Node.js
61+
uses: actions/setup-node@v1
62+
with:
63+
node-version: 14.x
64+
- uses: actions/cache@v2
65+
id: cache
66+
with:
67+
path: node_modules
68+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
69+
# no restore-keys here, so we only accept this exact version
70+
- run: yarn l10n:generate
71+
- run: COVERAGE=true yarn test
72+
- name: Code Coverage
73+
uses: codecov/codecov-action@v1
74+
75+
76+
build:
77+
name: Build
78+
needs: install
79+
runs-on: ubuntu-latest
80+
steps:
81+
- uses: actions/checkout@v2
82+
with:
83+
fetch-depth: 0
84+
- name: Setup Node.js
85+
uses: actions/setup-node@v1
86+
with:
87+
node-version: 14.x
88+
- uses: actions/cache@v2
89+
id: cache
90+
with:
91+
path: node_modules
92+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
93+
# no restore-keys here, so we only accept this exact version
94+
- run: yarn l10n:generate
95+
- run: ROOT_URL=open-event-frontend yarn build -prod
96+
- name: Deploy
97+
uses: peaceiris/actions-gh-pages@v3
98+
if: github.ref == 'refs/heads/development' && github.event_name == 'push'
99+
with:
100+
github_token: ${{ secrets.GITHUB_TOKEN }}
101+
publish_dir: ./dist
102+
force_orphan: true

app/components/public/side-menu.js

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ import { tracked } from '@glimmer/tracking';
77

88
@classic
99
export default class SideMenu extends Component {
10+
11+
activeSection = null;
12+
1013
@tracked
1114
showSpeakers = false;
1215

@@ -45,21 +48,32 @@ export default class SideMenu extends Component {
4548
this.showSessions = this.showSessions || (await this.loader.load(`/events/${this.event.id}/sessions?fields[session]=id&page[size]=1&filter=${JSON.stringify(filters)}`)).data.length;
4649
}
4750

51+
didRender() {
52+
if (!this.activeSection) { return }
53+
const target = document.querySelector(`[href='#${this.activeSection}']`);
54+
if (target) {
55+
// Delay click to give time to render
56+
setTimeout(() => {
57+
target.click();
58+
}, 0);
59+
}
60+
}
61+
4862
@action
49-
scrollToTarget() {
50-
document.querySelectorAll('.scroll').forEach(anchor => {
51-
anchor.addEventListener('click', function(e) {
52-
e.preventDefault();
53-
document.querySelector(this.getAttribute('href')).scrollIntoView({
54-
behavior: 'smooth'
55-
});
63+
goToSection(section) {
64+
this.set('activeSection', section);
65+
}
5666

57-
document.querySelectorAll('.scroll').forEach(node => {
58-
node.classList.remove('active');
59-
});
60-
e.target.classList.add('active');
61-
});
67+
@action
68+
scrollToTarget(section) {
69+
document.querySelector(`#${section}`).scrollIntoView({
70+
behavior: 'smooth'
71+
});
72+
this.set('activeSection', null);
73+
document.querySelectorAll('.scroll').forEach(node => {
74+
node.classList.remove('active');
6275
});
76+
document.querySelector(`[href='#${section}']`).classList.add('active');
6377
}
6478

6579
@computed('event.schedulePublishedOn')

app/routes/events/view/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ export default class extends Route.extend(EmberTableRouteMixin) {
1212
let queryString = {
1313
filter : filterOptions,
1414
'page[size]' : params.per_page || 10,
15-
'page[number]' : params.per_page || 1
15+
'page[number]' : params.page || 1
1616
};
1717
queryString = this.applySortFilters(queryString, params);
18-
const sponsorsPromise = this.asArray(eventDetails.query('sponsors', {}, queryString));
18+
const sponsorsPromise = this.asArray(eventDetails.query('sponsors', queryString));
1919
const roleInvitesPromise = eventDetails.query('roleInvites', {});
2020
const sessionTypesPromise = eventDetails.query('sessionTypes', {});
2121
const socialLinksPromise = eventDetails.query('socialLinks', {});

app/templates/components/public/side-menu.hbs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{{#if (and (not-eq this.session.currentRouteName 'public.cfs.new-session') (not-eq this.session.currentRouteName 'public.cfs.new-speaker') (not-eq this.session.currentRouteName 'public.cfs.edit-speaker') (not-eq this.session.currentRouteName 'public.cfs.edit-session'))}}
22
<div class="ui fluid vertical {{unless this.device.isMobile 'pointing'}} menu">
33
{{#if (eq this.session.currentRouteName 'public.index')}}
4-
<a href='#info' {{action "scrollToTarget"}} class='item active scroll'>
4+
<a href='#info' {{action "scrollToTarget" 'info'}} class='item active scroll'>
55
{{t 'Info'}}
66
</a>
77
{{#if this.event.tickets.length}}
8-
<a href='#tickets' {{action "scrollToTarget"}} class='item scroll'>
8+
<a href='#tickets' {{action "scrollToTarget" 'tickets'}} class='item scroll'>
99
{{t 'Tickets'}}
1010
</a>
1111
{{/if}}
@@ -15,13 +15,13 @@
1515
</LinkTo>
1616
{{/if}}
1717
{{else}}
18-
<a class="item" href="{{href-to 'public.index'}}">
19-
{{t 'Info'}}
20-
</a>
18+
<LinkTo class="item" @route="public.index" {{action 'goToSection' 'info'}}>
19+
{{t 'Info'}}
20+
</LinkTo>
2121
{{#if this.event.tickets.length}}
22-
<a class="item" href="{{href-to 'public.index'}}#tickets">
22+
<LinkTo class="item" @route="public.index" {{action 'goToSection' 'tickets'}}>
2323
{{t 'Tickets'}}
24-
</a>
24+
</LinkTo>
2525
{{/if}}
2626
{{#if this.showSpeakers}}
2727
<LinkTo @route="public.speakers" class="item">
@@ -46,34 +46,34 @@
4646
{{/if}}
4747
{{#if this.event.isSponsorsEnabled}}
4848
{{#if (eq this.session.currentRouteName 'public.index')}}
49-
<a href='#sponsor' {{action "scrollToTarget"}} class='item scroll'>
49+
<a href='#sponsor' {{action "scrollToTarget" 'sponsor'}} class='item scroll'>
5050
{{t 'Sponsors'}}
5151
</a>
5252
{{else}}
53-
<a class="item" href="{{href-to 'public.index'}}#sponsor">
53+
<LinkTo class="item" @route="public.index" {{action 'goToSection' 'sponsor'}}>
5454
{{t 'Sponsors'}}
55-
</a>
55+
</LinkTo>
5656
{{/if}}
5757
{{/if}}
5858
{{#if this.event.hasOwnerInfo}}
5959
{{#if (eq this.session.currentRouteName 'public.index')}}
60-
<a href='#organizer' {{action "scrollToTarget"}} class='item scroll'>
60+
<a href='#organizer' {{action "scrollToTarget" 'organizer'}} class='item scroll'>
6161
{{t 'Organizer'}}
6262
</a>
6363
{{else}}
64-
<a class="item" href="{{href-to 'public.index'}}#organizer">
64+
<LinkTo class="item" @route="public.index" {{action 'goToSection' 'organizer'}}>
6565
{{t 'Organizer'}}
66-
</a>
66+
</LinkTo>
6767
{{/if}}
6868
{{/if}}
6969
{{#if (eq this.session.currentRouteName 'public.index')}}
70-
<a href='#getting-here' class='item scroll'>
70+
<a href='#getting-here' {{action "scrollToTarget" 'getting-here'}} class='item scroll'>
7171
{{t 'Getting here'}}
7272
</a>
7373
{{else}}
74-
<a class="item" href="{{href-to 'public.index'}}#getting-here">
74+
<LinkTo class="item" @route="public.index" {{action 'goToSection' 'getting-here'}}>
7575
{{t 'Getting here'}}
76-
</a>
76+
</LinkTo>
7777
{{/if}}
7878
{{#if this.event.codeOfConduct}}
7979
<LinkTo @route="public.coc" class="item">

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"@types/rsvp": "^4.0.3",
5252
"@types/url-parse": "^1.4.3",
5353
"@typescript-eslint/eslint-plugin": "^4.8.2",
54-
"@typescript-eslint/parser": "^4.8.1",
54+
"@typescript-eslint/parser": "^4.8.2",
5555
"async": "^3.2.0",
5656
"babel-eslint": "^10.1.0",
5757
"broccoli-asset-rev": "^3.0.0",

yarn.lock

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2250,14 +2250,14 @@
22502250
eslint-scope "^5.0.0"
22512251
eslint-utils "^2.0.0"
22522252

2253-
"@typescript-eslint/parser@^4.8.1":
2254-
version "4.8.1"
2255-
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.8.1.tgz#4fe2fbdbb67485bafc4320b3ae91e34efe1219d1"
2256-
integrity sha512-QND8XSVetATHK9y2Ltc/XBl5Ro7Y62YuZKnPEwnNPB8E379fDsvzJ1dMJ46fg/VOmk0hXhatc+GXs5MaXuL5Uw==
2253+
"@typescript-eslint/parser@^4.8.2":
2254+
version "4.8.2"
2255+
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.8.2.tgz#78dccbe5124de2b8dea2d4c363dee9f769151ca8"
2256+
integrity sha512-u0leyJqmclYr3KcXOqd2fmx6SDGBO0MUNHHAjr0JS4Crbb3C3d8dwAdlazy133PLCcPn+aOUFiHn72wcuc5wYw==
22572257
dependencies:
2258-
"@typescript-eslint/scope-manager" "4.8.1"
2259-
"@typescript-eslint/types" "4.8.1"
2260-
"@typescript-eslint/typescript-estree" "4.8.1"
2258+
"@typescript-eslint/scope-manager" "4.8.2"
2259+
"@typescript-eslint/types" "4.8.2"
2260+
"@typescript-eslint/typescript-estree" "4.8.2"
22612261
debug "^4.1.1"
22622262

22632263
"@typescript-eslint/[email protected]":

0 commit comments

Comments
 (0)