Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
472fc13
PLAT-536 #comment add logout #time 15m
brooketopcoder Mar 4, 2022
2ca5f17
PLAt-536 #comment fix link hover #time 5m
brooketopcoder Mar 7, 2022
80d4bbe
PLAT-536 #comment fix logo size #time 15m
brooketopcoder Mar 8, 2022
c981053
PLAT-764 #comment convert svgs to components and
brooketopcoder Mar 8, 2022
43c3b70
PLAT-764 #comment remove styling from SVGs;
brooketopcoder Mar 8, 2022
29b1ee5
PLAT-764 #comment refactor narrow tool selectors
brooketopcoder Mar 8, 2022
d14ae22
PLAT-764 #comment rename svgs folder #time 5m
brooketopcoder Mar 8, 2022
0aa2bbe
PLAT-764 #comment clean up styles and svgs; #time 30m
brooketopcoder Mar 8, 2022
25087d1
PLAT-764 #comment clean-up #time 5m
brooketopcoder Mar 8, 2022
a19de5c
PALT-764 #comment clean-up #time 5m
brooketopcoder Mar 8, 2022
5485f05
PLAT-764 #comment clean-up #time 5m
brooketopcoder Mar 8, 2022
dd5275e
PLAT-764 #comment clean-up #time 5m
brooketopcoder Mar 9, 2022
ecf205e
PLAT-764 #comment clean-upo #time 5m
brooketopcoder Mar 9, 2022
ce7209a
Merge branch 'master' into PLAT-754_tools-config
brooketopcoder Mar 9, 2022
6e902ec
PLAT-754 #comment convert url configs to constants;
brooketopcoder Mar 9, 2022
83d24b8
PLAT-754 #comment create and use route
brooketopcoder Mar 10, 2022
efd8e51
PLAT-745 #comment add child routes;
brooketopcoder Mar 10, 2022
f257056
PLAT-754 #comment configure sections in content
brooketopcoder Mar 10, 2022
38ceed9
PLAT-754 #comment replace route config
brooketopcoder Mar 10, 2022
0047be9
PLAT-754 #comment hide sections for tools
brooketopcoder Mar 10, 2022
9c467d3
PLAT-754 #comment fix styling for expanded
brooketopcoder Mar 10, 2022
6b00439
PLAT-754 #comment route provider cleanup #time 1h
brooketopcoder Mar 10, 2022
bdf45cf
PLAT-754 #comment tools narrow clean-up; #time 30m
brooketopcoder Mar 10, 2022
4420617
PLAT-764 #comment clean-up #time 5m
brooketopcoder Mar 10, 2022
a7df686
PLAT-7584 #comment clean-up #time 10m
brooketopcoder Mar 10, 2022
9478eff
POLAT-754 #comment clean-up #time 5m
brooketopcoder Mar 10, 2022
37928c7
PLAT-754 #comment clean-up #time 5m
brooketopcoder Mar 10, 2022
784461e
PLAT-754 #comment clean-up #time 5m
brooketopcoder Mar 10, 2022
9d161e8
Merge branch 'master' into PLAT-754_tools-config
brooketopcoder Mar 10, 2022
8011b5c
PLAT-754 #comment update readme #time 10m
brooketopcoder Mar 10, 2022
3070fc5
Merge branch 'master' into PLAT-754_tools-config
brooketopcoder Mar 10, 2022
9da630d
Merge branch 'master' into PLAT-754_tools-config
brooketopcoder Mar 10, 2022
fbf5296
PLAT-754 #comment fix build issues #time 10m
brooketopcoder Mar 10, 2022
74f84ba
PLAT-754 #comment clean-up #time 5m
brooketopcoder Mar 10, 2022
e5f1fc0
Merge branch 'master' into PLAT-754_tools-config
brooketopcoder Mar 11, 2022
ddad763
PLAT-754 #comment remove commented out tests #time 5m
brooketopcoder Mar 11, 2022
0687f21
PLAT-802 #comment create profile util;
brooketopcoder Mar 11, 2022
9d38a6c
PLAT-825 #comment fix profile styling;
brooketopcoder Mar 14, 2022
20411b1
Merge branch 'PLAT-802_profile-util' into PLAT-825_form-text-fields
brooketopcoder Mar 14, 2022
6373d82
PLAT-825 #comment consolidate font styles; #time 1h
brooketopcoder Mar 14, 2022
3beac2d
PLAT-828 #comment create button component;
brooketopcoder Mar 14, 2022
9d0dc29
PLAT-825 Form Text Fields & Profile - PLAT-802_profile-util (#46)
brooketopcoder Mar 15, 2022
63b1c87
PLAT-828 #comment use axios for xhr;
brooketopcoder Mar 15, 2022
353f0d4
PLAT-828 #comment rename all services to
brooketopcoder Mar 15, 2022
2738b0e
PLAT-828 #comment add update password functions
brooketopcoder Mar 15, 2022
40f51dd
Merge branch 'PLAT-802_profile-util' into PLAT-828_profile-api
brooketopcoder Mar 15, 2022
a5288a7
PLAT-828 #comment clean-up #time 5m
brooketopcoder Mar 15, 2022
da90fd6
PLAT-828 #comment clean-up #time 10m
brooketopcoder Mar 16, 2022
322f729
PLAT-828 #comment use v3 api for pw change
brooketopcoder Mar 16, 2022
3d1e645
PLAT-828 profile api to PLAT-802_profile-util (#50)
brooketopcoder Mar 16, 2022
29b6408
Merge branch 'PLAT-802_profile-util' into PLAT-826_validation
brooketopcoder Mar 16, 2022
cd5d848
PLAT-826 #comment reset pw fields upon submission
brooketopcoder Mar 16, 2022
07a211a
PLAT-826 #comment permit buttons
brooketopcoder Mar 16, 2022
dce60af
PLAT-826 #comment support for fields
brooketopcoder Mar 16, 2022
4e36e0a
PLAT-826 #comment clean-up #time 10m
brooketopcoder Mar 16, 2022
71a7cec
PLAT-826 #comment clean-up #time 5m
brooketopcoder Mar 16, 2022
7282b63
PLAT-826 #comment fix eslint rules #time 25m
brooketopcoder Mar 16, 2022
1814110
PLAT-895 #comment convert tool tool to work intake
brooketopcoder Mar 17, 2022
1ca1bec
PROD-265 #comment Merge branch 'PROD-265_work-intake' into PROD-500_c…
brooketopcoder Mar 23, 2022
fb5a995
PROD-500 #comment clean-up #time 10m
brooketopcoder Mar 23, 2022
8be91d5
PROD-500 #comment rename profileContext
brooketopcoder Mar 24, 2022
84f068f
PROD-500 #comment clean up error handling; #time 10m
brooketopcoder Mar 24, 2022
9dc2fcb
PROD-500 #comment create work intake form;
brooketopcoder Mar 24, 2022
4bd77ec
PROD-500 #comment rename routecontext #time 5m
brooketopcoder Mar 24, 2022
105c887
PROD-500 #comment clean-up #time 10m
brooketopcoder Mar 24, 2022
7722e6f
PROD-500 #comment remove ordering;
brooketopcoder Mar 24, 2022
ceb93fc
PROD-1024 #comment fix form element naming #tme 5m
brooketopcoder Mar 24, 2022
2428532
PROD-500 #comment textarea #time 30m
brooketopcoder Mar 24, 2022
36e2403
Merge branch 'PROD-265_work-intake' into PROD-1024_textarea
brooketopcoder Mar 24, 2022
a3f0bbb
PROD-1024 #comment clean up after merge #time 15m
brooketopcoder Mar 24, 2022
8d56e48
PROD-1024 #comment fix lint issues #time 5m
brooketopcoder Mar 24, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const ToolSelectorWide: FC<ToolSelectorWideProps> = (props: ToolSelectorWideProp
<Link
className='large-tab'
tabIndex={-1}
to={route}
to={route}
>
{title}
</Link>
Expand Down
14 changes: 9 additions & 5 deletions src/lib/button/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
export { default as Button } from './Button'
export type {
ButtonSize,
ButtonStyle,
ButtonType
} from './Button'
export
// tslint:disable-next-line: no-unused-expression
type { ButtonSize } from './Button'
export
// tslint:disable-next-line: no-unused-expression
type { ButtonStyle } from './Button'
export
// tslint:disable-next-line: no-unused-expression
type { ButtonType } from './Button'
31 changes: 21 additions & 10 deletions src/lib/form/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import {
formSubmitAsync,
formValidateAndUpdate,
} from './form-functions'
import { InputText, InputTextarea } from './form-input'
import { FormInputModel } from './form-input.model'
import styles from './Form.module.scss'
import { TextInput } from './text-input'

interface FormProps<ValueType, RequestType> {
readonly formDef: FormDefinition
Expand Down Expand Up @@ -71,15 +71,26 @@ const Form: <ValueType extends any, RequestType extends any>(props: FormProps<Va
const formInputs: Array<JSX.Element> = props.formDef.inputs
.map(input => formGetInputModel(props.formDef.inputs, input.name))
.map((inputModel, index) => {
return (
<TextInput
{...inputModel}
key={inputModel.name}
tabIndex={inputModel.notTabbable ? -1 : index + 1}
type={inputModel.type || 'text'}
value={inputModel.value}
/>
)
switch (inputModel.type) {
case 'textarea':
return <InputTextarea
{...inputModel}
key={inputModel.name}
tabIndex={inputModel.notTabbable ? -1 : index + 1}
value={inputModel.value}
/>
default:
return (
<InputText
{...inputModel}
key={inputModel.name}
tabIndex={inputModel.notTabbable ? -1 : index + 1}
type={inputModel.type || 'text'}
value={inputModel.value}
/>
)
}

})

const buttons: Array<JSX.Element> = props.formDef.buttons
Expand Down
1 change: 0 additions & 1 deletion src/lib/form/form-field-wrapper/index.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/lib/form/form-input.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export interface FormInputModel {
readonly notTabbable?: boolean
readonly placeholder?: string
readonly preventAutocomplete?: boolean
readonly type: 'password' | 'text'
readonly type: 'password' | 'text' | 'textarea'
readonly validators: Array<(value: string | undefined, formValues?: HTMLFormControlsCollection, otherField?: string) => string | undefined>
value?: string
}
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
@import '../../styles';
@import '../../../styles';

$form-pad-top: calc($pad-md - $border);
$border-xs: 1px;
$error-line-height: 14px;

.form-field-wrapper {
position: relative;
display: flex;
flex-direction: column;
justify-content: flex-start;
padding-bottom: $pad-md;

.form-field {
flex: 1;
display: flex;
flex-direction: column;
align-items: flex-start;
padding: $pad-sm $form-pad-top;
padding: $pad-sm $form-pad-top $border-xs $form-pad-top;
height: calc($pad-xxl * 2);
background: $tc-white;
border: $border-xs solid $black-40;
Expand All @@ -35,7 +35,7 @@ $error-line-height: 14px;
&.focus,
&.form-field-error {
border-width: $border;
padding: calc($pad-sm - $border-xs) calc($form-pad-top - $border-xs);
padding: calc($pad-sm - $border-xs) calc($form-pad-top - $border-xs) 0 calc($form-pad-top - $border-xs);
}

&.disabled {
Expand All @@ -54,6 +54,8 @@ $error-line-height: 14px;
}

.label {
display: flex;
flex-direction: column;
top: calc(50% - $form-pad-top/2);
color: $turq-160;
margin-bottom: $pad-xs;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import classNames from 'classnames'
import { Dispatch, FC, ReactNode, SetStateAction, useState } from 'react'

import { IconSolid } from '../../svgs'
import { IconSolid } from '../../../svgs'

import styles from './Form-Field-Wrapper.module.scss'
import styles from './FormFieldWrapper.module.scss'

export const optionalHint: string = '(optional)'

interface FormFieldWrapperProps {
readonly children: ReactNode
Expand Down
2 changes: 2 additions & 0 deletions src/lib/form/form-input/form-field-wrapper/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { default as FormFieldWrapper } from './FormFieldWrapper'
export { optionalHint as inputOptionalHint } from './FormFieldWrapper'
3 changes: 3 additions & 0 deletions src/lib/form/form-input/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export { inputOptionalHint } from './form-field-wrapper'
export * from './input-text'
export * from './input-textarea'
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../styles';
@import '../../../styles';

.form-input-text {
@extend .body-small;
Expand Down
6 changes: 6 additions & 0 deletions src/lib/form/form-input/input-text/InputText.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import '@testing-library/jest-dom'

describe('<InputText /> ', () => {

test('it should display the InputText', () => { })
})
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import { FC } from 'react'

import { FormFieldWrapper } from '../form-field-wrapper'

import styles from './Text-Input.module.scss'
import styles from './InputText.module.scss'

export const optionalHint: string = '(optional)'

interface TextInputProps {
interface InputTextProps {
readonly dirty?: boolean
readonly disabled?: boolean
readonly error?: string
Expand All @@ -20,7 +20,7 @@ interface TextInputProps {
readonly value?: string | number
}

const TextInput: FC<TextInputProps> = (props: TextInputProps) => {
const InputText: FC<InputTextProps> = (props: InputTextProps) => {
return (
<FormFieldWrapper
dirty={!!props.dirty}
Expand All @@ -44,4 +44,4 @@ const TextInput: FC<TextInputProps> = (props: TextInputProps) => {
)
}

export default TextInput
export default InputText
3 changes: 3 additions & 0 deletions src/lib/form/form-input/input-text/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export {
default as InputText,
} from './InputText'
12 changes: 12 additions & 0 deletions src/lib/form/form-input/input-textarea/InputTextarea.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@import '../../../styles';

.form-input-textarea {
@include font-roboto;
@extend .body-small;
color: $black-60;
box-sizing: border-box;
border: none;
outline: none;
resize: vertical;
margin-left: calc(-1 * $border)
}
6 changes: 6 additions & 0 deletions src/lib/form/form-input/input-textarea/InputTextarea.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import '@testing-library/jest-dom'

describe('<InputTextarea /> ', () => {

test('it should display the InputTextarea', () => { })
})
43 changes: 43 additions & 0 deletions src/lib/form/form-input/input-textarea/InputTextarea.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import { FC } from 'react'

import { FormFieldWrapper } from '../form-field-wrapper'

import styles from './InputTextarea.module.scss'

interface InputTextareaProps {
readonly dirty?: boolean
readonly disabled?: boolean
readonly error?: string
readonly hint?: string
readonly label?: string
readonly name: string
readonly placeholder?: string
readonly preventAutocomplete?: boolean
readonly tabIndex: number
readonly value?: string | number
}

const InputTextarea: FC<InputTextareaProps> = (props: InputTextareaProps) => {
return (
<FormFieldWrapper
dirty={!!props.dirty}
disabled={!!props.disabled}
error={props.error}
hint={props.hint}
label={props.label || props.name}
name={props.name}
>
<textarea
autoComplete={!!props.preventAutocomplete ? 'off' : undefined}
className={styles['form-input-textarea']}
defaultValue={props.value}
disabled={!!props.disabled}
name={props.name}
placeholder={props.placeholder}
tabIndex={props.tabIndex}
/>
</FormFieldWrapper>
)
}

export default InputTextarea
3 changes: 3 additions & 0 deletions src/lib/form/form-input/input-textarea/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export {
default as InputTextarea,
} from './InputTextarea'
2 changes: 1 addition & 1 deletion src/lib/form/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ export {
formGetInputModel,
formReset,
} from './form-functions'
export { textInputOptionalHint } from './text-input'
export { inputOptionalHint } from './form-input'
export * from './validator-functions'
6 changes: 0 additions & 6 deletions src/lib/form/text-input/Text-Input.test.tsx

This file was deleted.

4 changes: 0 additions & 4 deletions src/lib/form/text-input/index.ts

This file was deleted.

4 changes: 3 additions & 1 deletion src/lib/functions/user-functions/user-store/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
export { patchAsync as userPatchAsync } from './user-xhr.store'
export type { UserPatchRequest } from './user-xhr.store'
export
Copy link
Contributor

Choose a reason for hiding this comment

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

I've not seen export on a line by itself before -- what does this indicate?

// tslint:disable-next-line: no-unused-expression
type { UserPatchRequest } from './user-xhr.store'
6 changes: 3 additions & 3 deletions src/tools/work-intake/work-intake-form.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
FormDefinition,
textInputOptionalHint,
inputOptionalHint,
validatorRequired,
} from '../../lib'

Expand All @@ -26,7 +26,7 @@ export const workIntakeDef: FormDefinition = {
],
},
{
hint: textInputOptionalHint,
hint: inputOptionalHint,
label: 'Share your data',
name: 'data',
placeholder: 'Paste a link',
Expand All @@ -36,7 +36,7 @@ export const workIntakeDef: FormDefinition = {
{
label: 'What would you like to learn?',
name: 'description',
type: 'text',
type: 'textarea',
validators: [
validatorRequired,
],
Expand Down