Permalink
Browse files

[editor] Upgrade editor packages (#1108)

* upgrade ramda

* upgrade monaco editor

* upgrade emotion

* upgrade rx

* upgrade redux

* upgrade react-calendar

* upgrade react-tabs

* upgrade tweek-client

* upgrade react-autosize-textarea

* upgrade react-highlight-words

* remove unused packages

* upgrade react

* upgrade react-tag-input
  • Loading branch information...
nataly87s committed Feb 7, 2019
1 parent 814b3e2 commit d5159558cdb76e07cf481ccfba87ebf7271b7b0b
Showing with 782 additions and 939 deletions.
  1. +1 −3 e2e/ui/spec/context/override-keys.js
  2. +3 −2 e2e/ui/spec/keys/edit-const-key.js
  3. +1 −0 e2e/ui/spec/validations/key-name-validations.js
  4. +4 −7 services/editor/config-overrides.js
  5. +38 −40 services/editor/package.json
  6. +10 −7 services/editor/src/Routes.js
  7. +62 −31 services/editor/src/components/JPadFullEditor/JPadVisualEditor/Partition/PartitionsSelector.js
  8. +3 −3 services/editor/src/components/UserBar.js
  9. +52 −30 services/editor/src/components/common/Input/ListTypedValue.js
  10. +51 −30 services/editor/src/pages/context/components/FixedKeys/FixedKeys.js
  11. +15 −13 services/editor/src/pages/keys/components/KeyPage/KeyEditPage/KeyTags/KeyTags.js
  12. +4 −4 services/editor/src/pages/keys/components/KeyPage/KeyEditPage/RevisionHistory/RevisionHistory.js
  13. +7 −4 services/editor/src/pages/login/components/AzureLoggedInPage.js
  14. +7 −4 services/editor/src/pages/login/components/BasicAuthLoggedInPage.js
  15. +3 −3 services/editor/src/pages/login/components/BasicAuthLoginButton.js
  16. +7 −4 services/editor/src/pages/login/components/LoggedInPage.js
  17. +28 −26 services/editor/src/pages/login/components/LoginPage.js
  18. +7 −4 services/editor/src/pages/login/components/SilentLoggedInPage.js
  19. +6 −6 services/editor/src/pages/settings/components/SettingsPage/Versions.js
  20. +2 −2 services/editor/src/store/browserHistory.js
  21. +4 −4 services/editor/src/store/configureStore.js
  22. +1 −1 services/editor/src/store/ducks/context.js
  23. +3 −3 services/editor/src/store/ducks/schema.js
  24. +2 −2 services/editor/src/store/ducks/schema.spec.js
  25. +44 −29 services/editor/src/store/ducks/selectedKey.js
  26. +8 −10 services/editor/src/store/ducks/tags.js
  27. +12 −11 services/editor/src/store/rootReducer.js
  28. +0 −1 services/editor/src/utils/tweekClients.js
  29. +397 −655 services/editor/yarn.lock
@@ -9,9 +9,7 @@ const identityId = 'override_keys_user';
const identityType = 'user';
const typedKey = 'behavior_tests/context/override_key';

fixture`Context Identity Properties`.page`${editorUrl}/context`
.httpAuth(credentials)
.beforeEach(login);
fixture`Context Override Keys`.page`${editorUrl}/context`.httpAuth(credentials).beforeEach(login);

test('should modify override keys', async (t) => {
const identity = await contextPage.open(identityType, identityId);
@@ -2,7 +2,6 @@ import { Selector } from 'testcafe';
import { expect } from 'chai';
import { editorUrl } from '../../utils/constants';
import { credentials, login } from '../../utils/auth-utils';
import { attributeSelector } from '../../utils/selector-utils';
import { waitForValueToEqual } from '../../clients/api-client';
import { createConstKey } from '../../clients/authoring-client';
import EditKey from '../../pages/Keys/EditKey';
@@ -61,7 +60,9 @@ test('should succeed editing key (valueType=object)', async (t) => {
});

test('should succeed editing key (valueType=date)', async (t) => {
const desiredDate = Selector(attributeSelector('datetime', '2018-10-11T00:00:00.000'));
const desiredDate = Selector('.react-calendar.calendar')
.find('button')
.withExactText('11');
const desiredDateFormatted = '10/11/2018 00:00:00';

const editKey = await EditKey.open(dateTypeKeyPath);
@@ -57,6 +57,7 @@ test('should allow creating a key named "a/b/c" and also a key named "b"', async
};

await addEmptyKey('a/b/c');
await t.navigateTo('/keys');
await addEmptyKey('b');
}).before(async (t) => {
await tweekManagementClient.deleteKey('a/b/c');
@@ -1,14 +1,11 @@
/* config-overrides.js */
const CopyWebpackPlugin = require('copy-webpack-plugin');
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');

module.exports = function override(config, env) {
config.plugins = (config.plugins || []).concat([
new CopyWebpackPlugin([
{
from: 'node_modules/monaco-editor/min/vs',
to: 'vs',
},
]),
new MonacoWebpackPlugin({
languages: ['json'],
}),
]);

return config;
@@ -17,78 +17,76 @@
"build:less": "node-less-chokidar src/",
"build:app": "react-app-rewired build",
"test": "react-scripts test",
"test:e2e": "cd ../../ && yarn start:e2e gateway && EDITOR_URL=http://localhost:3000 yarn test:local:ui",
"eject": "react-scripts eject",
"teardown": "yarn docker-compose down --remove-orphans",
"logs": "yarn docker-compose logs",
"docker-compose": "docker-compose -f ../../deployments/dev/docker-compose.yml -f ../../deployments/dev/docker-compose.override.yml -f ../../deployments/dev/docker-compose.local-editor.yml"
},
"dependencies": {
"adal-angular": "1.0.17",
"@emotion/core": "^10.0.7",
"@emotion/styled": "^10.0.7",
"adal-angular": "^1.0.17",
"animakit-expander": "^2.1.4",
"chance": "^1.0.13",
"change-case": "^3.0.2",
"change-case": "^3.1.0",
"classnames": "^2.2.5",
"emotion": "9.1.0",
"express": "4.16.3",
"connected-react-router": "^6.2.2",
"express": "^4.16.4",
"fast-json-patch": "^2.0.6",
"history": "^4.7.2",
"idb-keyval": "^2.5.1",
"jwt-decode": "2.2.0",
"lunr": "^2.1.6",
"md5": "2.2.1",
"moment": "^2.22.0",
"oidc-client": "1.5.4",
"jwt-decode": "^2.2.0",
"md5": "^2.2.1",
"moment": "^2.24.0",
"oidc-client": "^1.6.1",
"papp-polyfill": "^1.1.0",
"passport": "^0.4.0",
"passport-azure-ad": "^4.0.0",
"passport-google-oauth20": "^1.0.0",
"passport-http": "^0.3.0",
"passport-oauth2": "^1.4.0",
"prop-types": "^15.6.1",
"query-string": "5.1.1",
"ramda": "^0.25.0",
"react": "16.7.0",
"react-autosize-textarea": "^1.0.2",
"react-calendar": "2.17.4",
"react-document-title": "2.0.3",
"react-dom": "16.7.0",
"query-string": "^6.2.0",
"ramda": "^0.26.1",
"react": "^16.8.1",
"react-autosize-textarea": "^6.0.0",
"react-calendar": "^2.18.1",
"react-dnd": "^7.0.2",
"react-dnd-html5-backend": "^7.0.2",
"react-document-title": "^2.0.3",
"react-dom": "^16.8.1",
"react-draggable": "^3.0.5",
"react-emotion": "9.1.0",
"react-google-tag-manager": "^2.2.1",
"react-highlight-words": "^0.11.0",
"react-monaco-editor": "^0.14.1",
"react-highlight-words": "^0.16.0",
"react-monaco-editor": "^0.22.0",
"react-notification-system": "^0.2.17",
"react-redux": "^5.0.7",
"react-redux": "^6.0.0",
"react-router": "^4.2.0",
"react-router-dom": "^4.2.2",
"react-router-redux": "next",
"react-sanfona": "^1.1.0",
"react-tabs": "^2.2.1",
"react-tag-input": "^4.9.1",
"react-tabs": "^3.0.0",
"react-tag-input": "^6.2.1",
"react-tooltip": "^3.4.0",
"react-tweek": "0.4.0",
"react-tweek": "^0.4.1",
"react-virtualized": "^9.18.5",
"recompose": "^0.26.0",
"redux": "^3.7.2",
"recompose": "^0.30.0",
"redux": "^4.0.1",
"redux-actions": "^2.3.0",
"redux-promise": "^0.5.3",
"redux-promise": "^0.6.0",
"redux-thunk": "^2.2.0",
"rodal": "^1.6.3",
"rxjs": "^5.5.8",
"tweek-client": "1.0.0-rc5",
"tweek-local-cache": "0.5.0",
"rxjs": "^6.4.0",
"rxjs-compat": "^6.4.0",
"tweek-client": "^1.0.0-rc6",
"tweek-local-cache": "^0.5.1",
"velocity-react": "^1.3.3"
},
"devDependencies": {
"chai": "^4.1.2",
"chai-things": "^0.2.0",
"copy-webpack-plugin": "4.5.1",
"monaco-editor": "^0.15.1",
"monaco-editor-webpack-plugin": "^1.7.0",
"node-less-chokidar": "^0.4.1",
"nodemon": "^1.17.3",
"npm-run-all": "^4.1.5",
"react-app-rewired": "2.0.2",
"react-scripts": "2.1.3",
"react-test-renderer": "^16.3.0",
"react-app-rewired": "^2.1.0",
"react-scripts": "^2.1.3",
"react-test-renderer": "^16.8.1",
"rimraf": "^2.6.2"
},
"browserslist": [
@@ -1,6 +1,6 @@
import React from 'react';
import { Switch, Route, Redirect } from 'react-router';
import { ConnectedRouter } from 'react-router-redux';
import { ConnectedRouter } from 'connected-react-router';
import App from './components/App';
import PrivateRoute from './PrivateRoute';
import LoginPage from './pages/login/components/LoginPage';
@@ -49,16 +49,19 @@ const renderAppRoutes = () => (
<PrivateRoute path="/keys" render={renderKeyRoutes} />
<PrivateRoute path="/context" render={renderContextRoutes} />
<PrivateRoute path="/settings" render={renderSettingsRoutes} />
<Route path="/logout" exact render={() =>
{
signOut();
return <Redirect to="/login" />;
}} />
<Route
path="/logout"
exact
render={() => {
signOut();
return <Redirect to="/login" />;
}}
/>
</Switch>
</App>
);

export default props => (
export default () => (
<ConnectedRouter history={browserHistory}>
<Switch>
<Route path="/login" component={LoginPage} />
@@ -1,41 +1,68 @@
import React from 'react';
import { WithContext as ReactTags } from 'react-tag-input';
import { compose, withHandlers, withProps } from 'recompose';
import * as ContextService from '../../../../services/context-service';
import './PartitionsSelector.css';

export default ({ partitions, handlePartitionAddition, handlePartitionDelete, alerter }) => {
const allProperties = ContextService.getSchemaProperties().map(x => ({
id: x.id,
text: `${x.name} (${x.identity})`,
}));
const indexedSuggestions = allProperties
.filter(property => !partitions.includes(property.id))
.map(x => x.text);
const indexedTags = partitions.map(
partition =>
allProperties.find(property => property.id === partition) || {
id: partition,
text: partition,
},
);
const enhance = compose(
withProps(({ partitions }) => {
const allProperties = ContextService.getSchemaProperties().map((x) => ({
id: x.id,
text: `${x.name} (${x.identity})`,
}));
return {
allProperties,
indexedSuggestions: allProperties.filter((property) => !partitions.includes(property.id)),
indexedTags: partitions.map(
(partition) =>
allProperties.find((property) => property.id === partition) || {
id: partition,
text: partition,
},
),
};
}),
withHandlers({
handleAddition: ({
allProperties,
partitions,
handlePartitionAddition,
handlePartitionDelete,
alerter,
}) => (newValue) => {
const newId = newValue.id.toLowerCase();

let newProperty = allProperties.find((x) => x.id.toLowerCase() === newId);
if (!newProperty) {
newProperty = allProperties.find(
(x) => x.text.toLowerCase() === newValue.text.toLowerCase(),
);
}

const handleAddition = (newValue) => {
const newProperty = allProperties.find(x => x.text === newValue || x.id === newValue);
if (!newProperty) {
alerter.showAlert({
title: 'Attention!',
message: `Can't partition by '${newValue}'`,
});
} else if (!partitions.includes(newProperty.id)) {
handlePartitionAddition(newProperty.id);
} else {
alerter.showAlert({
title: 'Attention!',
message: `Property '${newProperty.text}' already exists in partitions list`,
});
}
};
if (!newProperty) {
alerter.showAlert({
title: 'Attention!',
message: `Can't partition by '${newValue.text}'`,
});
} else if (partitions.includes(newProperty.id)) {
alerter.showAlert({
title: 'Attention!',
message: `Property '${newProperty.text}' already exists in partitions list`,
});
} else {
handlePartitionAddition(newProperty.id);
}
},
}),
);

const PartitionSelector = ({
indexedSuggestions,
indexedTags,
handleAddition,
partitions,
handlePartitionDelete,
}) => {
return (
<div className="partitions-selector-container" data-comp="partition-selector">
<label className="partitions-label">Partition by:</label>
@@ -49,6 +76,8 @@ export default ({ partitions, handlePartitionAddition, handlePartitionDelete, al
minQueryLength={1}
allowDeleteFromEmptyInput
autocomplete
allowUnique={false}
allowDragDrop={false}
classNames={{
tags: 'tags-container',
tagInput: 'tag-input',
@@ -61,3 +90,5 @@ export default ({ partitions, handlePartitionAddition, handlePartitionDelete, al
</div>
);
};

export default enhance(PartitionSelector);
@@ -1,10 +1,10 @@
import React from 'react';
import md5 from 'md5';
import styled from 'react-emotion';
import styled from '@emotion/styled';
import { Link } from 'react-router-dom';
import { CurrentUserContext } from '../contexts/CurrentUser';

const Container = styled('div')`
const Container = styled.div`
display: flex;
background-color: #00506d;
width: 166px;
@@ -19,7 +19,7 @@ const Container = styled('div')`

const UserBar = () => (
<CurrentUserContext.Consumer>
{user =>
{(user) =>
user && (
<Container>
<div style={{ marginRight: 16, textAlign: 'right' }}>
Oops, something went wrong.

0 comments on commit d515955

Please sign in to comment.