# new ProjectTabs(props) → {React.PureComponent}
Parameters:
Name | Type | Description |
---|---|---|
props |
Object | |
deleting |
boolean | If |
objectGlobalName |
string | The global visible object name used by all tabs as reference. |
onSnackbarOpen |
function | Callback fired when the component request to display an error. |
project |
Object | Current project. |
serverBase |
string | The host and port in the URL of an API call. |
updateProject |
function | Callback fired when a part of current project was changed. |
Methods
# static onDataChange(informationTable, isUpdateNecessary)
Overview
Forwarded to theData
tab. Fired when a user makes changes in the information table.
Saves modified project in the component's state.
Parameters:
Name | Type | Description |
---|---|---|
informationTable |
Object | Modified information table from the |
isUpdateNecessary |
boolean | If |
# static onDataUploaded(isExternal)
Overview
Forwarded to theRules
and Classification
tabs. Fired when a user uploads information table.
Saves this information in the component's state.
Parameters:
Name | Type | Description |
---|---|---|
isExternal |
boolean | If |
# static onRulesUploaded(isExternal)
Overview
Forwarded to theRules
tab. Fired when a user uploads rule set.
Saves this information in the component's state.
Parameters:
Name | Type | Description |
---|---|---|
isExternal |
boolean | If |
# static onTabChange(event, newValue)
Overview
Fired when a tab is changed. If user had unsaved changes inData
tab,
method calls updateProjectOnServer
to save them on server.
Parameters:
Name | Type | Description |
---|---|---|
event |
Object | Represents an event that takes place in DOM. |
newValue |
number | The id of tab that was selected. |
# static showAlert(index, show, messagesopt)
Overview
Forwarded to all tabs. Fired when a tab receives information from the server that current results are outdated.Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
index |
number | The index of a selected tab. |
|
show |
boolean | If |
|
messages |
Array.<string> |
<optional> |
Optional messages displayed in alert. |
# static updateAlerts(result)
Overview
Updates alerts based on the response from server.Parameters:
Name | Type | Description |
---|---|---|
result |
Object | The response from the server. |
# static updateProjectOnServer(projectId, informationTable, finallyCallbackopt)
Overview
UtilizesfetchData
to perform an API call with POST method and information table in body.
Goal
The goal of this function is to save user's changes made in information table.Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
projectId |
string | The identifier of a selected project. |
|
informationTable |
Object | The local copy of an information table that will be sent to server. |
|
finallyCallback |
function |
<optional> |
The callback fired in finally part of the fetch function. |
# componentDidMount()
Overview
A component's lifecycle method. Fired once when component was mounted.Goal
Method callsupdateAlerts
.
# componentDidUpdate(prevProps, prevState, snapshot)
Overview
A component's lifecycle method. Fired after a component was updated.Goal
Checks if project was changed. If a new project was forwarded, method makes an API call to retrieve that project and saves changes from old project if necessary.Parameters:
Name | Type | Description |
---|---|---|
prevProps |
Object | Old props that were already replaced. |
prevState |
Object | Old state that was already replaced. |
snapshot |
Object | Returned from another lifecycle method |
# componentWillUnmount()
Overview
A component's lifecycle method. Fired when component was requested to be unmounted.Goal
If there were any unsaved changes, method callsupdateProjectOnServer
.