Skip to content

Commit

Permalink
refactor: extracted dashboard to separate package
Browse files Browse the repository at this point in the history
  • Loading branch information
manusa committed May 7, 2024
1 parent 2165ce5 commit a24e7b6
Show file tree
Hide file tree
Showing 40 changed files with 76 additions and 66 deletions.
3 changes: 2 additions & 1 deletion src/main/frontend/src/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ import {DeploymentsCard} from './deployments';
import {EventsList} from './events';
import {NodesCard} from './nodes';
import pods from './pods';
import {DashboardPage, FilterBar} from './components';
import {FilterBar} from './components';
import {DashboardPage} from './dashboard';
import {useUiNamespace} from './redux';

const cardResponsiveClass = 'w-full sm:w-1/2 md:w-1/3';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
*/
import React from 'react';
import {DashboardPage} from '../components';
import {DashboardPage} from '../dashboard';
import {List} from './';

export const ClusterRoleBindingsPage = () => (
Expand Down
2 changes: 1 addition & 1 deletion src/main/frontend/src/clusterroles/ClusterRolesPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
*/
import React from 'react';
import {DashboardPage} from '../components';
import {DashboardPage} from '../dashboard';
import {ClusterRolesList} from './';

export const ClusterRolesPage = () => (
Expand Down
3 changes: 2 additions & 1 deletion src/main/frontend/src/components/ResourceDetailPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ import React from 'react';
import {useNavigate} from 'react-router-dom';
import YAML from 'yaml';
import {name, namespace} from '../metadata';
import {Card, DashboardPage, Icon, Link, PopupMenu} from './';
import {Card, Icon, Link, PopupMenu} from './';
import {DashboardPage} from '../dashboard';

const downloadResource = resource => {
const mimeType = 'text/yaml';
Expand Down
12 changes: 2 additions & 10 deletions src/main/frontend/src/components/editor/ResourceEditPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,8 @@ import {
name as metadataName,
namespace as metadataNamespace
} from '../../metadata';
import {
useEditor,
Alert,
Card,
DashboardPage,
Icon,
Link,
YamlEditor,
Spinner
} from '../';
import {useEditor, Alert, Card, Icon, Link, YamlEditor, Spinner} from '../';
import {DashboardPage} from '../../dashboard';

export const ResourceEditPage = ({
kind,
Expand Down
1 change: 0 additions & 1 deletion src/main/frontend/src/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,3 @@ export {Table} from './Table';
export {Tag} from './Tag';
export {Textfield} from './Textfield';
export {Tooltip} from './Tooltip';
export {DashboardPage} from './dashboard';
3 changes: 2 additions & 1 deletion src/main/frontend/src/configmaps/ConfigMapsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
*
*/
import React from 'react';
import {DashboardPage, FilterBar} from '../components';
import {FilterBar} from '../components';
import {DashboardPage} from '../dashboard';
import {useUiNamespace} from '../redux';
import {ConfigMapsList} from './';

Expand Down
10 changes: 2 additions & 8 deletions src/main/frontend/src/cronjobs/CronJobsDetailPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,8 @@
*/
import React from 'react';
import {connect} from 'react-redux';
import {
Card,
DashboardPage,
Form,
Icon,
Link,
ResourceDetailPage
} from '../components';
import {Card, Form, Icon, Link, ResourceDetailPage} from '../components';
import {DashboardPage} from '../dashboard';
import {withParams} from '../router';
import {Details, namespace, uid} from '../metadata';
import {api, selectors} from './';
Expand Down
3 changes: 2 additions & 1 deletion src/main/frontend/src/cronjobs/CronJobsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
*
*/
import React from 'react';
import {DashboardPage, FilterBar} from '../components';
import {FilterBar} from '../components';
import {DashboardPage} from '../dashboard';
import {CronJobsList} from './';
import {useUiNamespace} from '../redux';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
*/
import React from 'react';
import {useLocation} from 'react-router-dom';
import {DashboardPage, Link} from '../components';
import {Link} from '../components';
import {DashboardPage} from '../dashboard';
import {CustomResourceDefinitionsList} from './';

export const CustomResourceDefinitionsPage = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
*/
import React from 'react';
import {DashboardPage} from '../components';
import {DashboardPage} from '../dashboard';
import {name} from '../metadata';
import {GroupLink} from './';

Expand Down
3 changes: 2 additions & 1 deletion src/main/frontend/src/daemonsets/DaemonSetsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
*/
import React from 'react';
import {DaemonSetsList} from './';
import {DashboardPage, FilterBar} from '../components';
import {FilterBar} from '../components';
import {DashboardPage} from '../dashboard';
import {useUiNamespace} from '../redux';

export const DaemonSetsPage = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
*/
import React, {useState} from 'react';
import {shallowEqual, useDispatch, useSelector} from 'react-redux';
import {clearError} from '../../redux';
import * as apis from '../../apis';
import i from '../icons';
import {name as metadataName} from '../../metadata';
import {selectors as nodeSelectors} from '../../nodes';
import {Alert, Icon, Link, Tooltip} from '../';
import {clearError} from '../redux';
import * as apis from '../apis';
import i from '../components/icons';
import {name as metadataName} from '../metadata';
import {selectors as nodeSelectors} from '../nodes';
import {Alert, Icon, Link, Tooltip} from '../components';
import {NewResource, NewResourceButton, SideBar} from './';

const OfflineIcon = () => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
import React, {useState, useEffect} from 'react';
import {connect} from 'react-redux';
import {bindActionCreators} from 'redux';
import {uiSetCreatingNewResource} from '../../redux';
import {createResource} from '../../fetch';
import {ResourceEditModal} from '../';
import {uiSetCreatingNewResource} from '../redux';
import {createResource} from '../fetch';
import {ResourceEditModal} from '../components';

const mapStateToProps = ({ui: {creatingNewResource}}) => ({
creatingNewResource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
import React from 'react';
import {connect} from 'react-redux';
import {bindActionCreators} from 'redux';
import {uiSetCreatingNewResource} from '../../redux';
import {Icon, Link} from '../';
import {uiSetCreatingNewResource} from '../redux';
import {Icon, Link} from '../components';

export const NewResourceButton = connect(undefined, dispatch =>
bindActionCreators(
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
import React, {useRef, useLayoutEffect} from 'react';
import {connect} from 'react-redux';
import {useMatch} from 'react-router-dom';
import * as apis from '../../apis';
import i from '../../components/icons';
import {useUiSidebar} from '../../redux';
import * as crd from '../../customresourcedefinitions';
import {Icon, Link} from '../../components';
import * as apis from '../apis';
import i from '../components/icons';
import {useUiSidebar} from '../redux';
import * as crd from '../customresourcedefinitions';
import {Icon, Link} from '../components';

import './SideBar.css';

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
*/
import React from 'react';
import {DeploymentConfigsList} from './';
import {DashboardPage, FilterBar} from '../components';
import {FilterBar} from '../components';
import {DashboardPage} from '../dashboard';
import {useUiNamespace} from '../redux';

export const DeploymentConfigsPage = () => {
Expand Down
3 changes: 2 additions & 1 deletion src/main/frontend/src/deployments/DeploymentsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
*
*/
import React from 'react';
import {DashboardPage, FilterBar} from '../components';
import {FilterBar} from '../components';
import {DashboardPage} from '../dashboard';
import {DeploymentsCard, DeploymentsList} from './';
import {useUiNamespace} from '../redux';

Expand Down
3 changes: 2 additions & 1 deletion src/main/frontend/src/endpoints/EndpointsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
*
*/
import React from 'react';
import {DashboardPage, FilterBar} from '../components';
import {FilterBar} from '../components';
import {DashboardPage} from '../dashboard';
import {List} from './';
import {useUiNamespace} from '../redux';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
*
*/
import React from 'react';
import {DashboardPage, FilterBar} from '../components';
import {FilterBar} from '../components';
import {DashboardPage} from '../dashboard';
import {HorizontalPodAutoscalersList} from './';
import {useUiNamespace} from '../redux';

Expand Down
3 changes: 2 additions & 1 deletion src/main/frontend/src/ingresses/IngressesPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
*
*/
import React from 'react';
import {DashboardPage, FilterBar} from '../components';
import {FilterBar} from '../components';
import {DashboardPage} from '../dashboard';
import {IngressesList} from './';
import {useUiNamespace} from '../redux';

Expand Down
3 changes: 2 additions & 1 deletion src/main/frontend/src/jobs/JobsDetailPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ import {Details, namespace, uid} from '../metadata';
import {api, selectors} from './';
import {ContainerList} from '../containers';
import pods from '../pods';
import {Card, DashboardPage, Form, ResourceDetailPage} from '../components';
import {Card, Form, ResourceDetailPage} from '../components';
import {DashboardPage} from '../dashboard';

const mapStateToProps = ({jobs}) => ({
jobs
Expand Down
3 changes: 2 additions & 1 deletion src/main/frontend/src/jobs/JobsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
*
*/
import React from 'react';
import {DashboardPage, FilterBar} from '../components';
import {FilterBar} from '../components';
import {DashboardPage} from '../dashboard';
import {JobsList} from './';
import {useUiNamespace} from '../redux';

Expand Down
2 changes: 1 addition & 1 deletion src/main/frontend/src/namespaces/NamespacesPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
*/
import React from 'react';
import {DashboardPage} from '../components';
import {DashboardPage} from '../dashboard';
import {NamespacesList} from './';

export const NamespacesPage = () => (
Expand Down
2 changes: 1 addition & 1 deletion src/main/frontend/src/nodes/NodesPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
*/
import React from 'react';
import {DashboardPage} from '../components/';
import {DashboardPage} from '../dashboard';
import {NodesCard, NodesList} from './';

export const NodesPage = () => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
*
*/
import React from 'react';
import {DashboardPage, FilterBar} from '../components';
import {FilterBar} from '../components';
import {DashboardPage} from '../dashboard';
import {useUiNamespace} from '../redux';
import {PersistentVolumeClaimsList} from './';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
*/
import React from 'react';
import {DashboardPage} from '../components';
import {DashboardPage} from '../dashboard';
import {PersistentVolumesList} from './';

export const PersistentVolumesPage = () => (
Expand Down
3 changes: 2 additions & 1 deletion src/main/frontend/src/pods/PodsExecPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ import {withParams} from '../router';
import {name, namespace} from '../metadata';
import {ContainerDropdown} from '../containers';
import p from './index';
import {Card, DashboardPage, Link} from '../components';
import {Card, Link} from '../components';
import {DashboardPage} from '../dashboard';

import 'xterm/css/xterm.css';

Expand Down
3 changes: 2 additions & 1 deletion src/main/frontend/src/pods/PodsLogsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ import {withParams} from '../router';
import {name, namespace} from '../metadata';
import {ContainerDropdown} from '../containers';
import p from '../pods';
import {Card, DashboardPage, Icon, Link, Switch} from '../components';
import {Card, Icon, Link, Switch} from '../components';
import {DashboardPage} from '../dashboard';

import './PodsLogsPage.css';

Expand Down
3 changes: 2 additions & 1 deletion src/main/frontend/src/pods/PodsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
*
*/
import React from 'react';
import {DashboardPage, FilterBar} from '../components';
import {FilterBar} from '../components';
import {DashboardPage} from '../dashboard';
import pods from './';
import {useUiNamespace} from '../redux';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
*
*/
import React from 'react';
import {DashboardPage, FilterBar} from '../components';
import {FilterBar} from '../components';
import {DashboardPage} from '../dashboard';
import {ReplicationControllersList} from './';
import {useUiNamespace} from '../redux';

Expand Down
3 changes: 2 additions & 1 deletion src/main/frontend/src/roles/RolesPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
*
*/
import React from 'react';
import {DashboardPage, FilterBar} from '../components';
import {FilterBar} from '../components';
import {DashboardPage} from '../dashboard';
import {useUiNamespace} from '../redux';
import {RolesList} from './';

Expand Down
3 changes: 2 additions & 1 deletion src/main/frontend/src/routes/RoutesPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
*/
import React from 'react';
import {useUiNamespace} from '../redux';
import {DashboardPage, FilterBar} from '../components';
import {FilterBar} from '../components';
import {DashboardPage} from '../dashboard';
import {RoutesList} from './';

export const RoutesPage = () => {
Expand Down
3 changes: 2 additions & 1 deletion src/main/frontend/src/search/SearchPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ import {ReplicaSetsList} from '../replicasets';
import {ReplicationControllersList} from '../replicationcontrollers';
import {RolesList} from '../roles';
import {RoutesList} from '../routes';
import {Card, DashboardPage, FilterBar, Textfield} from '../components';
import {Card, FilterBar, Textfield} from '../components';
import {DashboardPage} from '../dashboard';

const Instructions = () => (
<Card>
Expand Down
3 changes: 2 additions & 1 deletion src/main/frontend/src/secrets/SecretsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
*/
import React from 'react';
import {SecretsList} from './';
import {DashboardPage, FilterBar} from '../components';
import {FilterBar} from '../components';
import {DashboardPage} from '../dashboard';
import {useUiNamespace} from '../redux';

export const SecretsPage = () => {
Expand Down
3 changes: 2 additions & 1 deletion src/main/frontend/src/serviceaccounts/ServiceAccountsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
*/
import React from 'react';
import {ServiceAccountsList} from './';
import {DashboardPage, FilterBar} from '../components';
import {FilterBar} from '../components';
import {DashboardPage} from '../dashboard';
import {useUiNamespace} from '../redux';

export const ServiceAccountsPage = () => {
Expand Down
3 changes: 2 additions & 1 deletion src/main/frontend/src/services/ServicesPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
*
*/
import React from 'react';
import {DashboardPage, FilterBar} from '../components';
import {FilterBar} from '../components';
import {DashboardPage} from '../dashboard';
import {ServicesList} from './';
import {useUiNamespace} from '../redux';

Expand Down
Loading

0 comments on commit a24e7b6

Please sign in to comment.