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

Departments list usability #82

Open
gcharest opened this issue May 24, 2019 · 7 comments
Open

Departments list usability #82

gcharest opened this issue May 24, 2019 · 7 comments
Labels
enhancement New feature or request
Projects
Milestone

Comments

@gcharest
Copy link
Member

There are more than a hundred departments listed in the list. We need a better way of displaying for the users to choose one.

@gcharest gcharest added the enhancement New feature or request label May 24, 2019
@gcharest gcharest added this to To do in MVP via automation May 24, 2019
@CalvinRodo
Copy link
Contributor

Survey JS Allows Custom Widgets we can probably leverage something like select2 https://surveyjs.io/Examples/Library/?id=custom-widget-select2&platform=jQuery&theme=default

@gcharest
Copy link
Member Author

Also related #81

@KingBain
Copy link
Contributor

Was poking at this a bit, it might be easier to grab the csv file(client side) via jquery, then convert the csv into an array using jquery-csv, then feed the array contents into the choices section of the select2 json survey file.

from a client side though there are some issues 👍

  • the open data portal doesnt support https:// and this will cause issues with browers
  • cross site scripting issue
  • server admins will hunt me down if I make the client download the csv file everytime that javascript loads :)

was doing something like below, in plunker

var csvData = $.ajax({
    type: "GET",
    url: "http://donnees-data.tpsgc-pwgsc.gc.ca/ba1/min-dept/min-dept.csv",
    dataType: "text/csv",
});

var dept = $.csv.toArrays(csvData);

Will investigate doing this server side, but node.js is new for me and my janky web coding skills

@CalvinRodo
Copy link
Contributor

@KingBain I don't think server side is an option at the moment, we'd have to chat with the open canada folks to see if we can run a nodejs server somewhere.

At the moment this app is fully client side, we are leveraging the static site functionality of GitHub Pages.

Also instead of using JQuery to grab the data please look into either the Fetch API or a tool like Axios.

https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API

You can see the fetch API in use here https://github.com/esdc-devx/itsg33-yaml-explorer/blob/master/src/fetchYaml.js

@nschonni
Copy link
Member

nschonni commented Oct 8, 2019

I'm confused as to which department list is the "real" one. Currently there are 4 in the repo

@MrDeshaies MrDeshaies modified the milestones: MVP 0.7, 0.9.2 Dec 8, 2021
@MrDeshaies
Copy link
Contributor

To be clear, this ticket is about the widget used to select the department list. A filter based on keyboard input like select2 offers would be a great solution. This ticket is not about changing the data source used to populate the dropdown.

@MrDeshaies
Copy link
Contributor

The branch 82-departments-list tried to implement the select2 widget, but it's not working. The documentation may be wrong, or we may be missing something...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
MVP
  
To do
Development

No branches or pull requests

5 participants