From 60c5097d820f8885f9265ea7a33f3fdd82e258d3 Mon Sep 17 00:00:00 2001 From: konrad Date: Thu, 17 Dec 2020 13:44:22 +0000 Subject: [PATCH] Add trello migration (#336) Reload namespaces and lists after migrating Add trello logo Add trello migration Co-authored-by: kolaente Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/336 Co-Authored-By: konrad Co-Committed-By: konrad --- public/images/migration/trello.png | Bin 0 -> 4829 bytes src/components/migrator/migration.vue | 28 +++++++++++++++++++------- src/views/migrator/MigrateService.vue | 4 ++++ 3 files changed, 25 insertions(+), 7 deletions(-) create mode 100644 public/images/migration/trello.png diff --git a/public/images/migration/trello.png b/public/images/migration/trello.png new file mode 100644 index 0000000000000000000000000000000000000000..02cfa114048a94290d2e60b67889a77a336ad5df GIT binary patch literal 4829 zcmd^Dc~Dc?myXCPMp{7>P#BvQ1wm{O5ZM|KP?1H&5JV)gS%d(J5SFmXA~Y!QQx;`! zL=;GXu!LQ*U_=Qa2qf%;eG3pFvWAd(s693R&D8ugRlisFo%h}EJLlFr@7}s~?u)mz zwgB&w-3J1Jz*jC`x&ZQ5^AwVp*y=G?y@SqYt z=rJAiVi5Eg4@&w7di)9W_#-IxGYAC$JP1VsJ^la+0r(G~Fyd}EtYz1Re#a;RC>Re4 zA%IYTCGIv9Uc85~y`cR5f})W^(M+M7 zPi@yqZP!j~*GX%?kWST2r(S$X)q6$Nf7M}-(P5a;VVp%X$)cHN(=KIqn&)&{UjPBFu&nBiQ)fTMfwVS4{8?R6>b zb1mz0FYoiJ81Swf@TnYlP&M$dYS6cO@KN=kA8ybeH-xMi3aA|lsv8cj8%EU+KW<|F zMHq`Gj3p4qo|49%k;aohj6Ww&ydY1ce4I%AIGNTu`SR1`t4~weZPPiF>5{HFbk|&I z_k4NJJeJO?V6Z9~tg2pCb?-t=-$GsgV*S8k!@y$W;9}F@QuELfet3yE!X}NdKQOd?X(b7^gKX?={n zKF(gB{JJr?uWfx@=Ps{vS2nnu4ekb)x5?#gZS%O>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F{VT0D8mR9NQfEhapy*cUI0GKNthR1UbK8 z&Ctyj!AU`MU#1wQ6f`Ns0y8Nj`uYgykGt4}RU;~aZqpmW^NYUKN6MmAuiGWpPgUPF7RnJ*>slEd*j@|iqM%=moX zZ*%jf*vq6DF#5D%+DK^|*Ko>}rU3Dsvd^!Z1|)6iI|@59Lo`61XVvPjTw{jun>iU4HFxj>lwm&X{np!{VQMY2ViAG!9z0&l z49(FYgo7<%S72g5g$2}Dg6V?kz=}Nt1*ZFdLEhj;;z+^?%mi#7P|b~Zx(SlY)v9HU zml5D2a>mPz7pji}SnLSEG@ffeA2qI{c?Tv)W=B122I@XeOFvNNbsUJccQCGS)Vfgj zt!xALWYi>mythjT(I6w$IOl}@m}Oic#}q=O0^RFQSW>9oX&;WW?_sy2Ccas|M;TDl z(>{Mnw8**vb!s0RI`+u&wA;(~^D5UgpWM@4)PfdR<-bY{2dAss0eth4$~BGHajiK~ z%vKu176V}@L{1$LA)}|%%SadePD3V=qO@F|8%Vt~Gfj#*tR#2IH#4*vea=7LOse3d zX>#P@Osm&NwG>z?*|>J4k|tMod66^Mv=USv%rBRbzD_}|7pf_Q3t&23q;K8sjxQtq z9UO4om8v)K8`dNmZs!0Vdqb^!rsBc)?DXXMSzX{TkhCBSd3FC-8uP=_ohJ>tjO+E( zVwNFLpJ>{!(gem1|beqV_;m>YjFJ$xXGxl(z>YD)g%Q{jQ1x0SCl=^!u|eHjDBE zwJmgh{%x>K?|AQZVV5)R$#REEZu8z)QuRAMbL`j1e( hJoVilJ~_9ekm~*U224`CfA_!C6*KEgWhStw{{*;`GFSir literal 0 HcmV?d00001 diff --git a/src/components/migrator/migration.vue b/src/components/migrator/migration.vue index ac3998114..84c36c5a3 100644 --- a/src/components/migrator/migration.vue +++ b/src/components/migrator/migration.vue @@ -64,7 +64,7 @@ export default { isMigrating: false, lastMigrationDate: null, message: '', - wunderlistCode: '', + migratorAuthCode: '', } }, props: { @@ -82,13 +82,25 @@ export default { this.getAuthUrl() this.message = '' - if (typeof this.$route.query.code !== 'undefined') { - this.wunderlistCode = this.$route.query.code + if (typeof this.$route.query.code !== 'undefined' || location.hash.startsWith('#token=')) { + if (location.hash.startsWith('#token=')) { + this.migratorAuthCode = location.hash.substring(7) + console.log(location.hash.substring(7)) + } else { + this.migratorAuthCode = this.$route.query.code + } this.migrationService.getStatus() .then(r => { if (r.time) { - this.lastMigrationDate = new Date(r.time) - return + if (typeof r.time === 'string' && r.time.startsWith('0001-')) { + this.lastMigrationDate = null + } else { + this.lastMigrationDate = new Date(r.time) + } + + if (this.lastMigrationDate) { + return + } } this.migrate() }) @@ -109,10 +121,12 @@ export default { }, migrate() { this.isMigrating = true - this.lastMigrationDate = 0 - this.migrationService.migrate({code: this.wunderlistCode}) + this.lastMigrationDate = null + this.message = '' + this.migrationService.migrate({code: this.migratorAuthCode}) .then(r => { this.message = r.message + this.$store.dispatch('namespaces/loadNamespaces') }) .catch(e => { this.error(e, this) diff --git a/src/views/migrator/MigrateService.vue b/src/views/migrator/MigrateService.vue index f09d8a214..e126485cc 100644 --- a/src/views/migrator/MigrateService.vue +++ b/src/views/migrator/MigrateService.vue @@ -33,6 +33,10 @@ export default { this.name = 'Todoist' this.identifier = 'todoist' break + case 'trello': + this.name = 'Trello' + this.identifier = 'trello' + break default: router.push({name: '404'}) }