8000 Feature Request: Convert boards/lanes to text · Issue #2185 · wekan/wekan · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Feature Request: Convert boards/lanes to text #2185

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

Closed
gerroon opened this issue Feb 12, 2019 · 13 comments
Closed

Feature Request: Convert boards/lanes to text #2185

gerroon opened this issue Feb 12, 2019 · 13 comments

Comments

@gerroon
Copy link
gerroon commented Feb 12, 2019

Hi

Is it possible to convert boards or even swimlanes to text? I like that I can jot down ideas very quickly in Wekan but that is the end of it since I can’t make much use of it afterwards 😦

I know you can export json file but that is no use to me since I am not a dev, what am I going to do with a json file? I am looking for some kind of basic structured text so I can use in other places.

thanks

@xet7
Copy link
Member
xet7 commented Feb 12, 2019

What kind of text? Some of these?

Emacs Org mode and Leo Literate Editor Import / Export

Import / Export CSV

@gerroon
Copy link
Author
gerroon commented Feb 12, 2019

Hi

Well any text :) Any way to get the content out of Wekan is fine to me, except .json since it is no use and I cant find a way to make sense of it.

For instance I create many cards as my ideas flow and new lanes etc. Then I would like to just take those lanes as separate blocks of text and the cards as indented text under neat so

|LANE A| |LANE B|
|idea 1| |idea 20|
|idea 2| |idea 21|
|idea 3| |idea 22|

becomes

LANE A
	idea 1
	idea 2
	idea 3
	
LANE B
	idea 20
	idea 21
	idea 22

@xet7 xet7 added this to the 2019-03-31 Import/Export bugs milestone Feb 28, 2019
@xet7 xet7 changed the title QA: Convert boards/lanes to text? Feature Request: Convert boards/lanes to text Feb 28, 2019
@risacher
Copy link
Contributor

This is not terribly useful to the OP, who admits he isn't a dev, but I built a page that logs into the API, exports the board and dumps every list, card, and card description, as HTML. It might be useful inspiration for someone...

Because of CORS, these files have to be installed on the same domain as the Wekan instance, or CORS would have to be enabled.

The example files are here:
https://risacher.org/ref/wekan-pdf/sw.html
https://risacher.org/ref/wekan-pdf/sw.js
https://risacher.org/ref/wekan-pdf/sw.css

@risacher
Copy link
Contributor

It occurs to me that I could probably make a version that would work for anyone who had CORS turned on, if I added a server URL field. I'll try to do that tonight.

@xet7
Copy link
Member
xet7 commented May 22, 2019

@risacher

There are some example PR CSV code at #413 for CSV import/export issue #395 that could probably help, if you can look at those.

@xet7
Copy link
Member
xet7 commented May 22, 2019

@risacher

Wekan has CORS setting. Default is '' (empty string, disabled).

Snap

sudo snap set wekan cors='*'

Docker

https://github.com/wekan/wekan/blob/devel/docker-compose.yml#L241

Source

https://github.com/wekan/wekan/blob/devel/start-wekan.sh#L58

Sandstorm

It's not possible to set CORS at Sandstorm.

@gerroon
Copy link
Author
gerroon commented May 23, 2019

@risacher How do I install it on my server?

@risacher
Copy link
Contributor

@gerroon I don't know enough about how your server is configured to answer that question. Do you have a way to serve static content besides through Wekan? If so, those three files are moderately self-sufficient. Just having them anywhere on the same server should be sufficient. Depending on the route for your wekan installation, you might need to edit the prefix url in the .html file.

@xet7 In trying to make this work over CORS, I think I found an issue that makes CORS unusuable: namely that you can set "Access-control-allow-origin" via the CORS environment variable, but not "Access-control-allow-headers". As I read the CORS spec, I think that for the wekan API to work, server need to specify in the preflight response that as-a-minimum, "Authorization" and "Content-type" are allowed headers in a CORS request.

Specifically, when I try to make CORS request from Chrome, I get this error, "Access to fetch at 'https://risacher.org/wekan/users/login' from origin 'https://thunderflite.com' has been blocked by CORS policy: Request header field content-type is not allowed by Access-Control-Allow-Headers in preflight response."

If I can't get this to work, I'll file another issue. I think the fix is possibly a small change to server/cors.js and/or any docker-compose.yml files to add the "Access-Control-Allow-Headers" header.

@xet7
Copy link
Member
xet7 commented May 23, 2019

@risacher

Do you mean iframing?

sudo snap set wekan trusted-url='https://risacher.org'

Or alternatively allow all iframing (not recommended):

sudo snap set wekan browser-policy-enabled='false'

@gerroon
Copy link
Author
gerroon commented May 23, 2019

I use Snap for Wekan and I have apache. I will try it

@risacher
Copy link
Contributor

@xet7 I don't think I mean that. I'm trying to do this from inside browser, on cross-origin domain:

var headers = {  "Content-Type": "application/json" };
fetch(url+"/users/login", {
    method: 'POST',
    headers: headers, 
    body: JSON.stringify({username: uName, password: pWord })
  }).then((response) => { return response.json(); })
  .then((rLogin) => {
      token=rLogin.token;
      headers.Authorization = "bearer "+rLogin.token;
   }
...later...
fetch(url+"/api/users/"+id+"/boards", {
    method: 'GET',
    headers: headers
})
  .then((response) => { return response.json(); },

This code works in Chrome for single-domain requests. It does not work cross-domain, (even with setting CORS=*) and browser console gives the error above. From what I understand of the CORS spec (https://www.w3.org/TR/cors/#access-control-allow-headers-response-header) to use the Wekan API, the server will have to allow the "Authorization" header for the bearer token, and the "Content-type" header for application/json. It does this by setting the "Access-Control-Allow-Headers" headers in the Preflight response. "Content-type" is allowed by default in CORS only for application/x-www-form-urlencoded, multipart/form-data, or text/plain. Any other content-type requires that content-type be explicitly allowed by the server header during Preflight.

CORS is more complicated than I knew. I thought "Access-Control-Allow-Origin: *" was all that was needed.

@risacher
Copy link
Contributor

PR #2429 addresses the CORS issue I described by adding CORS_ALLOW_HEADERS and CORS_EXPOSE_HEADERS

@xet7
Copy link
Member
xet7 commented Nov 22, 2023

@xet7 xet7 closed this as completed Nov 22, 2023
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

3 participants
0