Skip to content

Commit

Permalink
Merge pull request #828 from bjoernricks/entities-loading
Browse files Browse the repository at this point in the history
Convert list pages to use redux store (part 1)
  • Loading branch information
swaterkamp authored Jul 26, 2018
2 parents 6ad2305 + 731449c commit 2c9160f
Show file tree
Hide file tree
Showing 19 changed files with 403 additions and 178 deletions.
2 changes: 2 additions & 0 deletions gsa/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,9 @@ set (GSA_JS_SRC_FILES
${GSA_SRC_DIR}/src/web/store/dashboard/settings/selectors.js
${GSA_SRC_DIR}/src/web/store/index.js
${GSA_SRC_DIR}/src/web/store/reducers.js
${GSA_SRC_DIR}/src/web/store/entities/agents.js
${GSA_SRC_DIR}/src/web/store/entities/alerts.js
${GSA_SRC_DIR}/src/web/store/entities/certbund.js
${GSA_SRC_DIR}/src/web/store/entities/credentials.js
${GSA_SRC_DIR}/src/web/store/entities/filters.js
${GSA_SRC_DIR}/src/web/store/entities/portlists.js
Expand Down
1 change: 1 addition & 0 deletions gsa/src/gmp/models/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,7 @@ export const REPORT_FORMATS_FILTER_FILTER = Filter.fromString(
export const REPORTS_FILTER_FILTER = Filter.fromString('type=report');
export const RESULTS_FILTER_FILTER = Filter.fromString('type=result');
export const ROLES_FILTER_FILTER = Filter.fromString('type=role');
export const SCANCONFIGS_FILTER_FILTER = Filter.fromString('type=config');
export const SCANNERS_FILTER_FILTER = Filter.fromString('type=scanner');
export const SCHEDULES_FILTER_FILTER = Filter.fromString('type=schedule');
export const SECINFO_FILTER_FILTER = Filter.fromString('type=info');
Expand Down
27 changes: 17 additions & 10 deletions gsa/src/web/pages/agents/listpage.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,26 @@ import _ from 'gmp/locale';

import {AGENTS_FILTER_FILTER} from 'gmp/models/filter';

import PropTypes from '../../utils/proptypes.js';
import withCapabilities from '../../utils/withCapabilities.js';
import PropTypes from 'web/utils/proptypes';
import withCapabilities from 'web/utils/withCapabilities';

import EntitiesPage from '../../entities/page.js';
import withEntitiesContainer from '../../entities/withEntitiesContainer.js';
import EntitiesPage from 'web/entities/page';
import withEntitiesContainer from 'web/entities/withEntitiesContainer2';

import ManualIcon from '../../components/icon/manualicon.js';
import NewIcon from '../../components/icon/newicon.js';
import ManualIcon from 'web/components/icon/manualicon';
import NewIcon from 'web/components/icon/newicon';

import IconDivider from '../../components/layout/icondivider.js';
import IconDivider from 'web/components/layout/icondivider';

import {createFilterDialog} from '../../components/powerfilter/dialog.js';
import {createFilterDialog} from 'web/components/powerfilter/dialog';

import AgentComponent from './component.js';
import AgentsTable, {SORT_FIELDS} from './table.js';
import {
loadEntities,
selector as entitiesSelector,
} from 'web/store/entities/agents';

import AgentComponent from './component';
import AgentsTable, {SORT_FIELDS} from './table';

const ToolBarIcons = withCapabilities(({
capabilities,
Expand Down Expand Up @@ -129,7 +134,9 @@ AgentsPage.propTypes = {


export default withEntitiesContainer('agent', {
entitiesSelector,
filtersFilter: AGENTS_FILTER_FILTER,
loadEntities,
})(AgentsPage);

// vim: set ts=2 sw=2 tw=80:
24 changes: 16 additions & 8 deletions gsa/src/web/pages/alerts/listpage.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,23 @@ import _ from 'gmp/locale';

import {ALERTS_FILTER_FILTER} from 'gmp/models/filter';

import IconDivider from '../../components/layout/icondivider.js';
import PropTypes from '../../utils/proptypes.js';
import withCapabilities from '../../utils/withCapabilities.js';
import PropTypes from 'web/utils/proptypes';
import withCapabilities from 'web/utils/withCapabilities.js';

import EntitiesPage from '../../entities/page.js';
import withEntitiesContainer from '../../entities/withEntitiesContainer.js';
import EntitiesPage from 'web/entities/page.js';
import withEntitiesContainer from 'web/entities/withEntitiesContainer2.js';

import ManualIcon from '../../components/icon/manualicon.js';
import NewIcon from '../../components/icon/newicon.js';
import ManualIcon from 'web/components/icon/manualicon.js';
import NewIcon from 'web/components/icon/newicon.js';

import {createFilterDialog} from '../../components/powerfilter/dialog.js';
import IconDivider from 'web/components/layout/icondivider';

import {createFilterDialog} from 'web/components/powerfilter/dialog.js';

import {
loadEntities,
selector as entitiesSelector,
} from 'web/store/entities/alerts';

import AlertComponent from './component.js';
import AlertTable, {SORT_FIELDS} from './table.js';
Expand Down Expand Up @@ -128,7 +134,9 @@ AlertsPage.propTypes = {
};

export default withEntitiesContainer('alert', {
entitiesSelector,
filtersFilter: ALERTS_FILTER_FILTER,
loadEntities,
})(AlertsPage);

// vim: set ts=2 sw=2 tw=80:
14 changes: 7 additions & 7 deletions gsa/src/web/pages/certbund/listpage.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ import _ from 'gmp/locale';

import {CERTBUND_FILTER_FILTER} from 'gmp/models/filter';

import EntitiesPage from '../../entities/page.js';
import withEntitiesContainer from '../../entities/withEntitiesContainer.js';
import EntitiesPage from 'web/entities/page';
import withEntitiesContainer from 'web/entities/withEntitiesContainer';

import DashboardControls from '../../components/dashboard/controls';
import DashboardControls from 'web/components/dashboard/controls';

import ManualIcon from '../../components/icon/manualicon.js';
import ManualIcon from 'web/components/icon/manualicon';

import CertBundFilterDialog from './filterdialog.js';
import CertBundTable from './table.js';
import CertBundFilterDialog from './filterdialog';
import CertBundTable from './table';

import CertBundDashboard, {CERTBUND_DASHBOARD_ID} from './dashboard/index.js';
import CertBundDashboard, {CERTBUND_DASHBOARD_ID} from './dashboard';

const ToolBarIcons = props => {
return (
Expand Down
27 changes: 17 additions & 10 deletions gsa/src/web/pages/credentials/listpage.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,26 @@ import _ from 'gmp/locale';

import {CREDENTIALS_FILTER_FILTER} from 'gmp/models/filter';

import PropTypes from '../../utils/proptypes.js';
import withCapabilities from '../../utils/withCapabilities.js';
import PropTypes from 'web/utils/proptypes';
import withCapabilities from 'web/utils/withCapabilities';

import EntitiesPage from '../../entities/page.js';
import withEntitiesContainer from '../../entities/withEntitiesContainer.js';
import EntitiesPage from 'web/entities/page';
import withEntitiesContainer from 'web/entities/withEntitiesContainer2';

import ManualIcon from '../../components/icon/manualicon.js';
import NewIcon from '../../components/icon/newicon.js';
import ManualIcon from 'web/components/icon/manualicon';
import NewIcon from 'web/components/icon/newicon';

import IconDivider from '../../components/layout/icondivider.js';
import IconDivider from 'web/components/layout/icondivider';

import {createFilterDialog} from '../../components/powerfilter/dialog.js';
import {createFilterDialog} from 'web/components/powerfilter/dialog';

import CredentialComponent from './component.js';
import CredentialsTable, {SORT_FIELDS} from './table.js';
import {
loadEntities,
selector as entitiesSelector,
} from 'web/store/entities/credentials';

import CredentialComponent from './component';
import CredentialsTable, {SORT_FIELDS} from './table';

const ToolBarIcons = withCapabilities(({
capabilities,
Expand Down Expand Up @@ -124,7 +129,9 @@ CredentialsPage.propTypes = {
};

export default withEntitiesContainer('credential', {
entitiesSelector,
filtersFilter: CREDENTIALS_FILTER_FILTER,
loadEntities,
})(CredentialsPage);

// vim: set ts=2 sw=2 tw=80:
27 changes: 17 additions & 10 deletions gsa/src/web/pages/filters/listpage.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,26 @@ import _ from 'gmp/locale';

import {FILTERS_FILTER_FILTER} from 'gmp/models/filter';

import PropTypes from '../../utils/proptypes.js';
import withCapabilities from '../../utils/withCapabilities.js';
import PropTypes from 'web/utils/proptypes';
import withCapabilities from 'web/utils/withCapabilities';

import EntitiesPage from '../../entities/page.js';
import withEntitiesContainer from '../../entities/withEntitiesContainer.js';
import EntitiesPage from 'web/entities/page';
import withEntitiesContainer from 'web/entities/withEntitiesContainer2';

import ManualIcon from '../../components/icon/manualicon.js';
import NewIcon from '../../components/icon/newicon.js';
import ManualIcon from 'web/components/icon/manualicon';
import NewIcon from 'web/components/icon/newicon';

import IconDivider from '../../components/layout/icondivider.js';
import IconDivider from 'web/components/layout/icondivider';

import {createFilterDialog} from '../../components/powerfilter/dialog.js';
import {createFilterDialog} from 'web/components/powerfilter/dialog';

import FilterComponent from './component.js';
import FiltersTable, {SORT_FIELDS} from './table.js';
import {
loadEntities,
selector as entitiesSelector,
} from 'web/store/entities/filters';

import FilterComponent from './component';
import FiltersTable, {SORT_FIELDS} from './table';

const ToolBarIcons = withCapabilities(({
capabilities,
Expand Down Expand Up @@ -120,7 +125,9 @@ FiltersPage.propTypes = {
};

export default withEntitiesContainer('filter', {
entitiesSelector,
filtersFilter: FILTERS_FILTER_FILTER,
loadEntities,
})(FiltersPage);

// vim: set ts=2 sw=2 tw=80:
31 changes: 19 additions & 12 deletions gsa/src/web/pages/portlists/listpage.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,28 @@ import React from 'react';

import _ from 'gmp/locale';

import IconDivider from '../../components/layout/icondivider.js';
import {PORTLISTS_FILTER_FILTER} from 'gmp/models/filter';

import PropTypes from '../../utils/proptypes.js';
import withCapabilities from '../../utils/withCapabilities.js';
import IconDivider from 'web/components/layout/icondivider';

import EntitiesPage from '../../entities/page.js';
import withEntitiesContainer from '../../entities/withEntitiesContainer.js';
import PropTypes from 'web/utils/proptypes';
import withCapabilities from 'web/utils/withCapabilities';

import ManualIcon from '../../components/icon/manualicon.js';
import Icon from '../../components/icon/icon.js';
import NewIcon from '../../components/icon/newicon.js';
import EntitiesPage from 'web/entities/page';
import withEntitiesContainer from 'web/entities/withEntitiesContainer2';

import {PORTLISTS_FILTER_FILTER} from 'gmp/models/filter.js';
import ManualIcon from 'web/components/icon/manualicon';
import Icon from 'web/components/icon/icon';
import NewIcon from 'web/components/icon/newicon';

import PortListComponent from './component.js';
import PortListsFilterDialog from './filterdialog.js';
import PortListsTable from './table.js';
import {
loadEntities,
selector as entitiesSelector,
} from 'web/store/entities/portlists';

import PortListComponent from './component';
import PortListsFilterDialog from './filterdialog';
import PortListsTable from './table';

const ToolBarIcons = withCapabilities(({
capabilities,
Expand Down Expand Up @@ -127,7 +132,9 @@ PortListsPage.propTypes = {
};

export default withEntitiesContainer('portlist', {
entitiesSelector,
filtersFilter: PORTLISTS_FILTER_FILTER,
loadEntities,
})(PortListsPage);

// vim: set ts=2 sw=2 tw=80:
27 changes: 17 additions & 10 deletions gsa/src/web/pages/reportformats/listpage.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,26 @@ import _ from 'gmp/locale';

import {REPORT_FORMATS_FILTER_FILTER} from 'gmp/models/filter';

import PropTypes from '../../utils/proptypes.js';
import withCapabilities from '../../utils/withCapabilities.js';
import PropTypes from 'web/utils/proptypes';
import withCapabilities from 'web/utils/withCapabilities';

import EntitiesPage from '../../entities/page.js';
import withEntitiesContainer from '../../entities/withEntitiesContainer.js';
import EntitiesPage from 'web/entities/page';
import withEntitiesContainer from 'web/entities/withEntitiesContainer2';

import ManualIcon from '../../components/icon/manualicon.js';
import NewIcon from '../../components/icon/newicon.js';
import ManualIcon from 'web/components/icon/manualicon';
import NewIcon from 'web/components/icon/newicon';

import IconDivider from '../../components/layout/icondivider.js';
import IconDivider from 'web/components/layout/icondivider';

import {createFilterDialog} from '../../components/powerfilter/dialog.js';
import {createFilterDialog} from 'web/components/powerfilter/dialog';

import ReportFormatComponent from './component.js';
import ReportFormatsTable, {SORT_FIELDS} from './table.js';
import {
loadEntities,
selector as entitiesSelector,
} from 'web/store/entities/reportformats';

import ReportFormatComponent from './component';
import ReportFormatsTable, {SORT_FIELDS} from './table';

const ToolBarIcons = withCapabilities(({
capabilities,
Expand Down Expand Up @@ -123,7 +128,9 @@ ReportFormatsPage.propTypes = {
};

export default withEntitiesContainer('reportformat', {
entitiesSelector,
filtersFilter: REPORT_FORMATS_FILTER_FILTER,
loadEntities,
})(ReportFormatsPage);

// vim: set ts=2 sw=2 tw=80:
32 changes: 21 additions & 11 deletions gsa/src/web/pages/scanconfigs/listpage.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,29 @@ import React from 'react';

import _ from 'gmp/locale';

import PropTypes from '../../utils/proptypes.js';
import withCapabilities from '../../utils/withCapabilities.js';
import {SCANCONFIGS_FILTER_FILTER} from 'gmp/models/filter';

import EntitiesPage from '../../entities/page.js';
import withEntitiesContainer from '../../entities/withEntitiesContainer.js';
import PropTypes from 'web/utils/proptypes';
import withCapabilities from 'web/utils/withCapabilities';

import ManualIcon from '../../components/icon/manualicon.js';
import Icon from '../../components/icon/icon.js';
import NewIcon from '../../components/icon/newicon.js';
import EntitiesPage from 'web/entities/page';
import withEntitiesContainer from 'web/entities/withEntitiesContainer2';

import IconDivider from '../../components/layout/icondivider.js';
import ManualIcon from 'web/components/icon/manualicon';
import Icon from 'web/components/icon/icon';
import NewIcon from 'web/components/icon/newicon';

import {createFilterDialog} from '../../components/powerfilter/dialog.js';
import IconDivider from 'web/components/layout/icondivider';

import ScanConfigComponent from './component.js';
import Table, {SORT_FIELDS} from './table.js';
import {createFilterDialog} from 'web/components/powerfilter/dialog';

import {
loadEntities,
selector as entitiesSelector,
} from 'web/store/entities/scanconfigs';

import ScanConfigComponent from './component';
import Table, {SORT_FIELDS} from './table';

const ToolBarIcons = withCapabilities(({
capabilities,
Expand Down Expand Up @@ -128,6 +135,9 @@ ScanConfigsPage.propTypes = {
};

export default withEntitiesContainer('scanconfig', {
entitiesSelector,
filtersFilter: SCANCONFIGS_FILTER_FILTER,
loadEntities,
})(ScanConfigsPage);

// vim: set ts=2 sw=2 tw=80:
Loading

0 comments on commit 2c9160f

Please sign in to comment.