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

Fix nav links of synonymous sub-headings under Associations #12201

merged 6 commits into from May 12, 2020


Copy link

@louy2 louy2 commented May 1, 2020

Pull Request check-list

Please make sure to review and check all of these items:

  • Does npm run test or npm run test-DIALECT pass with this change (including linting)?
  • Does the description below contain a link to an existing issue (Closes #[issue]) or a description of the issue you are solving?
  • Have you added new tests to prevent regressions?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Did you update the typescript typings accordingly (if applicable)?
  • Did you follow the commit message conventions explained in

Description of change

Added new transform fix-ids.js to fix sub-heading ids and links under Association.

Closes #12197

Copy link
Contributor Author

@louy2 louy2 commented May 1, 2020

Not sure how to add test for this one.

Copy link

@codecov codecov bot commented May 1, 2020

Codecov Report

Merging #12201 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #12201   +/-   ##
  Coverage   96.33%   96.33%           
  Files          95       95           
  Lines        9120     9120           
  Hits         8786     8786           
  Misses        334      334           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5336424...cde6f6b. Read the comment docs.

Copy link

@papb papb left a comment

Hello! I see you are a first-time contributor, thank you for taking the time to help Sequelize! I hope to see more PRs from you in the future!

Thanks for catching the fact that cheerio was missing from devDependencies! 🚀 I either deleted it by accident at some point, or never added it 😅

As for your PR, although it does work, I was hoping for something less specific, that would automatically adapt to further documentation changes.

Would you be willing to improve your PR? I suggest something on the lines of:

  • Detect every heading with an ID: $('h1,h2,h3,h4,h5').filter('[id]')
  • Find duplicate IDs among them
  • Replace their IDs with the following rule:
    #original-header --> #original-header
    #original-header --> #original-header-2
    #original-header --> #original-header-3
  • Also fix nav links (nice catch, I didn't think of that!) - you can assume that the links appear in nav in the same order they do in the page itself. To find the links you might use something like
    $('li[data-ice="manualNav"] a').filter(function() {
      return $(this).prop('href').endsWith(`${fileName}#${headerBeingFixed}`);

Not sure how to add test for this one.

Don't worry about a test, I think it's not necessary in this case, provided we manually check that it works.

@papb papb added status: awaiting response type: docs labels May 1, 2020
Copy link
Contributor Author

@louy2 louy2 commented May 3, 2020

Got confused by the mechanics of _.chain but got it working

Copy link
Contributor Author

@louy2 louy2 commented May 3, 2020

Also apparently id can only be set with attr.

Copy link

@sushantdhiman sushantdhiman left a comment

LGTM, waiting for @papb

papb approved these changes May 12, 2020
@papb papb merged commit 784712e into sequelize:master May 12, 2020
4 checks passed
Copy link

@papb papb commented May 12, 2020

Great work @louy2, thank you very much!!

@papb papb removed the status: awaiting response label May 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
type: docs
None yet

Successfully merging this pull request may close these issues.

3 participants