Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflict #37

Closed
wants to merge 17 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .env.example

This file was deleted.

24 changes: 24 additions & 0 deletions package-lock.json

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

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,16 @@
"@emotion/styled": "^11.11.0",
"@mui/icons-material": "^5.14.18",
"@mui/material": "^5.14.18",
"@mui/styles": "^5.14.18",
"@mui/x-date-pickers-pro": "^6.18.4",
"@reduxjs/toolkit": "^2.0.1",
"axios": "^1.6.3",
"date-fns": "^3.2.0",
"firebase": "^10.7.1",
"firebase-auth": "^0.1.2",
"mui-datatables": "^4.3.0",
"next": "^14.0.4",
"next-redux-wrapper": "^8.1.0",
"react": "^18",
"react-date-range": "^2.0.0-alpha.4",
"react-dom": "^18",
Expand Down
39 changes: 39 additions & 0 deletions src/Lib/Features/GetWorkspace.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { createSlice, createAsyncThunk } from '@reduxjs/toolkit';
import fetchParams from '../fetchParams';
import ENDPOINTS from "../../config/apiendpoint"
const initialState = {
data: [],
status: 'idle',
error: null,
};

export const fetchWorkspaceData = createAsyncThunk(
'getWorkspace/fetchWorkspaceData',
async (pageNumber, { dispatch }) => {
const params = fetchParams(`${ENDPOINTS.getWorkspaces}`);
return fetch(params.url, params.options)
.then(response => response.json())
}
);

const getWorkspace = createSlice({
name: 'getWorkspace',
initialState,
reducers: {},
extraReducers: (builder) => {
builder
.addCase(fetchWorkspaceData.pending, (state) => {
state.status = 'loading';
})
.addCase(fetchWorkspaceData.fulfilled, (state, action) => {
state.status = 'succeeded';
state.data = action.payload;
})
.addCase(fetchWorkspaceData.rejected, (state, action) => {
state.status = 'failed';
state.error = action.error.message;
});
},
});

export default getWorkspace.reducer;
23 changes: 23 additions & 0 deletions src/Lib/Features/RemoveWorkspaceMember.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { createSlice } from '@reduxjs/toolkit'

import constants from "../../app/actions/constants";

let initialState = {
data:[]
}


const RemoveWorkspaceMember = createSlice({
name: "RemoveWorkspaceMember",
initialState,
reducers: {
setRemoveWorkspaceMember: (state, action) => {
state.data = action.payload;
}
}
});


export const { setRemoveWorkspaceMember } = RemoveWorkspaceMember.actions;
export default RemoveWorkspaceMember.reducer;

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fetchParams from '@/Lib/fetchParams';
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
import fetchParams from '../fetchParams';

const initialState = {
status: 'idle',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fetchParams from '@/Lib/fetchParams';
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
import fetchParams from '../fetchParams';

const initialState = {
status: 'idle',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fetchParams from '@/Lib/fetchParams';
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
import fetchParams from '../fetchParams';

const initialState = {
status: 'idle',
Expand Down
21 changes: 21 additions & 0 deletions src/Lib/Features/apiStatus.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { createSlice } from '@reduxjs/toolkit'

let initialState = {
data:[]
}


const apistatus = createSlice({
name: "apistatus",
initialState,
reducers: {
setapistatus: (state=0, action) => {
state.data = action.payload;
}
}
});


export const { setapistatus } = apistatus.actions;
export default apistatus.reducer;

39 changes: 39 additions & 0 deletions src/Lib/Features/fetchLanguages.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { createSlice, createAsyncThunk } from '@reduxjs/toolkit';
import fetchParams from '../fetchParams';
import ENDPOINTS from "../../config/apiendpoint"
const initialState = {
data: [],
status: 'idle',
error: null,
};

export const fetchLanguages = createAsyncThunk(
'getLanguages/fetchLanguages',
async (pageNumber, { dispatch }) => {
const params = fetchParams(`${ENDPOINTS.getProjects}types/`);
return fetch(params.url, params.options)
.then(response => response.json())
}
);

const getLanguages = createSlice({
name: 'getLanguages',
initialState,
reducers: {},
extraReducers: (builder) => {
builder
.addCase(fetchLanguages.pending, (state) => {
state.status = 'loading';
})
.addCase(fetchLanguages.fulfilled, (state, action) => {
state.status = 'succeeded';
state.data = action.payload;
})
.addCase(fetchLanguages.rejected, (state, action) => {
state.status = 'failed';
state.error = action.error.message;
});
},
});

export default getLanguages.reducer;
41 changes: 41 additions & 0 deletions src/Lib/Features/getLoggedInData.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { createSlice, createAsyncThunk } from '@reduxjs/toolkit';
import fetchParams from '../fetchParams';
import ENDPOINTS from "../../config/apiendpoint"
const initialState = {
data: [],
status: 'idle',
error: null,
};

export const FetchLoggedInUserData = createAsyncThunk(
'getLoggedInUserData/FetchLoggedInUserData',
async (workspaceId, { dispatch }) => {
const params = fetchParams(`${ENDPOINTS.fetch}me/fetch/`);
return fetch(params.url, params.options)
.then(response => response.json())
}
);

const getLoggedInUserData = createSlice({
name: 'getLoggedInUserData',
initialState,
reducers: {},
extraReducers: (builder) => {
builder
.addCase(FetchLoggedInUserData.pending, (state) => {
state.status = 'loading';
})
.addCase(FetchLoggedInUserData.fulfilled, (state, action) => {
state.status = 'succeeded';
state.data = action.payload;
})
.addCase(FetchLoggedInUserData.rejected, (state, action) => {
state.status = 'failed';
state.error = action.error.message;
});
},
});

export default getLoggedInUserData.reducer;


39 changes: 39 additions & 0 deletions src/Lib/Features/getOrganizationUsers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { createSlice, createAsyncThunk } from '@reduxjs/toolkit';
import fetchParams from '../fetchParams';
import ENDPOINTS from "../../config/apiendpoint"
const initialState = {
data: [],
status: 'idle',
error: null,
};

export const fetchOrganizationUsers = createAsyncThunk(
'getOrganizationUsers/fetchOrganizationUsers',
async (orgId, { dispatch }) => {
const params = fetchParams(`${ENDPOINTS.getOrganizations}${orgId}/users/`);
return fetch(params.url, params.options)
.then(response => response.json())
}
);

const getOrganizationUsers = createSlice({
name: 'getOrganizationUsers',
initialState,
reducers: {},
extraReducers: (builder) => {
builder
.addCase(fetchOrganizationUsers.pending, (state) => {
state.status = 'loading';
})
.addCase(fetchOrganizationUsers.fulfilled, (state, action) => {
state.status = 'succeeded';
state.data = action.payload;
})
.addCase(fetchOrganizationUsers.rejected, (state, action) => {
state.status = 'failed';
state.error = action.error.message;
});
},
});

export default getOrganizationUsers.reducer;
39 changes: 39 additions & 0 deletions src/Lib/Features/getProjectDomains.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { createSlice, createAsyncThunk } from '@reduxjs/toolkit';
import fetchParams from '../fetchParams';
import ENDPOINTS from "../../config/apiendpoint"
const initialState = {
data: [],
status: 'idle',
error: null,
};

export const fetchProjectDomains = createAsyncThunk(
'getProjectDomains/fetchProjectDomains',
async (pageNumber, { dispatch }) => {
const params = fetchParams(`${ENDPOINTS.getProjects}types/`);
return fetch(params.url, params.options)
.then(response => response.json())
}
);

const getProjectDomains = createSlice({
name: 'getProjectDomains',
initialState,
reducers: {},
extraReducers: (builder) => {
builder
.addCase(fetchProjectDomains.pending, (state) => {
state.status = 'loading';
})
.addCase(fetchProjectDomains.fulfilled, (state, action) => {
state.status = 'succeeded';
state.data = action.payload;
})
.addCase(fetchProjectDomains.rejected, (state, action) => {
state.status = 'failed';
state.error = action.error.message;
});
},
});

export default getProjectDomains.reducer;
Loading
Loading