Skip to content

Commit

Permalink
Merge pull request #133 from bkd-mba-fbi/develop
Browse files Browse the repository at this point in the history
Lyss Patch
  • Loading branch information
schefbi authored Mar 9, 2022
2 parents 695d0a8 + 36145f5 commit 4352982
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 23 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# kursausschreibung 3.3.1
# kursausschreibung 3.3.2
[![Build 🏭🚀](https://github.com/bkd-mba-fbi/kursausschreibung/actions/workflows/buildDeploy.yml/badge.svg)](https://github.com/bkd-mba-fbi/kursausschreibung/actions/workflows/buildDeploy.yml)
## Prerequisites

Expand Down
12 changes: 9 additions & 3 deletions app/components/input/input-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export default Component.extend({
}
else {

this.set('field.fileLabelBevorFileChoose', this.get('field.fileTypeLabel'));
this.set('field.fileTypeLabel', inputFile.name);
this.set('field.fileObject', inputFile);

Expand Down Expand Up @@ -65,7 +64,7 @@ export default Component.extend({


var basic = jQuery('#img'+ this.field.id).croppie({
viewport: { width: 296, height: 396 },
viewport: { width: 300, height: 400 },
boundary: { width: 350, height: 450 },
});

Expand All @@ -90,6 +89,12 @@ export default Component.extend({
let elementIdFile = getElementIdFile(fieldId);
let buttonClassDel = document.getElementById('fileBtDel' + fieldId);
buttonClassDel.classList.add('uk-hidden');

if (this.get('field.options.required')) {
let buttonClass = document.getElementById('fileBt' + this.field.id);
buttonClass.classList.add('required');
}

let imgClassDel = document.getElementById('img' + fieldId);
imgClassDel.classList.add('uk-hidden');
let imgClassUp = document.getElementById('fileBtUpload' + fieldId);
Expand All @@ -109,7 +114,8 @@ export default Component.extend({
let inputFile = getInputFile(fieldId);
basic.croppie('result', {
type: 'base64',
format: 'jpeg'
format: 'jpeg',
size: {width: '300', height: '400'}
}).then(function(base64) {
// html is div (overflow hidden)
// with img positioned inside.
Expand Down
14 changes: 9 additions & 5 deletions app/framework/date-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,20 @@ export function eventStarted(event) {
}

/**
* return true if DateTo is smaller than or equal
* to the current date
* return true if DateTo + TimeTo is smaller than or equal
* to the current datetime
* @param {object} event event to check
*/
export function eventEnded(event) {
let now = new Date();
if (event.DateTo === null) {
return true;
let dateTo = event.DateTo;
let repalcePattern = '00:00:00';
if (dateTo === null) {
return false;
}
return parseISO(event.DateTo).getTime() <= now.getTime();

dateTo = dateTo.search(repalcePattern) > 0 ? dateTo.replace(repalcePattern,event.TimeTo) : dateTo;
return parseISO(dateTo).getTime() <= now.getTime();
}

/**
Expand Down
14 changes: 10 additions & 4 deletions app/framework/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ let [
[getCulture, setCulture],
[getAccessToken, setAccessToken],
[getRefreshToken, setRefreshToken],
[getTokenExpire, setTokenExpire],
[getDataToSubmit, setDataToSubmit]
[getTokenExpire, setTokenExpire]
] = [
'uiCulture',
'CLX.LoginToken',
Expand All @@ -38,6 +37,13 @@ export {
getCulture, setCulture,
getAccessToken, setAccessToken,
getRefreshToken, setRefreshToken,
getTokenExpire, setTokenExpire,
getDataToSubmit, setDataToSubmit
getTokenExpire, setTokenExpire
};

export function getDataToSubmit(){
return window.kursausschreibung.dataToSubmit;
}

export function setDataToSubmit(dataToSubmit){
window.kursausschreibung.dataToSubmit = dataToSubmit;
}
1 change: 1 addition & 0 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<meta name="Description" content="Kursmodul">
<!-- MODULE head configuration -->
{{content-for "head"}}
<meta name="kursausschreibung/config/environment" content="%7B%22modulePrefix%22%3A%22kursausschreibung%22%2C%22environment%22%3A%22development%22%2C%22rootURL%22%3A%22%22%2C%22locationType%22%3A%22hash%22%2C%22EmberENV%22%3A%7B%22FEATURES%22%3A%7B%7D%2C%22EXTEND_PROTOTYPES%22%3A%7B%22Date%22%3Afalse%7D%7D%2C%22APP%22%3A%7B%22rootElement%22%3A%22%23kursausschreibung-root%22%2C%22name%22%3A%22kursausschreibung%22%2C%22version%22%3A%223.3.1%2Bfeef2e77%22%7D%2C%22exportApplicationGlobal%22%3Atrue%7D" />

<!-- CSS -->
<link rel="stylesheet" href="{{rootURL}}assets/app.css">
Expand Down
18 changes: 10 additions & 8 deletions app/routes/list/category/event/confirmation.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default Route.extend({
if(additionalPeople.length > 0 ){
subscriptionData.SubscriptionDetails.push({VssId: SUBSCRIPTION_DETAIL_ALLOW_MULTIPLE_PEOPLE , Value: additionalPeople.length });
}
postSubscription(subscriptionData).then(id => {
return postSubscription(subscriptionData).then(id => {
subscriptionFiles.forEach(file => {

let data = {
Expand All @@ -73,7 +73,6 @@ export default Route.extend({
promises.push(postSubscriptionDetailsFiles(data,file));

});
return promises;
});
});

Expand Down Expand Up @@ -138,6 +137,12 @@ function createPerson(addressData) {
);
}

// delete keys with null-values
Object.keys(addressData).forEach(key => {
if (addressData[key] === null)
delete addressData[key];
});

return new Promise(resolve => postPerson(addressData)
.then((_data, _status, xhr) => { resolve([xhr]); }))
.then(([xhr]) => { // xhr is in an array so it gets correctly passed along
Expand All @@ -152,15 +157,12 @@ function createPerson(addressData) {
// the person already exists and must get updated
let personId = duplicateHeader.split('/').slice(-1)[0];

// delete keys with null-values
Object.keys(addressData).forEach(key => {
if (addressData[key] === null)
delete addressData[key];
});

// add id
addressData.Id = parseInt(personId);

//On duplicat Person itz not allowed to update SocialSecurityNumber
delete addressData.SocialSecurityNumber;

return putPerson(addressData, personId)
.then(() => personId)
.catch(error => {
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kursausschreibung",
"version": "3.3.1",
"version": "3.3.2",
"private": true,
"description": "Evento JS Module for online course announcement",
"license": "MIT",
Expand Down

0 comments on commit 4352982

Please sign in to comment.