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

added maps to preferences #666

Merged
merged 8 commits into from
Nov 15, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
added map to available default chart types
jina2k committed Nov 8, 2021
commit 9e423044e70fcfc7316491137d5f9b799de72bec
13 changes: 13 additions & 0 deletions src/client/app/components/admin/PreferencesComponent.tsx
Original file line number Diff line number Diff line change
@@ -117,6 +117,19 @@ class PreferencesComponent extends React.Component<PreferencesPropsWithIntl, {}>
<FormattedMessage id='compare'/>
</label>
</div>
<div className='radio'>
<label>
<input
type='radio'
name='chartTypes'
style={{marginRight: '10px'}}
value={ChartTypes.map}
onChange={this.handleDefaultChartToRenderChange}
checked={this.props.defaultChartToRender === ChartTypes.map}
/>
<FormattedMessage id='map'/>
</label>
</div>
</div>
<div className='checkbox'>
<p style={labelStyle}>
4 changes: 3 additions & 1 deletion src/server/sql/preferences/create_graph_types_enum.sql
Original file line number Diff line number Diff line change
@@ -5,7 +5,9 @@
-- This should avoid an error when the type already exists. This is an issue since
-- the OED install stops the creation of database items after this.
DO $$ BEGIN
CREATE TYPE graph_type AS ENUM('line', 'bar', 'compare');
CREATE TYPE graph_type AS ENUM('line', 'bar', 'compare', 'map');
ALTER TABLE preferences ALTER COLUMN default_chart_to_render SET DATA TYPE graph_type
USING default_chart_to_render::text::graph_type;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;