Skip to content

Commit

Permalink
chore(infra): apply suggestions from deepsource for js code
Browse files Browse the repository at this point in the history
  • Loading branch information
p-fernandez committed Dec 6, 2022
1 parent eb5ef33 commit cb0bc61
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export class PromoteFeedChange {
constructor(private feedRepository: FeedRepository) {}

async execute(command: PromoteTypeChangeCommand) {
let item: FeedEntity | undefined = undefined;
let item: FeedEntity | undefined;
if (command.item.name) {
item = await this.feedRepository.findOne({
_environmentId: command.environmentId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export class SendMessage {
return filter?.children?.find((item) => item?.on === 'subscriber');
});

let subscriber = undefined;
let subscriber;

if (fetchSubscriber) {
/// TODO: refactor command.subscriberId to command._subscriberId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ export class CreateLog {
if (command.raw) {
try {
rawData = JSON.stringify(command.raw);
// eslint-disable-next-line no-empty
} catch (e) {}
} catch (error) {
console.error('Parsing raw data when creating a log failed', error);
}
}

//
Expand Down
2 changes: 1 addition & 1 deletion apps/web/cypress/tests/auth.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ describe('User Sign-up and Login', function () {
cy.getByTestId('submit-btn').click();

// setting current time in future, to simulate expired token
var todaysDate = new Date();
const todaysDate = new Date();
todaysDate.setDate(todaysDate.getDate() + 30); // iat - exp = 30 days
cy.clock(todaysDate);

Expand Down
14 changes: 12 additions & 2 deletions apps/web/src/components/layout/components/SideNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,23 @@ export function SideNav({}: Props) {
<OrganizationSelect />
</Navbar.Section>
<BottomNav dark={dark} data-test-id="side-nav-bottom-links">
<a target="_blank" href="https://discord.novu.co" data-test-id="side-nav-bottom-link-support">
<a
target="_blank"
rel="noopener noreferrer"
href="https://discord.novu.co"
data-test-id="side-nav-bottom-link-support"
>
Support
</a>
<p>
<b>&nbsp;&nbsp;&nbsp;•&nbsp;&nbsp;&nbsp;</b>
</p>
<a target="_blank" href="https://docs.novu.co" data-test-id="side-nav-bottom-link-documentation">
<a
target="_blank"
rel="noopener noreferrer"
href="https://docs.novu.co"
data-test-id="side-nav-bottom-link-documentation"
>
Documentation
</a>
</BottomNav>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ const WorkflowEditorPage = ({

<Text mr={10} mt={10} size="md" color={colors.B60}>
Configure the digest parameters. Read more about the digest engine{' '}
<a target={'_blank'} href={'https://docs.novu.co/platform/digest'}>
<a target={'_blank'} rel="noopener noreferrer" href={'https://docs.novu.co/platform/digest'}>
here
</a>
.
Expand Down
2 changes: 1 addition & 1 deletion apps/widget/cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Cypress.Commands.add('initializeSession', function (settings = {} as IInitialize
cy.log(`Widget initialized: ${session.subscriberId}`);
})
.then((session: any) => {
let encryptedHmacHash: string | undefined = undefined;
let encryptedHmacHash: string | undefined;

if (settings.hmacEncryption) {
cy.task('enableEnvironmentHmac', {
Expand Down
3 changes: 1 addition & 2 deletions docs/src/theme/DocPage/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react';
import React, { createContext } from 'react';
import DocPage from '@theme-original/DocPage';
import { createContext } from 'react';

export const SidebarContext = createContext('default');

Expand Down
2 changes: 1 addition & 1 deletion docs/src/theme/Footer/Links/MultiColumn/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function SideColumn() {
className="footer__button"
href="https://github.com/novuhq/novu"
target="_blank"
rel="noopener"
rel="noopener noreferrer"
>
Star us on GitHub
</a>
Expand Down
4 changes: 2 additions & 2 deletions libs/embed/src/embed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class Novu {
}

function hideWidget() {
var elem = document.querySelector('.wrapper-novu-widget') as HTMLBodyElement;
const elem = document.querySelector('.wrapper-novu-widget') as HTMLBodyElement;

if (elem) {
elem.style.display = 'none';
Expand All @@ -134,7 +134,7 @@ class Novu {
_scope.widgetVisible = !_scope.widgetVisible;
positionIframe();

var elem = document.querySelector('.wrapper-novu-widget') as HTMLBodyElement;
const elem = document.querySelector('.wrapper-novu-widget') as HTMLBodyElement;

if (elem) {
elem.style.display = 'inline-block';
Expand Down

0 comments on commit cb0bc61

Please sign in to comment.