diff --git a/apps/dashboard/src/main/java/com/akto/action/AccountAction.java b/apps/dashboard/src/main/java/com/akto/action/AccountAction.java index f572eb31f0..4da16dd73c 100644 --- a/apps/dashboard/src/main/java/com/akto/action/AccountAction.java +++ b/apps/dashboard/src/main/java/com/akto/action/AccountAction.java @@ -37,6 +37,7 @@ import java.util.HashSet; import java.util.List; import java.util.Set; +import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; @@ -52,6 +53,7 @@ public class AccountAction extends UserAction { public static final int MAX_NUM_OF_LAMBDAS_TO_FETCH = 50; private static final ScheduledExecutorService executorService = Executors.newSingleThreadScheduledExecutor(); + private static final ExecutorService service = Executors.newFixedThreadPool(1); @Override public String execute() { @@ -309,7 +311,11 @@ public void run() { DaoInit.createIndices(); Main.insertRuntimeFilters(); RuntimeListener.initialiseDemoCollections(); - RuntimeListener.addSampleData(); + service.submit(() ->{ + Context.accountId.set(newAccountId); + loggerMaker.infoAndAddToDb("updating vulnerable api's collection for new account " + newAccountId, LogDb.DASHBOARD); + RuntimeListener.addSampleData(); + }); AccountSettingsDao.instance.updateOnboardingFlag(true); InitializerListener.insertPiiSources(); diff --git a/apps/dashboard/src/main/java/com/akto/action/LoginAction.java b/apps/dashboard/src/main/java/com/akto/action/LoginAction.java index 47643a12ed..fbbf2871df 100644 --- a/apps/dashboard/src/main/java/com/akto/action/LoginAction.java +++ b/apps/dashboard/src/main/java/com/akto/action/LoginAction.java @@ -1,13 +1,17 @@ package com.akto.action; +import com.akto.dao.BackwardCompatibilityDao; import com.akto.dao.SignupDao; import com.akto.dao.SingleTypeInfoDao; import com.akto.dao.UsersDao; import com.akto.dao.context.Context; +import com.akto.dto.BackwardCompatibility; import com.akto.dto.Config; import com.akto.dto.SignupInfo; import com.akto.dto.SignupUserInfo; import com.akto.dto.User; +import com.akto.listener.RuntimeListener; +import com.akto.log.LoggerMaker.LogDb; import com.akto.utils.Token; import com.akto.utils.JWT; import com.mongodb.BasicDBObject; @@ -29,6 +33,8 @@ import java.security.NoSuchAlgorithmException; import java.security.spec.InvalidKeySpecException; import java.util.*; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; import static com.akto.filter.UserDetailsFilter.LOGIN_URI; @@ -42,6 +48,7 @@ public class LoginAction implements Action, ServletResponseAware, ServletRequest private static final Logger logger = LoggerFactory.getLogger(LoginAction.class); public static final String REFRESH_TOKEN_COOKIE_NAME = "refreshToken"; + private static final ExecutorService service = Executors.newFixedThreadPool(1); public BasicDBObject getLoginResult() { return loginResult; } @@ -93,10 +100,37 @@ public String execute() throws IOException { //For the case when no account exists, the user will get access to 1_000_000 account String accountIdStr = user.getAccounts().keySet().isEmpty() ? "1000000" : user.getAccounts().keySet().iterator().next(); int accountId = StringUtils.isNumeric(accountIdStr) ? Integer.parseInt(accountIdStr) : 1_000_000; + try { + service.submit(() ->{ + triggerVulnColUpdation(user); + }); + } catch (Exception e) { + logger.error("error updating vuln collection ", e); + } decideFirstPage(loginResult, accountId); return result; } + private static void triggerVulnColUpdation(User user) { + for (String accountIdStr: user.getAccounts().keySet()) { + int accountId = Integer.parseInt(accountIdStr); + Context.accountId.set(accountId); + logger.info("updating vulnerable api's collection for account " + accountId); + try { + BackwardCompatibility backwardCompatibility = BackwardCompatibilityDao.instance.findOne(new BasicDBObject()); + if (backwardCompatibility.getVulnerableApiUpdationVersionV1() == 0) { + RuntimeListener.addSampleData(); + } + BackwardCompatibilityDao.instance.updateOne( + Filters.eq("_id", backwardCompatibility.getId()), + Updates.set(BackwardCompatibility.VULNERABLE_API_UPDATION_VERSION_V1, Context.now()) + ); + } catch (Exception e) { + logger.error("error updating vulnerable api's collection for account " + accountId + " " + e.getMessage()); + } + } + } + private void decideFirstPage(BasicDBObject loginResult, int accountId){ Context.accountId.set(accountId); long count = SingleTypeInfoDao.instance.getEstimatedCount(); @@ -157,6 +191,9 @@ public static String loginUser(User user, HttpServletResponse servletResponse, b ) ); } + service.submit(() ->{ + triggerVulnColUpdation(user); + }); return Action.SUCCESS.toUpperCase(); } catch (NoSuchAlgorithmException | InvalidKeySpecException | IOException e) { e.printStackTrace(); diff --git a/apps/dashboard/src/main/java/com/akto/listener/RuntimeListener.java b/apps/dashboard/src/main/java/com/akto/listener/RuntimeListener.java index da15a1e81b..377badbbcb 100644 --- a/apps/dashboard/src/main/java/com/akto/listener/RuntimeListener.java +++ b/apps/dashboard/src/main/java/com/akto/listener/RuntimeListener.java @@ -79,7 +79,7 @@ public void accept(Account account) { try { initialiseDemoCollections(); - addSampleData(); + //addSampleData(); } catch (Exception e) { loggerMaker.errorAndAddToDb(e,"Error while initialising demo collections: " + e, LoggerMaker.LogDb.DASHBOARD); } @@ -225,7 +225,7 @@ public static void addSampleData() { for (SingleTypeInfo singleTypeInfo: params) { urlList.add(singleTypeInfo.getUrl()); } - if (urlList.size() != 190) { + if (urlList.size() != 194) { Utils.pushDataToKafka(VULNERABLE_API_COLLECTION_ID, "", result, new ArrayList<>(), true); } diff --git a/apps/dashboard/src/main/resources/SampleApiData.json b/apps/dashboard/src/main/resources/SampleApiData.json index 304334d346..00239c8ed1 100644 --- a/apps/dashboard/src/main/resources/SampleApiData.json +++ b/apps/dashboard/src/main/resources/SampleApiData.json @@ -4490,5 +4490,135 @@ "responseHeaders": {}, "statusCode": 200 } + }, + { + "id": "CONTENT_TYPE_HEADER_MISSING", + "sampleData": { + "method": "GET", + "requestPayload": "", + "responsePayload": "{\"courses\": [{\"courseId\": \"CS101\", \"name\": \"Computer Science\", \"duration\": \"4 years\", \"faculty\": \"PROF-404\", \"description\": \"This course provides in-depth knowledge of computer science principles and applications.\"}, {\"courseId\": \"ENG201\", \"name\": \"English\", \"duration\": \"3 years\", \"faculty\": \"PROF-202\", \"description\": \"Explore the world of literature and develop critical thinking and analytical skills.\"}, {\"courseId\": \"MAT301\", \"name\": \"Mathematics\", \"duration\": \"3 years\", \"faculty\": \"PROF-505\", \"description\": \"Study advanced mathematical concepts and their real-world applications.\"}]}", + "requestHeaders": "{\"Authorization\":\"JWT eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJBa3RvIiwic3ViIjoibG9naW4iLCJzaWduZWRVcCI6InRydWUiLCJ1c2VybmFtZSI6InJpc2hhdi5zb2xhbmtpQGFrdG8uaW8iLCJpYXQiOjE2ODg3MTMzNTUsImV4cCI6MTY4ODcxNDI1NX0.ToSrgQdEWaTVBphY9QMPBmo1zWgaDt_2zRlFb4gLYcgn3x58ClnTciRXN--9 LeoKojWo466S2rDDK8KH3IhR7gTDKk9ihKfLaVoKIg7M7RaHxFgp - vtjWenFcR6IBqLXqYh_kCqBFDH3hjrbD1Qtoaieu_L1rtJFwqz2xoIZP0VEmTPXT4vxT6yoVlbgloROzu1cJFGnoFQm69OUNHpCLf9S_7Qs - 9 eV2V - AlzeClfMnblTqhQP_s4znPit2Ik0ypNIH - mEwgxL - coWVmphuFYy5uG5c2Z4F4te7r_QP9jlOVYFjwB6_9gQSwi1lrm8qKdNml1UKnh4NNizc1878oQ\", \"Content-Length\": \"2\"}", + "responseHeaders": "", + "status": "OK", + "statusCode": "200", + "path": "/api/college/course-list" + }, + "testData": { + "method": "GET", + "url": "/api/college/course-list", + "responsePayload": { + "courses": { + "courseId_1": "CS101", + "courseId_2": "CS102", + "courseId_3": "CS103", + "courseId_4": "CS104", + "courseId_5": "CS105" + } + }, + "responseHeaders": { + "Server": "Apache/2.4.18 (Ubuntu)" + }, + "statusCode": 200 + } + }, + { + "id": "FIREBASE_UNAUTHENTICATED", + "sampleData": { + "method": "GET", + "requestPayload": "", + "responsePayload": "{\"d1\" : \"CSE\", \"d2\": \"ECE\", \"d3\": \"IT\"}", + "requestHeaders": "{\"Authorization\":\"JWT eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJBa3RvIiwic3ViIjoibG9naW4iLCJzaWduZWRVcCI6InRydWUiLCJ1c2VybmFtZSI6InJpc2hhdi5zb2xhbmtpQGFrdG8uaW8iLCJpYXQiOjE2ODg3MTMzNTUsImV4cCI6MTY4ODcxNDI1NX0.ToSrgQdEWaTVBphY9QMPBmo1zWgaDt_2zRlFb4gLYcgn3x58ClnTciRXN--9 LeoKojWo466S2rDDK8KH3IhR7gTDKk9ihKfLaVoKIg7M7RaHxFgp - vtjWenFcR6IBqLXqYh_kCqBFDH3hjrbD1Qtoaieu_L1rtJFwqz2xoIZP0VEmTPXT4vxT6yoVlbgloROzu1cJFGnoFQm69OUNHpCLf9S_7Qs - 9 eV2V - AlzeClfMnblTqhQP_s4znPit2Ik0ypNIH - mEwgxL - coWVmphuFYy5uG5c2Z4F4te7r_QP9jlOVYFjwB6_9gQSwi1lrm8qKdNml1UKnh4NNizc1878oQ\", \"Content-Type\": \"application/json\", \"Content-Length\": \"2\"}", + "responseHeaders": "", + "status": "OK", + "statusCode": "200", + "path": "/api/college/info/departments/branch" + }, + "testData": { + "method": "GET", + "url": "/api/college/info/departments/branch.json", + "responsePayload": { + "d1": { + "id": "CSE", + "name": "Computer Science" + }, + "d2": { + "id": "ECE", + "name": "Electronics and Communication" + }, + "d3": { + "id": "IT", + "name": "Information Technology" + } + }, + "responseHeaders": {}, + "statusCode": 200 + } + }, + { + "id": "PASSWD_CHANGE_BRUTE_FORCE", + "sampleData": { + "method": "POST", + "requestPayload": "{\"username\": \"STUD-9965\", \"password\":\"qwerty123\"}", + "requestHeaders": "{\"Authorization\":\"JWT eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJBa3RvIiwic3ViIjoibG9naW4iLCJzaWduZWRVcCI6InRydWUiLCJ1c2VybmFtZSI6InJpc2hhdi5zb2xhbmtpQGFrdG8uaW8iLCJpYXQiOjE2ODg3MTMzNTUsImV4cCI6MTY4ODcxNDI1NX0.ToSrgQdEWaTVBphY9QMPBmo1zWgaDt_2zRlFb4gLYcgn3x58ClnTciRXN--9 LeoKojWo466S2rDDK8KH3IhR7gTDKk9ihKfLaVoKIg7M7RaHxFgp - vtjWenFcR6IBqLXqYh_kCqBFDH3hjrbD1Qtoaieu_L1rtJFwqz2xoIZP0VEmTPXT4vxT6yoVlbgloROzu1cJFGnoFQm69OUNHpCLf9S_7Qs - 9 eV2V - AlzeClfMnblTqhQP_s4znPit2Ik0ypNIH - mEwgxL - coWVmphuFYy5uG5c2Z4F4te7r_QP9jlOVYFjwB6_9gQSwi1lrm8qKdNml1UKnh4NNizc1878oQ\", \"HOST\": \"vulnerableapi.com\", \"Content-Type\": \"application/json\", \"Content-Length\": \"2\"}", + "responsePayload": "{\"status\": \"Password change successful\"}", + "responseHeaders": "", + "status": "OK", + "statusCode": "200", + "path": "/api/college/erp/login/change-password" + }, + "testData": { + "method": "POST", + "url": "/api/college/erp/login/change-password", + "responsePayload": { + "status": "Password change successful" + }, + "responseHeaders": {}, + "statusCode": 200 + } + }, + { + "id": "BOLA_COOKIE_FUZZING", + "sampleData": { + "method": "GET", + "requestPayload": "{\"email\": \"user6@example.com\",\"role\": \"user\"}", + "requestHeaders": "{\"Authorization\":\"JWT eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJBa3RvIiwic3ViIjoibG9naW4iLCJzaWduZWRVcCI6InRydWUiLCJ1c2VybmFtZSI6InJpc2hhdi5zb2xhbmtpQGFrdG8uaW8iLCJpYXQiOjE2ODg3MTMzNTUsImV4cCI6MTY4ODcxNDI1NX0.ToSrgQdEWaTVBphY9QMPBmo1zWgaDt_2zRlFb4gLYcgn3x58ClnTciRXN--9 LeoKojWo466S2rDDK8KH3IhR7gTDKk9ihKfLaVoKIg7M7RaHxFgp-vtjWenFcR6IBqLXqYh_kCqBFDH3hjrbD1Qtoaieu_L1rtJFwqz2xoIZP0VEmTPXT4vxT6yoVlbgloROzu1cJFGnoFQm69OUNHpCLf9S_7Qs-9eV2V-AlzeClfMnblTqhQP_s4znPit2Ik0ypNIH-mEwgxL-coWVmphuFYy5uG5c2Z4F4te7r_QP9jlOVYFjwB6_9gQSwi1lrm8qKdNml1UKnh4NNizc1878oQ\", \"HOST\": \"vulnerableapi.com\", \"cookie\": \"refreshToken=eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJBa3RvIiwic3ViIjoicmVmcmVzaFRva2VuIiwic2lnbmVasdkSDG3jsnVlIiwidjknbjhksd8757dfsjkgDFG93nQGFrdG8uaW8iLCJpYXQiOjE2ODk2OTg0MDgsImV4cCI6MTY5MDIxNjgwOH0.i4YOfDCn4W3weTYqU5M3zaB37L4DHRUaFc91XVzD0_WOYRlTETrzFyLRpMETP7GrttSE79DyFDIN9nVgtuiAOrcLafyZUZsbV9oqLaNxEHx3vcyOQpg7Br7AUPxzqnIyZs_vxdmnkewRoxaeMifhlXuhIvORCoLZRHBgLX66CuJNqBwQy6zO3W0DcdgFN0DOWeQulYN2m8KLuNVDzHswq0s9jOWLPEwVBwlQc-sdf3sFKAoe9rewKNMSA4ptWOds6tqphBs0RYyaE4S_HFywT8mmMb8mer7fdzFqTEXfyKFzEFbI2M9k2_kpASyd6uvl_Cdk22QSIZBzjRMVo3VOLWgg; intercom-device-id-xjvl0z2h=25750e91-1931-42e2-a319-8b7289df6800\"}", + "responsePayload": "{\"flower\": \"Lilium\", \"number\": \"274\"}", + "responseHeaders": "", + "status": "OK", + "statusCode": "200", + "path": "/api/college/garden/123653" + }, + "testData": { + "method": "GET", + "url": "/api/college/garden/123653", + "responsePayload": { + "flower": "Lilium", + "number": "274" + }, + "responseHeaders": {}, + "statusCode": 200 + } + }, + { + "id": "HEAD_METHOD_TEST", + "sampleData": { + "method": "GET", + "requestPayload": "", + "responsePayload": "{\"message\": \"Redirecting...\"}", + "requestHeaders": "{\"Authorization\":\"JWT eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJBa3RvIiwic3ViIjoibG9naW4iLCJzaWduZWRVcCI6InRydWUiLCJ1c2VybmFtZSI6InJpc2hhdi5zb2xhbmtpQGFrdG8uaW8iLCJpYXQiOjE2ODg3MTMzNTUsImV4cCI6MTY4ODcxNDI1NX0.ToSrgQdEWaTVBphY9QMPBmo1zWgaDt_2zRlFb4gLYcgn3x58ClnTciRXN--9 LeoKojWo466S2rDDK8KH3IhR7gTDKk9ihKfLaVoKIg7M7RaHxFgp - vtjWenFcR6IBqLXqYh_kCqBFDH3hjrbD1Qtoaieu_L1rtJFwqz2xoIZP0VEmTPXT4vxT6yoVlbgloROzu1cJFGnoFQm69OUNHpCLf9S_7Qs - 9 eV2V - AlzeClfMnblTqhQP_s4znPit2Ik0ypNIH - mEwgxL - coWVmphuFYy5uG5c2Z4F4te7r_QP9jlOVYFjwB6_9gQSwi1lrm8qKdNml1UKnh4NNizc1878oQ\", \"Content-Type\": \"application/json\", \"Content-Length\": \"2\", \"X-CSRF-Token\": \"abcdef1234567890\"}", + "responseHeaders": "", + "status": "OK", + "statusCode": "302", + "path": "/api/college/head-endpoint" + }, + "testData": { + "method": "HEAD", + "url": "/api/college/head-endpoint", + "responsePayload": { + "message": "Welcome to the collegeXYZ Portal" + }, + "responseHeaders": {}, + "statusCode": 200 + } } ] diff --git a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/components/shared/style.css b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/components/shared/style.css index 40ce595203..f592dd4285 100644 --- a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/components/shared/style.css +++ b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/components/shared/style.css @@ -44,10 +44,6 @@ padding-left: 10px ; } -.new-diff .view-lines{ - background: #FAFBFB !important; -} - .new-diff .monaco-hover{ background-color: #FFF5EA !important; border-radius: 2px; diff --git a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/dashboard.css b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/dashboard.css index e8b2051bce..1c651c8df1 100644 --- a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/dashboard.css +++ b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/dashboard.css @@ -114,6 +114,10 @@ word-break: break-all !important; } +.test-title .Polaris-Text--break { + word-break: normal !important; +} + .Polaris-Frame__Skip{ visibility: hidden !important; } diff --git a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/test_editor/TestEditor.jsx b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/test_editor/TestEditor.jsx index ca344036b8..2078fb47cd 100644 --- a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/test_editor/TestEditor.jsx +++ b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/test_editor/TestEditor.jsx @@ -25,6 +25,7 @@ const TestEditor = () => { const setVulnerableRequestMap = TestEditorStore(state => state.setVulnerableRequestMap) const setDefaultRequest = TestEditorStore(state => state.setDefaultRequest) const setActive = PersistStore(state => state.setActive) + const selectedSampleApi = TestEditorStore(state => state.selectedSampleApi) const [loading, setLoading] = useState(true) diff --git a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/test_editor/components/SampleApi.jsx b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/test_editor/components/SampleApi.jsx index d558c00bfe..de17dccc30 100644 --- a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/test_editor/components/SampleApi.jsx +++ b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/test_editor/components/SampleApi.jsx @@ -35,15 +35,15 @@ const SampleApi = () => { const selectedTest = TestEditorStore(state => state.selectedTest) const vulnerableRequestsObj = TestEditorStore(state => state.vulnerableRequestsMap) const defaultRequest = TestEditorStore(state => state.defaultRequest) - const selectedSampleApi = TestEditorStore(state => state.selectedSampleApi) - const setSelectedSampleApi = TestEditorStore(state => state.setSelectedSampleApi) + const selectedSampleApi = PersistStore(state => state.selectedSampleApi) + const setSelectedSampleApi = PersistStore(state => state.setSelectedSampleApi) const tabs = [{ id: 'request', content: 'Request' }, { id: 'response', content: 'Response'}]; const mapCollectionIdToName = func.mapCollectionIdToName(allCollections) useEffect(()=>{ let testId = selectedTest.value - let selectedUrl = selectedSampleApi.hasOwnProperty(testId) ? selectedSampleApi[testId] : vulnerableRequestsObj?.[testId] + let selectedUrl = Object.keys(selectedSampleApi).length > 0 ? selectedSampleApi : vulnerableRequestsObj?.[testId] setSelectedCollectionId(null) setCopyCollectionId(null) setTestResult(null) @@ -95,6 +95,8 @@ const SampleApi = () => { localEditorData = transform.formatData(sampleData?.responseJson, "http") } setEditorData({message: localEditorData}) + }else{ + setEditorData({message: ''}) } } @@ -137,23 +139,26 @@ const SampleApi = () => { },0) setSelected(0) + }else{ + setEditorData({message: ''}) } + }else{ + setEditorData({message: ''}) } } const toggleSelectApiActive = () => setSelectApiActive(prev => !prev) const saveFunc = () =>{ setSelectedApiEndpoint(copySelectedApiEndpoint) - let copySampleApiObj = {...selectedSampleApi} const urlObj = func.toMethodUrlObject(copySelectedApiEndpoint) - copySampleApiObj[selectedTest.value] = { + const sampleApi = { apiCollectionId :copyCollectionId, url: urlObj.url, method:{ "_name": urlObj.method } } - setSelectedSampleApi(copySampleApiObj) + setSelectedSampleApi(sampleApi) setSelectedCollectionId(copyCollectionId) toggleSelectApiActive() } diff --git a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/test_editor/components/YamlEditor.jsx b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/test_editor/components/YamlEditor.jsx index 766e0590c7..561e73f3b1 100644 --- a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/test_editor/components/YamlEditor.jsx +++ b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/test_editor/components/YamlEditor.jsx @@ -41,9 +41,6 @@ const YamlEditor = ({ fetchAllTests }) => { const setTestsObj = TestEditorStore(state => state.setTestsObj) const setCurrentContent = TestEditorStore(state => state.setCurrentContent) - const selectedSampleApi = TestEditorStore(state => state.selectedSampleApi) - const setSelectedSampleApi = TestEditorStore(state => state.setSelectedSampleApi) - const [ isEdited, setIsEdited ] = useState(false) const [ editorInstance, _setEditorInstance ] = useState() const editorInstanceRef = useRef(editorInstance) @@ -72,9 +69,6 @@ const YamlEditor = ({ fetchAllTests }) => { isError: false, message: "Test saved successfully!" }) - let newUrlObj = {...selectedSampleApi} - newUrlObj[addTestTemplateResponse.finalTestId] = selectedSampleApi[selectedTest.value]; - setSelectedSampleApi(newUrlObj); navigate(`/dashboard/test-editor/${addTestTemplateResponse.finalTestId}`) fetchAllTests() } catch(error) { diff --git a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/test_editor/testEditorStore.js b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/test_editor/testEditorStore.js index 81060fa74b..11ca3db2a9 100644 --- a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/test_editor/testEditorStore.js +++ b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/test_editor/testEditorStore.js @@ -26,9 +26,6 @@ let testEditorStore = (set)=>({ setCurrentContent:(currentContent)=>{ set({currentContent: currentContent}) }, - - selectedSampleApi: {}, - setSelectedSampleApi: (selectedSampleApi) => set({selectedSampleApi: selectedSampleApi}) }) testEditorStore = devtools(testEditorStore) diff --git a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/testing/TestRunResultPage/TestRunResultFlyout.jsx b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/testing/TestRunResultPage/TestRunResultFlyout.jsx index 735cfc68c1..4094008d5d 100644 --- a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/testing/TestRunResultPage/TestRunResultFlyout.jsx +++ b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/testing/TestRunResultPage/TestRunResultFlyout.jsx @@ -118,7 +118,7 @@ function TestRunResultFlyout(props) {