mirror of
https://github.com/Unleash/unleash.git
synced 2025-04-19 01:17:18 +02:00
fix: content-min-height
* fix: add min height calculation based on footer and header height * fix: set flex-shrink to 0 * fix: lint * feat: add support for navigating to feature from reporting dash * fix: tests
This commit is contained in:
parent
72e2981cf5
commit
e1078ef822
@ -1,3 +1,8 @@
|
|||||||
|
|
||||||
|
|
||||||
|
html { height: 100%; overflow:auto; }
|
||||||
|
body { height: 100%; }
|
||||||
|
|
||||||
:root {
|
:root {
|
||||||
/* FONT SIZE */
|
/* FONT SIZE */
|
||||||
--h1-size: 1.25rem;
|
--h1-size: 1.25rem;
|
||||||
|
@ -15,6 +15,10 @@ const dateOptions = {
|
|||||||
year: 'numeric',
|
year: 'numeric',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const scrollToTop = () => {
|
||||||
|
window.scrollTo(0, 0);
|
||||||
|
};
|
||||||
|
|
||||||
export const formatFullDateTimeWithLocale = (v, locale, tz) => {
|
export const formatFullDateTimeWithLocale = (v, locale, tz) => {
|
||||||
if (tz) {
|
if (tz) {
|
||||||
dateTimeOptions.timeZone = tz;
|
dateTimeOptions.timeZone = tz;
|
||||||
|
@ -17,6 +17,8 @@ import FeatureTagComponent from '../feature-tag-component';
|
|||||||
import StatusUpdateComponent from './status-update-component';
|
import StatusUpdateComponent from './status-update-component';
|
||||||
import AddTagDialog from '../add-tag-dialog-container';
|
import AddTagDialog from '../add-tag-dialog-container';
|
||||||
|
|
||||||
|
import { scrollToTop } from '../../common/util';
|
||||||
|
|
||||||
const TABS = {
|
const TABS = {
|
||||||
strategies: 0,
|
strategies: 0,
|
||||||
view: 1,
|
view: 1,
|
||||||
@ -31,6 +33,10 @@ export default class ViewFeatureToggleComponent extends React.Component {
|
|||||||
this.isFeatureView = !!props.fetchFeatureToggles;
|
this.isFeatureView = !!props.fetchFeatureToggles;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
componentDidMount() {
|
||||||
|
scrollToTop();
|
||||||
|
}
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
activeTab: PropTypes.string.isRequired,
|
activeTab: PropTypes.string.isRequired,
|
||||||
featureToggleName: PropTypes.string.isRequired,
|
featureToggleName: PropTypes.string.isRequired,
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import React, { PureComponent } from 'react';
|
import React, { PureComponent } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
import classnames from 'classnames';
|
||||||
import { Layout, Content, Footer, Grid, Cell } from 'react-mdl';
|
import { Layout, Content, Footer, Grid, Cell } from 'react-mdl';
|
||||||
|
|
||||||
import styles from '../styles.module.scss';
|
import styles from '../styles.module.scss';
|
||||||
@ -17,8 +18,8 @@ export default class App extends PureComponent {
|
|||||||
return (
|
return (
|
||||||
<Layout fixedHeader>
|
<Layout fixedHeader>
|
||||||
<Header location={this.props.location} />
|
<Header location={this.props.location} />
|
||||||
<Content className="mdl-color--grey-50">
|
<Content className={classnames('mdl-color--grey-50', styles.contentWrapper)}>
|
||||||
<Grid noSpacing className={styles.content} style={{ flex: 1 }}>
|
<Grid noSpacing className={styles.content}>
|
||||||
<Cell col={12}>
|
<Cell col={12}>
|
||||||
{this.props.children}
|
{this.props.children}
|
||||||
<ErrorContainer />
|
<ErrorContainer />
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Provider } from 'react-redux';
|
import { Provider } from 'react-redux';
|
||||||
|
import { HashRouter } from 'react-router-dom';
|
||||||
|
|
||||||
import { createStore } from 'redux';
|
import { createStore } from 'redux';
|
||||||
import { mount } from 'enzyme/build';
|
import { mount } from 'enzyme/build';
|
||||||
|
|
||||||
@ -22,9 +24,11 @@ jest.mock('react-mdl', () => ({
|
|||||||
|
|
||||||
test('changing projects renders only toggles from that project', () => {
|
test('changing projects renders only toggles from that project', () => {
|
||||||
const wrapper = mount(
|
const wrapper = mount(
|
||||||
|
<HashRouter>
|
||||||
<Provider store={createStore(mockReducer, mockStore)}>
|
<Provider store={createStore(mockReducer, mockStore)}>
|
||||||
<Reporting projects={testProjects} features={testFeatures} fetchFeatureToggles={() => {}} />
|
<Reporting projects={testProjects} features={testFeatures} fetchFeatureToggles={() => {}} />
|
||||||
</Provider>
|
</Provider>
|
||||||
|
</HashRouter>
|
||||||
);
|
);
|
||||||
|
|
||||||
const select = wrapper.find('.mdl-textfield__input').first();
|
const select = wrapper.find('.mdl-textfield__input').first();
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
import { useHistory } from 'react-router-dom';
|
||||||
|
|
||||||
import { Checkbox } from 'react-mdl';
|
import { Checkbox } from 'react-mdl';
|
||||||
import CheckIcon from '@material-ui/icons/Check';
|
import CheckIcon from '@material-ui/icons/Check';
|
||||||
@ -14,6 +15,7 @@ import styles from './reporting.module.scss';
|
|||||||
|
|
||||||
const ReportToggleListItem = ({ name, stale, lastSeenAt, createdAt, type, checked, bulkActionsOn, setFeatures }) => {
|
const ReportToggleListItem = ({ name, stale, lastSeenAt, createdAt, type, checked, bulkActionsOn, setFeatures }) => {
|
||||||
const nameMatches = feature => feature.name === name;
|
const nameMatches = feature => feature.name === name;
|
||||||
|
const history = useHistory();
|
||||||
|
|
||||||
const handleChange = () => {
|
const handleChange = () => {
|
||||||
setFeatures(prevState => {
|
setFeatures(prevState => {
|
||||||
@ -91,12 +93,16 @@ const ReportToggleListItem = ({ name, stale, lastSeenAt, createdAt, type, checke
|
|||||||
return renderStatus(<CheckIcon className={styles.reportIcon} />, 'Active');
|
return renderStatus(<CheckIcon className={styles.reportIcon} />, 'Active');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const navigateToFeature = () => {
|
||||||
|
history.push(`/features/strategies/${name}`);
|
||||||
|
};
|
||||||
|
|
||||||
const statusClasses = classnames(styles.active, {
|
const statusClasses = classnames(styles.active, {
|
||||||
[styles.stale]: stale,
|
[styles.stale]: stale,
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<tr>
|
<tr role="button" tabIndex={0} onClick={navigateToFeature} className={styles.tableRow}>
|
||||||
<ConditionallyRender
|
<ConditionallyRender
|
||||||
condition={bulkActionsOn}
|
condition={bulkActionsOn}
|
||||||
show={
|
show={
|
||||||
|
@ -169,3 +169,7 @@
|
|||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tableRow {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
@ -9,12 +9,18 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.contentWrapper {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
width: 1100px;
|
width: 1100px;
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
margin-top: 16px;
|
margin-top: 16px;
|
||||||
margin-bottom: 16px;
|
margin-bottom: 16px;
|
||||||
|
flex: 1 0 0%;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 1260px) {
|
@media (max-width: 1260px) {
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import React, { PureComponent } from 'react';
|
import React, { PureComponent } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import ViewFeatureToggle from './../../component/archive/view-container';
|
import ViewFeatureToggle from './../../component/archive/view-container';
|
||||||
|
|
||||||
export default class Features extends PureComponent {
|
export default class Features extends PureComponent {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
match: PropTypes.object.isRequired,
|
match: PropTypes.object.isRequired,
|
||||||
|
Loading…
Reference in New Issue
Block a user