Skip to content

Commit

Permalink
Merge pull request #65 from glific/feature/update-v17
Browse files Browse the repository at this point in the history
Sync with the latest nyaruka version
  • Loading branch information
mdshamoon authored Feb 21, 2022
2 parents 36c3197 + d7f9047 commit 222efab
Show file tree
Hide file tree
Showing 52 changed files with 1,880 additions and 574 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ report.html
lambda-build
lib
build
deploy
fabric
fabfile.py
52 changes: 51 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,61 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [v1.15.0](https://github.com/nyaruka/floweditor/compare/v1.14.3...v1.15.0)
#### [v1.17.0](https://github.com/nyaruka/floweditor/compare/v1.16.1...v1.17.0)

> 4 February 2022
- Fix removal of cases from field and expression routers [`#1037`](https://github.com/nyaruka/floweditor/pull/1037)
- Updates to allow for embedding inside containers [`#1036`](https://github.com/nyaruka/floweditor/pull/1036)
- Fix case removal from expression and field routers [`12caad1`](https://github.com/nyaruka/floweditor/commit/12caad1fd6f15fa30f77f5b428c383ebb5c26cdb)
- Remove unused imports [`0dd03c6`](https://github.com/nyaruka/floweditor/commit/0dd03c67dd94827704affd03e608e6f6644b495d)
- Add missing prop [`06eb896`](https://github.com/nyaruka/floweditor/commit/06eb8968ca7a1de99b2df212d42c1967a58a731c)

#### [v1.16.1](https://github.com/nyaruka/floweditor/compare/v1.16.0...v1.16.1)

> 5 January 2022
- Don't link up the contact in recents when simulating [`#1031`](https://github.com/nyaruka/floweditor/pull/1031)
- Fix test snapshot [`608124a`](https://github.com/nyaruka/floweditor/commit/608124a29e26557bc4b323b582728fb84baaa0df)

#### [v1.16.0](https://github.com/nyaruka/floweditor/compare/v1.15.2...v1.16.0)

> 5 January 2022
- Recent contacts updated [`#1030`](https://github.com/nyaruka/floweditor/pull/1030)
- Fix showing media drawer in simulator for waits with hints [`#1029`](https://github.com/nyaruka/floweditor/pull/1029)
- Simulator should use wait events rather than the wait object [`#1027`](https://github.com/nyaruka/floweditor/pull/1027)
- Replace recent messages rollover with recent contacts using segment data from sprint [`533bc0c`](https://github.com/nyaruka/floweditor/commit/533bc0ca066aded845b958a6b7e8c0f73220152e)
- Make recent contacts clickable. [`ff5c8e2`](https://github.com/nyaruka/floweditor/commit/ff5c8e2ac52ccdc010b12b1134142d0614df0344)
- Improve Recent Contacts appearance [`fe47628`](https://github.com/nyaruka/floweditor/commit/fe4762865223837fd13c5067386395f3a72332b5)

#### [v1.15.2](https://github.com/nyaruka/floweditor/compare/v1.15.1...v1.15.2)

> 18 November 2021
- Use child.status rather than child.run.status [`#1024`](https://github.com/nyaruka/floweditor/pull/1024)

#### [v1.15.1](https://github.com/nyaruka/floweditor/compare/v1.15.0...v1.15.1)

> 9 November 2021
- Add mn and cs locale files [`#1025`](https://github.com/nyaruka/floweditor/pull/1025)
- Bump url-parse from 1.4.7 to 1.5.3 [`#1022`](https://github.com/nyaruka/floweditor/pull/1022)
- Bump ws from 5.2.2 to 5.2.3 [`#1021`](https://github.com/nyaruka/floweditor/pull/1021)
- Bump path-parse from 1.0.6 to 1.0.7 [`#1020`](https://github.com/nyaruka/floweditor/pull/1020)
- Bump tmpl from 1.0.4 to 1.0.5 [`#1019`](https://github.com/nyaruka/floweditor/pull/1019)
- Use child.status rather than child.run.status [`60ebf6e`](https://github.com/nyaruka/floweditor/commit/60ebf6e708fddd230c7371a91e9629935477dad3)

#### [v1.15.0](https://github.com/nyaruka/floweditor/compare/v1.14.4...v1.15.0)

> 5 November 2021
- Update validation for various router types [`#1018`](https://github.com/nyaruka/floweditor/pull/1018)

#### [v1.14.4](https://github.com/nyaruka/floweditor/compare/v1.14.3...v1.14.4)

> 6 October 2021
- Only show location router tests if locations feature flag set [`#1016`](https://github.com/nyaruka/floweditor/pull/1016)
- Update to latest temba-components [`89f1fee`](https://github.com/nyaruka/floweditor/commit/89f1fee971a2d06afc9d7b32d00b0fff487baf49)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@glific/flow-editor",
"license": "AGPL-3.0",
"repository": "git://github.com/glific/floweditor.git",
"version": "1.15.0-2",
"version": "1.17.0-1",
"description": "'Standalone flow editing tool designed for use within the Glific suite of messaging tools'",
"browser": "umd/flow-editor.min.js",
"unpkg": "umd/flow-editor.min.js",
Expand Down
5 changes: 4 additions & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@
<script>
var base = 'http://localhost:4000/flow-editor/';

const frontendUrl = window.location.origin;

var uuid = '3fa22108-f464-41e5-81d9-d8a298854429';
var config = {
flow: uuid,
Expand Down Expand Up @@ -229,7 +231,7 @@
templates: base + 'templates',
flows: base + 'flows',
revisions: base + 'revisions/' + uuid,
recents: base + 'recents',
recents: base + 'recents/',
languages: base + 'languages',
environment: base + 'environment',
recipients: base + 'recipients',
Expand All @@ -238,6 +240,7 @@
activity: base + 'activity',
validateMedia: base + 'validate-media',
interactives: base + 'interactive-templates',
contact: frontendUrl + '/chat/',

editor: '/',

Expand Down
6 changes: 0 additions & 6 deletions src/components/canvas/Canvas.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@

$background_offset: ($grid_size / 2) + ($node_padding) + px;

.canvas_container {
width: 100%;
height: 100vh;
overflow-y: auto;
}

.canvas_background {
padding-top: 60px;
padding-left: 20px;
Expand Down
1 change: 1 addition & 0 deletions src/components/counter/Counter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export default class Counter extends React.Component<CounterProps> {
private handleMouseEvent(event: React.MouseEvent<HTMLDivElement>, callback: () => void): void {
event.preventDefault();
event.stopPropagation();

if (callback) {
callback();
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/flow/Flow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ export class Flow extends React.PureComponent<FlowStoreProps, {}> {
onUpdatePositions={this.props.onUpdateCanvasPositions}
onLoaded={this.handleCanvasLoaded}
></Canvas>
<div id="activity_recent_messages"></div>
<div id="activity_recent_contacts"></div>
</div>
);
}
Expand Down
27 changes: 17 additions & 10 deletions src/components/flow/exit/Exit.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,19 @@
}
}

.recent_messages {
.recent_contacts {
width: 200px;
margin-top: 12px;
margin-top: -15px;
margin-left: -100px;
z-index: $z_recent_messages;
z-index: $z_recent_contacts;

background: $light_gray_2;
border-radius: $curvature;
box-shadow: 0px 1px 3px 1px rgba(130, 130, 130, 0.2);
background: transparent;

.container {
box-shadow: 0px 1px 3px 1px rgba(130, 130, 130, 0.2);
border-radius: $curvature;
background: $light_gray_2;
}

&.no_recents {
.title {
Expand All @@ -159,14 +163,17 @@
text-align: center;
}

.message {
.row {
text-align: left;
padding: 8px 10px;
.text {
font-size: 13px;
border-top: 1px solid $light_gray;

.operand {
padding-top: 3px;
font-size: 12px;
}

.sent {
.time {
padding-top: 3px;
font-size: 10px;
}
Expand Down
42 changes: 29 additions & 13 deletions src/components/flow/exit/Exit.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const categories = [{ uuid: createUUID(), name: 'Red', exit_uuid: exit.uuid }];
const exitProps: ExitProps = {
exit,
categories,
recentMessages: [],
recentContacts: [],
node: { uuid: createUUID(), actions: [], exits: [] },
showDragHelper: false,
translating: false,
Expand Down Expand Up @@ -42,9 +42,17 @@ describe(ExitComp.name, () => {
<>
<ExitComp
{...exitProps}
recentMessages={[
{ text: 'Hi Mom!', sent: new Date().toUTCString() },
{ text: 'Hi Dad!', sent: new Date().toUTCString() }
recentContacts={[
{
contact: { uuid: 'eaea6433-d423-41dd-94a9-075de20f322d', name: 'Jim' },
operand: 'Hi Mom!',
time: new Date().toUTCString()
},
{
contact: { uuid: 'f781f594-af8b-4493-b67c-2421bf2d4625', name: 'Bob' },
operand: 'Hi Dad!',
time: new Date().toUTCString()
}
]}
/>
</>
Expand All @@ -53,21 +61,29 @@ describe(ExitComp.name, () => {
// give our portal a chance to mount
jest.runAllTimers();

// we have activity but we can't see our recent messages yet
// we have activity but we can't see our recent contacts yet
getByText('1,000');
expect(baseElement).toMatchSnapshot(baseElement);
});

it('shows recent messages on mouse over', () => {
it('shows recent contacts on mouse over', () => {
const { baseElement, getByText, queryAllByText } = render(
<>
<div id="activity_recent_messages"></div>
<div id="activity_recent_contacts"></div>

<ExitComp
{...exitProps}
recentMessages={[
{ text: 'Hi Mom!', sent: new Date().toUTCString() },
{ text: 'Hi Dad!', sent: new Date().toUTCString() }
recentContacts={[
{
contact: { uuid: 'eaea6433-d423-41dd-94a9-075de20f322d', name: 'Jim' },
operand: 'Hi Mom!',
time: new Date().toUTCString()
},
{
contact: { uuid: 'f781f594-af8b-4493-b67c-2421bf2d4625', name: 'Bob' },
operand: 'Hi Dad!',
time: new Date().toUTCString()
}
]}
/>
</>
Expand All @@ -76,14 +92,14 @@ describe(ExitComp.name, () => {
// give our portal a chance to mount
jest.runAllTimers();

// now we need to mouse over our activity to see recent messages
// now we need to mouse over our activity to see recent contacts
const activity = getByText('1,000');
expect(queryAllByText('Recent Messages').length).toEqual(0);
expect(queryAllByText('Recent Contacts').length).toEqual(0);

fireEvent.mouseEnter(activity);
jest.runAllTimers();

expect(queryAllByText('Recent Messages').length).toEqual(1);
expect(queryAllByText('Recent Contacts').length).toEqual(1);
getByText('Hi Mom!');
getByText('Hi Dad!');
expect(baseElement).toMatchSnapshot();
Expand Down
Loading

0 comments on commit 222efab

Please sign in to comment.