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

Create Barcode Scanner App powered by React (via wp packages) (wip) #7

Closed
wants to merge 62 commits into from

Conversation

nerrad
Copy link
Contributor

@nerrad nerrad commented May 22, 2018

Note: This branch now contains force pushed changes from a branch @tn3rb did some work on. So make sure you delete locally the branch for this pull and grab the latest from github.

Problem this Pull Request solves

As a part of doing #2 (converting [ESPRESSO_BARCODE_SCANNER] shortcode to a Gutenberg Block), I decided that it would be prudent to do the first step of creating a React based app for the actual scanner to replace the ajax/js powered existing app rendered via the shortcode. There's a few reasons for this including:

  • dogfooding the new js framework and apis in Event Espresso core (which helps expose issues that need fixed - and a lot were).
  • Enabling the possibility of having the app being independent of WordPress (powered completely via the REST API).
  • Enabling the app to (eventually) have a React Native version. This would allow for potentially releasing versions as mobile apps.
  • More consistent parity between what is embedded via a shortcode and the eventual WordPress block replacing the shortcode in the editor and the frontend.
  • More flexibility fo how we utilize this with EventSmart.
  • Greater potential for improving the ui/ux of how the app works (beyond simply copying what the existing shortcode powered implementation does)

Priority wise, the goal of this pull is to get to the app to a functional state replacing the feature set of the current shortcode powered app. This means that everything should work, but it won't be in a releasable state until the ui/ux receives some polish.

What needs done

This is an itemized list of things needing done for this app and what is complete.

  • Update the codebase (where possible) to follow new add-on framework/structure.
  • Implement new asset build process for add-on.
  • Add js unit tests
  • Get all components/logic in place (js) so that Scanner App is functional and works similarly to the existing app.
  • Finish all inline documentation for the code.
  • Fix scan input so that when continual scanning is happening, the scan input clears and it's ready for the next scan.
  • Add logic to control whether the app is available based on WordPress, PHP, and EE version. Currently WP: 5.2; EE: 4.9.80; PHP 5.6 (php version bump will be required regardless for whatever version receives this).
  • Improve UI/UX (includes actual styling)
  • Tweak the step menu implementation so that certain steps can only be toggled if prior fields are filled (i.e. selected event, or selected datetime)
  • Add options for hydrating initial state via the app mount point. In particular this is important for the eventual usage in the block.
  • Extract components that were implemented as a part of this build that belong in EE core - then reimplement as imported from core.
  • Extract CSS (and implement) as a part of the work for New direction for CSS and styling in EE core event-espresso-core#1041
  • Investigate bug @br3nt discovered: I noticed if I used the "Lookup Attendee" option on the "Scan" step and entered a Reg Code from a registration in my system, it would return the registration and attendee details including whether the registration was approved or not and/or required payment or not. That sounds fine but the issue is that the registration did not belong to the event and datetime that had been selected in the previous steps. Since the returned attendee details make no mention of the event or datetime, it simply appears that the information is valid for the current selections. However, the registration could belong to any event, even one that occurred years ago. This could easily allow people to print bogus tickets using barcodes / QR codes from a previously paid for past event to gain fraudulent entrance to a current event they have not paid for.

NOTE: This pull will contain commits including new components that I'm testing as a part of this work that will eventually be extracted and added to event-espresso-core for the global components. Things that are useful for usage by multiple EE products vs just this add-on.

How has this been tested

  • js unit tests
  • verify new app works as expected.
  • verify existing shortcode still works.

Checklist

Components being extracted to ee core (see zenhub dependencies connections for links to related pulls):

  • New css styling system.
  • <TextBubble /> (components/ui/enhanced-text/text-bubble)
  • <StatusCircle /> (components/ui/indicators/status-circle)
  • <StatusSection /> (components/ui/indicators/status-section)
  • <CheckInAction /> (registration-view/checkin)
  • <CheckInButton /> (registration-view/checkin)
  • get-checkin-in-status-configuration (helpers from registration-view/checkin/get-check-in-status-configuration)
  • <CheckInStatusIcon /> (registration-view/checkin)
  • withLatestCheckin ( 'registration-view/checkin`)

Other important notes:

  • PHP version requirement updated to PHP5.6 (confirmed with support team as okay)
  • EE4 version requirement will need to be updated to whatever version of EE core includes the Gutenberg framework (so there's a dependency on that being merged in) (also confirmed with support team as okay).

- updates webpack to 4
- update webpack config
- updates various packages
- fix up packages (that I can) which fail npm audit
- copy over latest i18n-map-extractor.js from core.
@nerrad
Copy link
Contributor Author

nerrad commented Jun 22, 2018

Components for ScannerView:

Note, this is just the initial draft to get the ball rolling. It's very likely that some of this will be consolidated when I see patterns emerge as I code this.

components from wireframe

In tree format:

<ScannerView>
    <AllRegistrationLink />
    <ScanInputView>
        <ScanTypeSelector />
        <ScanInput />
        <Button /> // submit button for scanner
    </ScanInputView>
</ScannerView>
<RegistrationView>
    <RegistrationDetailsView>
        <ContactDetails />
        <AvatarImage />
        <RegistrationActionsView>
            <RegistrationOwing>
                <StatusCircle />
            </RegistrationOwing>
            <RegistrationStatus>
                <StatusCircle />
            </RegistrationStatus>
            <RegistrationAction>
                <CheckinStatusTextBubble />
                <Button /> // Check-in action button for *this* registration
            </RegistrationAction>
            <RegistrationLinks />
        </RegistrationActionsView>
    </RegistrationDetails>
    <RegistrationGroupView>
        <RegistrationGroupTable>
            <RegistrationGroupRow />
                <CheckinStatusIndicator />
                <Button /> // Check-in Action Button for Reg in Row
            <Registration>
        </RegistrationGroupTable>
    </RegistrationGroupView>
    <Button /> // Check-in action button for all Registrations in Group
</RegistrationView>

@nerrad
Copy link
Contributor Author

nerrad commented Jun 24, 2018

I'm also going to experiment with using https://github.com/react-tools/react-table as a table component for this mini-app. If it works well, I may make this a recommended table component for the react stuff we do.

Along with that, I may use this HOC: https://github.com/dumptruckman/accessible-react-table to ensure our tables are accessible out of the gate.

nerrad added 4 commits June 24, 2018 07:57
this also registers a temporary tab for initial experimenation with the new app (alongside with the old app for reference).
@stale
Copy link

stale bot commented Aug 23, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale
Copy link

stale bot commented Oct 22, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the status:stale label Oct 22, 2018
@stale
Copy link

stale bot commented Oct 29, 2018

This issue has been automatically closed because it has been stale for a significant period of time without any activity.

@stale stale bot closed this Oct 29, 2018
@nerrad nerrad force-pushed the Gutenberg/convert-scanner-shortcode-to-block branch from 46fd200 to 0f8e526 Compare April 18, 2019 21:13
@stale
Copy link

stale bot commented Jul 5, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the status:stale label Jul 5, 2019
@stale
Copy link

stale bot commented Jul 12, 2019

This issue has been automatically closed because it has been stale for a significant period of time without any activity.

@stale stale bot closed this Jul 12, 2019
@stale
Copy link

stale bot commented Jul 12, 2019

This issue has been automatically closed because it has been stale for a significant period of time without any activity.

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

Successfully merging this pull request may close these issues.

3 participants