@@ -163,21 +162,20 @@ export function Tables() {
alt={name}
size="xs"
variant="circular"
- className={`cursor-pointer border-2 border-white ${
- key === 0 ? "" : "-ml-2.5"
- }`}
+ className={`cursor-pointer border-2 border-white ${key === 0 ? "" : "-ml-2.5"
+ }`}
/>
))}
- |
+ {/* |
{budget}
- |
+ */}
,
},
+ {
+ icon: ,
+ name: "attendance",
+ path: "/attendance",
+ element: ,
+ },
+ {
+ icon: ,
+ name: "projects",
+ path: "/projects",
+ element: ,
+ },
{
icon: ,
- name: "profile",
- path: "/profile",
- element: ,
+ name: "members",
+ path: "/members",
+ element: ,
},
+ // {
+ // icon: ,
+ // name: "profile",
+ // path: "/profile",
+ // element: ,
+ // },
{
icon: ,
name: "tables",
path: "/tables",
element: ,
},
- {
- icon: ,
- name: "notifications",
- path: "/notifications",
- element: ,
- },
+ // {
+ // icon: ,
+ // name: "notifications",
+ // path: "/notifications",
+ // element: ,
+ // },
],
},
{
- title: "auth pages",
+ title: "Monitoring",
layout: "auth",
pages: [
+
{
icon: ,
- name: "sign in",
- path: "/sign-in",
- element: ,
- },
- {
- icon: ,
- name: "sign up",
- path: "/sign-up",
- element: ,
+ name: "commits",
+ path: "/commits",
+ element: ,
},
+ // {
+ // icon: ,
+ // name: "sign in",
+ // path: "/sign-in",
+ // element: ,
+ // },
+ // {
+ // icon: ,
+ // name: "sign up",
+ // path: "/sign-up",
+ // element: ,
+ // },
],
},
];
diff --git a/src/store/custom-hooks.ts b/src/store/custom-hooks.ts
new file mode 100644
index 00000000..3771468e
--- /dev/null
+++ b/src/store/custom-hooks.ts
@@ -0,0 +1,6 @@
+import { useDispatch, useSelector } from 'react-redux'
+import type { RootState, AppDispatch } from './store'
+
+// Use throughout your app instead of plain `useDispatch` and `useSelector`
+export const useAppDispatch = useDispatch.withTypes ()
+export const useAppSelector = useSelector.withTypes()
diff --git a/src/store/services/azure-api-service.ts b/src/store/services/azure-api-service.ts
new file mode 100644
index 00000000..52c4d0b8
--- /dev/null
+++ b/src/store/services/azure-api-service.ts
@@ -0,0 +1,52 @@
+import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react';
+import { Commit, Project, Repository } from '../types/types';
+
+// Replace with your Azure DevOps organization name and personal access token
+const organization = 'devops-ais';
+const personalAccessToken = 'D1ijCqZTiu4U5ymKx8BwCCHXhQmKzZOt1cvwiaDvza7iF7qHvS5PJQQJ99AKACAAAAAAvEZnAAASAZDO3dIe';
+
+
+export const azureApi = createApi({
+ reducerPath: 'azureApi',
+ baseQuery: fetchBaseQuery({
+ baseUrl: `https://dev.azure.com/${organization}/_apis/`,
+ prepareHeaders: (headers) => {
+ headers.set('Authorization', `Basic ${btoa(`:${personalAccessToken}`)}`);
+ return headers;
+ },
+ }),
+ endpoints: (builder) => ({
+ fetchProjects: builder.query({
+ query: () => 'projects?api-version=7.1-preview.4',
+ transformResponse: (response: any) => response.value, // Extract the projects array
+ }),
+ fetchRepositories: builder.query({
+ // query: (projectName) =>
+ // `${projectName}/_apis/git/repositories?api-version=7.1-preview.1`,
+ query: (projectName) => {
+ const url = `${projectName}/_apis/git/repositories?api-version=7.1-preview.1`;
+ console.log('Fetching repositories URL:', url); // Log the final URL
+ return url;
+ },
+ transformResponse: (response: any) => response.value, // Extract the repositories array
+ }),
+ fetchCommits: builder.query({
+ // query: ({ projectName, repoId }) =>
+ // `${projectName}/_apis/git/repositories/${repoId}/commits?searchCriteria.fromDate=${new Date()
+ // .toISOString()
+ // .split('T')[0]}&api-version=7.1-preview.1`,
+ query: ({ projectName, repoId }) => {
+ const url = `${projectName}/_apis/git/repositories/${repoId}/commits?searchCriteria.fromDate=${new Date()
+ .toISOString()
+ .split('T')[0]}&api-version=7.1-preview.1`;
+ console.log('Fetching commits URL:', url); // Log the final URL
+ return url;
+ },
+ transformResponse: (response: any) => response.value, // Extract the commits array
+ }),
+ }),
+});
+
+
+export const { useFetchProjectsQuery , useFetchRepositoriesQuery,
+ useFetchCommitsQuery,} = azureApi;
\ No newline at end of file
diff --git a/src/store/services/azure-organization-service.ts b/src/store/services/azure-organization-service.ts
new file mode 100644
index 00000000..90d65fbf
--- /dev/null
+++ b/src/store/services/azure-organization-service.ts
@@ -0,0 +1,26 @@
+import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react';
+import { User } from '../types/types';
+
+// Replace with your Azure DevOps organization name and personal access token
+const organization = 'devops-ais';
+const personalAccessToken = 'D1ijCqZTiu4U5ymKx8BwCCHXhQmKzZOt1cvwiaDvza7iF7qHvS5PJQQJ99AKACAAAAAAvEZnAAASAZDO3dIe';
+
+// Create an RTK Query API
+export const azureOrganizationApi = createApi({
+ reducerPath: 'azureOrganizationApi',
+ baseQuery: fetchBaseQuery({
+ baseUrl: `https://vssps.dev.azure.com/${organization}/_apis/`,
+ prepareHeaders: (headers) => {
+ headers.set('Authorization', `Basic ${btoa(`:${personalAccessToken}`)}`);
+ return headers;
+ },
+ }),
+ endpoints: (builder) => ({
+ fetchUsers: builder.query({
+ query: () => 'graph/users?api-version=7.1-preview.1',
+ transformResponse: (response: any) => response.value, // Extract the users array
+ }),
+ }),
+});
+
+export const { useFetchUsersQuery } = azureOrganizationApi;
diff --git a/src/store/store.ts b/src/store/store.ts
new file mode 100644
index 00000000..e495f6ff
--- /dev/null
+++ b/src/store/store.ts
@@ -0,0 +1,19 @@
+import { configureStore } from '@reduxjs/toolkit';
+import { azureApi } from './services/azure-api-service';
+import { azureOrganizationApi } from './services/azure-organization-service';
+
+export const store = configureStore({
+ reducer: {
+ [azureApi.reducerPath]: azureApi.reducer,
+ [azureOrganizationApi.reducerPath]: azureOrganizationApi.reducer, // Add azureOrganizationApi reducer
+ },
+ middleware: (getDefaultMiddleware) =>
+ getDefaultMiddleware()
+ .concat(azureApi.middleware)
+ .concat(azureOrganizationApi.middleware), // Add azureOrganizationApi middleware
+});
+
+// Infer the `RootState` and `AppDispatch` types from the store itself
+export type RootState = ReturnType;
+// Inferred type: {posts: PostsState, comments: CommentsState, users: UsersState}
+export type AppDispatch = typeof store.dispatch;
diff --git a/src/store/types/types.ts b/src/store/types/types.ts
new file mode 100644
index 00000000..5ef8a9d1
--- /dev/null
+++ b/src/store/types/types.ts
@@ -0,0 +1,43 @@
+export interface Project {
+ id: string;
+ name: string;
+ description?: string;
+ }
+
+ export interface User {
+ principalName: string;
+ displayName: string;
+ emailAddress: string;
+ origin: string;
+ originId: string;
+ }
+
+ export interface Repository {
+ id: string; // Unique ID of the repository
+ name: string; // Repository name
+ url: string; // URL of the repository
+ project: {
+ id: string; // Project ID the repository belongs to
+ name: string; // Project name
+ };
+ remoteUrl: string; // Remote URL for the repository (e.g., Git clone URL)
+ defaultBranch: string; // Default branch of the repository
+ }
+
+ export interface Commit {
+ commitId: string; // Unique ID of the commit
+ comment: string; // Commit message
+ author: {
+ name: string; // Name of the author
+ email: string; // Email of the author
+ date: string; // Date and time of the commit (ISO format)
+ };
+ committer: {
+ name: string; // Name of the committer (can differ from the author in some cases)
+ email: string; // Email of the committer
+ date: string; // Date and time of the commit by the committer
+ };
+ url: string; // URL to view the commit in Azure DevOps
+ }
+
+
\ No newline at end of file
diff --git a/src/widgets/layout/dashboard-navbar.jsx b/src/widgets/layout/dashboard-navbar.jsx
index d91e23f7..7accff10 100644
--- a/src/widgets/layout/dashboard-navbar.jsx
+++ b/src/widgets/layout/dashboard-navbar.jsx
@@ -72,7 +72,7 @@ export function DashboardNavbar() {
-
+ {/*
-
-
diff --git a/src/widgets/layout/footer.jsx b/src/widgets/layout/footer.jsx
index 1ea98e53..c2ee3cb4 100644
--- a/src/widgets/layout/footer.jsx
+++ b/src/widgets/layout/footer.jsx
@@ -41,10 +41,10 @@ export function Footer({ brandName, brandLink, routes }) {
}
Footer.defaultProps = {
- brandName: "Creative Tim",
+ brandName: "Zindigi Tim",
brandLink: "https://www.creative-tim.com",
routes: [
- { name: "Creative Tim", path: "https://www.creative-tim.com" },
+ { name: "Zindigi Tim", path: "https://www.creative-tim.com" },
{ name: "About Us", path: "https://www.creative-tim.com/presentation" },
{ name: "Blog", path: "https://www.creative-tim.com/blog" },
{ name: "License", path: "https://www.creative-tim.com/license" },
diff --git a/src/widgets/layout/navbar.jsx b/src/widgets/layout/navbar.jsx
index ba0bd4c7..6057f364 100644
--- a/src/widgets/layout/navbar.jsx
+++ b/src/widgets/layout/navbar.jsx
@@ -83,7 +83,7 @@ export function Navbar({ brandName, routes, action }) {
}
Navbar.defaultProps = {
- brandName: "Material Tailwind React",
+ brandName: "Zindigi Dashboard",
action: (
|