Skip to content

Commit

Permalink
UI rename of Workflows to Flows in lots of places
Browse files Browse the repository at this point in the history
Merge pull request #378 from kendraio/flows_not_workflows
  • Loading branch information
lukestanley committed Aug 22, 2023
2 parents 8df9b79 + 0541699 commit 129c3a8
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 22 deletions.
2 changes: 1 addition & 1 deletion cypress/e2e/share.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('Share functionality', () => {
const flowUrl = "/workflow-builder?data=NobwRALgngDgpmAXGA5gewM4FcBGYA0YAhgCZEwRwBOAckQLYLIYDGAFnPURgWAO5oqAawBmAGzR8AkiSRhWHLj0I4JLIQGE09RgDsIcgDJpSAAgWduYAL75w0eHICWupwdv3YTSJxhiilLyU9H4B3gA8bABMAHwAIgFEONxwpixo nD6GOEA9NExNnaQXnJcMDAuKLzllbrVyGQQRMAA-FhYTiQAvN0ABnAA7ERRAIyjAMwkALQ4cEPTACwADCQzAJwArNvTROsAbPuLIgAcEyKjyX0AuqYAPqbAy9e8qmjqWjpZBsgAYk5iShUczsSymCBoUxYKhiUwwIhUBhFTyOZDpTIADwg0wwRAAbghCOjKFiANJwKByCxcV5qTTaPQ-eT41JoaHmeAsJwiJwsEGKIjIkqosCMDC4lCEyBuMTeQxODAQUxuTgYUwiKjafmWRCmEAgNIZEkQAB01KIJt0DFS1msQoc3hIeEIaHgiIgTgycklBkIpHIQLojCpoKUvHNAHE4BAgXJiXAsWbQxarcGVHTPoyjCYSKYmkR1Zr6NqaR5hd5alUauQ6g0wPngNcTYwqJKABQAAXwetM-jmYl1Ps73YAJCb44nzSa 3AxABKaxz2nvelffRyKNKiAcUwAHWlEFl 9M9tKjTgOCw1Rd8F0SFGhAwbEkCWaSAgVCwcEfz74WkxPwiEQYgYN 8i-gAys0gSIEBIFwGWDrelQXS8CgKEkAA8hQnq6DwiDgPCKAuAEuHvp YFESRHoZAACkQkoQU4ABeTArLYYDpGIWD0LocRwCI GgGAHCkNQQZykks68Dys6yMgM5iEKokkOJ1pyNh1CkRkyicbOYgAEpZKpVDUHIAjCOIkhGboJlmUS k2XZVD0Yi9D4eAbzqEJKLeEQLA0XhrxYDGOlIMJilyAAoiQbjLt54W XI-hYLo7C8P6FBmcwya6RZogSNI8lgHAsUQFIwS8BOPzgOaMhxkaCamgAjl VBQK5DAYEmAr1YQqGNIkJodKhtrXIQWRJLK8kfl 1jXPNtrFCpanBsgUhxDJThyXII2yPN6Yrpm3xyKeIr YFumXqFQWIBFUlKcgACCaymBVnBVWgEhUHIqlAVggLxUIPnlslRCpelfpkFlP05QKeWCAVkj1cgpVuO99CfQBSC1cmKOcY1iatdQHUIl1PWWH1YADWAe1tkuY0TVaqileRc3FJFyDyoqpjAbC5pXXSINIQp4NpWwGXQ7GcOWAjlmFfjYgKu440lcz01swhqteauWbIGd3joNgzrEFLq3eE4ISCLGhD5VZRVyCIaBoDbYA68d65-M7QK7ne81AA";

cy.visit(databaseUrl)
.contains("Workflow");
.contains("Flow");
cy.on('window:confirm', () => true);

cy.wait(3000);
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe('workspace-project App', () => {
cy.visit('/workflow-builder');
cy.contains('menu');
cy.get('app-root mat-toolbar').contains('menu').click();
cy.contains('workflow builder').click();
cy.contains('Flow Builder').click();
cy.contains('settings');
cy.get('mat-toolbar > button mat-icon').contains('settings').click();
cy.get('app-workflow-sidenav').contains('delete_forever').click().get('app-workflow-sidenav').contains('Mapping').should('not.exist');
Expand Down
2 changes: 1 addition & 1 deletion cypress/support/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import dexie from 'dexie';
export function loadFlowCode(blocks: Array<{ [key: string]: any }>): void {
const compressed = LZS.compressToEncodedURIComponent(JSON.stringify(blocks));
const url = `/workflow-builder?data=${compressed}`;
cy.visit(url).contains('Workflow');
cy.visit(url).contains('Flow');
}

/**
Expand Down
4 changes: 2 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Kendraio App

.. toctree::
:maxdepth: 2
:caption: Workflow Builder
:caption: Flow Builder (previously Workflow Builder)

workflow/intro
workflow/sharing
Expand All @@ -35,7 +35,7 @@ Kendraio App

.. toctree::
:maxdepth: 1
:caption: Workflow Blocks Reference
:caption: Flow Blocks Reference (previously Workflow Blocks Reference)

workflow/blocks/actions
workflow/blocks/adapter_info
Expand Down
10 changes: 6 additions & 4 deletions functions/src/handlers/workflow-cloud.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { userHash } from '../utils/get-hash';

const crypto = require('crypto');

const DEFAULT_ADAPTER_NAME = 'Adapter name';

const makeHash = (secret, salt) => {
return new Promise((resolve, reject) => {
crypto.scrypt(secret, salt, 64, (err, derivedKey) => {
Expand Down Expand Up @@ -51,7 +53,7 @@ function appFactory({db, auth}: { db: any, auth: admin.auth.Auth }) {
const now = new Date().toISOString();
return await db
.collection('adapters')
.doc(adapterName || 'UNKNOWN')
.doc(adapterName || DEFAULT_ADAPTER_NAME)
.collection('workflows')
.doc(workflowId || fakeId())
.set({
Expand Down Expand Up @@ -83,7 +85,7 @@ function appFactory({db, auth}: { db: any, auth: admin.auth.Auth }) {
workflowId: doc.id,
tags: doc.data().tags,
title: doc.data().title,
adapterName: doc.data().adapterName || 'UNKNOWN',
adapterName: doc.data().adapterName || DEFAULT_ADAPTER_NAME,
created: doc.data().created,
updated: doc.data().updated,
modified: doc.data().updated
Expand Down Expand Up @@ -144,7 +146,7 @@ function appFactory({db, auth}: { db: any, auth: admin.auth.Auth }) {
workflowId: doc.id,
title: doc.data().title,
tags: doc.data().tags,
adapterName: doc.data().adapterName || 'UNKNOWN',
adapterName: doc.data().adapterName || DEFAULT_ADAPTER_NAME,
created: doc.data().created,
updated: doc.data().updated,
modified: doc.data().updated
Expand All @@ -165,7 +167,7 @@ function appFactory({db, auth}: { db: any, auth: admin.auth.Auth }) {
workflowId: doc.id,
title: doc.data().title,
tags: doc.data().tags,
adapterName: doc.data().adapterName || 'UNKNOWN',
adapterName: doc.data().adapterName || DEFAULT_ADAPTER_NAME,
created: doc.data().created,
updated: doc.data().updated,
modified: doc.data().updated
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<p>
Title: {{ workflow.title }}<br>
Adapter: {{ workflow.getAdapterName() }}<br>
Workflow ID: {{ workflow.id }}<br>
Flow ID: {{ workflow.id || 'Flow ID' }}<br>
Tags: {{ workflow.tags.join(', ') }}
</p>
</mat-card>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class BlocksBuilderPageComponent implements OnInit {
) { }

ngOnInit() {
this.pageTitle.setTitle('Workflow', true);
this.pageTitle.setTitle('Flow', true);
this.adapters.adaptersReady$.pipe(
filter(Boolean),
take(1)
Expand Down
18 changes: 10 additions & 8 deletions src/app/services/workflow.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import { camelCase } from 'lodash-es';
import {ConnectionManagerService} from './connection-manager.service';
import {WorkflowRepoService} from './workflow-repo.service';

const DEFAULT_ADAPTER_NAME = 'Adapter name';

@Injectable({
providedIn: 'root'
})
Expand Down Expand Up @@ -58,13 +60,13 @@ export class WorkflowService {
const urlData = this.shareLinks.getData();
if (urlData && isArray(urlData)) {
this.blocks = urlData;
this.initWorkflow({ title: 'Workflow', blocks: urlData, context: {}, tags: [] }, true);
this.initWorkflow({ title: 'Flow name', blocks: urlData, context: {}, tags: [] }, true);
}
}

loadState() {
const state = JSON.parse(localStorage.getItem('kendraio-workflow-state'));
const title = get(state, 'title', 'Workflow');
const title = get(state, 'title', 'Flow name');
const blocks = get(state, 'blocks', []);
const context = get(state, 'context', {});
const tags = get(state, 'tags', []);
Expand Down Expand Up @@ -100,7 +102,7 @@ export class WorkflowService {
clearBlocks() {
this.blocks = [];
this.id = '';
this.title = 'Workflow';
this.title = 'Flow';
set(this.context, 'app.adapterName', undefined);
this.saveState();
this.router.navigate(['/workflow-builder']);
Expand Down Expand Up @@ -138,7 +140,7 @@ export class WorkflowService {
tags: get(config, 'tags', [])
});
this.id = get(config, 'id');
set(this.context, 'app.adapterName', get(config, 'adapterName', 'UNKNOWN'));
set(this.context, 'app.adapterName', get(config, 'adapterName', DEFAULT_ADAPTER_NAME));
this.saveState();
});
}
Expand Down Expand Up @@ -191,7 +193,7 @@ export class WorkflowService {
saveToAdapter() {
this.localData['workflows']
.where('[adapterName+workflowId]')
.equals([this.getAdapterName() || 'UNKNOWN', this.id])
.equals([this.getAdapterName() || DEFAULT_ADAPTER_NAME, this.id])
.modify({ blocks: this.blocks, title: this.title, workflowId: this.id, modified: true })
.then(() => {
this.localData['adapters'].get(this.getAdapterName()).then(adapter => {
Expand Down Expand Up @@ -231,7 +233,7 @@ export class WorkflowService {
// console.log(values);
const blocks = get(values, 'blocks', []);
const tags = get(values, 'tags', []);
const title = get(values, 'title', 'Workflow');
const title = get(values, 'title', 'Flow');
this.initWorkflow({ title, blocks, context: {}, tags });
this.id = get(values, 'id');
this.tags = get(values, 'tags', []);
Expand All @@ -249,7 +251,7 @@ export class WorkflowService {
});
dialogRef.afterClosed().subscribe(values => {
if (!!values) {
this.title = get(values, 'title', 'Workflow');
this.title = get(values, 'title', 'Flow');
this.id = get(values, 'id');
this.tags = get(values, 'tags');
set(this.context, 'app.adapterName', get(values, 'adapterName', this.getAdapterName()));
Expand All @@ -260,7 +262,7 @@ export class WorkflowService {
}

getAdapterName() {
return get(this.context, 'app.adapterName', 'UNKNOWN');
return get(this.context, 'app.adapterName', 'Adapter name');
}

getWorkflowId() {
Expand Down
6 changes: 3 additions & 3 deletions src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@
"upload": {
"title": "Upload"
},
"wfBuilder": "workflow builder",
"wfBuilder": "Flow Builder",
"workflowCloud": {
"menuTitle": "Workflow Cloud",
"pageTitle": "Build Your Workflow"
"menuTitle": "Flow Cloud",
"pageTitle": "Build Your Flow"
},
"queryBuilder": {
"menuTitle": "Query Builder",
Expand Down

1 comment on commit 129c3a8

@vercel
Copy link

@vercel vercel bot commented on 129c3a8 Aug 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

kendraio-app – ./

kendraio-app-git-develop-kendraio.vercel.app
kendraio-app-kendraio.vercel.app

Please sign in to comment.