Skip to content
Snippets Groups Projects
Commit 3bfdab31 authored by Allen Gilliland's avatar Allen Gilliland
Browse files

remove `field_type` as a user presented/controllable thing. only meaningful...

remove `field_type` as a user presented/controllable thing.  only meaningful implication is that the list of fields for breakout becomes all fields by default now.
parent a6e9d270
No related branches found
No related tags found
No related merge requests found
......@@ -16,7 +16,6 @@ export default class Column extends Component {
this.onNameChange = this.onNameChange.bind(this);
this.onSpecialTypeChange = this.onSpecialTypeChange.bind(this);
this.onTargetChange = this.onTargetChange.bind(this);
this.onTypeChange = this.onTypeChange.bind(this);
this.onVisibilityChange = this.onVisibilityChange.bind(this);
}
......@@ -50,10 +49,6 @@ export default class Column extends Component {
this.updateProperty("visibility_type", type.id);
}
onTypeChange(type) {
this.updateProperty("field_type", type.id);
}
onSpecialTypeChange(special_type) {
this.props.field.special_type = special_type.id;
this.props.updateFieldSpecialType(this.props.field);
......@@ -101,15 +96,6 @@ export default class Column extends Component {
onChange={this.onVisibilityChange}
/>
</div>
<div className="flex-full px1">
<Select
className="TableEditor-field-type block"
placeholder="Select a field type"
value={_.find(MetabaseCore.field_field_types, (type) => type.id === this.props.field.field_type)}
options={MetabaseCore.field_field_types}
onChange={this.onTypeChange}
/>
</div>
<div className="flex-full px1">
<Select
className="TableEditor-field-special-type block"
......
......@@ -20,7 +20,6 @@ export default class ColumnsList extends Component {
<div style={{minWidth: 420}} className="float-left px1">Column</div>
<div className="flex clearfix">
<div className="flex-half px1">Visibility</div>
<div className="flex-half px1">Type</div>
<div className="flex-half px1">Details</div>
</div>
</div>
......
......@@ -52,6 +52,7 @@ const TYPES = {
special: ["category"],
include: [LOCATION]
},
// NOTE: this is defunct right now. see definition of isDimension below.
[DIMENSION]: {
field: ["dimension"],
include: [DATE_TIME, CATEGORY, ENTITY]
......@@ -100,7 +101,7 @@ export const isBoolean = isFieldType.bind(null, BOOLEAN);
export const isString = isFieldType.bind(null, STRING);
export const isSummable = isFieldType.bind(null, SUMMABLE);
export const isCategory = isFieldType.bind(null, CATEGORY);
export const isDimension = isFieldType.bind(null, DIMENSION);
export const isDimension = () => true;
// operator argument constructors:
......
......@@ -39,20 +39,17 @@
(defendpoint PUT "/:id"
"Update `Field` with ID."
[id :as {{:keys [field_type special_type visibility_type description display_name]} :body}]
{field_type FieldType
special_type FieldSpecialType
[id :as {{:keys [special_type visibility_type description display_name]} :body}]
{special_type FieldSpecialType
visibility_type FieldVisibilityType
display_name NonEmptyString}
(let-404 [field (Field id)]
(write-check field)
(let [field_type (or field_type (:field_type field))
special_type (or special_type (:special_type field))
(let [special_type (or special_type (:special_type field))
visibility_type (or visibility_type (:visibility_type field))]
(check-400 (field/valid-metadata? (:base_type field) field_type special_type visibility_type))
(check-400 (field/valid-metadata? (:base_type field) (:field_type field) special_type visibility_type))
;; update the Field. start with keys that may be set to NULL then conditionally add other keys if they have values
(check-500 (m/mapply upd Field id (merge {:description description
:field_type field_type
:special_type special_type
:visibility_type visibility_type}
(when display_name {:display_name display_name}))))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment