Unverified Commit 0bd3573e authored by Tamika Tannis's avatar Tamika Tannis Committed by GitHub

fix: Apply column description length configuration (#522)

* Apply column description length configuration

* Lint fix
parent 8f11e7c9
......@@ -8,7 +8,7 @@ import { connect } from 'react-redux';
import ColumnDescEditableText from 'components/TableDetail/ColumnDescEditableText';
import ColumnStats from 'components/TableDetail/ColumnStats';
import { notificationsEnabled } from 'config/config-utils';
import { notificationsEnabled, getMaxLength } from 'config/config-utils';
import { openRequestDescriptionDialog } from 'ducks/notification/reducer';
import { OpenRequestAction } from 'ducks/notification/types';
import { logClick } from 'ducks/utilMethods';
......@@ -181,6 +181,7 @@ export class ColumnListItem extends React.Component<
<ColumnDescEditableText
columnIndex={this.props.index}
editable={metadata.is_editable}
maxLength={getMaxLength('columnDescLength')}
value={metadata.description}
/>
</EditableSection>
......
......@@ -11,7 +11,14 @@ import { GlobalState } from 'ducks/rootReducer';
import { getTableData } from 'ducks/tableMetadata/reducer';
import { GetTableDataRequest } from 'ducks/tableMetadata/types';
import AppConfig from 'config/config';
import {
getMaxLength,
getSourceIconClass,
indexDashboardsEnabled,
issueTrackingEnabled,
notificationsEnabled,
} from 'config/config-utils';
import BadgeList from 'components/common/BadgeList';
import BookmarkIcon from 'components/common/Bookmark/BookmarkIcon';
import Breadcrumb from 'components/common/Breadcrumb';
......@@ -38,13 +45,6 @@ import { ResourceType, TableMetadata } from 'interfaces';
import EditableSection from 'components/common/EditableSection';
import {
getSourceIconClass,
indexDashboardsEnabled,
issueTrackingEnabled,
notificationsEnabled,
} from 'config/config-utils';
import { formatDateTimeShort } from 'utils/dateUtils';
import { getLoggingParams } from 'utils/logUtils';
......@@ -246,7 +246,7 @@ export class TableDetail extends React.Component<
editUrl={editUrl}
>
<TableDescEditableText
maxLength={AppConfig.editableText.tableDescLength}
maxLength={getMaxLength('tableDescLength')}
value={data.description}
editable={data.is_editable}
/>
......
......@@ -170,3 +170,11 @@ export function generateExploreUrl(tableData: TableMetadata): string {
tableData.name
);
}
/**
* Gets the max length for items with a configurable max length.
* Currently only applied to `editableText`, but method can be extended for future cases
*/
export function getMaxLength(key: string) {
return AppConfig.editableText[key];
}
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