diff --git a/6 b/6 new file mode 100644 index 00000000..e69de29b diff --git a/browser/components/BoardShowPage/Card/CardBadges/CardLabel.sass b/browser/components/BoardShowPage/Card/CardBadges/CardLabel.sass index e233b09e..53d3d219 100644 --- a/browser/components/BoardShowPage/Card/CardBadges/CardLabel.sass +++ b/browser/components/BoardShowPage/Card/CardBadges/CardLabel.sass @@ -11,6 +11,7 @@ &:hover cursor: pointer &-text + min-height: 2em font-weight: bolder font-size: 80% padding: 0.4em 0.5em diff --git a/browser/components/BoardShowPage/LabelMain.js b/browser/components/BoardShowPage/LabelMain.js new file mode 100644 index 00000000..3f1fd414 --- /dev/null +++ b/browser/components/BoardShowPage/LabelMain.js @@ -0,0 +1,239 @@ +// import React, {Component} from 'react' +// import CardLabel from './Card/CardBadges/CardLabel' +// import ColorBox from './ColorBox' +// import Link from '../Link' +// import Form from '../Form' +// import Icon from '../Icon' +// import Button from '../Button' +// import ConfirmationButton from '../ConfirmationButton' +// import ActionsMenuPane from '../ActionsMenuPane' +// import boardStore from '../../stores/boardStore' +// import commands from '../../commands' +// import './Card/LabelMenu.sass' +// +// export default class MainLabelPanel extends Component { +// +// static propTypes = { +// card: React.PropTypes.object.isRequired, +// board: React.PropTypes.object.isRequired, +// // TODO: onClose: React.PropTypes.func.isRequired +// +// } +// +// +// //TODO: translate this constructor taken from LabelMenu for these components +// constructor(props){ +// super(props) +// this.state = { +// null: null +// } +// this.editLabel = this.editLabel.bind(this) +// } +// +// editLabel(labelId){ +// this.setState({editingLabel: labelId}) +// } +// +// +// +// editLabel(labelId, event){ +// event.preventDefault() +// this.props.editLabel(labelId) +// this.props.goToPane('Create Label Pane')() +// } +// +// +// addOrRemoveLabel(labelId, event) { +// event.preventDefault() +// commands.addOrRemoveLabel(this.props.card.id, labelId) +// } +// +// render() { +// const { card, board } = this.props +// const boardLabels = board.labels.map( label => { +// const checked = card.label_ids.includes(label.id) +// return +// }) +// +// return +//
+// {boardLabels} +//
+//
+// +// Create Label +// +//
+//
+// } +// } +// +// const LabelRow = (props) => { +// const {label, onClick, onEdit, checked} = props +// +// return
+//
+// +//
+// +//
+// } +// +// export class CreateLabelPanel extends Component { +// +// constructor(props) { +// super(props) +// this.state = {} +// +// if (props.state.editingLabel === null){ +// this.state.labelText = '' +// this.state.labelColor = '#98A0A4' +// } else { +// const label = this.labelBeingEdited(props) +// this.state.labelText = label.text +// this.state.labelColor = label.color +// } +// +// this.deleteLabel = this.deleteLabel.bind(this) +// this.changeColor = this.changeColor.bind(this) +// this.createOrEditLabel = this.createOrEditLabel.bind(this) +// this.handleChange = this.handleChange.bind(this) +// this.goBack = this.goBack.bind(this) +// } +// +// labelBeingEdited(props=this.props){ +// return this.isEditing(props) && +// props.board.labels.find(label => label.id === props.state.editingLabel) +// } +// +// isEditing(props=this.props){ +// return typeof props.state.editingLabel === 'number' +// } +// +// goBack(){ +// this.props.goToPane('Main Label Pane')() +// } +// +// deleteLabel(event) { +// if (event) event.preventDefault() +// commands.deleteLabel(this.props.board.id, this.props.state.editingLabel).then(this.goBack) +// } +// +// changeColor(event) { +// if (event) event.preventDefault() +// this.setState({labelColor: event.target.attributes.color.value}) +// } +// +// createOrEditLabel(event){ +// if (event) event.preventDefault() +// this.isEditing() ? this.updateLabel() : this.createLabel() +// } +// +// updateLabel(){ +// commands.updateLabel( +// this.props.board.id, +// this.props.state.editingLabel, +// { +// text: this.state.labelText, +// color: this.state.labelColor +// } +// ) +// .then(this.goBack) +// } +// +// createLabel(){ +// commands.createLabel(this.props.board.id, { +// text: this.state.labelText, +// color:this.state.labelColor, +// cardId: this.props.card.id, +// }).then(this.goBack) +// } +// +// handleChange(event) { +// this.setState({labelText: event.target.value}) +// } +// +// render() { +// const labelBeingEdited = this.labelBeingEdited() +// const header = this.isEditing() ? "Edit Label" : "Create Label" +// +// const colorBoxes = colors.map(color => { +// const checked = (this.state.labelColor===color) ? true : false +// return
+// +//
+// }) +// +// const deleteButton = this.isEditing() ? +// +// Delete +// : null +// +// return +//
+// +//
{colorBoxes}
+//
+//
+// +// {deleteButton} +//
+//
+//
+// } +// } +// +// const colors = [ +// "#0079bf", +// "#d8a359", +// "#70a95d", +// "#bc6858", +// "#9d7cae", +// "#d478a4", +// "#6cc885", +// "#30bbd3", +// "#98a0a4" +// ] diff --git a/browser/components/BoardShowPage/LabelsPane.js b/browser/components/BoardShowPage/LabelsPane.js new file mode 100644 index 00000000..79dd6bfb --- /dev/null +++ b/browser/components/BoardShowPage/LabelsPane.js @@ -0,0 +1,30 @@ +// import React, { Component, PropTypes } from 'react' +// import CardLabel from './Card/CardBadges/CardLabel' + + +// // This component is designed to be given to ActionsMenu +// export default class LabelsPane extends Component { + +// static propTypes = { +// board: PropTypes.object.isRequired, +// } + +// render(){ +// const { board } = this.props + +// const labels = board.labels.map( label => { +// return