Skip to content

Commit 8bf5efe

Browse files
committed
Merge branch 'main' into vimeo-fix
2 parents 4943b06 + 48ccb8d commit 8bf5efe

File tree

109 files changed

+2382
-1921
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+2382
-1921
lines changed

.github/workflows/pytest.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
fail-fast: false
3535
matrix:
3636
os: [ubuntu-latest] # TODO: Figure out macos-latest and Docker
37-
python-version: ['3.11']
37+
python-version: ['3.11', '3.12']
3838

3939
services:
4040
redis:
@@ -61,10 +61,10 @@ jobs:
6161
if: ${{ matrix.os == 'macos-latest' }}
6262
- name: Checkout code
6363
uses: actions/checkout@v3
64-
- name: Install Firefox (for browser testing)
65-
uses: browser-actions/setup-firefox@latest
66-
- name: Install Geckodriver (for browser testing)
67-
uses: browser-actions/setup-geckodriver@latest
64+
- name: Install Chrome (for browser testing)
65+
uses: browser-actions/setup-chrome@latest
66+
- name: Install Chromedriver (for browser testing)
67+
uses: nanasess/setup-chromedriver@v2
6868
- name: Install Python
6969
uses: actions/setup-python@v4
7070
with:
@@ -78,10 +78,12 @@ jobs:
7878
key: ${{ matrix.os }}-${{ env.pythonLocation }}-${{ hashFiles('requirements/base.txt') }}-${{ hashFiles('requirements.txt/test.txt') }}
7979
- name: Install Python dependencies
8080
run: make install-python-test
81+
- name: Install Playwright browser
82+
run: make install-playwright
8183
- name: Install Node
8284
uses: actions/setup-node@v3
8385
with:
84-
node-version: latest
86+
node-version: 20
8587
cache: npm
8688
- name: Cache node modules
8789
uses: actions/cache@v3

.pre-commit-config.yaml

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ ci:
88
skip: [
99
'pip-audit',
1010
'yesqa',
11+
'creosote',
1112
'no-commit-to-branch',
1213
# 'hadolint-docker',
1314
'docker-compose-check',
@@ -42,17 +43,15 @@ repos:
4243
'PYSEC-2022-42969', # https://github.com/pytest-dev/pytest/issues/10392
4344
'--ignore-vuln',
4445
'PYSEC-2023-73', # https://github.com/RedisLabs/redisraft/issues/608
45-
'--ignore-vuln',
46-
'PYSEC-2023-101', # https://github.com/pytest-dev/pytest-selenium/issues/310
4746
]
4847
files: ^requirements/.*\.txt$
4948
- repo: https://github.com/asottile/pyupgrade
5049
rev: v3.15.0
5150
hooks:
5251
- id: pyupgrade
53-
args: ['--keep-runtime-typing', '--py310-plus']
52+
args: ['--keep-runtime-typing', '--py311-plus']
5453
- repo: https://github.com/astral-sh/ruff-pre-commit
55-
rev: v0.0.292
54+
rev: v0.1.6
5655
hooks:
5756
- id: ruff
5857
args: ['--fix', '--exit-non-zero-on-fix']
@@ -98,7 +97,7 @@ repos:
9897
additional_dependencies:
9998
- tomli
10099
- repo: https://github.com/psf/black
101-
rev: 23.9.1
100+
rev: 23.11.0
102101
hooks:
103102
- id: black
104103
# Mypy is temporarily disabled until the SQLAlchemy 2.0 migration is complete
@@ -146,6 +145,27 @@ repos:
146145
args: ['-c', 'pyproject.toml']
147146
additional_dependencies:
148147
- 'bandit[toml]'
148+
- repo: https://github.com/fredrikaverpil/creosote
149+
rev: v3.0.0
150+
hooks:
151+
- id: creosote
152+
args:
153+
- --venv=.venv
154+
- --path=funnel
155+
- --path=tests
156+
- --path=migrations/versions
157+
- --deps-file=requirements/base.in
158+
- --exclude-dep=argon2-cffi # Optional dep for passlib
159+
- --exclude-dep=bcrypt # Optional dep for passlib
160+
- --exclude-dep=greenlet # Optional dep for SQLAlchemy's asyncio support
161+
- --exclude-dep=gunicorn # Not imported, used as server
162+
- --exclude-dep=linkify-it-py # Optional dep for markdown-it-py
163+
- --exclude-dep=psycopg # Optional dep for SQLAlchemy
164+
- --exclude-dep=rq-dashboard # Creosote fails to recognise the import
165+
- --exclude-dep=tzdata # Data-only dep, therefore no import statement
166+
- --exclude-dep=urllib3 # Required to silence a pip-audit warning
167+
- --exclude-dep=wtforms-sqlalchemy # Temp dep on an unreleased git branch
168+
149169
- repo: https://github.com/pre-commit/pre-commit-hooks
150170
rev: v4.5.0
151171
hooks:
@@ -188,7 +208,7 @@ repos:
188208
- id: forbid-tabs
189209
- id: remove-tabs
190210
- repo: https://github.com/pre-commit/mirrors-prettier
191-
rev: v3.0.3
211+
rev: v3.1.0
192212
hooks:
193213
- id: prettier
194214
args:

Makefile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ all:
77
@echo
88
@echo "For testing and CI:"
99
@echo " make install-test # Install everything needed for a test environment"
10+
@echo " make install-playwright # Install browsers for Playwright-based tests"
1011
@echo
1112
@echo "For development:"
1213
@echo " make install-dev # For first time setup and after dependency upgrades"
@@ -118,9 +119,18 @@ install-python-test: install-python-pip deps-editable
118119
install-python: install-python-pip deps-editable
119120
pip install --use-pep517 -r requirements/base.txt
120121

121-
install-dev: deps-editable install-python-dev install-npm assets
122+
install-playwright:
123+
@if command -v playwright > /dev/null; then\
124+
echo "playwright install --with-deps";\
125+
playwright install --with-deps;\
126+
else\
127+
echo "Install Playwright first: make install-python-test";\
128+
exit 1;\
129+
fi
122130

123-
install-test: deps-editable install-python-test install-npm assets
131+
install-dev: deps-editable install-python-dev install-playwright install-npm assets
132+
133+
install-test: deps-editable install-python-test install-playwright install-npm assets
124134

125135
install: deps-editable install-python install-npm-ci assets
126136

funnel/assets/js/rsvp_form_modal.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ import jsonForm from './utils/jsonform';
44
Vue.config.devtools = true;
55

66
const FormUI = {
7-
init(jsonSchema) {
7+
init(jsonSchema, useremail) {
88
/* eslint-disable no-new */
99
new Vue({
1010
el: '#register-form',
1111
data() {
1212
return {
1313
jsonSchema,
14+
useremail,
1415
};
1516
},
1617
components: {
@@ -27,7 +28,7 @@ const FormUI = {
2728
};
2829

2930
$(() => {
30-
window.Hasgeek.addRsvpForm = (jsonSchema) => {
31-
FormUI.init(jsonSchema);
31+
window.Hasgeek.addRsvpForm = (jsonSchema, useremail) => {
32+
FormUI.init(jsonSchema, useremail);
3233
};
3334
});

funnel/assets/js/schedule_view.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,9 +276,8 @@ const Schedule = {
276276
this.config.slotInterval
277277
);
278278
if (this.config.schedule[session.eventDay]) {
279-
this.config.schedule[session.eventDay].sessions[
280-
session.startTime
281-
].showLabel = true;
279+
this.config.schedule[session.eventDay].sessions[session.startTime].showLabel =
280+
true;
282281
this.config.schedule[session.eventDay].sessions[session.startTime].rooms[
283282
session.room_scoped_name
284283
].talk = session;

funnel/assets/js/utils/jsonform.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Form from './formhelper';
33

44
const jsonForm = Vue.component('jsonform', {
55
template: '#form-template',
6-
props: ['jsonschema', 'title', 'formid'],
6+
props: ['jsonschema', 'title', 'formid', 'useremail'],
77
methods: {
88
getFormData() {
99
const obj = {};

funnel/assets/js/utils/ractive_util.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { USER_AVATAR_IMG_SIZE } from '../constants';
55
Ractive.DEBUG = false;
66

77
export const useravatar = Ractive.extend({
8-
template: `{{#if user.profile_url && addprofilelink }}<a href="{{user.profile_url}}" class="nounderline">{{#if user.logo_url }}<img class="user__box__gravatar" src="{{ imgurl() }}" />{{else}}<div class="user__box__gravatar user__box__gravatar--initials" data-avatar-colour="{{ getAvatarColour(user.fullname) }}">{{ getInitials(user.fullname) }}</div>{{/if}}</a>{{else}}<span>{{#if user.logo_url }}<img class="user__box__gravatar" src="{{ imgurl() }}" />{{else}}<div class="user__box__gravatar user__box__gravatar--initials" data-avatar-colour="{{ getAvatarColour(user.fullname) }}">{{ getInitials(user.fullname) }}</div>{{/if}}</span>{{/if}}`,
8+
template: `{{#if addprofilelink }}<a href="{{user.absolute_url}}" class="nounderline">{{#if user.logo_url }}<img class="user__box__gravatar" src="{{ imgurl() }}" />{{else}}<div class="user__box__gravatar user__box__gravatar--initials" data-avatar-colour="{{ getAvatarColour(user.fullname) }}">{{ getInitials(user.fullname) }}</div>{{/if}}</a>{{else}}<span>{{#if user.logo_url }}<img class="user__box__gravatar" src="{{ imgurl() }}" />{{else}}<div class="user__box__gravatar user__box__gravatar--initials" data-avatar-colour="{{ getAvatarColour(user.fullname) }}">{{ getInitials(user.fullname) }}</div>{{/if}}</span>{{/if}}`,
99
data: {
1010
addprofilelink: true,
1111
size: 'medium',

funnel/assets/js/utils/vue_util.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { USER_AVATAR_IMG_SIZE } from '../constants';
55

66
export const userAvatarUI = Vue.component('useravatar', {
77
template:
8-
'<a :href="user.profile_url" v-if="user.profile_url && addprofilelink" class="nounderline"><span class="user__box__wrapper" v-if="user.logo_url"><img class="user__box__gravatar" :src="imgurl"></span><div class="user__box__gravatar user__box__gravatar--initials" :data-avatar-colour="getAvatarColour(user.fullname)" v-else>{{ getInitials(user.fullname) }}</div></a v-if="user.profile_url && addprofilelink"></a><span v-else><img class="user__box__gravatar" :src="imgurl" v-if="user.logo_url"/><div class="user__box__gravatar user__box__gravatar--initials" :data-avatar-colour="getAvatarColour(user.fullname)" v-else>{{ getInitials(user.fullname) }}</span v-else>',
8+
'<a :href="user.absolute_url" v-if="addprofilelink" class="nounderline"><span class="user__box__wrapper" v-if="user.logo_url"><img class="user__box__gravatar" :src="imgurl"></span><div class="user__box__gravatar user__box__gravatar--initials" :data-avatar-colour="getAvatarColour(user.fullname)" v-else>{{ getInitials(user.fullname) }}</div></a v-if="user.absolute_url && addprofilelink"></a><span v-else><img class="user__box__gravatar" :src="imgurl" v-if="user.logo_url"/><div class="user__box__gravatar user__box__gravatar--initials" :data-avatar-colour="getAvatarColour(user.fullname)" v-else>{{ getInitials(user.fullname) }}</span v-else>',
99
props: {
1010
user: Object,
1111
addprofilelink: {

funnel/assets/sass/components/_ticket-modal.scss

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
}
6969

7070
.price-btn {
71-
min-width: 200px;
71+
min-width: 150px;
7272
font-size: inherit;
7373
padding: 0;
7474
display: flex;
@@ -78,9 +78,7 @@
7878
justify-content: center;
7979
height: 42px;
8080
line-height: 16px;
81-
text-overflow: ellipsis;
82-
white-space: nowrap;
83-
overflow: hidden;
81+
white-space: break-spaces;
8482
}
8583

8684
.price-btn__txt {

funnel/assets/sass/pages/project.scss

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,13 @@
9797
border-color: inherit;
9898
}
9999
}
100-
.register-block__content--half {
101-
width: calc(50% - 8px);
100+
.register-block__content {
101+
width: calc(50% - $mui-grid-padding/2);
102102
align-self: flex-end;
103103
}
104-
.register-block__content--half:first-child {
105-
margin-right: 16px;
104+
.register-block__content:only-child {
105+
width: 100%;
106+
align-self: flex-end;
106107
}
107108
}
108109

@@ -141,7 +142,7 @@
141142
border-color: inherit;
142143
}
143144
}
144-
.register-block__content--half {
145+
.register-block__content {
145146
.register-block__content__rsvp-txt {
146147
font-size: 9px;
147148
}

0 commit comments

Comments
 (0)