-
Notifications
You must be signed in to change notification settings - Fork 8
Feature/audit log #670
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
Feature/audit log #670
Conversation
…and table column widths
…ng logic and optimizing status rendering
…AuditFilterModal component
…nce AuditFilterModal component
… AuditFilterModal positioning
… enhancing data rendering logic
…to feature/audit-log
…ainability in AuditLogs component
…igration-v2 into feature/audit-log
…into feature/audit-log
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| url: `${ | ||
| config.CS_URL[token_payload?.region as keyof typeof config.CS_URL] | ||
| }/stack/${res.data.stack.api_key}/dashboard`, | ||
| url: `${config.CS_URL[token_payload?.region as keyof typeof config.CS_URL] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add null checks
| }; | ||
|
|
||
| const getAuditData = async (req: Request): Promise<any> => { | ||
| const projectId = path.basename(req?.params?.projectId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
path?.basename?.()
| } | ||
|
|
||
| try { | ||
| const mainPath = process.cwd().split("migration-v2")[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
process?.cwd?.().split?.("migration-v2")?.[0];
| let fileData; | ||
| if (fs.existsSync(filePath)) { | ||
| const fileContent = await fsPromises.readFile(filePath, 'utf8'); | ||
| fileData = JSON.parse(fileContent); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check type then parse
| const formattedOptions: StackOption[] = stacks.map((stack: any) => ({ | ||
| label: stack.stackName, | ||
| value: stack.stackUid, | ||
| ...stack |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stack?.stackUid
| const label1 = useSelector((state: RootState) => state?.migration?.newMigrationData?.stackDetails?.label); | ||
| const value1 = useSelector((state: RootState) => state?.migration?.newMigrationData?.stackDetails?.value); | ||
| useEffect(() => { | ||
| if (stacks && stacks.length > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stacks?.length > 0
| searchText, | ||
| filter | ||
| ); | ||
| if (response.data) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
response?.data
| <ExecutionLog projectId={projectId} /> | ||
| )} | ||
| {active === "AuditLogs" && | ||
| <div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<></>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove div
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this from pr
…ing and added null checks
…endering to use divs
…to feature/audit-log
| const filter = req?.params?.filter; | ||
| const srcFunc = "getAuditData"; | ||
|
|
||
| if (projectId.includes('..') || stackId.includes('..') || moduleName.includes('..')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add optional chaining => projectId?.includes. stackId?.includes, moduleName?.includes
|
|
||
| const stackFolders = fs.readdirSync(logsDir); | ||
|
|
||
| const stackFolder = stackFolders.find(folder => folder.startsWith(stackId)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add optional chaining => tackFolders?.find, folder?.startsWith
| throw new BadRequestError("Migration data not found for this stack"); | ||
| } | ||
|
|
||
| const auditLogPath = path.resolve(logsDir, stackFolder, GET_AUDT_DATA?.LOGS_DIR, GET_AUDT_DATA?.AUDIT_DIR, GET_AUDT_DATA?.AUDIT_REPORT); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add optional chaining => path?.resolve
| } | ||
| let transformedData = transformAndFlattenData(fileData); | ||
| if (filter != GET_AUDT_DATA.FILTERALL) { | ||
| const filters = filter.split("-"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add optional chaining => filter?.split
| modalElement.classList.add('position-right'); | ||
| } | ||
| } | ||
| }, [isOpen]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add optional chaining in all line of code in useEffect
…n service and audit filter modal
|
@samarp-jain are we done with changes ? |
|
…s components, including table height adjustments and pagination improvements
… string for improved functionality
… improved data handling
…ntifiers and filtering options for improved log management
…enhance response handling in migration controller for improved status management
Audit Logs Screen Created