Skip to content
This repository has been archived by the owner on Dec 27, 2019. It is now read-only.

Boards and commissions components #1057

Merged
merged 1 commit into from
May 17, 2018

Conversation

fionawhim
Copy link
Contributor

Adds components for boards and commissions members as well as a
sidebar component for boards and commissions info.

Fixes [insert bug/issue number]


Changes proposed in this pull request:

Add @mentions of the person or team responsible for reviewing proposed changes

@fionawhim fionawhim self-assigned this May 15, 2018
@fionawhim fionawhim requested review from jimafisk and a user May 15, 2018 14:53
@fionawhim fionawhim force-pushed the boards-and-commissions-components branch 5 times, most recently from 35200d9 to d579b6e Compare May 15, 2018 18:42
}
EOF;

$commissions_data = json_decode($COMMISSIONS_DUMP, true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should try to use Drupal wrapper functions when possible because they can provide things like "improved or more secure UTF8-handling, or RFC-compliant handling of URLs in Drupal": https://api.drupal.org/api/drupal/includes%21common.inc/group/php_wrappers/7.x

Can we replace json_decode($COMMISSIONS_DUMP, true) with drupal_json_decode($COMMISSIONS_DUMP) even though it seems a silly in this example because it just returns the original php function: https://api.drupal.org/api/drupal/includes%21common.inc/function/drupal_json_decode/7.x

Adds components for boards and commissions members as well as a
sidebar component for boards and commissions info.
@fionawhim fionawhim force-pushed the boards-and-commissions-components branch from d579b6e to 4897927 Compare May 16, 2018 14:02
@fionawhim
Copy link
Contributor Author

@jimafisk OK updated the JSON parsing.

I'm curious about the get_variable default. Should that be to a staging instance or prod? How would we handle API keys?

@fionawhim
Copy link
Contributor Author

Oh, whoops. Looks like that code got stomped at some point.

Right now it’s defaulting to the staging commissions GraphQL server at commissions.digital-staging.boston.gov. Presumably I need to make that a configuration variable. Should it default to the staging URL? Or production?

@jimafisk
Copy link
Contributor

@finneganh I assume you're talking about line 36? Yeah this is something you could use variable set/get for. Is the idea that you want the Drupal staging site to point to the Graphql staging server and the prod to prod?

Variable setting looks something like this: variable_set('commissions_graphql_server', 'https://commissions.digital-staging.boston.gov/commissions/graphql'); which just saves this value to the variable mysql table. Then you can retrieve it with variable_get('commissions_graphql_server'). The tricky part is we're constantly overriding the stg db with the prod db so you'd ultimately get those values. You could always reset them via drush though by doing something like this: drush vset commissions_graphql_server https://commissions.digital-staging.boston.gov/commissions/graphql

Sorry if I'm not following your question. If you need an environment specific variable for your Drupal site URL, you could use the global base_url to avoid hard coding https://api.drupal.org/api/drupal/developer!globals.php/global/base_url/7.x

@fionawhim
Copy link
Contributor Author

@jimafisk Ok. So I think that the default should point to the staging instance of the GraphQL server for people in dev, since we don't need an API key or anything for that. Then Boston.gov staging / prod will have the variable_set version that points to the prod GraphQL instance.

Is that everything we need to get this checked in?

@jimafisk
Copy link
Contributor

@finneganh makes sense to me. Yes this looks great, merge away!

@fionawhim fionawhim merged commit 0faa3b0 into develop May 17, 2018
@fionawhim fionawhim deleted the boards-and-commissions-components branch May 17, 2018 13:50
@fionawhim fionawhim added this to Backlog in Drupal via automation May 17, 2018
@fionawhim fionawhim moved this from Backlog to Next in Drupal May 17, 2018
@fionawhim fionawhim moved this from Next to Inventory in Drupal May 17, 2018
@fionawhim fionawhim added this to Backlog in Boards and Commissions 🏫 via automation May 17, 2018
@fionawhim fionawhim moved this from Backlog to Inventory in Boards and Commissions 🏫 May 17, 2018
@fionawhim fionawhim moved this from Inventory to Done in Boards and Commissions 🏫 Jun 19, 2018
@fionawhim fionawhim moved this from Inventory to Done in Drupal Jun 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants