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

Remove login buttons when the submission limit is reached #793

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

viktorvanwijk
Copy link

@viktorvanwijk viktorvanwijk commented Feb 6, 2025

Copy link

codecov bot commented Feb 6, 2025

Bundle Report

Changes will increase total bundle size by 72 bytes (0.0%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
@open-formulieren/sdk-OpenForms-umd 4.78MB 36 bytes (0.0%) ⬆️
@open-formulieren/sdk-esm 4.75MB 36 bytes (0.0%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: @open-formulieren/sdk-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/sdk-*.js 36 bytes 1.01MB 0.0%

Files in assets/sdk-*.js:

  • ./src/components/FormStart/index.jsx → Total Size: 4.63kB
view changes for bundle: @open-formulieren/sdk-OpenForms-umd

Assets Changed:

Asset Name Size Change Total Size Change (%)
open-*.js 36 bytes 3.49MB 0.0%

Files in open-*.js:

  • ./src/components/FormStart/index.jsx → Total Size: 4.63kB

Copy link

codecov bot commented Feb 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.86%. Comparing base (c1f7d7e) to head (3974f79).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #793      +/-   ##
==========================================
- Coverage   84.23%   83.86%   -0.37%     
==========================================
  Files         245      245              
  Lines        4808     4810       +2     
  Branches     1279     1274       -5     
==========================================
- Hits         4050     4034      -16     
- Misses        729      747      +18     
  Partials       29       29              
Flag Coverage Δ
storybook 77.45% <100.00%> (-0.49%) ⬇️
vitest 62.71% <100.00%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@viktorvanwijk viktorvanwijk requested a review from vaszig February 11, 2025 09:34
@viktorvanwijk
Copy link
Author

Not exactly sure how the coverage has decreased from this change. Any ideas?

Copy link
Contributor

@vaszig vaszig left a comment

Choose a reason for hiding this comment

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

I don't know either what's wrong with the coverage.

Copy link
Contributor

@robinmolen robinmolen left a comment

Choose a reason for hiding this comment

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

Could you place this logic outside the conditional rendering? Chaining if statements is something we should try to avoid. I think this also makes it a bit more clear why things are happening

Maybe something like:

const showStartButton = !hasActiveSubmission && !form.submissionLimitReached;

...

       {hasActiveSubmission && (
          <ExistingSubmissionOptions
            form={form}
            onDestroySession={onDestroySession}
            isAuthenticated={isAuthenticated}
          />
        )}

        {showStartButton && (
          <LoginOptions
            // if cosign allows links in emails, we don't need to display the cosign
            // login options, so strip them out
            form={form.cosignHasLinkInEmail ? {...form, cosignLoginOptions: []} : form}
            onFormStart={onFormStart}
            extraNextParams={extraNextParams}
          />
        )}

@viktorvanwijk viktorvanwijk force-pushed the 5046-remove-login-buttons-when-submission-limit-is-reached branch from 78fbd8d to db553bf Compare February 18, 2025 08:53
…sion limit is reached

Doesn't make much sense to show these buttons if users are unable to start a form because the submission limit has been reached.
@viktorvanwijk viktorvanwijk force-pushed the 5046-remove-login-buttons-when-submission-limit-is-reached branch from db553bf to 3974f79 Compare February 18, 2025 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When the maximum number of submissions is reached, don't show the button to login
3 participants