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

fix: broken glyphicons used in react-json-schema #10267

Merged
merged 1 commit into from
Jul 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
17 changes: 10 additions & 7 deletions superset-frontend/src/SqlLab/components/ScheduleQueryButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { t } from '@superset-ui/translation';

import Button from '../../components/Button';
import ModalTrigger from '../../components/ModalTrigger';
import './ScheduleQueryButton.less';

const validators = {
greater: (a, b) => a > b,
Expand Down Expand Up @@ -159,12 +160,14 @@ class ScheduleQueryButton extends React.PureComponent {
</Row>
<Row>
<Col md={12}>
<Form
schema={getJSONSchema()}
uiSchema={getUISchema()}
onSubmit={this.onSchedule}
validate={getValidator()}
/>
<div className="json-schema">
<Form
schema={getJSONSchema()}
uiSchema={getUISchema()}
onSubmit={this.onSchedule}
validate={getValidator()}
/>
</div>
</Col>
</Row>
{this.props.scheduleQueryWarning && (
Expand Down Expand Up @@ -194,7 +197,7 @@ class ScheduleQueryButton extends React.PureComponent {
disabled={this.props.disabled}
tooltip={this.props.tooltip}
>
<i className="fa fa-calendar" /> {t('Schedule Query')}
<i className="fa fa-calendar" /> {t('Schedule')}
</Button>
}
bsSize="medium"
Expand Down
39 changes: 39 additions & 0 deletions superset-frontend/src/SqlLab/components/ScheduleQueryButton.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
// -------------------------------------------------------------
// Glyphicons are not supported and used by react-json-schema
// -------------------------------------------------------------
.json-schema {
i.glyphicon {
display: none;
}
.btn-add::after {
content: '+';
}
.array-item-move-up::after {
content: '↑';
}
.array-item-move-down::after {
content: '↓';
}
.array-item-remove::after {
content: '-';
}
}
// -------------------------------------------------------------
1 change: 1 addition & 0 deletions superset/views/sql_lab.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ class SavedQueryViewApi(SavedQueryView): # pylint: disable=too-many-ancestors
"description",
"sql",
"extra_json",
"extra",
Copy link
Member

Choose a reason for hiding this comment

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

I'm surprised to see both extra and extra_json - what's the difference/motivation?

Copy link
Member Author

Choose a reason for hiding this comment

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

extra_json is a string containing the serialized JSON, extra is the actual nested data structure. While I know the private API does not use extra_json, I assume that people in the wild (notably at Lyft where @betodealmeida shipped the feature) are very likely to use it.

Clearly it's not great to have JSON inception (serialized JSON inside of JSON)

I could have deprecated extra_json in favor of extra, but would need to do change management around it - likely just adding a note in UPDATING.md. Eventually we should move this under /api/v1 but, maybe a good time to do this.

]
add_columns = ["label", "db_id", "schema", "description", "sql", "extra_json"]
edit_columns = add_columns
Expand Down