Skip to content
Snippets Groups Projects
Commit dfa1fbee authored by Mohammad Torkashvand's avatar Mohammad Torkashvand
Browse files

run prettier

parent e23b70c4
No related branches found
No related tags found
1 merge request!35Upgrade core
Pipeline #88847 passed
# Add files here to ignore them from prettier formatting
/coverage
/mkdocs
.next
node_modules
......@@ -3,20 +3,26 @@
All notable changes to this project will be documented in this file.
## [2.4] - 2024-08-06
- Redesigned maps to utilize the leafletmap package, replacing graph maps with real-world maps for enhanced accuracy and user experience.
## [2.3] - 2024-06-18
- Extended the timeout for authentication on GAP
## [2.2] - 2024-06-04
- Add a new page that shows the IP trunks in the network.
## [2.1] - 2024-05-24
- Fix a bug that prevented operators from viewing workflows.
## [2.0] - 2024-05-23
- Update GUI to version 2.
- Rework project structure to be compatible with new UI library.
## [0.2] - 2023-12-04
- initial skeleton
import { useEffect } from 'react';
import axios from 'axios';
import { signOut } from 'next-auth/react';
const useAxiosInterceptor = () => {
useEffect(() => {
const responseInterceptor = axios.interceptors.response.use(
response => response,
error => {
if (error.response && error.response.status === 401) {
const currentUrl = window.location.href;
signOut({ callbackUrl: `/api/auth/signin?error=SessionRequired&callbackUrl=${encodeURIComponent(currentUrl)}` });
}
return Promise.reject(error);
}
);
return () => {
axios.interceptors.response.eject(responseInterceptor);
};
}, []);
};
export default useAxiosInterceptor;
import { useEffect } from 'react';
import { signOut } from 'next-auth/react';
const useFetchInterceptor = () => {
useEffect(() => {
const handleResponse = (response: Response) => {
if (response.status === 401) {
const currentUrl = window.location.href;
signOut({ callbackUrl: `/api/auth/signin?error=SessionRequired&callbackUrl=${encodeURIComponent(currentUrl)}` });
}
return response;
};
const originalFetch = global.fetch.bind(global);
global.fetch = async (input: RequestInfo | URL, init?: RequestInit) => {
const response = await originalFetch(input, init);
return handleResponse(response);
};
return () => {
global.fetch = originalFetch;
};
}, []);
};
export default useFetchInterceptor;
module.exports = {
reactStrictMode: false,
output: 'standalone',
i18n: {
// These are all the locales you want to support in
// your application
locales: ['en-GB', 'nl-NL'],
defaultLocale: 'en-GB',
},
transpilePackages: ['@orchestrator-ui/orchestrator-ui-components'],
publicRuntimeConfig: {
OPA_PUBLIC_BUNDLE_URL: process.env.OPA_PUBLIC_BUNDLE_URL,
OAUTH2_CLIENT_ID: process.env.OAUTH2_CLIENT_ID,
},
reactStrictMode: false,
output: 'standalone',
i18n: {
// These are all the locales you want to support in
// your application
locales: ['en-GB', 'nl-NL'],
defaultLocale: 'en-GB',
},
transpilePackages: ['@orchestrator-ui/orchestrator-ui-components'],
publicRuntimeConfig: {
OPA_PUBLIC_BUNDLE_URL: process.env.OPA_PUBLIC_BUNDLE_URL,
OAUTH2_CLIENT_ID: process.env.OAUTH2_CLIENT_ID,
},
};
......@@ -9,11 +9,12 @@
"build": "next build",
"start": "next start",
"lint": "next lint",
"prettier": "prettier --write \"{components,configuration,contexts,pages,translations,public}/**/*.{js,jsx,ts,tsx,json,css,scss,md}\"",
"prettier": "prettier -c \"{**/*,*}.{ts,tsx,json,js,md}\"",
"prettier-fix": "prettier --write \"{**/*,*}.{ts,tsx,json,js,md}\"",
"prettier:check": "prettier --check \"{components,configuration,contexts,pages,translations,public}/**/*.{js,jsx,ts,tsx,json,css,scss,md}\"",
"prepare": "husky"
},
"dependencies": {
"dependencies": {
"@elastic/datemath": "^5.0.3",
"@elastic/eui": "^95.1.0",
"@elfalem/leaflet-curve": "^0.9.2",
......@@ -74,5 +75,5 @@
"react-no-ssr": {
"react": "^18.3.1"
}
}
}
}
{
"extends": "@orchestrator-ui/tsconfig/nextjs.json",
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./*"]
},
"plugins": [
{
"name": "next"
}
],
"strictNullChecks": true,
"jsx": "preserve"
"extends": "@orchestrator-ui/tsconfig/nextjs.json",
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./*"]
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
"plugins": [
{
"name": "next"
}
],
"strictNullChecks": true,
"jsx": "preserve"
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
}
......@@ -15,7 +15,7 @@ export interface IptrunkSideNode {
site_latitude: number;
site_longitude: number;
};
owner_subscription_id: string
owner_subscription_id: string;
}
export interface Iptrunk {
......@@ -25,10 +25,14 @@ export interface Iptrunk {
iptrunk_type: string;
iptrunk_ipv4_network: string;
iptrunk_ipv6_network: string;
geant_s_sid: string,
geant_s_sid: string;
iptrunk_sides: Array<{ iptrunk_side_node: IptrunkSideNode }>;
}
export interface NetworkTopologyData {
iptrunks: Array<{ iptrunk: Iptrunk; insync: boolean; subscription_id: string }>;
iptrunks: Array<{
iptrunk: Iptrunk;
insync: boolean;
subscription_id: string;
}>;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment