const purposes update
This commit is contained in:
parent
c6d4ba8c45
commit
6aa488690c
|
@ -2,16 +2,16 @@ import React from 'preact/compat';
|
|||
import Comment from './Comment';
|
||||
import TextEntryField from './TextEntryField';
|
||||
import i18n from '../../../i18n';
|
||||
import PurposeDropdown from './PurposeDropdown';
|
||||
import PurposeDropdown, {purposes} from './PurposeDropdown';
|
||||
|
||||
const purposes = ['assessing', 'bookmarking', 'classifying', 'commenting', 'describing', 'editing', 'highlighting', 'identifying', 'linking', 'moderating', 'questioning']
|
||||
const purposeValues = purposes.map(p => p.value);
|
||||
/**
|
||||
* Comments are TextualBodies where the purpose field is either
|
||||
* blank or 'commenting' or 'replying'
|
||||
*/
|
||||
const isComment = body =>
|
||||
body.type === 'TextualBody' && (
|
||||
!body.hasOwnProperty('purpose') || purposes.indexOf(body.purpose) > -1
|
||||
!body.hasOwnProperty('purpose') || purposeValues.indexOf(body.purpose) > -1
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import React, { Component } from 'preact/compat';
|
||||
import Select from 'react-select';
|
||||
|
||||
const purposes = [{'value': 'assessing', 'label': 'Assessing'}, {'value': 'bookmarking', 'label': 'Bookmarking'}, {'value': 'classifying', 'label': 'Classifying'}, {'value': 'commenting', 'label': 'Commenting'}, {'value': 'describing', 'label': 'Describing'},{'value': 'editing', 'label': 'Editing'}, {'value': 'highlighting', 'label': 'Highlighting'},{'value': 'identifying', 'label': 'Identifying'},{'value': 'linking', 'label': 'Linking'},{'value': 'moderating', 'label': 'Moderating'},{'value': 'questioning', 'label': 'Questioning'}]
|
||||
export const purposes = [{'value': 'assessing', 'label': 'Assessing'}, {'value': 'bookmarking', 'label': 'Bookmarking'}, {'value': 'classifying', 'label': 'Classifying'}, {'value': 'commenting', 'label': 'Commenting'}, {'value': 'describing', 'label': 'Describing'},{'value': 'editing', 'label': 'Editing'}, {'value': 'highlighting', 'label': 'Highlighting'},{'value': 'identifying', 'label': 'Identifying'},{'value': 'linking', 'label': 'Linking'},{'value': 'moderating', 'label': 'Moderating'},{'value': 'questioning', 'label': 'Questioning'}]
|
||||
|
||||
export default class PurposeDropdown extends Component {
|
||||
render() {
|
||||
|
|
Loading…
Reference in New Issue