Comments (2)
I may be wrong but I think the trouble code is there:
Lines 587 to 593 in e73a44d
When a card is inserted, there may be a control that disable this option to show 'attachements' if the card has no attachment. then attachment are created in the next block. But then should try a Cards.update(this)
or something more sweet/targeted that retry to set this setting.
from wekan.
OK, I got it.
When the card is inserted, the coverId key of the new card points to the previous attachment file _id.
When attachments have been copied, one should look for the _id of the new card new attachments whose key "meta.copyFrom" is equal to the current coverId key. Then, change this key, with this _id.
The trouble is copyFile is async. The best would be copyFile to return the _id of the new attachment in a Promise, and to wait for this Promise only for the copy of the cover attachment. I didn't go further because it would imply waiting, and I know wekan is really concerned with scalability (copying a board means possibly copying a lot of cards).
Another way would be copyFile to handle this coverId change when called from the copy card function... Sounds strange...
We could also consider, the situation completely differently and handle it at display time. If coverId points to an attachment not belonging to the current card, look for current card attachments whose "meta.copyFrom" is equal to the current coverId and then correct it. This should be efficient. And if not enough, we could add a flag on the new card after copy to trigger this only once, but I think this is needless. When displaying a card anyway, the Card object is built with all the data we need, and it's no more than a condition test.
Your opinions?
from wekan.
Related Issues (20)
- Which lists are collapsed is affecting all users instead of just the user who needs to adjust their own view HOT 1
- Run Wekan Locally HOT 1
- delete custom filed
- Wekan - Node process HOT 4
- New Feature request: Is it possible to make the "link card --> cards" pull-down list alphabetically arranged
- Can't set a Due Date that has a leading zero in time, errors with `invalid time` HOT 4
- Add API option for editing Lists HOT 1
- Cannot scroll down "my Boards" in Android Chrome PMI HOT 1
- Card edit API has duplicated variable names for board move functionality instead of using existing ones HOT 1
- Moving Card's List using API leads to random sorting compared to Move Card dialogue where it ends up on top HOT 2
- Wiki - Install Updates Automatically - Command outdated HOT 1
- Turn off email notification HOT 4
- "Hide checked items" toggle is inverted and affects ALL Checklist objects in the Card
- Card Link / Board Open to Public Without Logging In. HOT 1
- Wekan Azure Singn in
- Other Admins Cannot See (Add Members Plus Symbol)
- "Edit Description" button is wildly out of place HOT 1
- [Docker-arm64] /data/attachments is not writable HOT 1
- WeKan Cloud maintenance In Progress HOT 1
- Export CSV/TSV from Board create unhandled Exception HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wekan.