property.tsx
TLDR
This file defines the CreatedByProperty class, which is a subclass of PropertyType. It exports an instance of the CreatedByProperty class as the default export.
Classes
CreatedByProperty
The CreatedByProperty class is a subclass of PropertyType. It represents a property type called "Created By". The class has the following attributes:
- Editor: The component used to edit the value of this property type. It is set to the CreatedBy component.
- name: The name of the property type, which is "Created By".
- type: The type of the property, which is "createdBy" as a PropertyTypeEnum.
- isReadOnly: A boolean value indicating whether the property is read-only. It is set to true.
- displayName: A function that takes an IntlShape as a parameter and returns the localized display name of the property type. It uses the intl.formatMessage function to retrieve the localized message for the "PropertyType.CreatedBy" key, with a default message of "Created by".
- canFilter: A boolean value indicating whether the property can be used for filtering. It is set to true.
- filterValueType: The type of value used for filtering, which is "person" as a FilterValueType.
- canGroup: A boolean value indicating whether the property can be used for grouping. It is set to true.
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {IntlShape} from 'react-intl'
import {PropertyType, PropertyTypeEnum, FilterValueType} from '../types'
import CreatedBy from './createdBy'
export default class CreatedByProperty extends PropertyType {
Editor = CreatedBy
name = 'Created By'
type = 'createdBy' as PropertyTypeEnum
isReadOnly = true
displayName = (intl: IntlShape) => intl.formatMessage({id: 'PropertyType.CreatedBy', defaultMessage: 'Created by'})
canFilter = true
filterValueType = 'person' as FilterValueType
canGroup = true
}