helpKnowledge

search_left

Collections

Collections in Knowledge are groupings of Items and define the schema or structure of the custom data stored in those Items. A Knowledge site can have multiple attached Collections. A Collection’s fields define the structure of the Items within it.

Model

FieldTypeDescription
_idObjectIdThe unique identifier for the Collection
lastUpdatedDateDate Collection was last updated
createdOnDateDate Collection was created
nameStringName given to Collection

Default Fields

Each collection has a number of fields that are always present. Some of these fields are editable and some of them cannot be changed by users.

Field NameField TypeEditableDescription
_archivedBooleantrueItems set to archived will not be published
_draftBooleanfalseItems set to draft will not be published
import React from 'react'
import classnames from 'classnames'
import cls from './styles.scss'

export type AlertProps = JSX.IntrinsicElements['div'] & {
  primary?: boolean,
  success?: boolean,
  warning?: boolean,
  danger?: boolean,
  leftEl?: React.ReactNode,
  rightEl?: React.ReactNode,
}

export const Alert = (props: AlertProps) => {
  const {
    className,
    primary,
    success,
    warning,
    danger,
    children,
    leftEl,
    rightEl,
    ...rest
  } = props
  return (
    <div
      role="alert"
      className={classnames(cls['alert'], className, {
        [cls['alert-primary']]: primary,
        [cls['alert-success']]: success,
        [cls['alert-warning']]: warning,
        [cls['alert-danger']]: danger,
      })}
      {...rest}
    >
      {leftEl && (
        <div className={cls['alert-left-el']}>{leftEl}</div>
      )}
      <div className={cls['alert-body']}>
        {children}
      </div>
      {rightEl && (
        <div className={cls['alert-right-el']}>{rightEl}</div>
      )}
    </div>
  )
}

Alert.displayName = 'Alert'

export default Alert