Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/tapis-project/tapis-ui into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
nathandf committed Oct 11, 2024
2 parents 461bf3b + ddad78e commit efd9fde
Show file tree
Hide file tree
Showing 17 changed files with 71 additions and 79 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const GenericModal: React.FC<GenericModalProps> = ({
}) => {
return (
<Modal
backdrop="static"
backdrop={true} // Set to "static" to prevent closing on click outside
keyboard={true}
isOpen={true}
toggle={toggle}
Expand Down
2 changes: 1 addition & 1 deletion src/app/Pods/_Layout/Layout.tsx

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

6 changes: 2 additions & 4 deletions src/app/Pods/_components/Modals/DeleteSnapshotModal.tsx

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

6 changes: 2 additions & 4 deletions src/app/Pods/_components/Modals/DeleteVolumeModal.tsx

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

9 changes: 3 additions & 6 deletions src/app/Pods/_components/NavTemplates/NavTemplates.tsx

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

11 changes: 3 additions & 8 deletions src/app/Pods/_components/PageImages/PageImages.tsx

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

12 changes: 3 additions & 9 deletions src/app/Pods/_components/PagePods/PagePods.tsx

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

12 changes: 4 additions & 8 deletions src/app/Pods/_components/PageSnapshots/PageSnapshots.tsx

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

9 changes: 3 additions & 6 deletions src/app/Pods/_components/PageTemplates/PageTemplates.tsx

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

11 changes: 3 additions & 8 deletions src/app/Pods/_components/PageVolumes/PageVolumes.tsx

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

8 changes: 3 additions & 5 deletions src/app/Pods/_components/PodsLoadingText/PodsLoadingText.tsx

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

10 changes: 4 additions & 6 deletions src/app/Pods/_components/PodsNavigation/PodsNavigation.tsx

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

12 changes: 0 additions & 12 deletions src/app/Pods/redux/store.ts

This file was deleted.

8 changes: 8 additions & 0 deletions src/redux/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// src/redux/index.ts
export {
default as store,
useAppDispatch,
useAppSelector,
useAppStore,
} from './store';
export { updateState, type PodsState } from './podsSlice';
8 changes: 7 additions & 1 deletion src/app/Pods/redux/podsSlice.tsx → src/redux/podsSlice.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createSlice, PayloadAction } from '@reduxjs/toolkit';
import { set } from 'date-fns';

interface PodsState {
export interface PodsState {
// arctiveXxxId: string; // Active item ID, used to store state when moving in and out of specific items.
// Tab bars, used to store state when moving in and out of specific tabs.
podTab: string;
Expand Down Expand Up @@ -62,3 +62,9 @@ const podsSlice = createSlice({

export const { updateState } = podsSlice.actions;
export default podsSlice.reducer;

// GET
// const { podTab, podRootTab } = useAppSelector((state) => state.pods);

// POST
// dispatch(updateState({"podTab": tabValue, "podRootTab": rootTabValue}));
20 changes: 20 additions & 0 deletions src/redux/store.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { configureStore } from '@reduxjs/toolkit';
import type { TypedUseSelectorHook } from 'react-redux';
import { useDispatch, useSelector, useStore } from 'react-redux';
import podsReducer from './podsSlice';
// import systemsReducer from './systemsSlice';

const store = configureStore({
reducer: {
pods: podsReducer,
// systems: systemsReducer
},
});

export type AppStore = typeof store;
export type RootState = ReturnType<AppStore['getState']>;
export type AppDispatch = typeof store.dispatch;
export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector;
export const useAppStore: () => AppStore = useStore;
export const useAppDispatch = useDispatch.withTypes<AppDispatch>(); // Export a hook that can be reused to resolve types
export default store;
4 changes: 4 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"compilerOptions": {
"target": "esnext",
"paths": {
"@redux": ["./redux/index.tsx"],
"@redux/*": ["./redux/*"]
},
"lib": ["dom", "dom.iterable", "esnext"],
// "lib": ["es6", "dom"],
"noImplicitAny": true,
Expand Down

0 comments on commit efd9fde

Please sign in to comment.