Commit 6de1a9a8 authored by Vincent Laroye's avatar Vincent Laroye

Merge branch 'feature/pbehavior-add-comment-field' into 'develop'

feature/pbehavior-add-comment-field

See merge request !653
parents 970ac89e 2a0f8d6c
Pipeline #4453 passed with stage
in 1 minute and 55 seconds
......@@ -32,7 +32,7 @@
r-rule-form(@input="changeRRule")
v-layout(row)
v-combobox(
label="Reason",
:label="$t('modals.createPbehavior.fields.reason')",
v-model="form.reason",
:items="selectItems.reasons",
:error-messages="errors.collect('reason')",
......@@ -41,13 +41,18 @@
)
v-layout(row)
v-select(
label="Type",
:label="$t('modals.createPbehavior.fields.type')",
v-model="form.type_",
:items="selectItems.types",
:error-messages="errors.collect('type')",
name="type",
v-validate="'required'"
)
v-layout(row)
v-textarea(
:label="$t('modals.createPbehavior.fields.comment')",
v-model="commentMessage",
)
v-layout(row)
v-alert(:value="serverError", type="error")
span {{ serverError }}
......@@ -88,6 +93,7 @@ export default {
data() {
return {
rRuleObject: null,
commentMessage: '',
form: {
name: '',
tstart: new Date(),
......@@ -141,6 +147,13 @@ export default {
data.rrule = this.rRuleObject.toString();
}
if (this.commentMessage !== '') {
data.comments = [{
author: this.currentUser.crecord_name,
message: this.commentMessage,
}];
}
this.$emit('submit', data);
}
},
......
......@@ -35,7 +35,6 @@ export const API_ROUTES = {
weatherWatcher: '/api/v2/weather/watchers',
pbehavior: {
pbehavior: '/api/v2/pbehavior',
create: '/pbehavior/create',
list: '/pbehavior/read',
},
pbehaviorById: '/api/v2/pbehavior_byeid',
......
......@@ -416,6 +416,7 @@ export default {
stop: 'End',
reason: 'Reason',
type: 'Type',
comment: 'Comment',
rRuleQuestion: 'Put a rrule on this pbehavior ?',
},
},
......
......@@ -95,7 +95,7 @@ export default {
async create({ commit }, { data, parents, parentsType }) {
try {
const id = await request.post(API_ROUTES.pbehavior.create, data);
const id = await request.post(API_ROUTES.pbehavior.pbehavior, data);
const pbehavior = {
...data,
enabled: true,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment