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

Migrate Query pages to React: cleanup #4512

146 changes: 0 additions & 146 deletions client/app/assets/less/inc/tab.less

This file was deleted.

3 changes: 0 additions & 3 deletions client/app/assets/less/main.less
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

/** Load Vendors Dependencies **/
@import '~font-awesome/less/font-awesome';
@import '~ui-select/dist/select.css';
@import '~angular-resizable/src/angular-resizable.css';
@import '~material-design-iconic-font/dist/css/material-design-iconic-font.css';
@import '~pace-progress/themes/blue/pace-theme-minimal.css';

Expand Down Expand Up @@ -35,7 +33,6 @@
@import 'inc/alert';
@import 'inc/media';
@import 'inc/modal';
@import 'inc/tab';
@import 'inc/panel';
@import 'inc/tooltips';
@import 'inc/popover';
Expand Down
19 changes: 0 additions & 19 deletions client/app/assets/less/redash/query.less
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,6 @@ body.fixed-layout {
}
}

.tab-nav .tab-new-vis {
margin: 0 5px;

> a {
color: @headings-color;
margin-top: 8px;
padding: 7px;
font-weight: 400;
}
}

.bottom-controller {
padding: 10px 15px;
background: #fff;
Expand Down Expand Up @@ -358,10 +347,6 @@ a.label-tag {
.visualization-renderer > .visualization-renderer-wrapper {
overflow: visible;
}

.tab-nav {
flex-shrink: 0;
}
}
.row {
background: #fff;
Expand Down Expand Up @@ -615,10 +600,6 @@ nav .rg-bottom {
display: none;
}

.tab-nav .tab-new-vis {
display: none;
}

.query-fullscreen {
flex-direction: column;
overflow: hidden;
Expand Down
12 changes: 0 additions & 12 deletions client/app/components/ColorBox.jsx

This file was deleted.

11 changes: 2 additions & 9 deletions client/app/components/EditInPlace.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { trim } from "lodash";
import React from "react";
import PropTypes from "prop-types";
import cx from "classnames";
import { react2angular } from "react2angular";
import { trim } from "lodash";
import Input from "antd/lib/input";

export class EditInPlace extends React.Component {
export default class EditInPlace extends React.Component {
static propTypes = {
ignoreBlanks: PropTypes.bool,
isEditable: PropTypes.bool,
Expand Down Expand Up @@ -95,9 +94,3 @@ export class EditInPlace extends React.Component {
);
}
}

export default function init(ngModule) {
ngModule.component("editInPlace", react2angular(EditInPlace));
}

init.init = true;
2 changes: 1 addition & 1 deletion client/app/components/EditParameterSettingsDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Select from "antd/lib/select";
import Input from "antd/lib/input";
import Divider from "antd/lib/divider";
import { wrap as wrapDialog, DialogPropType } from "@/components/DialogWrapper";
import { QuerySelector } from "@/components/QuerySelector";
import QuerySelector from "@/components/QuerySelector";
import { Query } from "@/services/query";

const { Option } = Select;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ import Dropdown from "antd/lib/dropdown";
import Menu from "antd/lib/menu";
import Button from "antd/lib/button";
import Icon from "antd/lib/icon";
import { react2angular } from "react2angular";

import QueryResultsLink from "./QueryResultsLink";

export function QueryControlDropdown(props) {
export default function QueryControlDropdown(props) {
const menu = (
<Menu>
{!props.query.isNew() && (!props.query.is_draft || !props.query.is_archived) && (
Expand Down Expand Up @@ -87,9 +86,3 @@ QueryControlDropdown.defaultProps = {
apiKey: "",
selectedTab: "",
};

export default function init(ngModule) {
ngModule.component("queryControlDropdown", react2angular(QueryControlDropdown));
}

init.init = true;
9 changes: 1 addition & 8 deletions client/app/components/EditVisualizationButton/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ import React from "react";
import PropTypes from "prop-types";
import Button from "antd/lib/button";
import Icon from "antd/lib/icon";
import { react2angular } from "react2angular";

export function EditVisualizationButton(props) {
export default function EditVisualizationButton(props) {
return (
<Button
data-test="EditVisualization"
Expand All @@ -24,9 +23,3 @@ EditVisualizationButton.propTypes = {
EditVisualizationButton.defaultProps = {
selectedTab: "",
};

export default function init(ngModule) {
ngModule.component("editVisualizationButton", react2angular(EditVisualizationButton));
}

init.init = true;
37 changes: 1 addition & 36 deletions client/app/components/FavoritesControl.jsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
import React from "react";
import PropTypes from "prop-types";
import { react2angular } from "react2angular";
import { $rootScope } from "@/services/ng";

export class FavoritesControl extends React.Component {
export default class FavoritesControl extends React.Component {
static propTypes = {
item: PropTypes.shape({
is_favorite: PropTypes.bool.isRequired,
}).isRequired,
onChange: PropTypes.func,
// Force component update when `item` changes.
// Remove this when `react2angular` will finally go to hell
forceUpdate: PropTypes.string, // eslint-disable-line react/no-unused-prop-types
};

static defaultProps = {
onChange: () => {},
forceUpdate: "",
};

toggleItem(event, item, callback) {
Expand Down Expand Up @@ -45,33 +40,3 @@ export class FavoritesControl extends React.Component {
);
}
}

export default function init(ngModule) {
ngModule.component("favoritesControlImpl", react2angular(FavoritesControl));
ngModule.component("favoritesControl", {
template: `
<favorites-control-impl
ng-if="$ctrl.item"
item="$ctrl.item"
on-change="$ctrl.onChange"
force-update="$ctrl.forceUpdateTag"
></favorites-control-impl>
`,
bindings: {
item: "=",
},
controller($scope) {
// See comment for FavoritesControl.propTypes.forceUpdate
this.forceUpdateTag = "force" + Date.now();
$scope.$on("reloadFavorites", () => {
this.forceUpdateTag = "force" + Date.now();
});

this.onChange = () => {
$scope.$applyAsync();
};
},
});
}

init.init = true;
2 changes: 1 addition & 1 deletion client/app/components/Filters.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import moment from "moment";
import React from "react";
import PropTypes from "prop-types";
import Select from "antd/lib/select";
import { formatColumnValue } from "@/filters";
import { formatColumnValue } from "@/lib/utils";

const ALL_VALUES = "###Redash::Filters::SelectAll###";
const NONE_VALUES = "###Redash::Filters::Clear###";
Expand Down
9 changes: 1 addition & 8 deletions client/app/components/NoTaggedObjectsFound.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import React from "react";
import PropTypes from "prop-types";
import { react2angular } from "react2angular";
import BigMessage from "@/components/BigMessage";
import { TagsControl } from "@/components/tags-control/TagsControl";

export function NoTaggedObjectsFound({ objectType, tags }) {
export default function NoTaggedObjectsFound({ objectType, tags }) {
return (
<BigMessage icon="fa-tags">
No {objectType} found tagged with&nbsp;
Expand All @@ -17,9 +16,3 @@ NoTaggedObjectsFound.propTypes = {
objectType: PropTypes.string.isRequired,
tags: PropTypes.oneOfType([PropTypes.array, PropTypes.objectOf(Set)]).isRequired,
};

export default function init(ngModule) {
ngModule.component("noTaggedObjectsFound", react2angular(NoTaggedObjectsFound));
}

init.init = true;
Loading