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

v3.19.0...v3.28.6 #183

Merged
merged 26 commits into from
Aug 16, 2024
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
50 changes: 34 additions & 16 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
module.exports = {
root: true,
parserOptions: {
ecmaVersion: 2017,
sourceType: 'module'
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true,
},
},
plugins: [
'ember'
],
plugins: ['ember'],
extends: [
'eslint:recommended',
'plugin:ember/recommended'
'plugin:ember/recommended',
'plugin:prettier/recommended',
],
env: {
browser: true
browser: true,
},
rules: {
'semi': 'error',
Expand All @@ -22,19 +24,35 @@ module.exports = {
// node files
{
files: [
'testem.js',
'ember-cli-build.js',
'config/**/*.js',
'lib/*/index.js'
'./.eslintrc.js',
'./.prettierrc.js',
'./.template-lintrc.js',
'./ember-cli-build.js',
'./testem.js',
'./blueprints/*/index.js',
'./config/**/*.js',
'./lib/*/index.js',
'./server/**/*.js',
],
parserOptions: {
sourceType: 'script',
ecmaVersion: 2015
},
env: {
browser: false,
node: true
}
}
]
node: true,
},
plugins: ['node'],
extends: ['plugin:node/recommended'],
rules: {
// this can be removed once the following is fixed
// https://github.com/mysticatea/eslint-plugin-node/issues/77
'node/no-unpublished-require': 'off',
},
},
{
// Test files:
files: ['tests/**/*-test.{js,ts}'],
extends: ['plugin:qunit/recommended'],
},
],
};
2 changes: 1 addition & 1 deletion .github/workflows/buildDeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

strategy:
matrix:
node-version: [10.x]
node-version: [14.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# misc
/.vscode
/.sass-cache
/.eslintcache
/connect.lock
/coverage/*
/libpeerconnection.log
Expand Down
21 changes: 21 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# unconventional js
/blueprints/*/files/
/vendor/

# compiled output
/dist/
/tmp/

# dependencies
/bower_components/
/node_modules/

# misc
/coverage/
!.*
.eslintcache

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
5 changes: 5 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict';

module.exports = {
singleQuote: true,
};
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
language: node_js
node_js:
- "10"
- "12"

sudo: false
dist: trusty
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ Make use of the many generators for code, try `ember help generate` for more det

### Linting

* `npm run lint:js`
* `npm run lint:js -- --fix`
* `npm run lint`
* `npm run lint:fix`

### Building

Expand Down
12 changes: 8 additions & 4 deletions app/components/event-list-search.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { setParameterByName, getParameterByName } from 'kursausschreibung/framew
import { sortAs } from '../framework/gui-helpers';
import { getSortAs } from '../framework/storage';
import settings from '../framework/settings';
import { getString } from '../framework/translate';
import { htmlSafe } from '@ember/string';

// tests if a query matches a value
function match(value, query) {
Expand Down Expand Up @@ -32,15 +34,15 @@ export default Component.extend({
this.send('queryChanged');
}

let sortOptions = [];
let options = '';
if(settings.sortOptions === undefined) {
sortOptions.push({key:'error', value:'configure key sortoptions array in settings'});
options = '<option value=error>configure key sortoptions array in settings</option>';
} else {
settings.sortOptions.forEach(option => {
sortOptions.push({key:option, value:"sort"+option});
options = options + '<option value='+option+'>'+getString("sort"+option)+'</option>';
});
}
this.set('sortOptions',sortOptions);
this.set('sortOptions',htmlSafe(options));
},

didRender() {
Expand All @@ -50,7 +52,9 @@ export default Component.extend({
filteredEvents: oneWay('events'),

keyUp(){
this.set('query',document.getElementById('searchEvents').value)
setParameterByName('search',this.get('query'));
this.send('queryChanged');
},

actions: {
Expand Down
10 changes: 10 additions & 0 deletions app/components/input/input-dropdown.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
import Component from '@ember/component';
import { vssDependency } from 'kursausschreibung/framework/form-helpers';
import { htmlSafe } from '@ember/string';

export default Component.extend({
willRender() {
let options = this.get('field.options.options');
let dropdownOptions = '';
options.forEach(option => {
dropdownOptions = dropdownOptions + '<option value='+option.Key+'>'+option.Value+'</option>';
});
this.set('dropdownOptions',htmlSafe(dropdownOptions));
},

change(){
let field = this.get('field');
let currentValue = null;
Expand Down
3 changes: 2 additions & 1 deletion app/components/input/input-email.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import Component from '@ember/component';
import { formFieldError } from 'kursausschreibung/framework/form-helpers';
import jQuery from 'jquery';

export default Component.extend({
change() {
// show an error message for duplicate e-mails
const emailFields = this.$().closest('form').find('input[type="email"]').toArray();
const emailFields = jQuery('#subscriptionForm').closest('form').find('input[type="email"]').toArray();
const emailFieldValues = emailFields.map(field => field.value);

emailFields.forEach((field, fieldIndex) => {
Expand Down
5 changes: 3 additions & 2 deletions app/components/input/input-freeform-dropdown.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import Component from '@ember/component';
import { vssDependency } from 'kursausschreibung/framework/form-helpers';
import jQuery from 'jquery';

export default Component.extend({
didInsertElement() {
this._super(...arguments);

let options = this.get('field.options').options.map(option => option.Value);

this.$('.typeahead').typeahead(
jQuery('.typeahead').typeahead(
{
hint: true,
highlight: true,
Expand All @@ -26,7 +27,7 @@ export default Component.extend({
},

willDestroyElement() {
this.$('.typeahead').typeahead('destroy');
jQuery('.typeahead').typeahead('destroy');
this._super(...arguments);
},

Expand Down
8 changes: 5 additions & 3 deletions app/components/input/input-postal-code.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Component from '@ember/component';
import { debounce } from '@ember/runloop';
import { getPostalCodes } from 'kursausschreibung/framework/api';
import jQuery from 'jquery';


export default Component.extend({
Expand All @@ -11,8 +12,9 @@ export default Component.extend({
getPostalCodes(query).then(response => asyncResults(response));
};

let $typeahead = this.$('.typeahead');
let $locationFields = this.$().closest('fieldset').find('input[name="Location"]');
let elementId = '#'+this.elementId
let $typeahead = jQuery(elementId).children(0);
let $locationFields = jQuery(elementId).closest('fieldset').find('input[name="Location"]');

$typeahead.typeahead(
{
Expand All @@ -38,7 +40,7 @@ export default Component.extend({
},

willDestroyElement() {
this.$('.typeahead').typeahead('destroy');
jQuery('.typeaheadZip').typeahead('destroy');
this._super(...arguments);
}
});
12 changes: 10 additions & 2 deletions app/components/subscription-form.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Component from '@ember/component';
import { computed } from '@ember/object';
import $ from 'jquery';
import jQuery from 'jquery';
import { formatDate, getDMY, getYMD } from 'kursausschreibung/framework/date-helpers';
import { setDataToSubmit } from 'kursausschreibung/framework/storage';
import { getString } from 'kursausschreibung/framework/translate';
Expand Down Expand Up @@ -30,10 +30,18 @@ export default Component.extend({
submit(event) {
event.preventDefault();

subscribe(this.$('form'), this);
subscribe(jQuery('form'), this);
this.get('subscribe')();
},

useCompanyAddress(){
var value = this.get('useCompanyAddress');
if(value){
this.set('useCompanyAddress',false);
} else {
this.set('useCompanyAddress',true);
}
},
addPerson() {
if (this.get('event.FreeSeats') - 1 - this.get('additionalPeopleCount') <= 0) {
uikit.modal.alert(getString('noSeatsAvailable'));
Expand Down
8 changes: 1 addition & 7 deletions app/controllers/list/category/event/index.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
import Controller from '@ember/controller';
import settings from 'kursausschreibung/framework/settings';
import LinkComponent from '@ember/routing/link-component';

let badgeFreeSeatsEnabled = typeof settings.badgeFreeSeats === 'object' && settings.badgeFreeSeats.enabled === true;

export default Controller.extend({
showBreadcrumbs: settings.showBreadcrumbs,
badgeFreeSeatsEnabled
});

// bindings for tooltip and disabled attributes
LinkComponent.reopen({
attributeBindings: ['data-uk-tooltip', 'disabled']
});
});
14 changes: 8 additions & 6 deletions app/controllers/list/category/event/subscribe.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import Controller from '@ember/controller';
import { inject as service } from '@ember/service';
import { action } from '@ember/object';

export default Controller.extend({
actions: {
subscribe() {
this.transitionToRoute('list.category.event.confirmation');
export default class subscribeController extends Controller {
@service router;
@action
subscribe() {
this.router.transitionTo('list.category.event.confirmation');
}
}
});
};
2 changes: 1 addition & 1 deletion app/framework/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ function prepareEvent(event) {
addDisplayData(event);

//settings subscriptionWithLoginURL
event.subscriptionWithLoginURL = settings.subscriptionWithLoginURL;
event.subscriptionWithLoginURL = encodeURI(settings.subscriptionWithLoginURL+'/'+event.EventCategory+'/'+event.Id+'/subscribe');

//event subtitle when > inside string
let eventSubtitle = event.Designation.split(settings.eventSubtitle);
Expand Down
3 changes: 2 additions & 1 deletion app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
<script src="{{rootURL}}locale/fr-CH.js"></script>

<!-- JS -->
<script src="{{rootURL}}assets/app.js"></script>
<script src="{{rootURL}}assets/vendor.js"></script>
<script src="{{rootURL}}assets/kursausschreibung.js"></script>
<!-- MODULE head configuration -->

<!--Interne Fortbildung exclude-->
Expand Down
33 changes: 17 additions & 16 deletions app/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,24 @@ const Router = EmberRouter.extend({
location: config.locationType,
rootURL: config.rootURL,

didTransition() {
this._super(...arguments);

var subscriptionProcessId = 'subscriptionProcess';

setInterval(function () {
if (document.getElementById(subscriptionProcessId) !== null) {
setOffsetStickyHeader(subscriptionProcessId);
init(){
this.on('routeDidChange', transition => {
this._super(...arguments);

var subscriptionProcessId = 'subscriptionProcess';

setInterval(function () {
if (document.getElementById(subscriptionProcessId) !== null) {
setOffsetStickyHeader(subscriptionProcessId);
}
}, 1000);

if (this.currentPath === 'list.category.event.subscribe') {
scrollToTimeout(subscriptionProcessId);
} else if (this.currentPath !== 'list.index') {
scrollToTimeout(rootElement.id);
}
}, 1000);

if (this.currentPath === 'list.category.event.subscribe') {
scrollToTimeout(subscriptionProcessId);
} else if (this.currentPath !== 'list.index') {
scrollToTimeout(rootElement.id);
}

});
}
});

Expand Down
Loading