Skip to content

Commit

Permalink
rename obieditortest -> obiformeditor (microsoft#618)
Browse files Browse the repository at this point in the history
* use @bfcomposer scope

* rename obieditortest -> obiformeditor

* fix demo app in code-editor

* ignore format message warnings

* disable fabric icon warnings

* disable fabric icon warnings without initializing for test

* disable formatMessage warnings in test
  • Loading branch information
a-b-r-o-w-n authored Jul 25, 2019
1 parent fa8e093 commit 6127f1c
Show file tree
Hide file tree
Showing 107 changed files with 92 additions and 65 deletions.
2 changes: 1 addition & 1 deletion Composer/.npmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
@bfdesigner:registry=https://botbuilder.myget.org/F/botbuilder-declarative/npm/
@bfcomposer:registry=https://botbuilder.myget.org/F/botbuilder-declarative/npm/
2 changes: 1 addition & 1 deletion Composer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ COPY packages/lib/cci-graph-lib/package.json ./packages/lib/cci-graph-lib/
COPY packages/lib/code-editor/package.json ./packages/lib/code-editor/
COPY packages/lib/shared-menus/package.json ./packages/lib/shared-menus/
COPY packages/extensions/package.json ./packages/extensions/
COPY packages/extensions/obieditortest/package.json ./packages/extensions/obieditortest/
COPY packages/extensions/obiformeditor/package.json ./packages/extensions/obiformeditor/
COPY packages/extensions/sample-json-editor/package.json ./packages/extensions/sample-json-editor/
COPY packages/extensions/visual-designer/package.json ./packages/extensions/visual-designer/

Expand Down
2 changes: 1 addition & 1 deletion Composer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"start": "concurrently --kill-others-on-fail \"npm:start:*\"",
"start:client": "cd packages/client && yarn start",
"start:server": "cd packages/server && yarn start",
"start:obieditor": "cd packages/extensions/obieditortest && yarn start -- --no-clear",
"start:obieditor": "cd packages/extensions/obiformeditor && yarn start -- --no-clear",
"test": "yarn typecheck && jest",
"test:coverage": "yarn test --coverage --no-cache --reporters=default --reporters=jest-junit",
"test:integration": "start-server-and-test test:integration:start http://localhost:5000 test:integration:run",
Expand Down
7 changes: 5 additions & 2 deletions Composer/packages/client/setupTests.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { initializeIcons } from '@uifabric/icons';
import { setIconOptions } from 'office-ui-fabric-react/lib/Styling';
import 'jest-dom/extend-expect';
import { cleanup } from 'react-testing-library';

initializeIcons();
// Suppress icon warnings.
setIconOptions({
disableWarnings: true,
});

afterEach(cleanup);
2 changes: 1 addition & 1 deletion Composer/packages/client/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { Store } from './store/index';
import { main, sideBar, content, divider, globalNav, leftNavBottom, rightPanel, dividerTop } from './styles';
import { CreationFlow } from './CreationFlow/index';

initializeIcons(/* optional base url */);
initializeIcons(undefined, { disableWarnings: true });

// eslint-disable-next-line react/display-name
const Content = forwardRef((props, ref) => <div css={content} {...props} ref={ref} />);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// this is currently hard-coded here

import FormEditor from 'composer-extensions/obieditortest';
import FormEditor from 'composer-extensions/obiformeditor';
import VisualDesigner from 'composer-extensions/visual-designer';

const getEditor = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import React, { useState, useEffect } from 'react';
import { initializeIcons } from 'office-ui-fabric-react';

import ApiClient from '../messenger/ApiClient';

import getEditor from './EditorMap';

import './extensionContainer.css';

initializeIcons(undefined, { disableWarnings: true });
/**
* ExtensionContainer is a IFrame container to host any extension as React component
* ExtensionContainer provides a React absraction to it's inner extention, on top of the
Expand Down
7 changes: 0 additions & 7 deletions Composer/packages/extensions/obieditortest/__tests__/setup.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# obieditortest
# obiformeditor

[![Travis][build-badge]][build]
[![npm package][npm-badge]][npm]
[![Coveralls][coveralls-badge]][coveralls]

Describe obieditortest here.
Describe obiformeditor here.

[build-badge]: https://img.shields.io/travis/user/repo/master.png?style=flat-square
[build]: https://travis-ci.org/user/repo
Expand All @@ -22,7 +22,7 @@ Describe obieditortest here.
There is a playground to see and experiment with all of the different OBI types. This is usually helpful to view
outside of Composer because it gives you a finer grain of control and allows you to drill down into any level of detail easily.

In the Composer directory or in the obieditortest directory:
In the Composer directory or in the obiformeditor directory:
```bash
yarn start
```
Expand Down Expand Up @@ -62,4 +62,4 @@ Once you are done making changes, commit them and push.
Then merge those changes into the [composer branch](https://github.com/a-b-r-o-w-n/react-jsonschema-form/tree/composer).
Once merged, update the package version by incrementing the number after the actual package version (ex. `1.4.0-1` -> `1.4.0-2`).
Create a tag with the new version number (`git tag v1.4.0-2`) and push to git.
Finally, update the tag in obieditortest package.json to reference the newly created tag.
Finally, update the tag in obiformeditor package.json to reference the newly created tag.
10 changes: 10 additions & 0 deletions Composer/packages/extensions/obiformeditor/__tests__/setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { setIconOptions } from 'office-ui-fabric-react/lib/Styling';
import 'jest-dom/extend-expect';
import { cleanup } from 'react-testing-library';

// Suppress icon warnings.
setIconOptions({
disableWarnings: true,
});

afterEach(cleanup);
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Controlled as CodeMirror } from 'react-codemirror2';
import { PrimaryButton, DefaultButton, DirectionalHint } from 'office-ui-fabric-react';
import debounce from 'lodash.debounce';
import nanoid from 'nanoid';
import { initializeIcons } from '@uifabric/icons';

import Example from '../../src';
import { ShellApi, LuFile } from '../../src/types';
Expand All @@ -18,6 +19,8 @@ import 'codemirror/theme/neat.css';

import './styles.scss';

initializeIcons(undefined, { disableWarnings: true });

const cmOptions = {
theme: 'material',
viewportMargin: Infinity,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"watch": "yarn build:ts --watch"
},
"dependencies": {
"@bfdesigner/react-jsonschema-form": "1.4.3-0",
"@bfcomposer/react-jsonschema-form": "1.6.0",
"@uifabric/fluent-theme": "^0.16.2",
"@uifabric/styling": "^6.45.3",
"classnames": "^2.2.6",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { IconButton } from 'office-ui-fabric-react';
import { IContextualMenuItem } from 'office-ui-fabric-react';
import { ArrayFieldItem } from '@bfdesigner/react-jsonschema-form';
import { ArrayFieldItem } from '@bfcomposer/react-jsonschema-form';
import formatMessage from 'format-message';
import { NeutralColors, FontSizes } from '@uifabric/fluent-theme';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { PrimaryButton } from 'office-ui-fabric-react';
import { ArrayFieldTemplateProps } from '@bfdesigner/react-jsonschema-form';
import { ArrayFieldTemplateProps } from '@bfcomposer/react-jsonschema-form';
import formatMessage from 'format-message';
import { createStepMenu, DialogGroup } from 'shared-menus';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { PrimaryButton } from 'office-ui-fabric-react';
import { ArrayFieldTemplateProps } from '@bfdesigner/react-jsonschema-form';
import { ArrayFieldTemplateProps } from '@bfcomposer/react-jsonschema-form';
import formatMessage from 'format-message';

import { BaseField } from '../fields/BaseField';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { PrimaryButton } from 'office-ui-fabric-react';
import { ArrayFieldTemplateProps } from '@bfdesigner/react-jsonschema-form';
import { ArrayFieldTemplateProps } from '@bfcomposer/react-jsonschema-form';
import formatMessage from 'format-message';

import { BaseField } from '../fields/BaseField';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { findSchemaDefinition } from '@bfdesigner/react-jsonschema-form/lib/utils';
import { ArrayFieldTemplateProps } from '@bfdesigner/react-jsonschema-form';
import { findSchemaDefinition } from '@bfcomposer/react-jsonschema-form/lib/utils';
import { ArrayFieldTemplateProps } from '@bfcomposer/react-jsonschema-form';

import StringArray from './StringArray';
import ObjectArray from './ObjectArray';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import get from 'lodash.get';
import { FieldTemplateProps } from '@bfdesigner/react-jsonschema-form';
import { FieldTemplateProps } from '@bfcomposer/react-jsonschema-form';

import { FIELDS_TO_HIDE } from '../schema/appschema';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React, { useState } from 'react';
import { PrimaryButton } from 'office-ui-fabric-react';
import { getUiOptions } from '@bfdesigner/react-jsonschema-form/lib/utils';
import { getUiOptions } from '@bfcomposer/react-jsonschema-form/lib/utils';
import get from 'lodash.get';
import omit from 'lodash.omit';
import { ObjectFieldTemplateProps } from '@bfdesigner/react-jsonschema-form';
import { ObjectFieldTemplateProps } from '@bfcomposer/react-jsonschema-form';
import formatMessage from 'format-message';

import { BaseField } from '../fields/BaseField';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { ColorClassNames, FontClassNames } from '@uifabric/styling';
import startCase from 'lodash.startcase';
import { JSONSchema6 } from 'json-schema';
import { IdSchema, UiSchema } from '@bfdesigner/react-jsonschema-form';
import { IdSchema, UiSchema } from '@bfcomposer/react-jsonschema-form';
import get from 'lodash.get';
import classnames from 'classnames';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState } from 'react';
import formatMessage from 'format-message';
import { FieldProps } from '@bfdesigner/react-jsonschema-form';
import { FieldProps } from '@bfcomposer/react-jsonschema-form';
import { PrimaryButton, TextField, DirectionalHint, IContextualMenuItem, IconButton } from 'office-ui-fabric-react';
import get from 'lodash.get';
import { NeutralColors, FontSizes } from '@uifabric/fluent-theme';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState } from 'react';
import { UnControlled as CodeMirror } from 'react-codemirror2';
import { FieldProps } from '@bfdesigner/react-jsonschema-form';
import { FieldProps } from '@bfcomposer/react-jsonschema-form';
import { Dropdown, IDropdownOption, MessageBar, MessageBarType } from 'office-ui-fabric-react';
import formatMessage from 'format-message';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState } from 'react';
import { UnControlled as CodeMirror } from 'react-codemirror2';
import { FieldProps } from '@bfdesigner/react-jsonschema-form';
import { FieldProps } from '@bfcomposer/react-jsonschema-form';

import 'codemirror/mode/javascript/javascript';
import 'codemirror/lib/codemirror.css';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState, ReactElement } from 'react';
import formatMessage from 'format-message';
import { FieldProps } from '@bfdesigner/react-jsonschema-form';
import { FieldProps } from '@bfcomposer/react-jsonschema-form';
import { Dropdown, ResponsiveMode, IDropdownOption, Spinner, SpinnerSize } from 'office-ui-fabric-react';

import { BaseField } from '../BaseField';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import formatMessage from 'format-message';
import { PrimaryButton, DirectionalHint } from 'office-ui-fabric-react';
import { FieldProps } from '@bfdesigner/react-jsonschema-form';
import { FieldProps } from '@bfcomposer/react-jsonschema-form';
import get from 'lodash.get';
import { createStepMenu, DialogGroup } from 'shared-menus';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { FieldProps } from '@bfdesigner/react-jsonschema-form';
import { FieldProps } from '@bfcomposer/react-jsonschema-form';

import { UnsupportedField } from './UnsupportedField';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { IColumn } from 'office-ui-fabric-react';
import { JSONSchema6 } from 'json-schema';
import { DirectionalHint } from 'office-ui-fabric-react';
import get from 'lodash.get';
import { FieldProps } from '@bfdesigner/react-jsonschema-form';
import { FieldProps } from '@bfcomposer/react-jsonschema-form';
import { NeutralColors, FontSizes } from '@uifabric/fluent-theme';

import { buildDialogOptions, swap, remove, insertAt, DialogOptionsOpts } from '../utils';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { FieldProps } from '@bfdesigner/react-jsonschema-form';
import { FieldProps } from '@bfcomposer/react-jsonschema-form';

export const UnsupportedField: React.FC<FieldProps> = props => {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import JSONForm, { UiSchema, Widget, FormProps as JSONFormProps } from '@bfdesigner/react-jsonschema-form';
import JSONForm, { UiSchema, Widget, FormProps as JSONFormProps } from '@bfcomposer/react-jsonschema-form';
import { JSONSchema6 } from 'json-schema';

import * as widgets from './widgets';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { WidgetProps, FieldProps, ObjectFieldTemplateProps } from '@bfdesigner/react-jsonschema-form';
import { WidgetProps, FieldProps, ObjectFieldTemplateProps } from '@bfcomposer/react-jsonschema-form';

import { ShellApi, LuFile, LgFile, DialogInfo } from '../types';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { Checkbox } from 'office-ui-fabric-react';
import { WidgetProps } from '@bfdesigner/react-jsonschema-form';
import { WidgetProps } from '@bfcomposer/react-jsonschema-form';
import { NeutralColors } from '@uifabric/fluent-theme';

export function CheckboxWidget(props: WidgetProps) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { DatePicker } from 'office-ui-fabric-react';
import { WidgetProps } from '@bfdesigner/react-jsonschema-form';
import { WidgetProps } from '@bfcomposer/react-jsonschema-form';

export function DateTimeWidget(props: WidgetProps) {
const { onChange, onBlur, onFocus, required, value, schema, ...rest } = props;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { TextField } from 'office-ui-fabric-react';
import { WidgetProps } from '@bfdesigner/react-jsonschema-form';
import { WidgetProps } from '@bfcomposer/react-jsonschema-form';

export const TextareaWidget: React.FunctionComponent<WidgetProps> = props => {
const { label, onBlur, onChange, onFocus, readonly, value, placeholder, schema, id, disabled } = props;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { Toggle } from 'office-ui-fabric-react';
import { WidgetProps } from '@bfdesigner/react-jsonschema-form';
import { WidgetProps } from '@bfcomposer/react-jsonschema-form';

export function ToggleWidget(props: WidgetProps) {
const { label, onChange, value } = props;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { initializeIcons } from '@uifabric/icons';
import formatMessage from 'format-message';

import ObiFormEditor from './ObiFormEditor';

initializeIcons();
formatMessage.setup({
missingTranslation: 'ignore',
});
Expand Down
4 changes: 2 additions & 2 deletions Composer/packages/extensions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"main": "index.js",
"scripts": {
"build:visual-designer": "cd visual-designer && yarn build",
"build:obieditortest": "cd obieditortest && yarn build",
"build:obiformeditor": "cd obiformeditor && yarn build",
"build:sample-json-editor": "cd sample-json-editor && yarn build",
"build:all": "concurrently --kill-others-on-fail \"yarn:build:obieditortest\" \"yarn:build:sample-json-editor\" \"yarn:build:visual-designer\""
"build:all": "concurrently --kill-others-on-fail \"yarn:build:obiformeditor\" \"yarn:build:sample-json-editor\" \"yarn:build:visual-designer\""
},
"author": "",
"license": "ISC"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import React, { Component } from 'react';
import { render } from 'react-dom';
import { Nav } from 'office-ui-fabric-react';
import { initializeIcons } from 'office-ui-fabric-react/lib/Icons';

import { VisualEditorDemo } from './stories/VisualEditorDemo';
import { StepEditorDemo } from './stories/StepEditorDemo';
import { EventsEditorDemo } from './stories/EventsEditorDemo';
import './index.css';

initializeIcons(undefined, { disableWarnings: true });

const DemoMaps = {
VisualEditorDemo: {
key: 'VisualEditorDemo',
Expand Down
2 changes: 0 additions & 2 deletions Composer/packages/extensions/visual-designer/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import React, { useRef, useState, useEffect } from 'react';
import { isEqual } from 'lodash';
import { initializeIcons } from 'office-ui-fabric-react/lib/Icons';
import formatMessage from 'format-message';

import { ObiEditor } from './editors/ObiEditor';
import { isLayoutEqual } from './shared/isLayoutEqual';
import { NodeRendererContext } from './store/NodeRendererContext';

initializeIcons(/* optional base url */);
formatMessage.setup({
missingTranslation: 'ignore',
});
Expand Down
4 changes: 2 additions & 2 deletions Composer/packages/lib/code-editor/demo/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState } from 'react';

import CodeEditor from '../../src';
import { BaseEditor } from '../../src';

const LU_HELP =
'https://github.com/Microsoft/botbuilder-tools/blob/master/packages/Ludown/docs/lu-file-format.md#lu-file-format';
Expand All @@ -13,7 +13,7 @@ export default function App() {

return (
<div style={{ height: 'calc(100vh - 20px)', width: '100%' }}>
<CodeEditor onChange={newVal => setValue(newVal)} value={value} placeholder={placeholder} />
<BaseEditor onChange={newVal => setValue(newVal)} value={value} placeholder={placeholder} />
</div>
);
}
2 changes: 0 additions & 2 deletions Composer/packages/lib/code-editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@
"webpack-dev-server": "^3.7.0"
},
"dependencies": {
"@uifabric/fluent-theme": "^0.16.10",
"lodash.throttle": "^4.1.1",
"office-ui-fabric-react": "^6.189.1",
"react-monaco-editor": "^0.26.2"
}
}
Loading

0 comments on commit 6127f1c

Please sign in to comment.