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

Simplify document loading #872

Open
2 tasks
laurelmay opened this issue May 19, 2023 · 4 comments
Open
2 tasks

Simplify document loading #872

laurelmay opened this issue May 19, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@laurelmay
Copy link
Contributor

laurelmay commented May 19, 2023

Description

As a user of the OSCAL Viewer, I want to paste a URL and have it "just work" without giving a validation error because I gave a URL to a Profile instead of Catalog.

Acceptance Criteria

  • All existing Viewer routes continue to exist but functionally work the same way (for any document URL given, it is loaded)
    • This means /catalog/?url=A_PROFILE should display the profile without error
    • This is necessary to preserve existing URLs and ensure they continue to function
  • The "homepage" (/) no longer displays the Catalog Viewer by default but instead more of a welcome text with the "OSCAL Loader Form" to allow specifying a URL
    • It would likely be helpful to have a few example documents on this page to choose from
  • All routes in the Editor continue to function exactly as they do today
  • Hamburger menu navigation is removed in the Viewer (editor navigation is unchanged)
  • The new preferred method is simply https://viewer.oscal.io/?url= and documentation/samples are updated to use this

Proposed Solution

This probably requires pretty extensive changes to the OSCALLoader and OSCALLoaderForm but with the Convert.toOscal function, it should be feasible to determine which document type we have (based on which field is populated).

The majority of the "friendly" bits for this (the new welcome page, etc) need to be defined in the oscal-viewer package rather than included in the library. At the same time, it would be great to remove all Route-based stuff from the oscal-react-library if any is still present.

Additional Notes

This is a good "first step" to refactoring OSCALLoader and OSCALLoaderForm as it forces us to more dynamically handle the document type while still allowing us to maintain assumptions about having an entire document.

Implementation

  • I can (or plan to) submit a pull request to implement this
  • Implementing this may result in a breaking change
@laurelmay laurelmay added the enhancement New feature or request label May 19, 2023
@brian-ruf-ezd
Copy link
Contributor

Assumption: Error handling will function the same way it has. No change in error handling mechanisms.

laurelmay pushed a commit to EasyDynamics/oscal-editor-deployment that referenced this issue May 26, 2023
### Navigation Failing

For some reason the first click when selecting catalogs in the drawer
selector fails. This leads to A LOT of tests failing as we use this
function in pretty much all our tests.

This temporary fix will let us test other functionality rather than just
always failing. We really should **completely rework** how we navigate
to each document type in the future as this code is extremely fragile.

### Loading Invalid Components Failing

When we intentionally put in invalid data, a `TypeError` is thrown. We
are still able to reload new data after that failure, so we catch the
exception. This test may be want to reconsidered when
EasyDynamics/oscal-react-library#872 or
subsequent related issues are completed.
@Bronstrom
Copy link
Contributor

6/8/23 Sprint Planning - Moved from Sprint 48 to Sprint 49

@Bronstrom
Copy link
Contributor

6/22/23 Sprint Planning - Moved from Sprint 49 to Sprint 50

@Bronstrom
Copy link
Contributor

7/6/23 Sprint Planning - Removed from sprint board. Planning to return to this issue at a later date.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants