This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { CSSProperties, FC, useCallback, useEffect, useState } from 'react'; | |
import { VariableSizeList as List } from 'react-window'; | |
import xmlHttpRequest from 'axios'; | |
import classes from './app.module.scss'; | |
interface Prop { | |
index: number; | |
style: CSSProperties; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const paginator = (array, pageSize, pageNumber) => { | |
const page = pageNumber - 1; | |
const data = array.slice(page * pageSize, pageNumber * pageSize) | |
return data; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
attachStoryWithSummary = (remoteStory: Story, jiraStory: any) => { | |
const { fields: { summary, description }} = jiraStory; | |
const story: Story = { ...remoteStory, summary, description }; | |
const { source: {type: store, externalId}, id: internalId} = story; | |
this.unifiedTaskStoreService.addStory(story); | |
this.unifiedTaskStoreService.addLookUp(store, internalId, externalId); | |
} | |
// attach with parent internalId, save task in local store | |
saveTaskInLocalStore = (parentId: string, task: Task): void => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const path = require('path'); | |
const proxy = require('express-http-proxy'); | |
const dotenv = require('dotenv'); | |
// Bind heroku port from environment variables or assign the port number 4200 when tested on a different environment. | |
dotenv.config(); | |
const port = process.env.PORT||4200; | |
// Create an express server. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.dashboard { | |
.dashboard-contents { | |
margin: 1em 2em; | |
} | |
.trends-upsell{ | |
display: inline-grid; | |
grid-template-columns: repeat(2, min-content); | |
height: 40vh; | |
min-height: 280px; | |
grid-gap: 1vw; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.my-circle { | |
height: 3px; | |
width: 100%; | |
position: relative; | |
overflow: hidden; | |
background-color: #ddd; | |
} | |
.my-circle::after { | |
display: block; | |
position: absolute; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
css | |
.content { | |
position: absolute; | |
top: 50%; | |
left: 50%; | |
transform: translate(-50%, -50%); | |
} | |
ul { | |
padding: 3em; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// actions | |
export const createTravelReadinessDocument = (documentType, payload) => ({ | |
type: 'CREATE_TRAVEL_READINESS_DOCUMENT', | |
payload, | |
documentType | |
}); | |
export const createTravelReadinessDocumentSuccess = (response) => ({ | |
type: 'CREATE_TRAVEL_READINESS_DOCUMENT_SUCCESS', | |
response |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
listEmailTemplates(req, res) { | |
try { | |
const limit = 6; | |
const { query: { page, search } } = req; | |
const data = search | |
? await models.ReminderEmailTemplate.findAndCountAll(searchEmailTemplates(search)) | |
: await models.ReminderEmailTemplate.findAndCountAll({ paranoid: false }); | |
const { count } = data; | |
const pageCount = Math.ceil(count / limit); | |
const currentPage = page < 1 || !page || pageCount === 0 ? 1 : Math.min(page, pageCount); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.test import RequestFactory, TestCase | |
class TestUsers(TestCase): | |
def setUp(self): | |
self.factory = RequestFactory() | |
self.user = User.objects.create_user( | |
username='koech', | |
email='kevin@gmail.com', | |
password='Kev#12345' | |
) |
NewerOlder