-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature expanded story labels auto complete (#456)
* Create project_labels attribute on ProjectBoard * Add project_labels to labels suggestions and option to add new ones * Create board_operations project_labels test * Change project_labels to labels * Move deleteLabel and addLabel logic to reducer * Fix wrong props on ExpandedStoryDescription
- Loading branch information
1 parent
5f61e07
commit 0a048f7
Showing
16 changed files
with
155 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import actionTypes from './actionTypes'; | ||
|
||
export const addLabelToProject = (label) => ({ | ||
type: actionTypes.ADD_LABEL_TO_PROJECT, | ||
label | ||
}); | ||
|
||
export const addLabelSuccess = (storyId, label) => ({ | ||
type: actionTypes.ADD_LABEL, | ||
storyId, | ||
label | ||
}); | ||
|
||
export const removeLabel = (storyId, labelName) => ({ | ||
type: actionTypes.DELETE_LABEL, | ||
storyId, | ||
labelName | ||
}); | ||
|
||
export const addLabel = (storyId, label) => | ||
(dispatch) => { | ||
dispatch(addLabelSuccess(storyId, label)); | ||
dispatch(addLabelToProject(label)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import * as Label from './label'; | ||
|
||
export const deserialize = (board) => ({ | ||
...board.project, | ||
labels: Label.splitLabels(board.labels) | ||
}); | ||
|
||
export const addLabel = (project, label) => ({ | ||
...project, | ||
labels: Label.uniqueLabels([ | ||
...project.labels, | ||
label | ||
]) | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
import httpService from '../../services/httpService'; | ||
import changeCase from 'change-object-case'; | ||
import * as Story from './story'; | ||
import * as Project from './project'; | ||
|
||
export function get(projectId) { | ||
return httpService | ||
.get(`/beta/project_boards/${projectId}`) | ||
.then(({ data }) => changeCase.camelKeys(data, { recursive: true, arrayRecursive: true })) | ||
.then((projectBoard) => ({ | ||
...projectBoard, | ||
project: Project.deserialize(projectBoard), | ||
stories: projectBoard.stories.map(Story.deserialize) | ||
})); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.