Giter Site home page Giter Site logo

rcdexta / react-trello Goto Github PK

View Code? Open in Web Editor NEW
2.2K 39.0 467.0 9.1 MB

Pluggable components to add a kanban board to your application

Home Page: https://rcdexta.com/react-trello/

License: MIT License

JavaScript 99.62% HTML 0.12% CSS 0.27%
react reactjs-components trello kanban-board js-library

react-trello's Introduction

React Trello

Pluggable components to add a Trello (like) kanban board to your application

Build Status yarn version bundlephobia.com

This library is not affiliated, associated, authorized, endorsed by or in any way officially connected to Trello, Inc. Trello is a registered trademark of Atlassian, Inc.

Basic Demo

Edit react-trello-example

Features Showcase

Storybook

Features

alt tag

  • Responsive and extensible
  • Easily pluggable into existing react application
  • Supports pagination when scrolling individual lanes
  • Drag-And-Drop on cards and lanes (compatible with touch devices)
  • Edit functionality to add/delete cards
  • Custom elements to define lane and card appearance
  • Event bus for triggering events externally (e.g.: adding or removing cards based on events coming from backend)
  • Inline edit lane's title

Getting Started

Install using npm or yarn

$ npm install --save react-trello

or

$ yarn add react-trello

Usage

The Board component takes a prop called data that contains all the details related to rendering the board. A sample data json is given here to illustrate the contract:

const data = {
  lanes: [
    {
      id: 'lane1',
      title: 'Planned Tasks',
      label: '2/2',
      cards: [
        {id: 'Card1', title: 'Write Blog', description: 'Can AI make memes', label: '30 mins', draggable: false},
        {id: 'Card2', title: 'Pay Rent', description: 'Transfer via NEFT', label: '5 mins', metadata: {sha: 'be312a1'}}
      ]
    },
    {
      id: 'lane2',
      title: 'Completed',
      label: '0/0',
      cards: []
    }
  ]
}

draggable property of Card object is true by default.

The data is passed to the board component and that's it.

import React from 'react'
import Board from 'react-trello'

export default class App extends React.Component {
  render() {
    return <Board data={data} />
  }
}

Refer to storybook for detailed examples: https://rcdexta.github.io/react-trello/

Also refer to the sample project that uses react-trello as illustration: https://github.com/rcdexta/react-trello-example

Use edge version of project (current master branch)

$ yarn add rcdexta/react-trello

and

import Board from 'react-trello/src'

Upgrade

Breaking changes. Since version 2.2 these properties are removed: addLaneTitle, addCardLink, customLaneHeader, newCardTemplate, newLaneTemplate, and customCardLayout with children element.

Follow upgrade instructions to make easy migration.

Properties

This is the container component that encapsulates the lanes and cards

Required parameters

Name Type Description
data object Actual board data in the form of json

Optionable flags

Name Type Description
draggable boolean Makes all cards and lanes draggable. Default: false
laneDraggable boolean Set to false to disable lane dragging. Default: true
cardDraggable boolean Set to false to disable card dragging. Default: true
collapsibleLanes boolean Make the lanes with cards collapsible. Default: false
editable boolean Makes the entire board editable. Allow cards to be added or deleted Default: false
canAddLanes boolean Allows new lanes to be added to the board. Default: false
hideCardDeleteIcon boolean Disable showing the delete icon to the top right corner of the card (when board is editable)
editLaneTitle boolean Allow inline lane title edit Default: false

Callbacks and handlers

Name Type Description
handleDragStart function Callback function triggered when card drag is started: handleDragStart(cardId, laneId)
handleDragEnd function Callback function triggered when card drag ends, return false if you want to cancel drop: handleDragEnd(cardId, sourceLaneId, targetLaneId, position, cardDetails)
handleLaneDragStart function Callback function triggered when lane drag is started: handleLaneDragStart(laneId)
handleLaneDragEnd function Callback function triggered when lane drag ends: handleLaneDragEnd(removedIndex, addedIndex, payload)
onDataChange function Called everytime the data changes due to user interaction or event bus: onDataChange(newData)
onCardClick function Called when a card is clicked: onCardClick(cardId, metadata, laneId)
onCardAdd function Called when a new card is added: onCardAdd(card, laneId)
onBeforeCardDelete function Called before delete a card, please call the callback() if confirm to delete a card: onConfirmCardDelete(callback)
onCardDelete function Called when a card is deleted: onCardDelete(cardId, laneId)
onCardMoveAcrossLanes function Called when a card is moved across lanes onCardMoveAcrossLanes(fromLaneId, toLaneId, cardId, index)
onLaneAdd function Called when a new lane is added: onLaneAdd(params)
onLaneDelete function Called when a lane is deleted onLaneDelete(laneId)
onLaneUpdate function Called when a lane attributes are updated onLaneUpdate(laneId, data)
onLaneClick function Called when a lane is clicked onLaneClick(laneId). Card clicks are not propagated to lane click event
onLaneScroll function Called when a lane is scrolled to the end: onLaneScroll(requestedPage, laneId)

Other functions

Name Type Description
eventBusHandle function This is a special function that providers a publishHook to pass new events to the board. See details in Publish Events section
laneSortFunction function Used to specify the logic to sort cards on a lane: laneSortFunction(card1, card2)

I18n support

Name Type Description
lang string Language of compiled texts ("en", "ru", "pt-br"). Default is "en"
t function Translation function. You can specify either one key as a String. Look into ./src/locales for keys list

Style customization

Name Type Description
style object Pass CSS style props to board container
cardStyle object CSS style for every cards
laneStyle object CSS style for every lanes
tagStyle object If cards have tags, use this prop to modify their style
cardDragClass string CSS class to be applied to Card when being dragged
cardDropClass string CSS class to be applied to Card when being dropped
laneDragClass string CSS class to be applied to Lane when being dragged
laneDropClass string CSS class to be applied to Lane when being dropped
components object Map of customised components. List of available.

Lane specific props

Name Type Description
id string ID of lane
style object Pass CSS style props to lane container
labelStyle object Pass CSS style props of label
cardStyle object Pass CSS style props for cards in this lane
disallowAddingCard boolean Disallow adding card button in this lane (default: false)

Refer to stories folder for examples on many more options for customization.

Editable Board

It is possible to make the entire board editable by setting the editable prop to true. This switch prop will enable existing cards to be deleted and show a Add Card link at the bottom of each lane, clicking which will show an inline editable new card.

Check out the editable board story and its corresponding source code for more details.

Styling and customization

There are three ways to apply styles to the library components including Board, Lane or Card:

1. Predefined CSS classnames

Use the predefined css classnames attached to these elements that go by .react-trello-lane, .react-trello-card, .react-trello-board:

.react-trello-lane {
  border: 0;
  background-color: initial;
}

2. Pass custom style attributes as part of data.

This method depends on used Card and Lane components.

const data = {
  lanes: [
    {
      id: 'lane1',
      title: 'Planned Tasks',
      style: { backgroundColor: 'yellow' },  // Style of Lane
      cardStyle: { backgroundColor: 'blue' } // Style of Card
      ...
};

<Board 
  style={{backgroundColor: 'red'}}  // Style of BoardWrapper
  data={data}
  />

Storybook example - stories/Styling.story.js

3. Completely customize the look-and-feel by using components dependency injection.

You can override any of used components (ether one or completery all)

const components = {
  GlobalStyle: MyGlobalStyle, // global style created with method `createGlobalStyle` of `styled-components`
  LaneHeader: MyLaneHeader,
  Card: MyCard,
  AddCardLink: MyAddCardLink,
  ...
};

<Board components={components} />

Total list of customizable components: src/components/index.js

Refer to components definitions to discover their properties list and types.

Refer more examples in storybook.

Publish Events

When defining the board, it is possible to obtain a event hook to the component to publish new events later after the board has been rendered. Refer the example below:

let eventBus = undefined

const setEventBus = (handle) => {
  eventBus = handle
}
//To add a card
eventBus.publish({type: 'ADD_CARD', laneId: 'COMPLETED', card: {id: "M1", title: "Buy Milk", label: "15 mins", description: "Also set reminder"}})

//To update a card
eventBus.publish({type: 'UPDATE_CARD', laneId: 'COMPLETED', card: {id: "M1", title: "Buy Milk (Updated)", label: "20 mins", description: "Also set reminder (Updated)"}})

//To remove a card
eventBus.publish({type: 'REMOVE_CARD', laneId: 'PLANNED', cardId: "M1"})

//To move a card from one lane to another. index specifies the position to move the card to in the target lane
eventBus.publish({type: 'MOVE_CARD', fromLaneId: 'PLANNED', toLaneId: 'WIP', cardId: 'Plan3', index: 0})

//To update the lanes
eventBus.publish({type: 'UPDATE_LANES', lanes: newLaneData})

<Board data={data} eventBusHandle={setEventBus}/>

The first event in the above example will move the card Buy Milk from the planned lane to completed lane. We expect that this library can be wired to a backend push api that can alter the state of the board in realtime.

I18n and text translations

Custom text translation function

Pass translation function to provide custom or localized texts:

// If your translation table is flat
//
// For example: { 'placeholder.title': 'some text' }
const customTranslation = (key) => TRANSLATION_TABLE[key]

// If your translation table has nested hashes (provided translations table is it)
//
// For example: { 'placeholder': { 'title': 'some text' } }
import { createTranslate } from 'react-trello'
const customTranslation = createTranslate(TRANSLATION_TABLE)

<Board t={customTranslation} .../>

List of available keys - locales/en/translation.json

react-i18next example

import { withTranslation } from 'react-i18next';

const I18nBoard = withTranslation()(Board) 

Compatible Browsers

Tested to work with following browsers using Browserling:

  • Chrome 60 or above
  • Firefox 52 or above
  • Opera 51 or above
  • Safari 4.0 or above
  • Microsoft Edge 15 or above

Logging

Pass environment variable REDUX_LOGGING as true to enable Redux logging in any environment

Development

cd react-trello/
yarn install
yarn run storybook

Scripts

  1. yarn run lint : Lint all js files
  2. yarn run lintfix : fix linting errors of all js files
  3. yarn run semantic-release : make a release. Leave it for CI to do.
  4. yarn run storybook: Start developing by using storybook
  5. yarn run test : Run tests. tests file should be written as *.test.js and using ES2015
  6. yarn run test:watch : Watch tests while writing
  7. yarn run test:cover : Show coverage report of your tests
  8. yarn run test:report : Report test coverage to codecov.io. Leave this for CI
  9. yarn run build: transpile all ES6 component files into ES5(commonjs) and put it in dist directory
  10. yarn run docs: create static build of storybook in docs directory that can be used for github pages

Learn how to write stories here

Maintainers


rcdexta

dapi

License

MIT

react-trello's People

Contributors

ahmetcetin avatar dapi avatar dependabot-preview[bot] avatar dependabot[bot] avatar ebelanger avatar edudavid avatar g-rath avatar ifours avatar joeyleadjig avatar lowsky avatar lucianbuzzo avatar mahatch avatar mattsrobot avatar miguelwhite avatar mrogach2350 avatar ocxers avatar oliviervanbulck avatar orangecoding avatar patcon avatar paulcombal avatar plusminushalf avatar prakashbalaji avatar rcdexta avatar rubensflinco avatar shaneosullivan avatar tatosjb avatar thorjarhun avatar vittorio avatar vspedr avatar yashutanna avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-trello's Issues

Customize Lanes?

Is there a way I can customize the lanes similar to customizing Cards?
For instance the width, max height of the lanes, heading etc...
May be having 2 lanes on top of each other?

Style the Lane Label

Great component 👍

What is the proper way tot style the Lane Label? I recognize the Lane, and Title can be styled, but what of the Label?

npm ERR! missing script: start

npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "run" "start"
npm ERR! node v7.7.1
npm ERR! npm v4.1.2

npm ERR! missing script: start
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! https://github.com/npm/npm/issues

npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\zestard16\Desktop\trello\abc\react-trello-master\npm-debug.log

Add a card button

Do you have plan to implement the "Add a card" button on the bottom of the lane like Trello?

Manage Position on 1 Lane

After I adjust position and send to API to save. But when i reload it, it gone. How can i get property position to save string index. and save it.
Help me plz !!! Tks all guys

sourceLaneId equal targetLaneId?

Hi,
when implementing drag & drop behaviour it seems like the parameters sourceLaneId and targetLaneId which are given within the handleDragEnd-method are the same. In your Demo it is working correctly but when i use the code which is in your story.js it shows the beviour i just described above.

OnClick "delete card" : stop propagation

Hi,

First, thank you for your work ! Helps a lot 👍

I'm using your new feature "editable" board, wich works well.

Just one problem, I'm using "onCardClick" to display a popin with more informations about the card.
When I click on the delete button, the onCardClick is triggered too.

Since their is no "onCardDelete", we can not overwrite this. Could you change it, so onCardClick is not triggered anymore ?

Best regards.

NB : a "onCardAdd" would be great too :)

Module Parse Error

I get this error after I install react-trello then I run my environment. I'm using latest webpack, any ideas on how I can resolve this?

ERROR in ./~/react-trello/dist/styles/Dragula.scss
Module parse failed: /ui/node_modules/react-trello/dist/styles/Dragula.scss Unexpected token (1:0)
You may need an appropriate loader to handle this file type.

Thanks.

On card click is not triggered any more

Hi,

With last update (1.26.1), onCarcClick i snot triggered any more :

<Board
              draggable={true}
              handleDragEnd={(cardId, sourceLaneId, targetLaneId) => this.dragCardToCol(cardId, targetLaneId)}
              tagStyle={{fontSize: '70%'}}
              onCardClick={(cardId, metadata, laneId) => alert(cardId)}
              onCardAdd={(card, laneId) => this.addCard(card, laneId)}
              onCardDelete={(cardId, laneId) => this.askDeleteCard(cardId, laneId)}
              newCardTemplate={<NewCard />}
              customCardLayout
              data={data}
              addCardLink={
                <a href="#">
                  <i className="fa fa-plus" aria-hidden="true"></i>
                  &nbsp;Ajouter une tâche
                </a>
              }
              editable
            >
              <CustomCard/>

When I click on the card, the alert is never displayed (same with a custom function this.showDetails(cardId) )

Webpack problem with editable ?

Hi,

Having a problem wich maybe (or not) a problem with webpack.

Using react-trello and the editable props, wich works well on my dev station (using hot reload).
When going to production, i'm using webpack in prod configuration. All works fine, except the "editable" or react-trello. Their is no errors, other props of react-trello works well... (it's like editable is false, but in code it's true...)

Any idea what could be the problem ?

Thank's for your help.

cannot get drag to work

Greetings!

I see that you made fixes to bugs, but I cannot seem to get the drag to work.

Also your example is not working either.

PLease advise when you get the chance!

Unable to drag cards

Hello @rcdexta ,

First of all congratulations for the component.

I am playing with react-trello but I am having issues with drag and drop cards between lanes.

Here is my code:
render() { return ( <Board data={data} draggable={true} onDragStart={() => console.log('start')} onDragEnd={() => console.log('end')} /> ); }

What I am missing?

Regards,

Eduardo

When adding a new card, I do not receive the nextData

When I add a card to the board using .publish({type: 'ADD_CARD', ...}); I do not receive the nextData inside the function called 'shouldReceiveNewData'.

When I add a card, the component does not render again to get the new state.
The state is not updating with the new card added.

My example:

addCard = () => {
        const { eventBus, } = this.state;

        eventBus.publish({
            type: 'ADD_CARD',
            laneId: 'lane1',
            card: {
                id: `card1`,
                title: 'new card',
                label: '30 mins',
                description: 'new task',
                metadata: { laneId: 'lane1' }
            }
        });
    }
shouldReceiveNewData = nextData => {
        console.log('it is not being called);
        console.log(nextData);
    }

<Board data={this.state.boardData} eventBusHandle={this.setEventBus} onDataChange{this.shouldReceiveNewData}/>

Bug : onCardAdd give wrong LaneId

If I add an id props to the board like this :

<Board
            id={"mainBoardProject"}
            editable={true}
            tagStyle={{fontSize: '70%'}}
            onCardClick={(cardId, metadata, laneId) => this.openEditCard(cardId)}
            onCardAdd={(card, laneId) => this.addCard(card, laneId)}
            onCardDelete={(cardId, laneId) => this.askDeleteCard(cardId, laneId)}
            customCardLayout
            data={data}
            addCardLink={<a href="#">Ajouter une tâche</a>}
          >
            <CustomCard/>
          </Board>

then the props onCardAdd always return "mainBoardProject" as laneId !

If i delete the props id={"mainBoardProject"} then all is fine :)

Cannot read property 'style' of undefined in version of '1.26.4'

Hi~, i upgrade the version of react-trello from '1.26.0' to '1.26.4', i got the following error.

uncaught at _callee TypeError: Cannot read property 'style' of undefined
    at eval (webpack-internal:///870:151:100)
    at eval (webpack-internal:///2165:359:24)
    at DragHandle.render (webpack-internal:///2179:181:14)
    at eval (webpack-internal:///1257:793:21)
    at measureLifeCyclePerf (webpack-internal:///1257:73:12)
    at ReactCompositeComponentWrapper._renderValidatedComponentWithoutOwnerOrContext (webpack-internal:///1257:792:25)
    at ReactCompositeComponentWrapper._renderValidatedComponent (webpack-internal:///1257:819:32)
    at ReactCompositeComponentWrapper.performInitialMount (webpack-internal:///1257:359:30)
    at ReactCompositeComponentWrapper.mountComponent (webpack-internal:///1257:255:21)
    at Object.mountComponent (webpack-internal:///179:43:35)

This error disappear in v1.26.0

My Code is as bellow:

 <Board
            style={{  }}
            data={{ lanes: laneList }}
            draggable
            customCardLayout
            handleDragEnd={this.handleDragEnd.bind(this)}
            handleDragStart={this.handleDragStart.bind(this)}
            onCardClick={this.onWorkItemClick.bind(this)}
            customLaneHeader={<CustomLaneHeader />}
          >
            <CustomCard stateList={nextStateList} intl={intl} listMap={listMap} dispatch={dispatch} />
</Board>

Can't resolve components/Board

./node_modules/react-trello/dist/index.js
Module not found: Can't resolve './components/Board' in '/Users/chrislewis/Projects/statrecruit-react/node_modules/react-trello/dist'

Board with className styling

Hi rcdexta,

Is it possible to add a className to the Board component with this styling on it, or is only inline styling supported?

JSX:
<Board className={styles.board} data={processes} />

CSS:
.board { background-color: #191F26; padding-top: 10; padding-left: 10; }

Thanks

Hides on first time dragging of card #1

On first time load, when i tried to drag the card to another lane it gets hide (invisible).
Then after doing "Add card" in the same lane where last hided, the card gets visible now..

Update board data issue

I am using custom card layout and I want to change card color when I move a card into another lane.
So, I set the draggable props to true.
And in handleDragEnd function, I set the status of class, so the component must be rendered again, but the color of the card was not changed.
I tried to debug and I noticed that update board view event occurs later than drawing cards.
Please check this issue and let me know how to solve this problem.
Thanks.

Customize delete button for editable cards

Reference: #42

Hi - Thanks for your work! Just wondering if it is possible to add custom component to the delete button? It fits well with standard setup but my styling is using material-ui components and I would like to change the delete button (or actually remove it - so I could have a popup show info on click)

image

Any idea??

Cheers,

M

Questions

Hello @rcdexta,

I have two questions about the component:

  1. How can I get card index inside lane. For example, if I want to persist the cards position inside a lane, how do I know its position?

  2. Is it possible to drop card in a specific position when moving across lanes?

Regards,

Eduardo

A question on how react-trello handles the REFRESH_BOARD publish

I am attempting to use the refresh board command to use new data returned from an api. The problem i am running into is that using values from my props (ie. this.props.data) does not refresh the state of the object, however using the publich with data = { login: [] } updates the status just fine. Here is some snippets for reference:

   setEventBus(handle) {
        this.setState({ eventBus: handle });
    }

    refreshBoard(data) {
        this.state.eventBus.publish({
            type: 'REFRESH_BOARD',
            data: data,
        });
    }

  updateCard(card) {
        this.props.updateCard(card, this.props.login).then(response => {
            this.props.getBoard(this.props.login).then(response2 => {
                let data = Object.assign({}, { ...response2.payload });
                this.refreshBoard(data);
            });
            this.closeModals();
        });
    }


<Board
     style={styles.trelloBoard}
     draggable
     customCardLayout
     customLaneHeader={<CustomLaneHeader />}
     data={this.props.data}
     handleDragEnd={this.updateCardLane}
     onCardClick={this.cardDetailModal}
     onDataChange={this.checkCurrentData}
     eventBusHandle={this.setEventBus}
/>

so here it gets updated 2 ways, when the data field in the board changes as it uses this.props.data, coming from an axios redux call, and using the publish. Is there something i am missing in my usage of this component?

Custom data with customcard

I have problem with cards in lanes.

error: TypeError: Cannot read property 'length' of undefined at t.r.sameCards (Lane.js:130) at t.value (Lane.js:230) at d.updateComponent (ReactCompositeComponent.js:611) at d.receiveComponent (ReactCompositeComponent.js:544) at Object.receiveComponent (ReactReconciler.js:122) at d._updateRenderedComponent (ReactCompositeComponent.js:751) at d._performComponentUpdate (ReactCompositeComponent.js:721) at d.updateComponent (ReactCompositeComponent.js:642) at d.receiveComponent (ReactCompositeComponent.js:544) at Object.receiveComponent (ReactReconciler.js:122)

Somebody know that problem and knows any solution ?

My data:
lanes:
0:cards:
0:{id: 187, id_project: 2, id_company: 1, id_owner: 18, id_odoo: null, …}
1:{id: 240, id_project: 2, id_company: 1, id_owner: 18, id_odoo: null, …}
length:2
currentPage:1
id:"2018-01-23"
label:"2018-01-23"
title:"Today"
1:{id: "2018-01-24", title: "Tommorow", label: "2018-01-24", cards: Array(0), currentPage: 1}

Updating board data does not re-render the board?

Hi, I am currently having board data as a prop boardData: {lanes: []} in constructor() and then I try to fetch the lanes in componentDidMount(). My problem is that even after fetching successfully and this.state.boardData were updated, the board is still rendering with {lanes: []}

Is it not possible to render the board dynamically right now?

Problem card order when drag card between two lanes

I'm using customCards and when I drag a card from a column A to a column B I can drop my item in any position, but when I leave the item the items is added at the end of the list.
Is this the expected behaviour? I'm the only one with this problem?
thank you!

cleanup outdated dependencies

Hi, this is a really great project and I also like to see how it used styled-component!

While running
npm outdated I found tht some dependencies are outdated/old or could even be removed, because they are unused.

E.g. dependencies for testing, like
babel-jest chai chai-enzyme enzyme istanbul jest jest-cli jsdom mocha [email protected](deprecated in react@16!) [email protected] sinon
(for react-addons-test-utils, see note about migration/deprecation on https://reactjs.org/blog/2017/04/07/react-v15.5.0.html#react-test-utils)

Even while some are difficult to upgrade, but I did not find any unit tests, yet ;-)

So how about reducing the list of dependencies?

As a follow-up, let's add some updated Jest based unit tests later in a separate task, when there was some time?

ReferenceError: window is not defined

ReferenceError: window is not defined
at Object. (D:\bobtrade\bobtrade-marketplace\node_modules\react-trello\dist\components\Board.js:33:61)
at Module._compile (module.js:570:32)
at Module._extensions..js (module.js:579:10)
at Object.require.extensions.(anonymous function) [as .js] (D:\bobtrade\bobtrade-marketplace\node_modules\babel-register\lib\node.js:152:7)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (D:\bobtrade\bobtrade-marketplace\node_modules\react-trello\dist\index.js:8:14)
at Module._compile (module.js:570:32)
at Module._extensions..js (module.js:579:10)
at Object.require.extensions.(anonymous function) [as .js] (D:\bobtrade\bobtrade-marketplace\node_modules\babel-register\lib\node.js:152:7)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (D:/bobtrade/bobtrade-marketplace/client/components/Merchant/Order/Orders.js:4:1)
at Module._compile (module.js:570:32)
at loader (D:\bobtrade\bobtrade-marketplace\node_modules\babel-register\lib\node.js:144:5)
at Object.require.extensions.(anonymous function) [as .js] (D:\bobtrade\bobtrade-marketplace\node_modules\babel-register\lib\node.js:154:7)

Dynamic updating Card Title

I am programatically updating the Card Title, but this does not seem to impact the rendering of the Card Title? Any ideas?

Passing components to the Lane

Is it possible to pass components to the lane?

For example: The Lane has a label, but it accepts only string. Is it possible to pass a custom component inside a lane? For example, I would like to pass an 'options' component there instead a string, or maybe pass a custom 'button' component at the end of the lane, to add cards to the lanes.

Touch responsive

Hi,
Great Component.
I was wondering if it works for touch Events also, for iPads or phones?

It responds to click events on desktop but doesn't responding to touch events.

Add and Delete Button

Do this library have Add and delete button for card and lane like real Trello? If have, pls let me know how to using it? Tks

Pass laneId when clicking in a card

Currently, when we click on a card, the onCardClick() function is passing only the cardId. Is it possible to pass the laneId too (or maybe the entire card object)? It gonna be better to find the card inside the lane or receive all the data from the card.

For example: When I click on a card, I want to open a modal with details about the card. It will be more easy to get the card inside the lane that I want passing the laneId too.

Example: (cardId, metadata, laneId) => alert(laneId) or (cardObject) => alert(cardObject)

I created a PR for this.

Got error when using custom card

image

Here is my custom card with components taken from react-bootstrap https://react-bootstrap.github.io/components.html#panels

const CustomCard = props => {
    const CardSubject = (
        <h4>{props.subject}</h4>
    );

    return (
        <Panel header={CardSubject} bsStyle="success">
            <Grid>
                <Row className="show-grid">
                    <Col xs={12} md={8}>Status: {props.status}</Col>
                    <Col xs={6} md={4}>Assigned to: {props.assignee}</Col>
                </Row>
                <Row className="show-grid">
                    <Col xs={12} md={8}>Link1</Col>
                    <Col xs={6} md={4}>Link2</Col>
                </Row>
            </Grid>
        </Panel>
    )
}

Problem window is not defined

When I try to add your library to my project I get this error:

] [dev:server] /home/blablabla/demo/node_modules/react-trello/dist/components/Board.js:33 [2] var store = (0, _redux.createStore)(_BoardReducer2.default, window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()); [2] ^ [2] ReferenceError: window is not defined [2] at Object.<anonymous> (/home/blablabla/demo/node_modules/react-trello/dist/components/Board.js:33:61) [2] at Module._compile (module.js:570:32) [2] at Object.Module._extensions..js (module.js:579:10) [2] at Module.load (module.js:487:32) [2] at tryModuleLoad (module.js:446:12) [2] at Function.Module._load (module.js:438:3) [2] at Module.require (module.js:497:17) [2] at require (internal/module.js:20:19) [2] at Object.<anonymous> (/home/blablabla/demo/node_modules/react-trello/dist/index.js:8:14) [2] at Module._compile (module.js:570:32)
How can I solve this issue? I saw an other issue closed but the problem already exists.
I'm using the version "react-trello":"^1.18.1"-

I've seen that you define also a store (redux) for your library? How can I use my redux store instead of your?

Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.