Unverified Commit f66359f8 authored by Tamika Tannis's avatar Tamika Tannis Committed by GitHub

Update configs (#454)

parent 0368e371
export const DEFAULT_ERROR_TEXT = 'There was a problem with the request, please reload the page.';
export const USERID_LABEL = 'email address';
...@@ -12,13 +12,13 @@ import { UpdateMethod, UpdateOwnerPayload } from 'interfaces'; ...@@ -12,13 +12,13 @@ import { UpdateMethod, UpdateOwnerPayload } from 'interfaces';
// TODO: Use css-modules instead of 'import' // TODO: Use css-modules instead of 'import'
import './styles.scss'; import './styles.scss';
const DEFAULT_ERROR_TEXT = 'There was a problem with the request, please reload the page.';
import { GlobalState } from 'ducks/rootReducer'; import { GlobalState } from 'ducks/rootReducer';
import { updateTableOwner } from 'ducks/tableMetadata/owners/reducer'; import { updateTableOwner } from 'ducks/tableMetadata/owners/reducer';
import { EditableSectionChildProps } from 'components/common/EditableSection'; import { EditableSectionChildProps } from 'components/common/EditableSection';
import { logClick } from 'ducks/utilMethods'; import { logClick } from 'ducks/utilMethods';
import * as Constants from './constants';
export interface DispatchFromProps { export interface DispatchFromProps {
onUpdateList: (updateArray: UpdateOwnerPayload[], onSuccess?: () => any, onFailure?: () => any) => void; onUpdateList: (updateArray: UpdateOwnerPayload[], onSuccess?: () => any, onFailure?: () => any) => void;
} }
...@@ -102,7 +102,7 @@ export class OwnerEditor extends React.Component<OwnerEditorProps, OwnerEditorSt ...@@ -102,7 +102,7 @@ export class OwnerEditor extends React.Component<OwnerEditorProps, OwnerEditorSt
this.props.setEditMode(false); this.props.setEditMode(false);
}; };
const onFailureCallback = () => { const onFailureCallback = () => {
this.setState({ errorText: DEFAULT_ERROR_TEXT, readOnly: true }); this.setState({ errorText: Constants.DEFAULT_ERROR_TEXT, readOnly: true });
this.props.setEditMode(false); this.props.setEditMode(false);
}; };
this.props.onUpdateList(updateArray, onSuccessCallback, onFailureCallback); this.props.onUpdateList(updateArray, onSuccessCallback, onFailureCallback);
...@@ -152,7 +152,7 @@ export class OwnerEditor extends React.Component<OwnerEditorProps, OwnerEditorSt ...@@ -152,7 +152,7 @@ export class OwnerEditor extends React.Component<OwnerEditorProps, OwnerEditorSt
<input <input
id='add-item-input' id='add-item-input'
autoFocus={true} autoFocus={true}
placeholder={`Please enter ${AppConfig.userIdLabel}`} placeholder={`Please enter ${AppConfig.userIdLabel || Constants.USERID_LABEL}`}
ref={ this.inputRef } ref={ this.inputRef }
/> />
<button className="btn btn-default add-button" type="submit" aria-label="Add Item"> <button className="btn btn-default add-button" type="submit" aria-label="Add Item">
......
...@@ -14,7 +14,7 @@ export interface AppConfig { ...@@ -14,7 +14,7 @@ export interface AppConfig {
google: GoogleAnalyticsConfig; google: GoogleAnalyticsConfig;
indexDashboards: IndexDashboardsConfig; indexDashboards: IndexDashboardsConfig;
indexUsers: IndexUsersConfig; indexUsers: IndexUsersConfig;
userIdLabel: string; userIdLabel?: string; /* Temporary configuration due to lacking string customization/translation support */
issueTracking: IssueTrackingConfig; issueTracking: IssueTrackingConfig;
logoPath: string | null; logoPath: string | null;
mailClientFeatures: MailClientFeaturesConfig; mailClientFeatures: MailClientFeaturesConfig;
...@@ -32,7 +32,7 @@ export interface AppConfigCustom { ...@@ -32,7 +32,7 @@ export interface AppConfigCustom {
google?: GoogleAnalyticsConfig; google?: GoogleAnalyticsConfig;
indexDashboards?: IndexDashboardsConfig; indexDashboards?: IndexDashboardsConfig;
indexUsers?: IndexUsersConfig; indexUsers?: IndexUsersConfig;
userIdLabel: string; userIdLabel?: string; /* Temporary configuration due to lacking string customization/translation support */
issueTracking?: IssueTrackingConfig; issueTracking?: IssueTrackingConfig;
logoPath?: string; logoPath?: string;
mailClientFeatures?: MailClientFeaturesConfig; mailClientFeatures?: MailClientFeaturesConfig;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment