Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

chore(docs-app): allow switching to newer versions #15281

Closed

Conversation

Narretz
Copy link
Contributor

@Narretz Narretz commented Oct 17, 2016

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Feature for the docs app

What is the current behavior? (You can also link to an open issue here)
You cannot switch to a newer version from an older version in the docs app.

What is the new behavior (if this is a feature change)?
For docs app versions that contain this commit, switchting is possible. The docs app
will request the new versions-data.json file from the snapshot folder and fill the version switcher with
this data.

Does this PR introduce a breaking change?
No

Please check if the PR fulfills these requirements

Other information:

With this patch, the docs app will request available versions data from the snapshot,
which are now stored in a separate versions-data.json file.

This only affects docs apps that contain this commit, so older doc apps
will still only display the versions up to their own version.

With this patch, the docs app will request available versions data from the snapshot,
which are now stored in a separate versions-data.json file.

This only affects docs apps that contain this commit, so older doc apps
will still only display the versions up to their own version.
minor = version.minor;
}
}).then(function() {
return $http.get('../snapshot/versions_data.json');
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this relative URL work when it is running from the root of https://docs.angularjs.org?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm. So for https://docs.angularjs.org (which is the snapshot) we cannot use this relative path. At the moment, it doesn't matter, because we only get the snapshot versions-data when we are not on the snapshot.

For all other versions the root is https://code.angularjs.org//docs. In that case, this should be either ../../snapshot/versions_data.json or /snapshot/versions_data.json.

However, since we want to point docs.angularjs.org to the latest stable, an absolute url is probably the best idea. At the moment, this doesn't work because of CORS, though.

Copy link
Member

Choose a reason for hiding this comment

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

Will this fail silently when people run the docs app locally?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. It will also fail silently if the snapshot json data can't be requested for some reason. It's strictly an optional enhancement.

@gkalpak
Copy link
Member

gkalpak commented Oct 17, 2016

👍 This is a much needed improvement.

@gkalpak gkalpak modified the milestones: Backlog2, Backlog Oct 18, 2016
@petebacondarwin
Copy link
Contributor

@Narretz and I had a chat about this. We came up with new idea that doesn't require a change to the docs app and will work with older versions too.
It involves rewrite rules on the code.angularjs.org server...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants