Skip to content

Commit

Permalink
Landing Page (frontend only)
Browse files Browse the repository at this point in the history
(cherry picked from commit 46487c5)
(cherry picked from commit 18e944a382a5cf867020b5d31e90144aa7a3c07e)
(cherry picked from commit a8ac3fb)
(cherry picked from commit 55b7eb6)

Rebase

Fix tag endpoint

(cherry picked from commit d714792)
(cherry picked from commit 8181c54)
(cherry picked from commit e82c615)
(cherry picked from commit 8cd80a2)
(cherry picked from commit 2ba0dee)
(cherry picked from commit e3a5621)
(cherry picked from commit 2bb73e4)
(cherry picked from commit e63fdf6)
(cherry picked from commit dc5a95c)
  • Loading branch information
betodealmeida committed Apr 8, 2019
1 parent 0f935e9 commit b643ff0
Show file tree
Hide file tree
Showing 27 changed files with 1,249 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default () => describe('Bubble', () => {

it('should work', () => {
verify(BUBBLE_FORM_DATA);
cy.get('.chart-container svg circle').should('have.length', 208);
cy.get('.chart-container svg circle').should('have.length', 220);
});

it('should work with filter', () => {
Expand Down
21 changes: 21 additions & 0 deletions superset/assets/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion superset/assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
"react-bootstrap": "^0.31.5",
"react-bootstrap-dialog": "^0.10.0",
"react-bootstrap-slider": "2.1.5",
"react-bootstrap-table-next": "^1.4.0",
"react-color": "^2.13.8",
"react-datetime": "^2.14.0",
"react-dnd": "^2.5.4",
Expand All @@ -128,6 +129,7 @@
"react-split": "^2.0.4",
"react-sticky": "^6.0.2",
"react-syntax-highlighter": "^7.0.4",
"react-tag-autocomplete": "^5.8.0",
"react-transition-group": "^2.5.3",
"react-virtualized": "9.19.1",
"react-virtualized-select": "^3.1.3",
Expand All @@ -139,7 +141,8 @@
"shortid": "^2.2.6",
"underscore": "^1.8.3",
"urijs": "^1.18.10",
"viewport-mercator-project": "^6.1.1"
"viewport-mercator-project": "^6.1.1",
"whatwg-fetch": "^3.0.0"
},
"devDependencies": {
"@babel/cli": "^7.2.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,21 @@ const layoutWithTabs = undoableDashboardLayoutWithTabs.present;

describe('DashboardBuilder', () => {
let favStarStub;
let fetchMock; // mock calls to tagview/tags/${objectType}/${objectId}/

beforeAll(() => {
// this is invoked on mount, so we stub it instead of making a request
favStarStub = sinon
.stub(dashboardStateActions, 'fetchFaveStar')
.returns({ type: 'mock-action' });
fetchMock = jest
.spyOn(window, 'fetch')
.mockImplementation(() => Promise.resolve({}));
});

afterAll(() => {
favStarStub.restore();
fetchMock.mockClear();
});

const props = {
Expand Down
18 changes: 14 additions & 4 deletions superset/assets/spec/javascripts/welcome/Welcome_spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,26 @@ import { shallow } from 'enzyme';
import Welcome from '../../../src/welcome/Welcome';

describe('Welcome', () => {
let fetchMock; // mock calls to /tagview/tags/suggestions/

beforeAll(() => {
fetchMock = jest.spyOn(window, 'fetch').mockImplementation(() => Promise.resolve({}));
});

afterAll(() => {
fetchMock.mockClear();
});

const mockedProps = {};
it('is valid', () => {
expect(
React.isValidElement(<Welcome {...mockedProps} />),
).toBe(true);
});
it('renders 4 Tab, Panel, and Row components', () => {
it('renders 4 Tabs, 4 Panels, and 5 Row components', () => {
const wrapper = shallow(<Welcome {...mockedProps} />);
expect(wrapper.find(Tab)).toHaveLength(3);
expect(wrapper.find(Panel)).toHaveLength(3);
expect(wrapper.find(Row)).toHaveLength(3);
expect(wrapper.find(Tab)).toHaveLength(4);
expect(wrapper.find(Panel)).toHaveLength(4);
expect(wrapper.find(Row)).toHaveLength(5);
});
});
213 changes: 213 additions & 0 deletions superset/assets/src/components/ObjectTags.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,213 @@
/**
* 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.
*/
/**
* <div class="react-tags">
* <div class="react-tags__selected">
* <button class="react-tags__selected-tag">
* <span class="react-tags__selected-tag-name" />
* </button>
* </div>
* <div class="react-tags__search">
* <div class="react-tags__search-input">
* <input />
* <div />
* </div>
* <div class="react-tags__suggestions">
* <ul>
* <li class="is-active">
* <mark />
* </li>
* <li class="is-disabled">
* <mark />
* </li>
* </ul>
* </div>
* </div>
*/
.react-tags {
position: relative;
display: inline-block;
padding: 1px 0 0 1px;
margin: 0 10px;
border: 1px solid #F5F5F5;
border-radius: 1px;

/* shared font styles */
font-size: 12px;
line-height: 1.2;

/* clicking anywhere will focus the input */
cursor: text;
}

.react-tags-rw {
display: inline-block;
margin: 0 10px;
font-size: 12px;
line-height: 1.2;
}

.react-tags.is-focused {
border-color: #F0F0F0;
}

.react-tags__selected {
display: inline;
}

.react-tags__selected-tag {
display: inline-block;
box-sizing: border-box;
margin: 0;
padding: 6px 8px;
border: 1px solid #F5F5F5;
border-radius: 2px;
background: #F1F1F1;

/* match the font styles */
font-size: inherit;
line-height: inherit;
}

.react-tags__selected-tag:after {
content: '\2715';
color: #AAA;
margin-left: 8px;
}

.react-tags__selected-tag:hover,
.react-tags__selected-tag:focus {
border-color: #B1B1B1;
}

.react-tags__search {
display: inline-block;

/* match tag layout */
padding: 7px 2px;
margin-bottom: 0;

/* prevent autoresize overflowing the container */
max-width: 100%;
}

@media screen and (min-width: 30em) {

.react-tags__search {
/* this will become the offsetParent for suggestions */
position: relative;
}

}

.react-tags__search input {
/* prevent autoresize overflowing the container */
max-width: 100%;

/* remove styles and layout from this element */
margin: 0;
margin-left: 2px;
padding: 0;
border: 0;
outline: none;

/* match the font styles */
font-size: inherit;
line-height: inherit;
}

.react-tags__search input::-ms-clear {
display: none;
}

.react-tags__suggestions {
position: absolute;
top: 100%;
left: 0;
width: 100%;
z-index: 9999;
}

@media screen and (min-width: 30em) {

.react-tags__suggestions {
width: 240px;
}

}

.react-tags__suggestions ul {
margin: 4px -1px;
padding: 0;
list-style: none;
background: white;
border: 1px solid #D1D1D1;
border-radius: 2px;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.react-tags__suggestions li {
border-bottom: 1px solid #ddd;
padding: 6px 8px;
}

.react-tags__suggestions li mark {
text-decoration: underline;
background: none;
font-weight: 600;
}

.react-tags__suggestions li:hover {
cursor: pointer;
background: #eee;
}

.react-tags__suggestions li.is-active {
background: #b7cfe0;
}

.react-tags__suggestions li.is-disabled {
opacity: 0.5;
cursor: auto;
}

.react-tags span.label {
margin-left: 5px;
padding: 0.3em 0.6em 0.3em;
}

.react-tags a.deco-none {
color: inherit;
text-decoration:none;
}

.react-tags-rw span.label {
margin-left: 5px;
}

.react-tags-rw a.deco-none {
color: inherit;
text-decoration:none;
}

.react-tags span.glyphicon {
cursor: pointer;
margin-left: 3px;
top: 2px;
}
Loading

0 comments on commit b643ff0

Please sign in to comment.