Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import from Trello - Labels issue #5345

Open
sergiobaiao opened this issue Mar 13, 2024 · 5 comments
Open

Import from Trello - Labels issue #5345

sergiobaiao opened this issue Mar 13, 2024 · 5 comments

Comments

@sergiobaiao
Copy link

sergiobaiao commented Mar 13, 2024

When importing a JSON from Trello, Wekan doesn't support standard Trello label colors, as in the log:

wekan-app  | Exception while invoking method 'importBoard' Error: yellow_light is not an allowed value
wekan-app  |     at getErrorObject (packages/aldeed_collection2-core.js:480:15)
wekan-app  |     at ns.Collection.doValidate (packages/aldeed_collection2-core.js:462:13)
wekan-app  |     at ns.Collection.Mongo.Collection.<computed> [as insert] (packages/aldeed_collection2-core.js:214:25)
wekan-app  |     at packages/matb33:collection-hooks/collection-hooks.js:87:46
wekan-app  |     at packages/meteor.js:365:18
wekan-app  |     at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1389:31)
wekan-app  |     at Object.directOp (packages/matb33:collection-hooks/collection-hooks.js:20:27)
wekan-app  |     at Object.self.direct.<computed> [as insert] (packages/matb33:collection-hooks/collection-hooks.js:86:30)
wekan-app  |     at TrelloCreator.createBoardAndLabels (models/trelloCreator.js:233:35)
wekan-app  |     at TrelloCreator.create (models/trelloCreator.js:761:26)
wekan-app  |     at MethodInvocation.importBoard (models/import.js:35:20)
wekan-app  |     at packages/check/match.js:118:15
wekan-app  |     at packages/meteor.js:365:18
wekan-app  |     at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1389:31)
wekan-app  |     at Object._failIfArgumentsAreNotAllChecked (packages/check/match.js:116:43)
wekan-app  |     at maybeAuditArgumentChecks (packages/ddp-server/livedata_server.js:1935:18)
wekan-app  |     at getCurrentMethodInvocationResult (packages/ddp-server/livedata_server.js:808:38)
wekan-app  |     at packages/meteor.js:365:18
wekan-app  |     at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1389:31)
wekan-app  |     at packages/ddp-server/livedata_server.js:827:46
wekan-app  |     at new Promise (<anonymous>)
wekan-app  |     at Session.method (packages/ddp-server/livedata_server.js:775:23)
wekan-app  | Sanitized and reported to the client as: errorClass [Error]: yellow_light is not an allowed value [400]
wekan-app  |     at getErrorObject (packages/aldeed_collection2-core.js:486:28)
wekan-app  |     at ns.Collection.doValidate (packages/aldeed_collection2-core.js:462:13)
wekan-app  |     at ns.Collection.Mongo.Collection.<computed> [as insert] (packages/aldeed_collection2-core.js:214:25)
wekan-app  |     at packages/matb33:collection-hooks/collection-hooks.js:87:46
wekan-app  |     at packages/meteor.js:365:18
wekan-app  |     at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1389:31)
wekan-app  |     at Object.directOp (packages/matb33:collection-hooks/collection-hooks.js:20:27)
wekan-app  |     at Object.self.direct.<computed> [as insert] (packages/matb33:collection-hooks/collection-hooks.js:86:30)
wekan-app  |     at TrelloCreator.createBoardAndLabels (models/trelloCreator.js:233:35)
wekan-app  |     at TrelloCreator.create (models/trelloCreator.js:761:26)
wekan-app  |     at MethodInvocation.importBoard (models/import.js:35:20)
wekan-app  |     at packages/check/match.js:118:15
wekan-app  |     at packages/meteor.js:365:18
wekan-app  |     at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1389:31)
wekan-app  |     at Object._failIfArgumentsAreNotAllChecked (packages/check/match.js:116:43)
wekan-app  |     at maybeAuditArgumentChecks (packages/ddp-server/livedata_server.js:1935:18)
wekan-app  |     at getCurrentMethodInvocationResult (packages/ddp-server/livedata_server.js:808:38)
wekan-app  |     at packages/meteor.js:365:18
wekan-app  |     at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1389:31)
wekan-app  |     at packages/ddp-server/livedata_server.js:827:46
wekan-app  |     at new Promise (<anonymous>)
wekan-app  |     at Session.method (packages/ddp-server/livedata_server.js:775:23) {
wekan-app  |   isClientSafe: true,
wekan-app  |   error: 400,
wekan-app  |   reason: 'yellow_light is not an allowed value',
wekan-app  |   details: '[{"name":"labels.1.color","type":"notAllowed","value":"yellow_light"}]',
wekan-app  |   errorType: 'Meteor.Error'
wekan-app  | }

@oninoni
Copy link

oninoni commented Mar 18, 2024

Yeah the issue should be fairly easy to fix?
You just need to register the "new trello colors" in the importer.
I'd do it myself, but i have no idea how the importer works and i can't find it.

@xet7
Copy link
Member

xet7 commented Mar 19, 2024

@oninoni

https://github.com/wekan/wekan/blob/main/models/trelloCreator.js

Trello colors could be changed to WeKan colors.

@fredricj
Copy link

fredricj commented Apr 5, 2024

This is a list of all base colors currently used by Trello, taken from a board export:

  • green
  • yellow
  • orange
  • red
  • purple
  • blue
  • sky
  • lime
  • pink
  • black

All except yellow have a mapping in getColor(). In addition, each also have a _dark and _light variant in Trello that is not mapped by the importer. I had a cursory glance at the code but it's not clear to me where these would need to be added or if it should be handled another way considering how I don't how labels are handled by wekan.

@xet7 is this part of your work to get the new importer working or can/should this be done separately?

@xet7
Copy link
Member

xet7 commented Apr 5, 2024

@fredricj

Current Trello label import code is here:

https://github.com/wekan/wekan/blob/main/models/trelloCreator.js#L220

I'm looking at what to change, to get importing to work properly.

Also, if someone has already figured out some changes, PRs welcome, like described here:

https://github.com/wekan/wekan/wiki/Emoji

@GoestaSmekal
Copy link

GoestaSmekal commented Apr 19, 2024

There is a quite uggly but simple workaround for the impatient: just replace the colors named "something_someotherthing" with just "something" in the json data from trello.
In terms of Perl regular expressions: s/"color":\s?"(\w+)_\w+"/"color": "$1"/g
Now you can import urgent boards until the official fix made it into the upstream code.
cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants