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

Angular 16 #425

wants to merge 31 commits into from

Conversation

lukestanley
Copy link
Member

@lukestanley lukestanley commented Jan 9, 2024

This upgrades to Angular 16, now it's Ivy engine is in use, bringing along various changes and enhancements to the existing codebase.

The key highlights include:

Upgrading Angular dependencies.

Material UI Components Update: Accompanying the Angular upgrade, the Material UI components have been updated to their latest versions. This update involved replacing legacy Material components with their current counterparts, ensuring a smoother UI experience and compatibility with Angular 16.

Form and Query Builders fix - Monaco Editor package switch: A significant change in this PR is the switch from @materia-ui/ngx-monaco-editor to ngx-monaco-editor-v2. This change was because the old materia-ui package had no compatible update available, there were runtime errors encountered with Angular 16 that broke the Form and Query Builders. Fixing Monaco Editor path issue - the configuration for Monaco Editor has been adjusted so it can load properly also.

Cypress Test Adjustments: To adapt to the changes in the UI components and the new Angular version, several Cypress tests have been modified. This includes updates to selectors and the introduction of forced clicks in scenarios where elements were being obscured, thereby addressing test failures post-upgrade. Some of these changes might be revereted now Cypress has been upgraded, they might not be needed!

Code Refinements and Cleanup: Prettifier / linting changes (sorry! I didn't do it! I reverted some for readability but there are a lot!), removal of unused imports like CanDeactivate from Angular Router, updates to TypeScript versions.

Correcting outdated Formly validation properties.

CommonJS compilation bailout warnings: To resolve console warnings I added a Lodash to an allowed list. More resources may need adding if similar warnings still show.

I cherry-picked the commits on top of develop and resolved some merge conflicts ahead of time.

A way to re-do the same linting / "prettifier" changes on develop could help reduce the diff. So far, I wasn't able to figure out how to do that in a way that gives the same results.

One key concern is that state reactivity issues in Flows may be happening more often than before, this is a possible regression. See this issue.

Copy link

vercel bot commented Jan 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
kendraio-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 25, 2024 8:39pm

@lukestanley lukestanley changed the base branch from develop-linted to develop January 9, 2024 17:00
// 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?

{
"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

@lukestanley lukestanley marked this pull request as ready for review January 11, 2024 10:08
@lukestanley lukestanley changed the title Angular 16 picked Angular 16 Jan 11, 2024

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".

Copy link
Collaborator

@gsambrotta gsambrotta left a comment

Choose a reason for hiding this comment

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

Yeyyy!!! 🎉 🎉 🎉
Well done @lukestanley, amazing work 👏 👏 👏

Code wise, it looks pretty good to me. I left some minor comments.

About the UI test, I am checking the vercel url: https://kendraio-app-git-angular-16-kendraio.vercel.app

1_ Here: https://kendraio-app-git-angular-16-kendraio.vercel.app/connect they UI looks different then in the production app. I also don't see the "Connect" button.
2_ Grid header and Button label seems to have a different font: https://kendraio-app-git-angular-16-kendraio.vercel.app/core/adapters.
3_ Sidemenu items are back to be label Workflow instead of Flow
5_ Grid design is different and I would say less good looking then what we had previously
6_ When I go to Flow Cloud I do not see the flows at the first render. I do see the flows if I search for them.
7_ Flow cloud flows do not have a "Launch" button so I cannot open them
8_ Some design is off like this
image
image
image

@@ -7,15 +7,16 @@ import { EDITOR_OPTIONS } from './editor-options';
import JSONFormatter from 'json-formatter-js';
import {get, has, isString} from 'lodash-es';
import {BehaviorSubject} from 'rxjs';
import '@angular/material/tooltip';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this imported here? Was previously part of the MatDialog and now they are separate?

Copy link
Collaborator

Choose a reason for hiding this comment

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

If so, why is not also imported in the below file settings-page-component.ts, where the same MatDialog is used?

}

@import "~@fortawesome/fontawesome-free/css/all.css";
@import "@fortawesome/fontawesome-free/css/all.css";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is correct that the first world is @fortawesome? Is a mistype from the fontawesome team ? :D

package.json Show resolved Hide resolved
@@ -24,7 +24,7 @@ describe('Subroutine workflow block', () => {
"workflowId": "madeUpFlowIDA"
}
]);
cy.get('mat-toolbar > button mat-icon').contains('settings').click();
cy.get('mat-toolbar > button mat-icon').contains('settings').click({force: true});
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we need this force: 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.

We may not with the new Cypress version! I need to check.

cypress/e2e/spec.ts Show resolved Hide resolved
cypress/fixtures/listWorkflowsFlow.json Show resolved Hide resolved
// this time we got there
cy.location().should((loc) => {
expect(loc.pathname).to.eq('/dashboard');
});
})

*/
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?

src/app/channels/channels.module.ts Outdated Show resolved Hide resolved
@lukestanley
Copy link
Member Author

lukestanley commented Jan 12, 2024

Yeyyy!!! 🎉 🎉 🎉 Well done @lukestanley, amazing work 👏 👏 👏

Thanks! Not all me, of course!

Code wise, it looks pretty good to me. I left some minor comments.
Thanks, I'll work my way through them.

About the UI test, I am checking the vercel url: https://kendraio-app-git-angular-16-kendraio.vercel.app

1_ Here: https://kendraio-app-git-angular-16-kendraio.vercel.app/connect they UI looks different then in the production app. I also don't see the "Connect" button.

This is problematic! Maybe the warning I just found is related?

2_ Grid header and Button label seems to have a different font: https://kendraio-app-git-angular-16-kendraio.vercel.app/core/adapters.

This is undesirable, an issue for this and other styling issues is a good idea, I think.

3_ Sidemenu items are back to be label Workflow instead of Flow

Did you have a 4th point? I noticed you had a numbered list with a missing 4 :)

5_ Grid design is different and I would say less good looking then what we had previously

6_ When I go to Flow Cloud I do not see the flows at the first render. I do see the flows if I search for them.
Okay, that seems to match the (state reactivity?) bug I was seeing in the Cypress tests.
Good to confirm that we are seeing it in real usage, not just test conditions - e.g: I think it rules the Cypress mocks out as a possible cause.

7_ Flow cloud flows do not have a "Launch" button so I cannot open them 8_ Some design is off like this...

I noticed a console warning just now, that suggests a version change has broken some functionality. Missing buttons for example, I think are much more serious than the style problem/s.
This is copy pasted from my console:

AG Grid: Could not find 'connectionStatusRenderer' component. It was configured as "cellRenderer: 'connectionStatusRenderer'" but it wasn't found in the list of registered components. ag-grid-community.auto.esm.js:19659:16
Did you mean: [agCheckboxCellRenderer,agColumnHeader,agColumnGroupHeader]? ag-grid-community.auto.esm.js:19661:20
If using a custom component check it has been registered as described in: https://ag-grid.com/javascript-data-grid/components/ ag-grid-community.auto.esm.js:19663:16
AG Grid: Could not find 'workflowRenderer' component. It was configured as "cellRenderer: 'workflowRenderer'" but it wasn't found in the list of registered components. ag-grid-community.auto.esm.js:19659:16
Did you mean: [agTooltipComponent,agGroupCellRenderer,agLoadingCellRenderer]? ag-grid-community.auto.esm.js:19661:20
If using a custom component check it has been registered as described in: https://ag-grid.com/javascript-data-grid/components/

This was referenced Jan 18, 2024
@lukestanley
Copy link
Member Author

lukestanley commented Jan 25, 2024

@gsambrotta can look at these problems:

  • Identify components with broken UI - do they need tests too?
    • Find if AG Grid broken in this branch
  • Identify new styling defects
  • Comments that link to issues
  • Review tests, are force clicks needed with new Cypress version?
  • Undo unexpected "Workflow" text UI regression

@lukestanley
Copy link
Member Author

I made #435 to track the state reactivity issues.

lukestanley and others added 18 commits March 6, 2024 13:13
…re fix, removes ngModelGroup. Materia-ui module was stale. Prior setDiagnosticOptions configuration caused error due to missing object. The ngModelGroup template property also caused runtime error and is not needed.
* restore correct UI style to grid

* apply breaking changes with frmeworkComponents, bump version to 31
* migrate with ng generate, fix card style

* adjust dialogs

* fix block comment textarea UI

* clean up main.scss

* fix connect to user link

* update test script with develop, fix datagrid disable test
@CodeKrakken
Copy link
Collaborator

CodeKrakken commented Mar 20, 2024

Issues on /bandsintown/editEvent -

  • Lineup button looks wrong, produces wrong form and does not update.
  • Tickets Manager button looks wrong but produces right form (albeit with wrongly styled Remove button) and updates correctly.
  • Update Event button fires every time but only successfully updates the API the first time. However there is no syntactical difference between the successful and failing commands.

Live
Live 1

Vercel
Upgrade 1

Live
Live 2

Vercel
Upgrade 2

Live
Live 3

Vercel
Upgrade 3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In progress
Development

Successfully merging this pull request may close these issues.

4 participants