Skip to content

Commit

Permalink
Renamed AddTextboxDialog to TextboxDialog
Browse files Browse the repository at this point in the history
  • Loading branch information
ranbena committed Mar 26, 2019
1 parent ff49fc1 commit 44feba5
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import Divider from 'antd/lib/divider';
import { wrap as wrapDialog, DialogPropType } from '@/components/DialogWrapper';
import notification from '@/services/notification';

import './AddTextboxDialog.less';
import './TextboxDialog.less';

class AddTextboxDialog extends React.Component {
class TextboxDialog extends React.Component {
static propTypes = {
dashboard: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types
dialog: DialogPropType.isRequired,
Expand Down Expand Up @@ -76,7 +76,7 @@ class AddTextboxDialog extends React.Component {
okText={isNew ? 'Add to Dashboard' : 'Save'}
width={500}
>
<div className="add-textbox">
<div className="textbox-dialog">
<Input.TextArea
className="resize-vertical"
rows="5"
Expand Down Expand Up @@ -111,4 +111,4 @@ class AddTextboxDialog extends React.Component {
}
}

export default wrapDialog(AddTextboxDialog);
export default wrapDialog(TextboxDialog);
4 changes: 2 additions & 2 deletions client/app/components/dashboards/widget.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { filter } from 'lodash';
import template from './widget.html';
import AddTextboxDialog from '@/components/dashboards/AddTextboxDialog';
import TextboxDialog from '@/components/dashboards/TextboxDialog';
import widgetDialogTemplate from './widget-dialog.html';
import EditParameterMappingsDialog from '@/components/dashboards/EditParameterMappingsDialog';
import './widget.less';
Expand All @@ -22,7 +22,7 @@ function DashboardWidgetCtrl($scope, $location, $uibModal, $window, $rootScope,
this.canViewQuery = currentUser.hasPermission('view_query');

this.editTextBox = () => {
AddTextboxDialog.showModal({
TextboxDialog.showModal({
dashboard: this.dashboard,
text: this.widget.text,
onConfirm: (text) => {
Expand Down
4 changes: 2 additions & 2 deletions client/app/pages/dashboards/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { durationHumanize } from '@/filters';
import template from './dashboard.html';
import ShareDashboardDialog from './ShareDashboardDialog';
import AddWidgetDialog from '@/components/dashboards/AddWidgetDialog';
import AddTextboxDialog from '@/components/dashboards/AddTextboxDialog';
import TextboxDialog from '@/components/dashboards/TextboxDialog';
import notification from '@/services/notification';

import './dashboard.less';
Expand Down Expand Up @@ -327,7 +327,7 @@ function DashboardCtrl(
};

this.showAddTextboxDialog = () => {
AddTextboxDialog.showModal({
TextboxDialog.showModal({
dashboard: this.dashboard,
onConfirm: this.addTextbox,
});
Expand Down
6 changes: 3 additions & 3 deletions client/cypress/integration/dashboard/dashboard_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,11 @@ describe('Dashboard', () => {
cy.visit(this.dashboardUrl);
editDashboard();
cy.contains('a', 'Add Textbox').click();
cy.get('.add-textbox').within(() => {
cy.get('.textbox-dialog').within(() => {
cy.get('textarea').type('Hello World!');
});
cy.contains('button', 'Add to Dashboard').click();
cy.get('.add-textbox').should('not.exist');
cy.get('.textbox-dialog').should('not.exist');
cy.get('.textbox').should('exist');
});

Expand Down Expand Up @@ -256,7 +256,7 @@ describe('Dashboard', () => {
});

const newContent = '[edited]';
cy.get('.add-textbox')
cy.get('.textbox-dialog')
.should('exist')
.within(() => {
cy.get('textarea')
Expand Down

0 comments on commit 44feba5

Please sign in to comment.