diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/App.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/App.vue index 9971344fc..0ae6fc578 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/App.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/App.vue @@ -50,7 +50,6 @@ export default { create: window.buttonText || null, edit: window.buttonText || null }, - type: window.buttonType || null, size: window.buttonSize || null, displayText: window.buttonDisplayText //boolean, default: true }, diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue index d483534a7..fa4ff4773 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue @@ -145,7 +145,7 @@ export default { default: { button: { text: { create: 'add_an_address_title', edit: 'edit_address' }, - type: 'btn-create', + type: { create: 'btn-create', edit: 'btn-update'}, displayText: true }, title: { create: 'add_an_address_title', edit: 'edit_address' }, @@ -223,13 +223,10 @@ export default { return (this.context.edit) ? this.default.button.text.edit : this.default.button.text.create; }, getClassButton() { - let type = this.default.button.type, - size = ''; - if (typeof this.options.button !== 'undefined') { - type = this.options.button.type !== null ? this.options.button.type : type; - size = this.options.button.size !== null ? this.options.button.size : size; - } - return size ? `${size} ${type}` : type; + let type = (this.context.edit) ? this.default.button.type.edit : this.default.button.type.create; + let size = (typeof this.options.button !== 'undefined' && this.options.button.size !== null) ? + `${this.options.button.size} ` : ''; + return `${size}${type}`; }, displayTextButton() { return (typeof this.options.button !== 'undefined' && typeof this.options.button.displayText !== 'undefined') ? diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/index.js b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/index.js index d662ebf5a..bb2dd6543 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/index.js +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/index.js @@ -3,8 +3,6 @@ import App from './App.vue'; import { _createI18n } from 'ChillMainAssets/vuejs/_js/i18n'; import { addressMessages } from './i18n'; -//import { createI18n } from 'vue-i18n'; -//const i18n = createI18n(); const i18n = _createI18n( addressMessages ); const app = createApp({ diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/api.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/api.js index d315a3db7..676bbf7b7 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/api.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/api.js @@ -4,12 +4,12 @@ * * @id integer - id of accompanyingCourse */ -const getAccompanyingCourse = (id) => { +const getAccompanyingCourse = (id) => { const url = `/api/1.0/person/accompanying-course/${id}.json`; return fetch(url) .then(response => { if (response.ok) { return response.json(); } - throw Error('Error with request resource response'); + throw Error('Error with request resource response'); }); }; @@ -20,8 +20,8 @@ const getAccompanyingCourse = (id) => { * @id integer - id of accompanyingCourse * @body Object - dictionary with changes to post */ -const patchAccompanyingCourse = (id, body) => { - console.log('body', body); +const patchAccompanyingCourse = (id, body) => { + //console.log('body', body); const url = `/api/1.0/person/accompanying-course/${id}.json`; return fetch(url, { method: 'PATCH', @@ -32,7 +32,7 @@ const patchAccompanyingCourse = (id, body) => { }) .then(response => { if (response.ok) { return response.json(); } - throw Error('Error with request resource response'); + throw Error('Error with request resource response'); }); }; @@ -47,24 +47,24 @@ const confirmAccompanyingCourse = (id) => { }) .then(response => { if (response.ok) { return response.json(); } - throw Error('Error with request resource response'); + throw Error('Error with request resource response'); }); }; /* -* Endpoint +* Endpoint */ const getSocialIssues = () => { const url = `/api/1.0/person/social-work/social-issue.json`; return fetch(url) .then(response => { if (response.ok) { return response.json(); } - throw Error('Error with request resource response'); + throw Error('Error with request resource response'); }); }; /* -* Endpoint v.2 chill_api_single_accompanying_course_participation, +* Endpoint v.2 chill_api_single_accompanying_course_participation, * method POST/DELETE, add/close a participation to the accompanyingCourse * * @id integer - id of accompanyingCourse @@ -83,12 +83,12 @@ const postParticipation = (id, payload, method) => { }) .then(response => { if (response.ok) { return response.json(); } - throw Error('Error with request resource response'); + throw Error('Error with request resource response'); }); }; /* -* Endpoint v.2 chill_api_single_accompanying_course_requestor, +* Endpoint v.2 chill_api_single_accompanying_course_requestor, * method POST/DELETE, add/close a requestor to the accompanyingCourse * * @id integer - id of accompanyingCourse @@ -109,12 +109,12 @@ const postRequestor = (id, payload, method) => { }) .then(response => { if (response.ok) { return response.json(); } - throw Error('Error with request resource response'); + throw Error('Error with request resource response'); }); }; /* -* Endpoint v.2 chill_api_single_accompanying_course_resource, +* Endpoint v.2 chill_api_single_accompanying_course_resource, * method POST/DELETE, add/remove a resource to the accompanyingCourse * * @id integer - id of accompanyingCourse @@ -126,11 +126,11 @@ const postResource = (id, payload, method) => { const body = { type: "accompanying_period_resource" }; switch (method) { case 'DELETE': - body['id'] = payload.id; + body['id'] = payload.id; break; default: body['resource'] = { type: payload.type, id: payload.id }; - } + } //console.log('body', body); const url = `/api/1.0/person/accompanying-course/${id}/resource.json`; return fetch(url, { @@ -142,7 +142,7 @@ const postResource = (id, payload, method) => { }) .then(response => { if (response.ok) { return response.json(); } - throw Error('Error with request resource response'); + throw Error('Error with request resource response'); }); }; @@ -150,7 +150,7 @@ const postResource = (id, payload, method) => { * Endpoint to Add/remove SocialIssue */ const postSocialIssue = (id, body, method) => { - //console.log('api body and method', body, method); + //console.log('api body and method', body, method); const url = `/api/1.0/person/accompanying-course/${id}/socialissue.json`; return fetch(url, { method: method, @@ -161,7 +161,7 @@ const postSocialIssue = (id, body, method) => { }) .then(response => { if (response.ok) { return response.json(); } - throw Error('Error with request resource response'); + throw Error('Error with request resource response'); }); }; @@ -170,7 +170,7 @@ const getUsers = () => { return fetch(url) .then(response => { if (response.ok) { return response.json(); } - throw Error('Error with request resource response'); + throw Error('Error with request resource response'); }); }; @@ -179,7 +179,7 @@ const whoami = () => { return fetch(url) .then(response => { if (response.ok) { return response.json(); } - throw Error('Error with request resource response'); + throw Error('Error with request resource response'); }); }; @@ -188,11 +188,11 @@ const getListOrigins = () => { return fetch(url) .then(response => { if (response.ok) { return response.json(); } - throw Error('Error with request resource response'); + throw Error('Error with request resource response'); }); } -export { +export { getAccompanyingCourse, patchAccompanyingCourse, confirmAccompanyingCourse, diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/CourseLocation.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/CourseLocation.vue index 0aae70295..df9ded5c5 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/CourseLocation.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/CourseLocation.vue @@ -32,7 +32,7 @@ ref="addAddress"> -
  • +