Members

(constant) dm_sans :Object

Loads DM Sans font with various weights and styles.

Type:
  • Object

(constant) getStaticData

Fetches static data for the employees.

(constant) isDevelopment :boolean

Checks if the environment is development.

Type:
  • boolean

(constant) metadata :Object

Metadata related to the ShowEmployees component.

Type:
  • Object

(constant) metadata :Object

Object containing metadata for the application.

Type:
  • Object

(constant) metadata :Object

Metadata information for the 'Not Found' component.

Type:
  • Object

(constant) metadata :Object

Metadata related to the Home component.

Type:
  • Object

(constant) metadataBase :string

Sets the base URL for metadata based on the environment.

Type:
  • string

Methods

GET(request) → {Object}

Send a get request

Parameters:
NameTypeDescription
requestObject

Data to get

Returns:
  • Response from API
Type: 
Object

POST(request) → {Object}

Send a post request

Parameters:
NameTypeDescription
requestObject

Data to post

Returns:
  • Response from API
Type: 
Object

addEmployee(bodyData) → {Object}

Function to add an employee.

Parameters:
NameTypeDescription
bodyDataObject

Object containing employees data.

Returns:
  • Object containing the response from API.
Type: 
Object

formatDateUS(date) → {Date}

Function to format the date in US format.

Parameters:
NameTypeDescription
dateDate

Date to format.

Returns:
  • Date formated.
Type: 
Date

listEmployees() → {Object}

Function to list all employees.

Returns:
  • Object containing an array of all employees.
Type: 
Object

showDataZone(isList, dataState, numberOfLines, setModalIsOpen, setUserToOpen) → {ReactElement}

Function to display the data zone.

Parameters:
NameTypeDescription
isListboolean

Boolean to determine if the view mode is list.

dataStateArray

Data to be displayed.

numberOfLinesnumber

Number of lines to display.

setModalIsOpenfunction

Setter for modal open state.

setUserToOpenfunction

Setter for the user to open in modal.

Returns:

Rendered component.

Type: 
ReactElement

showTitle(isList, handleToggleList, handleSearchChange, filteredData, handleChangeNbOfLines) → {ReactElement}

Function to display the title.

Parameters:
NameTypeDescription
isListboolean

Boolean to determine if the view mode is list.

handleToggleListfunction

Handler for toggling list view.

handleSearchChangefunction

Handler for search change.

filteredDataArray

Filtered data.

handleChangeNbOfLinesfunction

Handler to change number of lines.

Returns:

Rendered component.

Type: 
ReactElement

sortEmployees(objectData) → {Object}

Function to sort a list of employees.

Parameters:
NameTypeDescription
objectDataObject

List to be sorted

Returns:
  • Object containing the data sorted.
Type: 
Object