Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
ogptoolbox-ui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
53
Issues
53
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
ogptoolbox
ogptoolbox-ui
Commits
9c765ff7
Commit
9c765ff7
authored
Aug 12, 2017
by
Emmanuel Raviart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rating is now optional when posting a property.
parent
a7053d92
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
8 deletions
+25
-8
src/Cards/Item/State.elm
src/Cards/Item/State.elm
+1
-1
src/Properties/New/State.elm
src/Properties/New/State.elm
+1
-1
src/Requests.elm
src/Requests.elm
+23
-6
No files found.
src/Cards/Item/State.elm
View file @
9c765ff7
...
...
@@ -382,7 +382,7 @@ update msg model =
Debug
.
crash
"
Cards.Item.State update ValueUpserted: model.editedKeyId == Nothing"
in
(
{
model
|
data
=
mergeData
data
model
.
data
}
,
Requests
.
postProperty
model
.
authentication
model
.
cardId
editedKeyId
data
.
id
1
,
Requests
.
postProperty
model
.
authentication
model
.
cardId
editedKeyId
data
.
id
(
Just
1
)
|>
Http
.
send
(
ForSelf
<<
PropertyUpserted
)
)
...
...
src/Properties/New/State.elm
View file @
9c765ff7
...
...
@@ -111,7 +111,7 @@ update msg model =
ValueUpserted
data
->
(
{
model
|
data
=
mergeData
data
model
.
data
}
,
Requests
.
postProperty
model
.
authentication
model
.
objectId
model
.
keyId
data
.
id
1
,
Requests
.
postProperty
model
.
authentication
model
.
objectId
model
.
keyId
data
.
id
(
Just
1
)
|>
Http
.
send
(
ForSelf
<<
Upserted
)
)
...
...
src/Requests.elm
View file @
9c765ff7
...
...
@@ -349,7 +349,7 @@ postCollection authentication collectionId collectionJson =
}
postProperty
:
Maybe
Authentication
->
String
->
String
->
String
->
Int
->
Http
.
Request
DataIdBody
postProperty
:
Maybe
Authentication
->
String
->
String
->
String
->
Maybe
Int
->
Http
.
Request
DataIdBody
postProperty
authentication
objectId
keyId
valueId
rating
=
Http
.
request
{
method
=
"
POST"
...
...
@@ -357,11 +357,28 @@ postProperty authentication objectId keyId valueId rating =
,
url
=
apiUrl
++
"
properties?show=ballots&show=values&depth=3"
,
body
=
Encode
.
object
[
(
"
keyId"
,
Encode
.
string
keyId
)
,
(
"
objectId"
,
Encode
.
string
objectId
)
,
(
"
rating"
,
Encode
.
int
rating
)
,
(
"
valueId"
,
Encode
.
string
valueId
)
]
([
(
"
keyId"
,
Just
<|
Encode
.
string
keyId
)
,
(
"
objectId"
,
Just
<|
Encode
.
string
objectId
)
,
(
"
rating"
,
case
rating
of
Just
rating
->
Just
<|
Encode
.
int
rating
Nothing
->
Nothing
)
,
(
"
valueId"
,
Just
<|
Encode
.
string
valueId
)
]
|>
List
.
filterMap
(
\
(
key
,
value
)
->
case
value
of
Just
value
->
Just
(
key
,
value
)
Nothing
->
Nothing
)
)
|>
Http
.
jsonBody
,
expect
=
Http
.
expectJson
dataIdBodyDecoder
,
timeout
=
Nothing
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment