Skip to content

Commit

Permalink
Add B1 Tab
Browse files Browse the repository at this point in the history
* Changes from SITE-3986

* Update B1Tab.tsx

* Create SMTPTestCases.tsx

* Remove duplicate files

* Add env variables and move API calls to ServerActions

* Improve environment variable name

* Remove env variables

* Add Loading Button, Remove Default Profile Values

* add IMAP/POP3 manual validation, attachment type field

* Fix tab data carryover, fix include filter

* Add XDR endpoint fields

* Add XDR DocumentSelector handling

* Fix incorrect emails

* Fix missing doc select on XDR 3

* Add logs formatting

* Fix reversed IMAP and POP3 icons

* Add tooltip

* Fix XDR logs and missing manual validations

* Add attachment type tooltip

* Remove Tooltips add XDR API call

* Add error condition, add clear button

* Fix more info sections, censor profile password

* Add clear selected document

* Remove accept/reject on API error

* Fix XDR more info page

* add tooltip and pop over for endpoint copy

* Fix incorrect xdr email addresses

* Replace popover system and fix error handling

* Language improvements and fix clear button visibility trigger

* Fix language errors

* Add clear button to XDR send

* Basic xdr functionality

* Add manual validation, request/response, remining request fields,

* add xdr document selector

* Add XDR Document Select test functionality, add colorized XML display

* Correct document selection per sub criteria

* Fix failure detection on empty responses

* Banish type errors

* Less restrictive clear button

* Fix CORS issue with document select

* Update DocumentSelector.tsx

* add prettier ignore to bugged line

* Add improved warning triggers

* Add backup content, fix criteriaMet icon on non manual tests

* Language fix and null value handling

* Update replacement values

* Modify jessionid formation

* Update ServerActions.ts

* Alternative auth method

* Improve error handling
  • Loading branch information
ebrockainq authored Sep 18, 2024
1 parent 8486564 commit b095e1a
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions src/components/direct/test-by-criteria/ServerActions.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use server'
import axios from 'axios'
import { authOptions } from '@/lib/auth'
import { NextRequest, NextResponse } from 'next/server'
import _ from 'lodash'
import { getServerSession } from 'next-auth'

Expand Down Expand Up @@ -135,10 +134,9 @@ export async function handleXDRAPICall(data: XDRAPICallData): Promise<XDRAPIResp
const config = {
method: 'post',
url: apiUrl,
headers: {
'Content-Type': 'application/json',
Cookie: `JSESSIONID=${jsessionid}`,
},
headers: session
? { 'Content-Type': 'application/json', Cookie: `JSESSIONID=${jsessionid}` }
: { 'Content-Type': 'application/json' },
data: JSON.stringify(formattedData),
}

Expand All @@ -149,8 +147,17 @@ export async function handleXDRAPICall(data: XDRAPICallData): Promise<XDRAPIResp
console.log('Raw content 1226:', response.data)
const content = response.data

const testRequest = content.content.value.request || content.message
const testResponse = content.content.value.response || content.message
let testRequest = ''
let testResponse = ''

if (content && content.content && content.content.value) {
testRequest = content.content.value.request || content.message
testResponse = content.content.value.response || content.message
} else {
console.error('Invalid response structure:', content)
testRequest = content.message
testResponse = content.message
}

return {
criteriaMet: content.status,
Expand Down

0 comments on commit b095e1a

Please sign in to comment.