#50837 Issue 50836 - Port Schema UI tab to React
Closed by spichugi. Opened by spichugi.
spichugi/389-ds-base schema_webui  into  master

Download 50837.patch

Description: Port the schema UI tab to React and preserve all
existing features.

https://pagure.io/389-ds-base/issue/50836

Reviewed by: ?

Can we merge the two setState functions into this one?

This can be removed :)

I think you are missing a file from your PR, I can not build the server:

ERROR in ./src/schema.jsx
Module not found: Error: Can't resolve './lib/schema/schemaTables.jsx' in '/home/mareynol/source/ds389/389-ds-base/src/cockpit/389-console/src'

rebased onto 8d415b6564c963469b8e8fe27879632a155b1d23

I've put the files to PR. Please, check.

1 new commit added

  • Remove old code and fix couple of issues

Can we merge the two setState functions into this one?

Fixed.

This can be removed :)

Fixed.

Clicking on Schema tab crashes browser:

TypeError: rowData.x_origin is null
schemaTables.jsx:333:36
    formatters schemaTables.jsx:333
    evaluateFormatters evaluate-formatters.js:10
    reduce self-hosted:303
    evaluateFormatters evaluate-formatters.js:8
    render body-row.js:120
    map self-hosted:251
    render body-row.js:90
    React 13
    toggleLoading schema.jsx:113
    toggleLoading self-hosted:880
    loadSchemaData schema.jsx:214
    s cockpit.js:979
    f cockpit.js:991
    n cockpit.js:897
The above error occurred in the <BodyRow> component:
    in BodyRow (created by Body)
    in tbody (created by Body)
    in Body (created by DSTable)
    in table (created by Provider)
    in Provider (created by TablePfProvider)
    in TablePfProvider (created by DSTable)
    in div (created by DSTable)
    in DSTable (created by AttributesTable)
    in div (created by AttributesTable)
    in AttributesTable (created by Schema)
    in div (created by Schema)
    in div (created by TabPane)
    in Transition (created by Fade)
    in Fade (created by TabPane)
    in TabPane (created by Schema)
    in div (created by TabContent)
    in TabContent (created by Schema)
    in div (created by Schema)
    in TabContainer (created by Uncontrolled(TabContainer))
    in Uncontrolled(TabContainer) (created by Schema)
    in div (created by Schema)
    in div (created by Schema)
    in div (created by Schema)
    in Schema

1 new commit added

  • Fix the issue when x_origin is null

Hm, it doesn't crash the browser when I click on Schema but if I search for the attribute which has x_origin == null - it crashes.

This commit should fix it. Please check.

Better, but when I try to add a new attribute i get a usage error:

tools.jsx:58 CMD: cmdOperationAttribute: Do the add operation on Attribute ==> dsconf -j ldapi://%2fvar%2frun%2fslapd-localhost.socket schema attributetypes add mark --single-value --user-mod --oid  --usage userApplications --desc mark --sup  --equality  --substr  --ordering 
cockpit.js:606 usage: dsconf instance schema attributetypes add [-h] [--oid OID]
                                                 [--desc DESC]
                                                 [--x-origin X_ORIGIN]
                                                 [--aliases ALIASES [ALIASES ...]]
                                                 [--single-value]
                                                 [--multi-value]
                                                 [--no-user-mod] [--user-mod]
                                                 [--equality EQUALITY]
                                                 [--substr SUBSTR]
                                                 [--ordering ORDERING]
                                                 [--usage USAGE]
                                                 [--sup SUP [SUP ...]]
                                                 --syntax SYNTAX
                                                 name
dsconf instance schema attributetypes add: error: the following arguments are required: --syntax

We now need "--syntax "

1 new commit added

  • Add field validation

Yeah, I was about to add it but then I decided to create the PR sooner for the initial review.
Now it the field validation is added, please check.

On FF there is no space between the checkbox and the label for user-defined classes.

When adding an objectclass, the tab just starts reloading, but doesn't say its saving, just says that the page is reloading. This is confusing

When I click on "view objectclass" it also showing the loading page. It should just open the modal, not reload the entire tab every time I want to look at an objectclass. So there's some weird toggling going on for these tasks. Also viewing an objectclass does not show the allowed attributes.

Same issue when deleting an objectclass. When you choose delete the pages just says "Loading schema". Then a notification finally pops up saying the delete was successful.

On the objectclass table if I reset the page size the browser crashes (for the Attribute table it works correctly):

TypeError: rowData.x_origin is undefined
schemaTables.jsx:125:36
The above error occurred in the <BodyRow> component:
    in BodyRow (created by Body)
    in tbody (created by Body)
    in Body (created by DSTable)
    in table (created by Provider)
    in Provider (created by TablePfProvider)
    in TablePfProvider (created by DSTable)
    in div (created by DSTable)
    in DSTable (created by ObjectClassesTable)
    in div (created by ObjectClassesTable)
    in ObjectClassesTable (created by Schema)
    in div (created by Schema)
    in div (created by TabPane)
    in Transition (created by Fade)
    in Fade (created by TabPane)
    in TabPane (created by Schema)
    in div (created by TabContent)
    in TabContent (created by Schema)
    in div (created by Schema)
    in TabContainer (created by Uncontrolled(TabContainer))
    in Uncontrolled(TabContainer) (created by Schema)
    in div (created by Schema)
    in div (created by Schema)
    in div (created by Schema)
    in Schema

rebased onto 084799802b14b0fe7688d2d7a586fb59e4402470

On FF there is no space between the checkbox and the label for user-defined classes.

Fixed.

When adding an objectclass, the tab just starts reloading, but doesn't say its saving, just says that the page is reloading. This is confusing
When I click on "view objectclass" it also showing the loading page. It should just open the modal, not reload the entire tab every time I want to look at an objectclass. So there's some weird toggling going on for these tasks. Also viewing an objectclass does not show the allowed attributes.
Same issue when deleting an objectclass. When you choose delete the pages just says "Loading schema". Then a notification finally pops up saying the delete was successful.

I agree, it's a bit confusing. I've split the spinners to 3 kinds: global, table, modal.

On the objectclass table if I reset the page size the browser crashes (for the Attribute table it works correctly)

Works for me but I've added an additional precaution check.

Please, review.

For objectclasses and attributes I still don't see a space between the checkbox and the label Only Non-standard Schema (attributes with X-ORIGIN: "user defined")

Everything else is good!

rebased onto 2ebdd30847f952dcf38d7eb9735840774562b979

Pull-Request has been merged by spichugi

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This pull request has been cloned to Github as issue and is available here:
- https://github.com/389ds/389-ds-base/issues/3891

If you want to continue to work on the PR, please navigate to the github issue,
download the patch from the attachments and file a new pull request.

Thank you for understanding. We apologize for all inconvenience.

Pull-Request has been closed by spichugi

Metadata