aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/documents/Documents.ts135
-rw-r--r--src/client/util/.ClientUtils.ts.icloudbin161 -> 0 bytes
-rw-r--r--src/client/views/FilterPanel.tsx30
3 files changed, 99 insertions, 66 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts
index 533df5c11..1988c6328 100644
--- a/src/client/documents/Documents.ts
+++ b/src/client/documents/Documents.ts
@@ -86,13 +86,18 @@ export class FInfo {
class BoolInfo extends FInfo {
fieldType? = 'boolean';
values?: boolean[] = [true, false];
+ constructor(d: string, filterable?: boolean) {
+ super(d);
+ this.filterable = filterable;
+ }
}
class NumInfo extends FInfo {
fieldType? = 'number';
values?: number[] = [];
- constructor(d: string, readOnly?: boolean, values?: number[], filterable?: boolean) {
+ constructor(d: string, filterable?: boolean, readOnly?: boolean, values?: number[]) {
super(d, readOnly);
this.values = values;
+ this.filterable = filterable;
}
}
class StrInfo extends FInfo {
@@ -110,27 +115,32 @@ class DocInfo extends FInfo {
constructor(d: string, filterable?: boolean, values?: Doc[]) {
super(d, true);
this.values = values;
+ this.filterable = filterable;
}
}
class DimInfo extends FInfo {
fieldType? = 'enumeration';
values? = [DimUnit.Pixel, DimUnit.Ratio];
readOnly = false;
+ filterable = false;
}
class PEInfo extends FInfo {
fieldType? = 'enumeration';
values? = ['all', 'none'];
readOnly = false;
+ filterable = false;
}
class DAInfo extends FInfo {
fieldType? = 'enumeration';
values? = ['embed', 'copy', 'move', 'same', 'proto', 'none'];
readOnly = false;
+ filterable = false;
}
class CTypeInfo extends FInfo {
fieldType? = 'enumeration';
values? = Array.from(Object.keys(CollectionViewType));
readOnly = false;
+ filterable = false;
}
class DTypeInfo extends FInfo {
fieldType? = 'enumeration';
@@ -140,6 +150,7 @@ class DTypeInfo extends FInfo {
class DateInfo extends FInfo {
fieldType? = 'date';
values?: DateField[] = [];
+ filterable = true;
}
class ListInfo extends FInfo {
fieldType? = 'list';
@@ -158,23 +169,23 @@ type DATEt = DateInfo | number;
type DTYPEt = DTypeInfo | string;
export class DocumentOptions {
// coordinate and dimensions depending on view
- x?: NUMt = new NumInfo('x coordinate of document in a freeform view');
- y?: NUMt = new NumInfo('y coordinage of document in a freeform view');
- z?: NUMt = new NumInfo('whether document is in overlay (1) or not (0)', false, [1, 0]);
- _dimMagnitude?: NUMt = new NumInfo("magnitude of collectionMulti{row,col} element's width or height");
+ x?: NUMt = new NumInfo('x coordinate of document in a freeform view', false);
+ y?: NUMt = new NumInfo('y coordinage of document in a freeform view', false);
+ z?: NUMt = new NumInfo('whether document is in overlay (1) or not (0)', false, false, [1, 0]);
+ _dimMagnitude?: NUMt = new NumInfo("magnitude of collectionMulti{row,col} element's width or height", false);
_dimUnit?: DIMt = new DimInfo("units of collectionMulti{row,col} element's width or height - 'px' or '*' for pixels or relative units");
- lat?: NUMt = new NumInfo('latitude coordinate for map views');
- lng?: NUMt = new NumInfo('longitude coordinate for map views');
- _timecodeToShow?: NUMt = new NumInfo('the time that a document should be displayed (e.g., when an annotation shows up as a video plays)');
- _timecodeToHide?: NUMt = new NumInfo('the time that a document should be hidden');
- _width?: NUMt = new NumInfo('displayed width of a document');
- _height?: NUMt = new NumInfo('displayed height of document');
- data_nativeWidth?: NUMt = new NumInfo('native width of data field contents (e.g., the pixel width of an image)');
- data_nativeHeight?: NUMt = new NumInfo('native height of data field contents (e.g., the pixel height of an image)');
- linearBtnWidth?: NUMt = new NumInfo('unexpanded width of a linear menu button (button "width" changes when it expands)');
- _nativeWidth?: NUMt = new NumInfo('native width of document contents (e.g., the pixel width of an image)');
- _nativeHeight?: NUMt = new NumInfo('native height of document contents (e.g., the pixel height of an image)');
- _nativeDimModifiable?: BOOLt = new BoolInfo('native dimensions can be modified using document decoration reizers');
+ lat?: NUMt = new NumInfo('latitude coordinate for map views', false);
+ lng?: NUMt = new NumInfo('longitude coordinate for map views', false);
+ _timecodeToShow?: NUMt = new NumInfo('the time that a document should be displayed (e.g., when an annotation shows up as a video plays)', false);
+ _timecodeToHide?: NUMt = new NumInfo('the time that a document should be hidden', false);
+ _width?: NUMt = new NumInfo('displayed width of a document', true);
+ _height?: NUMt = new NumInfo('displayed height of document', true);
+ data_nativeWidth?: NUMt = new NumInfo('native width of data field contents (e.g., the pixel width of an image)', false);
+ data_nativeHeight?: NUMt = new NumInfo('native height of data field contents (e.g., the pixel height of an image)', false);
+ linearBtnWidth?: NUMt = new NumInfo('unexpanded width of a linear menu button (button "width" changes when it expands)', false);
+ _nativeWidth?: NUMt = new NumInfo('native width of document contents (e.g., the pixel width of an image)', false);
+ _nativeHeight?: NUMt = new NumInfo('native height of document contents (e.g., the pixel height of an image)', false);
+ _nativeDimModifiable?: BOOLt = new BoolInfo('native dimensions can be modified using document decoration reizers', false);
_nativeHeightUnfrozen?: BOOLt = new BoolInfo('native height can be changed independent of width by dragging decoration resizers');
'acl-Guest'?: string; // public permissions
@@ -182,29 +193,29 @@ export class DocumentOptions {
type?: DTYPEt = new DTypeInfo('type of document', true);
type_collection?: COLLt = new CTypeInfo('how collection is rendered'); // sub type of a collection
_type_collection?: COLLt = new CTypeInfo('how collection is rendered'); // sub type of a collection
- title?: STRt = new StrInfo('title of document');
+ title?: STRt = new StrInfo('title of document', true);
caption?: RichTextField;
author?: string; // STRt = new StrInfo('creator of document'); // bcz: don't change this. Otherwise, the userDoc's field Infos will have a FieldInfo assigned to its author field which will render it unreadable
author_date?: DATEt = new DateInfo('date the document was created', true);
annotationOn?: DOCt = new DocInfo('document annotated by this document', false);
- color?: STRt = new StrInfo('foreground color data doc', true);
- hidden?: BOOLt = new BoolInfo('whether the document is not rendered by its collection');
- backgroundColor?: STRt = new StrInfo('background color for data doc');
- opacity?: NUMt = new NumInfo('document opacity');
- viewTransitionTime?: NUMt = new NumInfo('transition duration for view parameters');
- dontRegisterView?: BOOLt = new BoolInfo('are views of this document registered so that they can be found when following links, etc');
+ color?: STRt = new StrInfo('foreground color data doc', false);
+ hidden?: BOOLt = new BoolInfo('whether the document is not rendered by its collection', false);
+ backgroundColor?: STRt = new StrInfo('background color for data doc', false);
+ opacity?: NUMt = new NumInfo('document opacity', false);
+ viewTransitionTime?: NUMt = new NumInfo('transition duration for view parameters', false);
+ dontRegisterView?: BOOLt = new BoolInfo('are views of this document registered so that they can be found when following links, etc', false);
_undoIgnoreFields?: List<string>; //'fields that should not be added to the undo stack (opacity for Undo/Redo/and sidebar) AND whether modifications to document are undoable (true for linearview menu buttons to prevent open/close from entering undo stack)'
undoIgnoreFields?: List<string>; //'fields that should not be added to the undo stack (opacity for Undo/Redo/and sidebar) AND whether modifications to document are undoable (true for linearview menu buttons to prevent open/close from entering undo stack)'
- _headerHeight?: NUMt = new NumInfo('height of document header used for displaying title');
- _headerFontSize?: NUMt = new NumInfo('font size of header of custom notes');
+ _headerHeight?: NUMt = new NumInfo('height of document header used for displaying title', false);
+ _headerFontSize?: NUMt = new NumInfo('font size of header of custom notes', false);
_headerPointerEvents?: PEVt = new PEInfo('types of events the header of a custom text document can consume');
_lockedPosition?: BOOLt = new BoolInfo("lock the x,y coordinates of the document so that it can't be dragged");
_lockedTransform?: BOOLt = new BoolInfo('lock the freeform_panx,freeform_pany and scale parameters of the document so that it be panned/zoomed');
layout?: string | Doc; // default layout string or template document
- layout_keyValue?: STRt = new StrInfo('layout definition for showing keyValue view of document');
- layout_explainer?: STRt = new StrInfo('explanation displayed at top of a collection to describe its purpose');
- layout_headerButton?: DOCt = new DocInfo('the (button) Doc to display at the top of a collection.');
+ layout_keyValue?: STRt = new StrInfo('layout definition for showing keyValue view of document', false);
+ layout_explainer?: STRt = new StrInfo('explanation displayed at top of a collection to describe its purpose', false);
+ layout_headerButton?: DOCt = new DocInfo('the (button) Doc to display at the top of a collection.', false);
layout_disableBrushing?: BOOLt = new BoolInfo('whether to suppress border highlighting');
layout_unrendered?: BOOLt = new BoolInfo('denotes an annotation that is not rendered with a DocumentView (e.g, rtf/pdf text selections and links to scroll locations in web/pdf)');
layout_hideOpenButton?: BOOLt = new BoolInfo('whether to hide the open full screen button when selected');
@@ -216,33 +227,33 @@ export class DocumentOptions {
layout_hideDecorationTitle?: BOOLt = new BoolInfo('whether to suppress the document decortations title when selected');
layout_borderRounding?: string;
layout_boxShadow?: string; // box-shadow css string OR "standard" to use dash standard box shadow
- layout_maxAutoHeight?: NUMt = new NumInfo('maximum height for newly created (eg, from pasting) text documents');
+ layout_maxAutoHeight?: NUMt = new NumInfo('maximum height for newly created (eg, from pasting) text documents', false);
_layout_autoHeight?: BOOLt = new BoolInfo('whether document automatically resizes vertically to display contents');
- _layout_curPage?: NUMt = new NumInfo('current page of a PDF or other? paginated document');
- _layout_currentTimecode?: NUMt = new NumInfo('the current timecode of a time-based document (e.g., current time of a video) value is in seconds');
+ _layout_curPage?: NUMt = new NumInfo('current page of a PDF or other? paginated document', false);
+ _layout_currentTimecode?: NUMt = new NumInfo('the current timecode of a time-based document (e.g., current time of a video) value is in seconds', false);
_layout_hideContextMenu?: BOOLt = new BoolInfo('whether the context menu can be shown');
_layout_fitWidth?: BOOLt = new BoolInfo('whether document should scale its contents to fit its rendered width or not (e.g., for PDFviews)');
_layout_fitContentsToBox?: BOOLt = new BoolInfo('whether a freeformview should zoom/scale to create a shrinkwrapped view of its content');
- _layout_fieldKey?: STRt = new StrInfo('the field key containing the current layout definition');
+ _layout_fieldKey?: STRt = new StrInfo('the field key containing the current layout definition', false);
_layout_enableAltContentUI?: BOOLt = new BoolInfo('whether to show alternate content button');
_layout_showTitle?: string; // field name to display in header (:hover is an optional suffix)
_layout_showSidebar?: BOOLt = new BoolInfo('whether an annotationsidebar should be displayed for text docuemnts');
_layout_showCaption?: string; // which field to display in the caption area. leave empty to have no caption
_chromeHidden?: BOOLt = new BoolInfo('whether the editing chrome for a document is hidden');
- _gridGap?: NUMt = new NumInfo('gap between items in masonry view');
- _xMargin?: NUMt = new NumInfo('gap between left edge of document and start of masonry/stacking layouts');
- _yMargin?: NUMt = new NumInfo('gap between top edge of dcoument and start of masonry/stacking layouts');
- _xPadding?: NUMt = new NumInfo('x padding');
- _yPadding?: NUMt = new NumInfo('y padding');
+ _gridGap?: NUMt = new NumInfo('gap between items in masonry view', false);
+ _xMargin?: NUMt = new NumInfo('gap between left edge of document and start of masonry/stacking layouts', false);
+ _yMargin?: NUMt = new NumInfo('gap between top edge of dcoument and start of masonry/stacking layouts', false);
+ _xPadding?: NUMt = new NumInfo('x padding', false);
+ _yPadding?: NUMt = new NumInfo('y padding', false);
_singleLine?: boolean; // whether label box is restricted to one line of text
_createDocOnCR?: boolean; // whether carriage returns and tabs create new text documents
- _columnWidth?: NUMt = new NumInfo('width of table column');
+ _columnWidth?: NUMt = new NumInfo('width of table column', false);
_columnsHideIfEmpty?: BOOLt = new BoolInfo('whether stacking view column headings should be hidden');
- _caption_xMargin?: NUMt = new NumInfo('x margin of caption inside of a carousel collection', true);
- _caption_yMargin?: NUMt = new NumInfo('y margin of caption inside of a carousel collection', true);
- icon_nativeWidth?: NUMt = new NumInfo('native width of icon view', true);
- icon_nativeHeight?: NUMt = new NumInfo('native height of icon view', true);
+ _caption_xMargin?: NUMt = new NumInfo('x margin of caption inside of a carousel collection', false, true);
+ _caption_yMargin?: NUMt = new NumInfo('y margin of caption inside of a carousel collection', false, true);
+ icon_nativeWidth?: NUMt = new NumInfo('native width of icon view', false, true);
+ icon_nativeHeight?: NUMt = new NumInfo('native height of icon view', false, true);
_text_fontSize?: string;
_text_fontFamily?: string;
_text_fontWeight?: string;
@@ -250,11 +261,11 @@ export class DocumentOptions {
infoWindowOpen?: BOOLt = new BoolInfo('whether info window corresponding to pin is open (on MapDocuments)');
_carousel_index?: NUMt = new NumInfo('which item index the carousel viewer is showing');
- _label_minFontSize?: NUMt = new NumInfo('minimum font size for labelBoxes');
- _label_maxFontSize?: NUMt = new NumInfo('maximum font size for labelBoxes');
- stroke_width?: NUMt = new NumInfo('width of an ink stroke');
- icon_label?: STRt = new StrInfo('label to use for a fontIcon doc (otherwise, the title is used)');
- mediaState?: STRt = new StrInfo('status of audio/video media document: "pendingRecording", "recording", "paused", "playing"');
+ _label_minFontSize?: NUMt = new NumInfo('minimum font size for labelBoxes', false);
+ _label_maxFontSize?: NUMt = new NumInfo('maximum font size for labelBoxes', false);
+ stroke_width?: NUMt = new NumInfo('width of an ink stroke', false);
+ icon_label?: STRt = new StrInfo('label to use for a fontIcon doc (otherwise, the title is used)', false);
+ mediaState?: STRt = new StrInfo('status of audio/video media document: "pendingRecording", "recording", "paused", "playing"', false);
recording?: BOOLt = new BoolInfo('whether WebCam is recording or not');
autoPlayAnchors?: BOOLt = new BoolInfo('whether to play audio/video when an anchor is clicked in a stackedTimeline.');
dontPlayLinkOnSelect?: BOOLt = new BoolInfo('whether an audio/video should start playing when a link is followed to it.');
@@ -270,7 +281,7 @@ export class DocumentOptions {
contextMenuIcons?: List<string>;
childFilters_boolean?: string;
childFilters?: List<string>;
- childLimitHeight?: NUMt = new NumInfo('whether to limit the height of collection children. 0 - means height can be no bigger than width');
+ childLimitHeight?: NUMt = new NumInfo('whether to limit the height of collection children. 0 - means height can be no bigger than width', false);
childLayoutTemplate?: Doc; // template for collection to use to render its children (see PresBox layout in tree view)
childLayoutString?: string; // template string for collection to use to render its children
childDocumentsActive?: BOOLt = new BoolInfo('whether child documents are active when parent is document active');
@@ -282,12 +293,12 @@ export class DocumentOptions {
childContextMenuIcons?: List<string>;
targetScriptKey?: string; // where to write a template script (used by collections with click templates which need to target onClick, onDoubleClick, etc)
- lastFrame?: NUMt = new NumInfo('the last frame of a frame-based collection (e.g., progressive slide)');
- activeFrame?: NUMt = new NumInfo('the active frame of a document in a frame base collection');
- appearFrame?: NUMt = new NumInfo('the frame in which the document appears');
- _currentFrame?: NUMt = new NumInfo('the current frame of a frame-based collection (e.g., progressive slide)');
+ lastFrame?: NUMt = new NumInfo('the last frame of a frame-based collection (e.g., progressive slide)', false);
+ activeFrame?: NUMt = new NumInfo('the active frame of a document in a frame base collection', false);
+ appearFrame?: NUMt = new NumInfo('the frame in which the document appears', false);
+ _currentFrame?: NUMt = new NumInfo('the current frame of a frame-based collection (e.g., progressive slide)', false);
- isSystem?: BOOLt = new BoolInfo('is this a system created/owned doc', true);
+ isSystem?: BOOLt = new BoolInfo('is this a system created/owned doc', false);
isBaseProto?: BOOLt = new BoolInfo('is doc a base level prototype for data documents as opposed to data documents which are prototypes for layout documents. base protos are not cloned during a deep');
isTemplateForField?: string; // the field key for which the containing document is a rendering template
isTemplateDoc?: BOOLt = new BoolInfo('is the document a template for creating other documents');
@@ -296,21 +307,23 @@ export class DocumentOptions {
_isTimelineLabel?: BOOLt = new BoolInfo('is document a timeline label');
_isLightbox?: BOOLt = new BoolInfo('whether a collection acts as a lightbox by opening lightbox links by hiding all other documents in collection besides link target');
- presPanX?: NUMt = new NumInfo('panX saved as a view spec');
- presPanY?: NUMt = new NumInfo('panY saved as a view spec');
- presViewScale?: NUMt = new NumInfo('viewScale saved as a view Spec');
- presTransition?: NUMt = new NumInfo('the time taken for the transition TO a document');
- presDuration?: NUMt = new NumInfo('the duration of the slide in presentation view');
+ presPanX?: NUMt = new NumInfo('panX saved as a view spec', false);
+ presPanY?: NUMt = new NumInfo('panY saved as a view spec', false);
+ presViewScale?: NUMt = new NumInfo('viewScale saved as a view Spec', false);
+ presTransition?: NUMt = new NumInfo('the time taken for the transition TO a document', false);
+ presDuration?: NUMt = new NumInfo('the duration of the slide in presentation view', false);
presZoomText?: BOOLt = new BoolInfo('whether text anchors should shown in a larger box when following links to make them stand out');
data?: any;
data_useCors?: BOOLt = new BoolInfo('whether CORS protocol should be used for web page');
columnHeaders?: List<SchemaHeaderField>; // headers for stacking views
schemaHeaders?: List<SchemaHeaderField>; // headers for schema view
- dockingConfig?: STRt = new StrInfo('configuration of golden layout windows (applies only if doc is rendered as a CollectionDockingView)');
+ dockingConfig?: STRt = new StrInfo('configuration of golden layout windows (applies only if doc is rendered as a CollectionDockingView)', false);
icon?: string; // icon used by fonticonbox to render button
noteType?: string;
+ // STOPPING HERE
+
// freeform properties
_freeform_backgroundGrid?: boolean;
_freeform_scale?: NUMt = new NumInfo('how much a freeform view has been scaled (zoomed)');
@@ -380,7 +393,7 @@ export class DocumentOptions {
cloneFieldFilter?: List<string>; // fields not to copy when the document is clonedclipboard?: Doc;
dragWhenActive?: BOOLt = new BoolInfo('should document drag when it is active - e.g., pileView, group');
dragAction?: DROPt = new DAInfo('how to drag document when it is active (e.g., tree, groups)');
- dragFactory_count?: NUMt = new NumInfo('number of items created from a drag button (used for setting title with incrementing index)', true);
+ dragFactory_count?: NUMt = new NumInfo('number of items created from a drag button (used for setting title with incrementing index)', false, true);
dragFactory?: Doc; // document to create when dragging with a suitable onDragStart script
clickFactory?: Doc; // document to create when clicking on a button with a suitable onClick script
onDragStart?: ScriptField; //script to execute at start of drag operation -- e.g., when a "creator" button is dragged this script generates a different document to drop
diff --git a/src/client/util/.ClientUtils.ts.icloud b/src/client/util/.ClientUtils.ts.icloud
deleted file mode 100644
index e5e477586..000000000
--- a/src/client/util/.ClientUtils.ts.icloud
+++ /dev/null
Binary files differ
diff --git a/src/client/views/FilterPanel.tsx b/src/client/views/FilterPanel.tsx
index 1a923a995..93f4cf818 100644
--- a/src/client/views/FilterPanel.tsx
+++ b/src/client/views/FilterPanel.tsx
@@ -15,7 +15,8 @@ import { AiOutlineMinusSquare, AiOutlinePlusSquare } from 'react-icons/ai';
import { CiCircleRemove } from 'react-icons/ci';
import { Slider, Rail, Handles, Tracks, Ticks } from 'react-compound-slider';
import { TooltipRail, Handle, Tick, Track } from './nodes/SliderBox-components';
-import { DocumentOptions } from '../documents/Documents';
+import { DocumentOptions, FInfo } from '../documents/Documents';
+import { string32 } from 'pdfjs-dist/types/src/shared/util';
//slight bug when you don't click on background canvas before creating filter and the you click on the canvas
@@ -28,6 +29,8 @@ interface filterProps {
@observer
export class FilterPanel extends React.Component<filterProps> {
+ private _documentOptions: DocumentOptions = new DocumentOptions();
+
public static LayoutString(fieldKey: string) {
return FieldView.LayoutString(FilterPanel, fieldKey);
}
@@ -262,12 +265,21 @@ export class FilterPanel extends React.Component<filterProps> {
render() {
// console.log('this is frist one today ' + this._allFacets);
this._allFacets.forEach(element => console.log(element));
- const options = this._allFacets.filter(facet => this.activeFacetHeaders.indexOf(facet) === -1).map(facet => ({ value: facet, label: facet }));
+ // const options = Object.entries(this._documentOptions).forEach((pair: [string, FInfo]) => pair[1].filterable ).map(facet => value: facet, label: facet) //this._allFacets.filter(facet => this.activeFacetHeaders.indexOf(facet) === -1).map(facet => ({ value: facet, label: facet }));
// console.log('HEELLLLLL ' + DocumentOptions);
- const freeformOptions: DocumentOptions = {};
+ let filteredOptions: string[] = ['author', 'tags', 'text', 'acl-Guest'];
+
+ Object.entries(this._documentOptions).forEach((pair: [string, FInfo]) => {
+ if (pair[1].filterable) {
+ filteredOptions.push(pair[0]);
+ console.log('THIS IS FILTERABLE ALKDJFIIEII' + filteredOptions);
+ }
+ });
+
+ let options = filteredOptions.map(facet => ({ value: facet, label: facet }));
- console.log('wht is this ' + freeformOptions.author);
+ // Object.entries(this._documentOptions).forEach((pair: [string, FInfo]) => console.log('this is first piar ' + pair[0] + ' this is second piar ' + pair[1].filterable));
return (
<div className="filterBox-treeView">
@@ -373,13 +385,21 @@ export class FilterPanel extends React.Component<filterProps> {
case 'range':
const domain = renderInfoDomain;
+ const range = renderInfoRange;
+
+ if (range) {
+ console.log('this is info range ' + range[0] + ' , ' + range[1]);
+ }
+
if (domain) {
+ console.log('this is info domain ' + domain[0] + ', ' + domain[1]);
+
return (
<div className="sliderBox-outerDiv" style={{ width: '95%', height: 45 }}>
<Slider
mode={2}
step={Math.min(1, 0.1 * (domain[1] - domain[0]))}
- domain={[-1000, 1000]}
+ domain={[domain[0], domain[1]]} // -1000, 1000
rootStyle={{ position: 'relative', width: '100%' }}
onChange={values => Doc.setDocRangeFilter(this.targetDoc, facetHeader, values)}
values={renderInfoRange!}>