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

[DEV] Collections #783

Closed
ascott opened this issue Nov 6, 2019 · 9 comments
Assignees

Comments

@ascott
Copy link
Contributor

@ascott ascott commented Nov 6, 2019

Design issue: #771

@paninee

  • add a column to the cases table called ‘collections’
    • this column should be like specific_topics in that it stores an array of strings
  • allow collection field to be filtered in search

@ascott

  • add collections field to edit and reader view
  • add collections field to search filters ui
  • add collections keys to shared options file
    • participedia_team [Participedia Team]
    • gov_of_canada [Government of Canada]
    • sciencewise [Sciencewise]
    • coady_students [Coady Students]
    • usoton_students [USoton Students]
    • uarkansas_students [U Arkansas Students]
  • add collection field strings to en.js to be translated
@ascott

This comment has been minimized.

Copy link
Contributor Author

@ascott ascott commented Nov 6, 2019

@paninee i started a branch for this feature and the allowed keys to the shared-field-option.js file. let me know if you need anything else from me on this!

https://github.com/participedia/api/compare/feature/collections?expand=1

@jesicarson

This comment has been minimized.

Copy link

@jesicarson jesicarson commented Nov 8, 2019

@ascott @paninee the explanatory and modal text for collections has been updated in this doc. and we're going check in with the universities (coady, usoton, arkansas) to make sure they want a collection and if so what they prefer to call it. is it ok to update those later?

@ascott

This comment has been minimized.

Copy link
Contributor Author

@ascott ascott commented Nov 8, 2019

@jesicarson thanks, and yes, we can update those before we launch

@ascott

This comment has been minimized.

Copy link
Contributor Author

@ascott ascott commented Nov 12, 2019

@paninee i added the front changes to this branch, and ran the migration, but i'm getting this error when i try to save a collection:

Possibly Unhandled Rejection at: Promise for reason BatchError {
    stat: { total: 3, succeeded: 2, failed: 1, duration: 13 }
    errors: [
        2: Error: Property 'collections' doesn't exist.
            at query.replace.name (/Users/alannascott/code/participedia/api/node_modules/pg-promise/lib/formatting.js:163:19)
            at String.replace (<anonymous>)
            at Object.object (/Users/alannascott/code/participedia/api/node_modules/pg-promise/lib/formatting.js:143:22)
            at Object.$formatQuery [as formatQuery] (/Users/alannascott/code/participedia/api/node_modules/pg-promise/lib/formatting.js:297:29)
            at Task.$query (/Users/alannascott/code/participedia/api/node_modules/pg-promise/lib/query.js:133:40)
            at Task.<anonymous> (/Users/alannascott/code/participedia/api/node_modules/pg-promise/lib/query.js:259:23)
            at Task.query (/Users/alannascott/code/participedia/api/node_modules/pg-promise/lib/task.js:119:34)
            at Task.obj.none (/Users/alannascott/code/participedia/api/node_modules/pg-promise/lib/database.js:504:30)
            at Task.db.tx.t (/Users/alannascott/code/participedia/api/api/controllers/case.js:240:13)
            at callback (/Users/alannascott/code/participedia/api/node_modules/pg-promise/lib/task.js:201:21)
            at begin.then (/Users/alannascott/code/participedia/api/node_modules/pg-promise/lib/task.js:261:25)
        From previous event:
            at Object.execute (/Users/alannascott/code/participedia/api/node_modules/pg-promise/lib/task.js:261:14)
            at config.$npm.connect.pool.then.db (/Users/alannascott/code/participedia/api/node_modules/pg-promise/lib/database.js:1581:45)
            at processImmediate (internal/timers.js:443:21)
            at process.topLevelDomainCallback (domain.js:136:23)
        From previous event:
            at Database.taskProcessor (/Users/alannascott/code/participedia/api/node_modules/pg-promise/lib/database.js:1578:18)
            at Database.obj.tx (/Users/alannascott/code/participedia/api/node_modules/pg-promise/lib/database.js:1453:34)
            at postCaseUpdateHttp (/Users/alannascott/code/participedia/api/api/controllers/case.js:236:16)
    ]
} {}

any ideas?

@paninee

This comment has been minimized.

Copy link
Collaborator

@paninee paninee commented Nov 15, 2019

@paninee i added the front changes to this branch, and ran the migration, but i'm getting this error when i try to save a collection:

Possibly Unhandled Rejection at: Promise for reason BatchError {
    stat: { total: 3, succeeded: 2, failed: 1, duration: 13 }
    errors: [
        2: Error: Property 'collections' doesn't exist.
            at query.replace.name (/Users/alannascott/code/participedia/api/node_modules/pg-promise/lib/formatting.js:163:19)
            at String.replace (<anonymous>)
            at Object.object (/Users/alannascott/code/participedia/api/node_modules/pg-promise/lib/formatting.js:143:22)
            at Object.$formatQuery [as formatQuery] (/Users/alannascott/code/participedia/api/node_modules/pg-promise/lib/formatting.js:297:29)
            at Task.$query (/Users/alannascott/code/participedia/api/node_modules/pg-promise/lib/query.js:133:40)
            at Task.<anonymous> (/Users/alannascott/code/participedia/api/node_modules/pg-promise/lib/query.js:259:23)
            at Task.query (/Users/alannascott/code/participedia/api/node_modules/pg-promise/lib/task.js:119:34)
            at Task.obj.none (/Users/alannascott/code/participedia/api/node_modules/pg-promise/lib/database.js:504:30)
            at Task.db.tx.t (/Users/alannascott/code/participedia/api/api/controllers/case.js:240:13)
            at callback (/Users/alannascott/code/participedia/api/node_modules/pg-promise/lib/task.js:201:21)
            at begin.then (/Users/alannascott/code/participedia/api/node_modules/pg-promise/lib/task.js:261:25)
        From previous event:
            at Object.execute (/Users/alannascott/code/participedia/api/node_modules/pg-promise/lib/task.js:261:14)
            at config.$npm.connect.pool.then.db (/Users/alannascott/code/participedia/api/node_modules/pg-promise/lib/database.js:1581:45)
            at processImmediate (internal/timers.js:443:21)
            at process.topLevelDomainCallback (domain.js:136:23)
        From previous event:
            at Database.taskProcessor (/Users/alannascott/code/participedia/api/node_modules/pg-promise/lib/database.js:1578:18)
            at Database.obj.tx (/Users/alannascott/code/participedia/api/node_modules/pg-promise/lib/database.js:1453:34)
            at postCaseUpdateHttp (/Users/alannascott/code/participedia/api/api/controllers/case.js:236:16)
    ]
} {}

any ideas?

fixed

@ascott

This comment has been minimized.

Copy link
Contributor Author

@ascott ascott commented Nov 18, 2019

@jesicarson this has been shipped to staging for testing!

@ascott

This comment has been minimized.

Copy link
Contributor Author

@ascott ascott commented Nov 20, 2019

  • Need to update the names of the university collections to the following:
    participedia/usersnaps#933

  • U Arkansas Students should be: "University of Arkansas Clinton School of Public Service"

  • Coady Students should be: "Coady Institute Graduates"

  • USoton Students should be: "University of Southampton Students"

  • add info icon/modal for collections field
    participedia/usersnaps#934

@jesicarson

This comment has been minimized.

Copy link

@jesicarson jesicarson commented Nov 20, 2019

@ascott Arkansas was updated to: "UA Clinton School of Public Service Students"

@ascott

This comment has been minimized.

Copy link
Contributor Author

@ascott ascott commented Nov 21, 2019

this is complete and on production now

@ascott ascott closed this Nov 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.