Skip to content
This repository was archived by the owner on Nov 20, 2025. It is now read-only.

Feature/dsbd 95 2#48

Open
n3op2 wants to merge 23 commits intomainfrom
feature/dsbd-95-2
Open

Feature/dsbd 95 2#48
n3op2 wants to merge 23 commits intomainfrom
feature/dsbd-95-2

Conversation

@n3op2
Copy link
Contributor

@n3op2 n3op2 commented Sep 21, 2022

What

Mainly adding a new button (console - please refer to screenshots) along with the new asset (img for icon). However, went a little beyond and made Modal.js components decoupled from read-demo. There are other changes making UI components a bit more friendly for cross demos.

Q: No sure about the icon, maybe it should be within login box?

Changes

  • moved demo 2 variables to context
  • refactor of demos/read/Modal.js to make it reusable and use it for rendering demo 2B output
  • new icon Console for display exception
  • some other little up clean ups which can be seen in Feature/dsbd 95 2 #48
  • read-demo e2e test update to be inline with shared modal

Screenshots

Screenshot 2022-09-21 at 21 31 26

Screenshot 2022-09-21 at 21 27 47

@n3op2 n3op2 marked this pull request as ready for review September 21, 2022 20:48
@n3op2 n3op2 requested a review from nitro-marky September 22, 2022 08:31
@jonmattgray
Copy link
Contributor

I've tried a login API call on demo 2 and it has this error:

Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render.

@n3op2 n3op2 requested a review from jonmattgray September 27, 2022 09:13
@jonmattgray
Copy link
Contributor

Demo 2 isn't functioning correctly, think there's something wrong with state? If I login successfully with root, password then go back to main menu and start demo 2 again, subsequent login attempts behave strangely. Putting incorrect login details then still shows the secret desktop, then says login failed, and the spinner never stops.

@n3op2
Copy link
Contributor Author

n3op2 commented Sep 29, 2022

@jonmattgray the close bug has been fixed as well

@n3op2 n3op2 requested a review from jonmattgray September 29, 2022 13:16
Copy link
Contributor

@mattdean-digicatapult mattdean-digicatapult left a comment

Choose a reason for hiding this comment

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

I'm going to be honest I'm in two minds on this one. The feature add here is really useful but unfortunately you've tied it to a move to storing everything in a global Context which I'm really struggling with. Lack of separation of concerns is not good and this is a definite quality regression. I'm therefore not sure I'm going to approve this even if you address the specific comments I'm making, but obviously that's a good start. I may end up looking at rebasing this into several separate changes to bring in the feature in a more controlled way.

Comment on lines +201 to +206
{...{
...state,
ProgressBar: ({ update, readDemo }) => (
<ProgressBar update={update} readDemo={readDemo} />
),
}}
Copy link
Contributor

@mattdean-digicatapult mattdean-digicatapult Sep 30, 2022

Choose a reason for hiding this comment

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

I honestly don't know what this does. Can we simplify this syntactically to reduce the amount of spreading? It looks likes it could be:

          <Modal
            type={'readDemo'}
            update={update}
            ProgressBar={({ update, readDemo }) => (
              <ProgressBar update={update} readDemo={readDemo} />
            )}
            {...state}
          />

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes sir!

Comment on lines -122 to -127
<Help
theme={theme}
content={helpContent}
showContentState={showHelp}
setShowContentState={setShowHelp}
/>
Copy link
Contributor

@mattdean-digicatapult mattdean-digicatapult Sep 30, 2022

Choose a reason for hiding this comment

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

what has happened to Help? Looking at these changes it looks like it's not there unless we're running in aarch64 i.e. isMorello !== true

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's below since it's using absolute positioniong anyway so moved it one level


const renderActions = ({ update, readDemo }) => {
// giving default value to avoid bugs in case this is undefined
const renderActions = ({ update, type = 'readDemo', ...props }) => {
Copy link
Contributor

@mattdean-digicatapult mattdean-digicatapult Sep 30, 2022

Choose a reason for hiding this comment

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

type is a really ugly solution to this. Separating the Context into two would be much more scalable and useful. I get this is not simple

Copy link
Contributor Author

Choose a reason for hiding this comment

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

totally agree, but I don;'t want to grow this story any more, happy to add a task for breaking down context.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants