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

Feat/spike ant d strategy #1639

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

jarvisraymond-uchicago
Copy link
Contributor

@jarvisraymond-uchicago jarvisraymond-uchicago commented Nov 15, 2024

Link to JIRA ticket if there is one:
https://ctds-planx.atlassian.net/browse/VADC-1400

Draft PR for Discussion Purposes

Prototype of Tech Approaches for AntD Remediation.

  • Creates prototype library AntDAccessibilityFixes
    • Consists of a variety of functions to inject aria labels and/or otherwise manipulate non-508 compliant markup created by AntD Library
  • Alternative approach to recreating AntD components from scratch or porting VADC applications to use library that is accessible out-of-box (both approaches likely exceeding a year of dev time)
  • This prototype adds aria labels to AntD table radio buttons, but the library can be expanded using a similar approach to add and remove attributes such as aria-labels, titles and summaries.
  • Uses descriptive functions to handle the unique requirements for each ticket
    • helps organize and separate logic for 508 compliance
  • Trade Offs: DOM manipulation should probably be kept as minimal while meeting compliance standards to reduce complexity and maintainability issues.
    • i.e. adding one aria label vs. adding a wrapping <label> element, unique id attributes, for attributes referencing other DOM nodes etc.

vzpgb and others added 9 commits November 6, 2024 11:10
…#1626)

* fix(cardDescriptionParsing): initial commit (#1612)

* fix(cardDescriptionParsing): initial commit

* fix(cardDescriptionParsing): ranner linter and fixed error

* Bugfix/combo box labels (#1611)

* bugfix(comboBoxLabels): Began dev of new select box component, need to resolve issues with setting selectedValue

* bugfix(comboBoxLabels): made select box a controllable component, moved IsEnterOrSpace into accessibilityUtils folder

* bugfix(comboBoxLabels): removed console.log statements

* bugfix(comboBoxLabels): ran linter

* bugfix(comboBoxLabels): removed commented code

* bugfix(comboBoxLabels): ran linter

* bugfix(comboBoxLabels): Added Teams Dropdown test

* bugfix(comboBoxLabels): updated  Teams Dropdown test

* bugfix(comboBoxLabels): removed unneeded div element from TeamDropdown

* fix(comboBoxLabels): Updated label text

* fix(comboBoxLabels): Updated unit test

* VADC-1420: Fixed modal button color to ensure accessibility (#1615)

* fix(vadc-1420): Fixed modal button color to ensure accessibility

* Updated background/border/hover colors for modal window

* (VADC-1430): fix(vaLogoAltText)

* VADC-1479: Updated Previous/Next buttons' colors for VA GWAS according to 508 (#1618)

* fix(vadc-1479): Updated colors for the GWAS next/previous buttons

* fix(vadc-1479): Undo automatic discovery style changes

* fix(vadc-1479): Updated class in CSS for Previous/Next buttons

* Use updated colors only for active button (#1620)

* VADC-1516: Updated colors for the buttons in the GWAS modal according to 508 (#1621)

* fix(vadc-1516): Updated colors for the buttons in the GWAS modal

* fix(vadc-1516): Unify style order

* fix(vadc-1516): Refactor CSS

* fix(vadc-1516): Added comment

* fix(vadc-1516): Updated text color for the dropdown in the Team's modal

* fix(vadc-1516): formatting

* fix(vadc-1516): formatting

* fix(vadc-1516): formatting

* fix(vadc-1516): formatting

* fix(vadc-1482):  Updated button colors in Eurler diagram

* fix(vadc-1482): Updated focus color for the Eurler diagram

---------

Co-authored-by: Jarvis <[email protected]>
...replacing it with a more generic error message that applies better to
all possible error scenarios
* fix: revert and bring back old data dictionary button component

...from https://github.com/uc-cdis/data-portal/tree/5dc09282573e93f8e11d44f53d65e3cf677256c6/src/Analysis/AtlasDataDictionary/AtlasDataDictionaryButton
...which in turn is a restore from older code #1478

* fix: using AtlasLegacyDataDictionaryButton for the legacy scenario

* fix: remove unused variables

* fix: fix AtlasLegacyDataDictionaryButton tests

* feat: use feature flag legacyDataDictionary instead of analysis app attribute

* fix: remove duplicated AtlasDataDictionaryButton css file

* fix: use project specific feature flag name
@mfshao
Copy link
Collaborator

mfshao commented Nov 15, 2024

maybe we can try to update to antd v5, might be easier than migrating everyting to mantine

@jarvisraymond-uchicago
Copy link
Contributor Author

maybe we can try to update to antd v5, might be easier than migrating everyting to mantine

Interesting idea! Do you know if antd v5 is 508 compliant?

@mfshao
Copy link
Collaborator

mfshao commented Nov 15, 2024

maybe we can try to update to antd v5, might be easier than migrating everyting to mantine

Interesting idea! Do you know if antd v5 is 508 compliant?

I'm not sure, and tbh I don't have a high hope on that. But maybe it will make our patching easier (although it can also goes to the other way)
Franking I think replacing with something like mantine might be the best solution. But that level of effort makes me feeling uncertain

Copy link

filepath $$\textcolor{#23d18b}{\tt{passed}}$$ $$\textcolor{#f14c4c}{\tt{failed}}$$ $$\textcolor{#ffa500}{\tt{skipped}}$$ SUBTOTAL
$$\textcolor{#23d18b}{\tt{tests/test\_requestor.py}}$$ $$\textcolor{#23d18b}{\tt{5}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#23d18b}{\tt{5}}$$
$$\textcolor{#23d18b}{\tt{tests/test\_ras\_authn.py}}$$ $$\textcolor{#23d18b}{\tt{3}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#23d18b}{\tt{3}}$$
$$\textcolor{#23d18b}{\tt{tests/test\_data\_upload.py}}$$ $$\textcolor{#23d18b}{\tt{2}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#23d18b}{\tt{2}}$$
$$\textcolor{#23d18b}{\tt{tests/test\_indexing\_page.py}}$$ $$\textcolor{#23d18b}{\tt{2}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#23d18b}{\tt{2}}$$
$$\textcolor{#23d18b}{\tt{tests/test\_audit\_service.py}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{tests/test\_login\_page.py}}$$ $$\textcolor{#23d18b}{\tt{2}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#23d18b}{\tt{2}}$$
$$\textcolor{#23d18b}{\tt{tests/test\_homepage.py}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{tests/test\_graph\_submit\_and\_query.py}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#ffa500}{\tt{tests/test\_gen3ff\_landing\_page.py}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#ffa500}{\tt{2}}$$ $$\textcolor{#ffa500}{\tt{2}}$$
$$\textcolor{#ffa500}{\tt{tests/test\_register\_user.py}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#ffa500}{\tt{2}}$$ $$\textcolor{#ffa500}{\tt{2}}$$
$$\textcolor{#f14c4c}{\tt{tests/test\_pfb\_export.py}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#f14c4c}{\tt{1}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#f14c4c}{\tt{1}}$$
$$\textcolor{#f14c4c}{\tt{tests/test\_discoverypage.py}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#f14c4c}{\tt{1}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#f14c4c}{\tt{1}}$$
$$\textcolor{#f14c4c}{\tt{TOTAL}}$$ $$\textcolor{#23d18b}{\tt{17}}$$ $$\textcolor{#f14c4c}{\tt{2}}$$ $$\textcolor{#ffa500}{\tt{4}}$$ $$\textcolor{#f14c4c}{\tt{23}}$$

Please find the detailed integration test report here

Please find the ci env pod logs here

@jarvisraymond-uchicago
Copy link
Contributor Author

Investigate RC option (building block of AntD)

https://github.com/react-component/table

@jarvisraymond-uchicago
Copy link
Contributor Author

jarvisraymond-uchicago commented Nov 15, 2024

@pieterlukasse Implement fixes at NPM build step (postHTML: https://www.npmjs.com/package/posthtml)

Not sure if this would work or not. Requires additional library.

Example using Tree matching with AntD component (generated by ChatGPT):

posthtml()
  .use(function(tree) {
    // Targeting an element with a specific 'data-select-id'
    tree.match({ tag: 'select', attrs: { 'data-select-id': '1' } }, (node) => {
      node.attrs = node.attrs || {};
      node.attrs['data-test'] = 'custom-select'; // Add a new data-test attribute
      return node;
    });

    return tree;
  })
  .process(html)
  .then(result => {
    console.log(result.html);  // Outputs modified HTML with the added data-test attribute
  });

Base automatically changed from feat/vadc_sprint23 to master November 27, 2024 18:40
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.

4 participants