Select the correct request tab link for request page url#964
Select the correct request tab link for request page url#964prakashchoudhary07 merged 1 commit intodevelopfrom
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Summary by CodeRabbit
WalkthroughThis pull request introduces a new test case to verify that the request page URL correctly updates after the page reloads. It also modifies the control flow in the request script by adding a call to update the URL query parameter (using Changes
Sequence Diagram(s)sequenceDiagram
participant U as User
participant RP as RequestPage
participant PS as populateStatus
participant UQ as updateUrlWithQuery
U->>RP: Navigate to Request Page
RP->>PS: Populate request statuses
PS-->>RP: Return status data
RP->>UQ: Update URL with OOO_REQUEST_TYPE
UQ-->>RP: URL updated
Assessment against linked issues
Suggested reviewers
Poem
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
Hi @pankajjs |
I think you are correct. If the request url is of type=onboarding after refresh, we should be displaying onboarding card. |
60f2907 to
f49e20d
Compare
Deploying dashboard-rds with
|
| Latest commit: |
f49e20d
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://c1626288.dashboard-rds.pages.dev |
| Branch Preview URL: | https://fix-mismatch-tab-url.dashboard-rds.pages.dev |
| data-testid="ooo-tab" | ||
| >OOO</a | ||
| > | ||
| <a href="#" id="ooo_tab_link" data-testid="ooo-tab">OOO</a> |
There was a problem hiding this comment.
Remove the default selected_tab class from here because after a reload it selects the ooo tab then goes to another tab to match the request page url
| const applyFilterButton = document.getElementById('applyFilterButton'); | ||
| const userNameFilterInput = document.getElementById('assignee-search-input'); | ||
| let currentReqType = OOO_REQUEST_TYPE; | ||
| let currentReqType = params.get('type') ?? OOO_REQUEST_TYPE; |
There was a problem hiding this comment.
Fetches type from page url if not found select ooo request type as default
| function updateTabLink(requestType) { | ||
| if (requestType === OOO_REQUEST_TYPE) { | ||
| oooTabLink.classList.add(selected__tab__class); | ||
| onboardingExtensionTabLink.classList.remove(selected__tab__class); | ||
| extensionTabLink.classList.remove(selected__tab__class); | ||
| } else if (requestType === ONBOARDING_EXTENSION_REQUEST_TYPE) { | ||
| onboardingExtensionTabLink.classList.add(selected__tab__class); | ||
| oooTabLink.classList.remove(selected__tab__class); | ||
| extensionTabLink.classList.remove(selected__tab__class); | ||
| } else if (requestType === EXTENSION_REQUEST_TYPE) { | ||
| extensionTabLink.classList.add(selected__tab__class); | ||
| oooTabLink.classList.remove(selected__tab__class); | ||
| onboardingExtensionTabLink.classList.remove(selected__tab__class); | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
Based on current request type it adds selected__tab class to request tab link and removes from others
| oooTabLink.classList.add(selected__tab__class); | ||
| extensionTabLink.classList.remove(selected__tab__class); | ||
| onboardingExtensionTabLink.classList.remove(selected__tab__class); | ||
| updateTabLink(currentReqType.toUpperCase()); |
There was a problem hiding this comment.
Have refactored this as it is being handle in updateTabLink function
| extensionTabLink.classList.add(selected__tab__class); | ||
| oooTabLink.classList.remove(selected__tab__class); | ||
| onboardingExtensionTabLink.classList.remove(selected__tab__class); | ||
| updateTabLink(currentReqType.toUpperCase()); |
There was a problem hiding this comment.
Have refactored this as it is being handle in updateTabLink function
| onboardingExtensionTabLink.classList.add(selected__tab__class); | ||
| extensionTabLink.classList.remove(selected__tab__class); | ||
| oooTabLink.classList.remove(selected__tab__class); | ||
| updateTabLink(currentReqType.toUpperCase()); |
There was a problem hiding this comment.
Have refactored this as it is being handle in updateTabLink function
| } | ||
| } | ||
|
|
||
| updateTabLink(currentReqType.toUpperCase()); |
There was a problem hiding this comment.
select the request tab link based on current type for every page reload
| }); | ||
|
|
||
| it('should update the card when the accept or reject button is clicked for OOO requests', async () => { | ||
| await page.click('#ooo_tab_link'); |
There was a problem hiding this comment.
Since the selected__tab has been removed from index.html, has to manually click ooo_tab_link to simulate the behaviour
Date: 22 March, 2025
Developer Name: @pankajjs
Issue Ticket Number
Description
This PR fixes the mismatch in request page url and selected request tab.
-It correctly selects the request tab link given the request page url.
-It matches the request tab link with given page url even after reloading.
Documentation Updated?
Under Feature Flag
Database Changes
Breaking Changes
Development Tested?
Screenshots
Working Video
4.mp4
Test Coverage
Screenshots
Additional Notes