Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angular 16 #425

Open
wants to merge 31 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
9497e18
Update TypeScript version and add ng-update
lukestanley Jan 9, 2024
9349fa1
Updates Angular dependencies and remove unused CanDeactivate import
lukestanley Jan 9, 2024
8155eff
Angular 16 update: up eslint
okasen Aug 2, 2023
c96d57d
Angular 16 update: up cdk
okasen Aug 2, 2023
9e0ec1a
Angular 16 update: update Material library
okasen Aug 2, 2023
8d41450
Angular 16 Upgrade: Get frontend working, flow and query builders sti…
okasen Aug 11, 2023
0e083ca
Angular 16: Remove legacy materials
Aug 14, 2023
310a5a4
Fixes Monaco-editor use by using v2 wrapper with correct path to stat…
lukestanley Sep 18, 2023
6866f16
Switch @materia-ui/ngx-monaco-editor to ngx-monaco-editor-v2, configu…
lukestanley Dec 21, 2023
b100220
Fixes Cypress tests with settings button click - enable force click, …
lukestanley Dec 21, 2023
03db6d5
Cypress gosub bug fix (changed selector)
lukestanley Dec 21, 2023
eb8ee66
Prevent Cypress warning by naming mock
lukestanley Jan 8, 2024
7547a55
Force Cypress to click "hidden" areas
lukestanley Jan 8, 2024
e2083d5
FIXME: Ignores REAL error of MatFormField placeholder text not popula…
lukestanley Jan 8, 2024
b8655c2
Names intercept mock to avoid Cypress warning
lukestanley Jan 8, 2024
d3aa5db
Clarifies that a mock is used
lukestanley Jan 8, 2024
7ad2226
Fix: Renames old Formly validation property
lukestanley Jan 8, 2024
22169ce
Allows Lodash CommonJS property tidy console warnings
lukestanley Jan 8, 2024
f01496a
Work around reactivity problem by pressing button and tries fixing co…
lukestanley Jan 8, 2024
2db5994
Disables broken confirm test
lukestanley Jan 8, 2024
648eda6
Update zone.js and adds back package lock
lukestanley Jan 9, 2024
7a1dc12
Reverting automated prettier changes to reduce non-needed changes
lukestanley Jan 11, 2024
9698154
Fix Ag Grid UI and custom component render (#447)
gsambrotta Feb 13, 2024
9128574
Convert "Workflow" text to "Flow" (#451)
gsambrotta Feb 29, 2024
2d028c8
Migrate angular MUI to MDC components (#454)
gsambrotta Mar 4, 2024
dd2bed0
upate package.json
gsambrotta Mar 6, 2024
e3af7a7
remove force:true from click (#457)
gsambrotta Mar 6, 2024
0f6669e
fix style in Audio control component
gsambrotta Mar 13, 2024
db2380e
clean up track-clip directive, fix resizable and draggable
gsambrotta Mar 22, 2024
4195bfa
fix draggable, use ngOnInit
gsambrotta Mar 25, 2024
16fcaf1
fix spinner UI on page loading and on HTTP load
gsambrotta Mar 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"allowedCommonJsDependencies": [
"lodash"
],
"outputPath": "dist",
"index": "src/index.html",
"main": "src/main.ts",
Expand All @@ -33,11 +36,7 @@
"src/mstile-150x150.png",
"src/assets",
"src/manifest.json",
{
"glob": "**/*",
"input": "node_modules/ngx-monaco-editor/assets/monaco",
"output": "./assets/monaco/"
}
{ "glob": "**/*", "input": "node_modules/monaco-editor", "output": "/assets/monaco/" }
],
"styles": [
"node_modules/@fortawesome/fontawesome-free/css/all.css",
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/context_and_state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ describe('Kendraio context and state', () => {
loadFlowCode([
{
"type": "context-save",
"valueGetter": "`true`",
"valueGetter": "`false`",
"contextKey": "state.global.disabled",
},
{
Expand Down
6 changes: 3 additions & 3 deletions cypress/e2e/gosub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,21 @@ describe('Subroutine workflow block', () => {
"workflowId": "madeUpFlowIDA"
}
]);
cy.get('mat-toolbar > button mat-icon').contains('settings').click();
cy.get('[data-cy="toolbar-setting-button"]').click();
cy.get("#mat-expansion-panel-header-0").click();
// cy.pause();
cy.get("#mat-input-0")
.clear()
.type("s")
.type("o")
.get(".mat-option-text", { timeout: 1000 })
.get("mat-option", { timeout: 1000 })
.contains("someAdapterB");
cy.get("#mat-input-0")
.clear()
.type("someAdapterB")
.get("#mat-input-1")
.clear()
.get(".mat-option-text", { timeout: 1000 })
.get("mat-option", { timeout: 1000 })
.contains("madeUpFlowIDB");
});

Expand Down
6 changes: 3 additions & 3 deletions cypress/e2e/share.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ describe('Share functionality', () => {
cy.contains('Rishi');

// Now we press the share button, and select share database:
cy.get('mat-icon').contains("settings").click();
cy.get('mat-icon').contains("share").click();
cy.get('button:contains("Share database")').click();
cy.get('[data-cy="toolbar-setting-button"]').click();
cy.get('[data-cy="sidenav-share-button"]').click();
cy.get('[data-cy="dialog-share-shareDatabase"]').click();

// assert shareValue is in the databaseUrl
cy.get('app-show-share-link-dialog textarea').should('contain', databaseUrl);
Expand Down
44 changes: 24 additions & 20 deletions cypress/e2e/spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('workspace-project App', () => {


// Prevent external network requests for fonts with empty CSS rule
cy.intercept('https://fonts.googleapis.com/**', "*{ }");
cy.intercept('https://fonts.googleapis.com/**', "*{ }").as('emptyFonts');

});

Expand Down Expand Up @@ -51,13 +51,13 @@ describe('workspace-project App', () => {
cy.get('app-root mat-toolbar').contains('menu').click();
cy.contains('Flow Builder').click();
cy.contains('settings');
cy.get('mat-toolbar > button mat-icon').contains('settings').click();
cy.get('[data-cy="toolbar-setting-button"]').click();
cy.get('app-workflow-sidenav').contains('delete_forever').click().get('app-workflow-sidenav').contains('Mapping').should('not.exist');
cy.get('app-workflow-sidenav').contains('Add Task').click();
cy.get('[data-cy="blocks-editor-add-task"]').click();
cy.contains('Select Task');
cy.get('mat-dialog-container').contains('Mapping').click();
cy.get('app-add-block-dialog .mat-dialog-actions').contains('Add Task').click();
cy.get('app-workflow-sidenav').contains('Mapping');
cy.get('[data-cy="dialog-addBlock-addTask-button"]').click();
cy.get('button').contains('Mapping');
});


Expand All @@ -69,10 +69,10 @@ describe('workspace-project App', () => {
"blockComment": "testingComment",
}
]);
cy.get('mat-toolbar > button mat-icon').contains('settings').click();
cy.get('[data-cy="toolbar-setting-button"]').click();
cy.get('app-workflow-sidenav').contains('testingComment').should('exist');
cy.get('app-workflow-sidenav').contains('testingComment').click();
cy.get('app-workflow-sidenav').contains('Block Comment');
cy.get('app-workflow-sidenav').contains('testingComment').click();
// cy.get('app-workflow-sidenav').contains('Block Comment'); // FIXME: regression - MatFormField placeholder text is not visible
gsambrotta marked this conversation as resolved.
Show resolved Hide resolved
});


Expand All @@ -83,7 +83,7 @@ describe('workspace-project App', () => {
"blockComment": "testingComment first line\nComment line2",
}
]);
cy.get('mat-toolbar > button mat-icon').contains('settings').click();
cy.get('[data-cy="toolbar-setting-button"]').click();
cy.get('app-workflow-sidenav').contains('testingComment').should('exist');
cy.get('app-workflow-sidenav').contains('line2').should('not.exist');
cy.get('app-workflow-sidenav').contains('testingComment').click();
Expand All @@ -102,27 +102,31 @@ describe('workspace-project App', () => {

cy.intercept('GET', 'https://app.kendra.io/api/workflowCloud/listWorkflows', {
fixture: 'listWorkflowsFlow.json'
});
}).as('listWorkflowsFlow.json');

cy.intercept('GET', 'https://app.kendra.io/api', {
fixture: 'flowList.json'
}
).as('flowList.json');

cy.visit('/workflowCloud/listWorkflows');
cy.contains('Submit').click();
Copy link
Member Author

Choose a reason for hiding this comment

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

I made an issue for this change: #429
It might be a complex and tricky "can of worms".

cy.contains('Made up flow A');
});


/*
it('should prevent a user from leaving the flow when it flow has been modified', () => {
cy.intercept('https://app.kendra.io/api/core/dashboard', { fixture: 'dashboardHomeFlow.json' });
//cy.intercept('https://app.kendra.io/api/core/dashboard', { fixture: 'dashboardHomeFlow.json' });
cy.intercept('GET', 'https://app.kendra.io/api/TESTING/dummy1', {
fixture: 'dummyWorkflow1.json'
}
).as('workflow.json');
let count = 0;
// intercept the request to confirm navigation
// cancel the first attempt and then accept the next attemp



cy.on('window:confirm', (str) => {
count += 1;
if (count === 1) {
Expand All @@ -138,27 +142,27 @@ describe('workspace-project App', () => {
});
cy.contains('Dummy Workflow 1').should('be.visible', { timeout: 10000 });
cy.contains('settings');
cy.get('mat-toolbar > button mat-icon').contains('settings').click();
cy.get('mat-toolbar > button mat-icon').contains('settings').click({force: true});

cy.get('app-workflow-sidenav').contains('Add Task').click();
cy.get('app-workflow-sidenav').contains('Add Task').click({force: true});
cy.contains('Select Task');
cy.get('mat-dialog-container').contains('Mapping').click();
cy.get('app-add-block-dialog .mat-dialog-actions').contains('Add Task').click();
cy.get('mat-dialog-container').contains('Mapping').click({force: false});
cy.get('app-workflow-sidenav').contains('Add Task').click({force: true});

cy.get('app-root mat-toolbar').contains('menu').click();
cy.get('app-root mat-toolbar').contains('menu').click({force: true});
// click in the menu to navigate away
cy.contains('Dashboard').click();
cy.contains('Dashboard').click({force: true});
// confirm that we're not on the dashboard
cy.location().should((loc) => {
expect(loc.pathname).to.eq('/TESTING/dummy1');
});
// try again
cy.contains('Dashboard').click();
cy.contains('Dashboard').click({force: true});
// this time we got there
cy.location().should((loc) => {
expect(loc.pathname).to.eq('/dashboard');
});
})

*/
Copy link
Member Author

Choose a reason for hiding this comment

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

Need an issue for this too.

Copy link
Member Author

Choose a reason for hiding this comment

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

Now there is an issue for it: #428

Copy link
Collaborator

Choose a reason for hiding this comment

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

Add the issue to the code comment?


});
196 changes: 195 additions & 1 deletion cypress/fixtures/listWorkflowsFlow.json
Original file line number Diff line number Diff line change
@@ -1 +1,195 @@
{"blocks":[{"type":"init"},{"type":"variable-get","name":"filterTag"},{"type":"mapping","mapping":"(type(data)=='string' && data!='--none--') && data"},{"type":"template","template":"{{#if data}}Filtering by tag: <strong>{{data}}</strong>{{/if}}"},{"type":"context-save","contextKey":"filterTag"},{"type":"mapping","mapping":"{ \"term\":\" \", \"displayHidden\":false}"},{"type":"form","hasSubmit":false,"emitOnInit":true,"jsonSchema":{"type":"object","properties":{"term":{"type":"string","title":"Search term","default":""},"displayHidden":{"type":"boolean","title":"Show hidden","default":false}}},"uiSchema":{}},{"type":"context-save","contextKey":"search"},{"type":"http","method":"get","endpoint":"https://app.kendra.io/api"},{"type":"mapping","mapping":"context.search.term!=null && data[?contains(toLower(title), toLower(trim($.context.search.term))) || contains(toLower(adapterName), toLower(trim($.context.search.term)))] || data"},{"type":"mapping","mapping":"data[?$.context.search.displayHidden || !(tags[?@ == 'hidden'])]"},{"type":"mapping","mapping":"context.filterTag && data[?(tags[?@ == $.context.filterTag])] || data"},{"type":"grid","passThrough":true,"gridOptions":{"pagination":true,"paginationPageSize":15,"defaultColDef":{"sortable":true,"resizable":true}},"columnDefs":[{"headerName":"Title","field":"title","width":300,"filter":true},{"headerName":"Operations","cellRenderer":"workflowRenderer","cellRendererParams":{"blocks":[{"type":"actions","buttons":[{"label":"Launch","blocks":[{"type":"launch","valueGetters":{"adapter":"data.adapterName","workflowId":"data.id"}}]}]}]}},{"headerName":"Workflow ID","field":"id"},{"headerName":"Adapter","field":"adapterName","filter":true},{"headerName":"Modified","field":"modified","sort":"desc","valueFormatter":"formatDate(value, 'ff')"},{"headerName":"tags","field":"tags"}]},{"type":"mapping","mapping":"data && uniq(data[*].tags[])"},{"type":"mapping","mapping":"[data,['--none--']][]"},{"type":"mapping","mapping":"data && { form: set(`{\r\n \"type\": \"form\",\r\n \"jsonSchema\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"tag\": {\r\n \"title\": \"Tag\",\r\n \"description\": \"Select a tag to filter by\",\r\n \"type\": \"string\",\r\n \"enum\": [\"1\"] \r\n }\r\n }\r\n },\r\n \"uiSchema\": { \r\n }\r\n}`, 'jsonSchema.properties.tag.enum', data) }"},{"type":"mapping","mapping":"context.filterTag!='--none--' && merge(data,{tag:$.context.filterTag}) || data"},{"type":"form","hasSubmit":false,"label":"Filter","emitOnInit":false,"schemaGetter":{"blocks":[{"type":"mapping","mapping":"data.form"}]}},{"type":"actions","buttons":[{"label":"Filter","color":"default","blocks":[{"type":"variable-set","name":"filterTag","notify":false,"valueGetter":"data.tag"},{"type":"dispatch","action":"refreshWorkflow"}]}]}],"id":"listWorkflows","workflowId":"listWorkflows","adapterName":"workflowCloud","created":"2021-11-19T16:58:04.556Z","tags":["start"],"updated":"2021-11-19T16:58:04.555Z","modified":"2021-11-19T16:58:04.555Z","title":"List Workflows"}
{
"blocks": [
{
"type": "init",
"blockComment": "Mocked"
gsambrotta marked this conversation as resolved.
Show resolved Hide resolved
},
{
"type": "variable-get",
"name": "filterTag"
},
{
"type": "mapping",
"mapping": "(type(data)=='string' && data!='--none--') && data"
},
{
"type": "template",
"template": "{{#if data}}Filtering by tag: <strong>{{data}}</strong>{{/if}}"
},
{
"type": "context-save",
"contextKey": "filterTag"
},
{
"type": "mapping",
"mapping": "{ \"term\":\" \", \"displayHidden\":false}"
},
{
"type": "form",
"hasSubmit": true,
Copy link
Member Author

Choose a reason for hiding this comment

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

Added the submit button to avoid state bug.

Copy link
Member Author

Choose a reason for hiding this comment

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

Again, a related issue was made for this:
#429

"emitOnInit": true,
"jsonSchema": {
"type": "object",
"properties": {
"term": {
"type": "string",
"title": "Search term",
"default": ""
},
"displayHidden": {
"type": "boolean",
"title": "Show hidden",
"default": false
}
}
},
"uiSchema": {}
},
{
"type": "context-save",
"contextKey": "search"
},
{
"type": "http",
"method": "get",
"endpoint": "https://app.kendra.io/api"
},
{
"type": "mapping",
"mapping": "context.search.term!=null && data[?contains(toLower(title), toLower(trim($.context.search.term))) || contains(toLower(adapterName), toLower(trim($.context.search.term)))] || data"
},
{
"type": "mapping",
"mapping": "data[?$.context.search.displayHidden || !(tags[?@ == 'hidden'])]"
},
{
"type": "mapping",
"mapping": "context.filterTag && data[?(tags[?@ == $.context.filterTag])] || data"
},
{
"type": "grid",
"passThrough": true,
"gridOptions": {
"pagination": true,
"paginationPageSize": 15,
"defaultColDef": {
"sortable": true,
"resizable": true
}
},
"columnDefs": [
{
"headerName": "Title",
"field": "title",
"width": 300,
"filter": true
},
{
"headerName": "Operations",
"cellRenderer": "workflowRenderer",
"cellRendererParams": {
"blocks": [
{
"type": "actions",
"buttons": [
{
"label": "Launch",
"blocks": [
{
"type": "launch",
"valueGetters": {
"adapter": "data.adapterName",
"workflowId": "data.id"
}
}
]
}
]
}
]
}
},
{
"headerName": "Workflow ID",
"field": "id"
},
{
"headerName": "Adapter",
"field": "adapterName",
"filter": true
},
{
"headerName": "Modified",
"field": "modified",
"sort": "desc",
"valueFormatter": "formatDate(value, 'ff')"
},
{
"headerName": "tags",
"field": "tags"
}
]
},
{
"type": "mapping",
"mapping": "data && uniq(data[*].tags[])"
},
{
"type": "mapping",
"mapping": "[data,['--none--']][]"
},
{
"type": "mapping",
"mapping": "data && { form: set(`{\r\n \"type\": \"form\",\r\n \"jsonSchema\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"tag\": {\r\n \"title\": \"Tag\",\r\n \"description\": \"Select a tag to filter by\",\r\n \"type\": \"string\",\r\n \"enum\": [\"1\"] \r\n }\r\n }\r\n },\r\n \"uiSchema\": { \r\n }\r\n}`, 'jsonSchema.properties.tag.enum', data) }"
},
{
"type": "mapping",
"mapping": "context.filterTag!='--none--' && merge(data,{tag:$.context.filterTag}) || data"
},
{
"type": "form",
"hasSubmit": false,
"label": "Filter",
"emitOnInit": false,
"schemaGetter": {
"blocks": [
{
"type": "mapping",
"mapping": "data.form"
}
]
}
},
{
"type": "actions",
"buttons": [
{
"label": "Filter",
"color": "default",
"blocks": [
{
"type": "variable-set",
"name": "filterTag",
"notify": false,
"valueGetter": "data.tag"
},
{
"type": "dispatch",
"action": "refreshWorkflow"
}
]
}
]
}
],
"id": "listWorkflows",
"workflowId": "listWorkflows",
"adapterName": "workflowCloud",
"created": "2021-11-19T16:58:04.556Z",
"tags": [
"start"
],
"updated": "2021-11-19T16:58:04.555Z",
"modified": "2021-11-19T16:58:04.555Z",
"title": "List Workflows"
}
3 changes: 2 additions & 1 deletion cypress/fixtures/workflow-cloud.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"blocks": [
{
"type": "init"
"type": "init",
"blockComment": "Mocked"
},
{
"type": "variable-get",
Expand Down
Loading
Loading