Skip to content

Quick edit game player character#169

Merged
mikelax merged 5 commits intomasterfrom
163_char_edit
Jul 5, 2018
Merged

Quick edit game player character#169
mikelax merged 5 commits intomasterfrom
163_char_edit

Conversation

@nazar
Copy link
Collaborator

@nazar nazar commented Jul 2, 2018

References #163

@nazar nazar requested a review from mikelax July 2, 2018 16:00
@nazar nazar self-assigned this Jul 2, 2018
@nazar
Copy link
Collaborator Author

nazar commented Jul 2, 2018

I'm going to check out React Semantic docs to see if it supports the new 16.3 Context in the Popup component as I'm not a fan in how I'm passing the gameId down the the modal.

@nazar
Copy link
Collaborator Author

nazar commented Jul 2, 2018

It doesn't look like the code for React 16.3 has been released yet.

I'll keep an 👁 on semantic and update once React 16.3 changes are released.

Copy link
Owner

@mikelax mikelax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left one small comment.
Also, where is the logic that looks at the type of game to decide what fields should be included in the quick edit modal?

import serviceExecutor from 'utils/serviceExecutor';


export default function ({
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nazar should this be a named function? is there an eslint rule for this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A function name is optional when it is exported as the default function.

1. Add per label quick edit forms
2. split up updateCharacter and quickUpdateCharacter mutations to avoid generalization rabbit hole
.chain()
.map((change) => {
return (`
<div class="change-meta">
Copy link
Owner

@mikelax mikelax Jul 3, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nazar should this be a p instead of div to match the messages generated by the editor?
Also, when I look at the html that was saved to the game_messages table, I don't see the class attribute, is it possible that is getting stripped somewhere?

.map((change) => {
return (`
<div class="change-meta">
<strong>${changeDescription || 'Changed'}</strong>:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nazar should the value here changeDescription be stored in the character_logs table in the change_description field? I think it should, right?

Eventually we are going to allow viewing the "history", or changelog of a Character, and it would be nice to see the the human entered value for the description rather than the generic Character stats updated.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should the value here changeDescription be stored in the character_logs table in the change_description field? I think it should, right?

changeDescription should be stored character_logs - I'll double check 👍

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch @mikelax

function doUpdateCharacter() {
const cleanInput = _(input)
.chain()
.omit(['changeDescription', 'changeMeta'])
Copy link
Owner

@mikelax mikelax Jul 3, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nazar should changeDescription be removed from this line here so the user entered description will override the default Character stats updated message?

Update: I tried removing the field but then the save function doesn't work, so I must be missing the reason for it.

nazar added 2 commits July 5, 2018 12:08
1. fix saving of change description in characters_logs
2. only character owners can see the quick exit popup
3. fix owner guard not working on characters edit
…sages. This extra type is used to hide the "edit" button on character update game messages
"source-map-support": "0.5.4",
"sql-fixtures": "1.0.0",
"subscriptions-transport-ws": "0.9.7",
"tsml": "^1.0.1",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nazar I'll merge this PR, but do you think this lib is necessary? I saw its not maintained anymore, though I assume the function it performs is really straight forward so no need for updates??

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lib is nice in that it strips whitespace and newlines added in backtick quoted multiline strings.

The code is < 10 lines - I did attempt to copypasta it but eslint disliked the non fancy es6 formats and I was too short on time to es5 -> es6 it.

@mikelax mikelax merged commit a13c0d3 into master Jul 5, 2018
@mikelax mikelax deleted the 163_char_edit branch July 5, 2018 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants