Global

Members

# constant getStorage

Helper function to get a value from localStorage.

View Source hooks/useLocalStorage.js, line 9

# constant useLocalStorage

A hook to use localStorage as a model for state.

View Source hooks/useLocalStorage.js, line 28

# constant useToggle

Hook to toggle a state between expanded and collapsed. Determines the transitioning name of the css class.

View Source hooks/useToggle.js, line 31

Methods

# createErrorSection(title, label, message) → {Array.<object>}

Create an error section
Parameters:
Name Type Description
title string title
label string label
message string message

View Source helpers/viewLayout.js, line 17

- error section
Array.<object>

# GenericLayout(props)

Primary UI component for user interaction
Parameters:
Name Type Description
props Object The props for the component
data Object The data for the grid
layout Object The layout for the grid
initialSortColumn String The initial sort column for the grid
initialSortDirection String The initial sort direction for the grid
showToolbar Boolean Whether to show the toolbar
actions Array The actions column for the grid
themeGroup Object The theme group for the grid use this to override the default theme group found in "pamGrid" of muiTheme.js

View Source stories/GenericLayout.jsx, line 24

# getConditionalLoadout(field, data) → {object}

Check if a field is visible based on the conditions and data
Parameters:
Name Type Description
field object parsed field
data object data object

View Source helpers/viewLayout.js, line 346

returns the conditional loadout for the field
object

# getStaticProps(field) → {object}

Parse and set various properties for supported static fields
Parameters:
Name Type Description
field object field object

View Source helpers/viewLayout.js, line 292

parsed field
object

# getViewFieldValue(inData) → {string|Array.<object>}

Get the conditional loadout for a field
Parameters:
Name Type Description
inData object data object

View Source helpers/viewLayout.js, line 323

field value
string | Array.<object>

# getViewValue(field, inData, empty, key) → {any}

Get the value of the view view model
Parameters:
Name Type Description
field object field object
inData any data to parse
empty string empty value
key string key of the field

View Source helpers/viewLayout.js, line 209

value of the view
any

# parseSection(section, data, key) → {object}

Parse a section
Parameters:
Name Type Description
section object section object
data object data object
key string key

View Source helpers/viewLayout.js, line 61

- parsed section
object

# parseTokens(tokensB64) → {ParsedUserToken}

Parameters:
Name Type Description
tokensB64 string

View Source helpers/JWTUtil.js, line 30

# parseViewField(field, asyncFieldsMap) → {ParsedField}

Parse a field
Parameters:
Name Type Description
field object field object
asyncFieldsMap Map.<string, string> map of async fields

View Source helpers/viewLayout.js, line 114

parsed field
ParsedField

# parseViewLayout(layout, data, key) → {Array.<object>}

Parse a view field
Parameters:
Name Type Description
layout object layout object
sections Array.<object> sections array
data object data object
key string key

View Source helpers/viewLayout.js, line 37

- parsed sections
Array.<object>

# PermissionFilter(props) → {React.ReactElement}

Component that checks if the user has the required permissions Should set ONE of the following properties permission, any, OR all
Parameters:
Name Type Attributes Description
props object
permission string <optional>
A single required permission
any array.<string> <optional>
Passes if ANY of the permissions are met
all array.<string> <optional>
Passes if ALL of the permissions are met
isRoute boolean <optional>
If true, the component will render a Navigate component instead of null if the user does not have the required permissions
noAuthOptions Route401Props <optional>
If isRoute is true, this component will be rendered instead of the Navigate component if the user does not have the required permissions
showLoggingIn boolean <optional>
If true, the component will render a CircularProgress component if the user is in the LOGGING_IN state
children React.ReactNode <optional>
The children to render if the user has the required permissions

View Source stories/PermissionFilter.jsx, line 47

- The children to render if the user has the required permissions OR null if the user does not have the required permissions
React.ReactElement
Example
SampleUsage:
    // Show the children if the user has the admin permission
		<PermissionFilter permission="admin">
				<div>Admin</div>
		</PermissionFilter>
    // Show the children if the user has the admin OR user permission
		<PermissionFilter any={["admin", "user"]}>
				<div>Admin or User</div>
		</PermissionFilter>
    // Show the children if the user has the admin AND user permission
		<PermissionFilter all={["admin", "user"]}>
				<div>Admin and User</div>
		</PermissionFilter>

    // Route example. If the user does not have the required permissions, they will be redirected to the root
    <Route path="applications/addfd" element={
        <PermissionFilter isRoute={true} permission={ACLS.CAN_ADD_APPLICATION}>
          <ApplicationForm type={GRANT_APP_TYPES.FD} />
        </PermissionFilter>
      }
    />;

# useIsModal(modalClosed, debugId) → {object}

Hook to use help with modal functionality. Exposes open state and setter along with functions set the state.
Parameters:
Name Type Description
modalClosed * function to call when the modal is closed
debugId * string to use for debugging. If not provided the debug method will log

View Source hooks/useIsModal.js, line 10

object

# valueExists(value) → {boolean}

Check if a value is in the object
Parameters:
Name Type Description
value string | number value to check

View Source helpers/viewLayout.js, line 105

true if value is in the object
boolean

Type Definitions

Object

# AuthContext

Properties:
Name Type Description
authState AuthState The auth state
login function Login the user
logout function Logout the user
refresh function Refresh the user token
getPermissions function Get the user permissions
getBearerToken function Get the bearer token

View Source models/auth.js, line 127

object

# AuthState

Properties:
Name Type Description
state AuthStateType The current state of the auth state
refreshToken string The refresh token
bearerToken string The bearer token
user User The user object
loggedOutuser object The logged out / anonymous user object
config object The auth config
staleCheckState string The state of the stale check
lastRequestTime number The last time a request was made
refreshing boolean Whether or not the auth state is refreshing

View Source models/auth.js, line 114

AUTH_STATES.INITIALIZING | AUTH_STATES.LOGGED_OUT | AUTH_STATES.LOGGING_IN | AUTH_STATES.LOGGED_IN | AUTH_STATES.TOKEN_STALE | AUTH_STATES.REFRESHING_TOKEN | AUTH_STATES.ERROR

# AuthStateType

The auth state type

View Source models/auth.js, line 7

object

# DecodedAccessToken

Properties:
Name Type Description
client_id string The client id
scope string The scope
username string The username
version number The version
auth_time string The auth time
event_id string The event id
exp number The expiration
iat string The issued at
iss string The issuer
jti string The jwt id
origin_jti string The origin jwt id
sub string The subject
token_use string The token use *

View Source models/auth.js, line 30

object

# DecodedIDToken

Properties:
Name Type Description
at_hash string The access token hash
aud string The audience
cognito:groups Array.<string> The cognito groups
cognito:username string The cognito username
email string The email
email_verified boolean If the email is verified
auth_time string The auth time
event_id string The event id
exp number The expiration
iat string The issued at
iss string The issuer
jti string The jwt id
origin_jti string The origin jwt id
sub string The subject
token_use string The token use *

View Source models/auth.js, line 11

Object

# DecodedToken

Properties:
Name Type Description
access_token string The access token
token_type string The token type
expires_in number The token expiration
refresh_token string The refresh token
id_token string The id token

View Source models/auth.js, line 47

Object

# ParsedUser

Properties:
Name Type Description
authenticated boolean if the user is authenticated
name string The user name
email string The user email
given_name string The user's first name
family_name string The user's last name
id string The user id
sub string The user sub
raw DecodedIDToken The raw user object

View Source models/auth.js, line 56

Object

# ParsedUserToken

Properties:
Name Type Description
token DecodedToken The user token
user ParsedUser The user name
idToken DecodedIDToken The decoded token
accessToken DecodedAccessToken The decoded access token
isExpired function If the token is expired
timeToExpired function The time until the token expires
refreshToken string Refresh the token

View Source models/auth.js, line 68

object

# RawUser

Properties:
Name Type Attributes Description
name string The name of the user
id string The id of the user
permissions object The permissions of the user
email string <optional>
The email of the user
phone string <optional>
The phone number of the user
username string <optional>
The username of the user
firstName string <optional>
The first name of the user
lastName string <optional>
The last name of the user
fullName string <optional>
The full name of the user
preferredName string <optional>
The preferred name of the user
preferredFirstName string <optional>
The preferred first name of the user
preferredLastName string <optional>
The preferred last name of the user
preferredFullName string <optional>
The preferred full name of the user

View Source models/auth.js, line 79

object

# User

Properties:
Name Type Description
name string The name of the user (or email if no name)
acl Array.<string> Access control list
isSignedIn boolean Whether or not the user is signed in
id string The id of the user
meta object any meta data about the user passed in via API middleware
authenticated boolean if the user is authenticated
name string The user name
email string The user email
given_name string The user's first name
family_name string The user's last name
id string The user id
sub string The user sub
raw DecodedIDToken The raw user object

View Source models/auth.js, line 97

Object

# useToggleObject

Properties:
Name Type Description
expanded boolean The expanded state of the toggle.
function setExpanded The setter for the expanded state of the toggle.
toggleCss string The current css of the toggle.
function setToggleCss The setter for the css of the toggle.
forceOpen function Force the toggle to be open.
toggleComplete function Callback when the toggle animation is complete.

View Source hooks/useToggle.js, line 10