Skip to content
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

fix: sentry issues #1844

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

fix: sentry issues #1844

wants to merge 4 commits into from

Conversation

ankit9431
Copy link
Contributor

@ankit9431 ankit9431 commented Jun 18, 2024

Description

This PR includes changes to:

  • fix

Fixes # (issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • The title of the PR states what changed and the related issues number (used for the release note).
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas

@ankit9431 ankit9431 requested a review from vivek-devtron as a code owner June 18, 2024 13:00
Copy link

Quality Gate Passed Quality Gate passed

Issues
8 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@@ -1194,7 +1194,10 @@ export const getDeploymentAppType = (
return allowedDeploymentTypes[0]
}

export const hasApproverAccess = (email: string, approverList: string[]): boolean => {
export const hasApproverAccess = (email: string = '', approverList: string[]= []): boolean => {// added null check for email and approverList
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can remove equating to '' since already checking in first if block. And can remove this comment since it is clear from the if block.

console.log(`Service Worker at: ${swUrl}`);
if (r) {
setInterval(async () => {
if (!r.installing && navigator) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why have we reversed the if condition, earlier we were exiting from block in case of truthy now we are nesting the conditions inside this block.

setGroupFilterOptions(_groupFilterOption);
}
} catch (error) {
console.error('Error fetching environment group list:', error);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can import showError and use it to show error in toast by calling showError(error)

@@ -539,6 +539,7 @@ export const Details: React.FC<DetailsType> = ({
}, [isPollingRequired])

async function handleHibernate(e) {

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert this extra line

@@ -306,7 +306,7 @@ export default function AppOverview({ appMetaInfo, getAppMetaInfoRes, filteredEn
{createdBy}
</div>
</div>
{appType === 'app' && gitMaterials.length > 0 && (
{appType === 'app' && gitMaterials && gitMaterials.length > 0 && (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can write as gitMaterials?.length > 0

const _groupedData = groupDataByType(result);
setGroupedOptionsDataOverride(_groupedData);
} catch (error) {
console.error('Error fetching options:', error);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use showError instead of console.error

@AbhishekA1509 AbhishekA1509 changed the title Fix/sentry fix fix: sentry issues Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants