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

ITV-2200 Deprecate the use of *history=broadcast #527

Merged
merged 12 commits into from
Jan 3, 2019
Merged

ITV-2200 Deprecate the use of *history=broadcast #527

merged 12 commits into from
Jan 3, 2019

Conversation

acarlson0000
Copy link
Contributor

  • Pass through currentUrlParams to Historian
  • Update usages of hash fragment to utilize query param

- Pass through currentUrlParams to Historian
- Update usages of hash fragment to utilize query param
*/
hasBroadcastOrigin: function hasBroadcastOrigin () {
return this._historyArray.length > 0 && this._historyArray[this._historyArray.length - 1] === Historian.HISTORY_TOKEN + Historian.BROADCAST_ENTRY;
return this._urlParams.length > 0 && this._urlParams[Historian.BROADCAST_ENTRY] === true;
}
});

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggest to remove the BROADCAST_ENTRY and everything to do with history= if we are moving away from this as a concept.
Then update any partner specs we have which i'm sure there were a few years ago.
Need to speak with @aevans-bbc

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, this was re-factored to remove. I guess we'll need to put some tickets in for the updates to partner specs now?

@@ -18,9 +18,10 @@ define(
* @constructor
* @ignore
*/
init: function init (currentUrl) {
init: function init (currentUrl, UrlAppParams) {
Copy link
Contributor

Choose a reason for hiding this comment

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

actually - if currentUrl already contains the query parameters then no need to pass in the UrlAppParams right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is true - essentially this could be achieved by currentUrl.match(/broadcast=true/) but this seemed far too hacky. Took this approach rather than a) pulling lib/application into historian b) re-implementing the queryParam extraction - but I'm happy with either way really :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Tiny bit of human linting...

Suggested change
init: function init (currentUrl, UrlAppParams) {
init: function init (currentUrl, urlAppParams) {

@@ -18,9 +18,10 @@ define(
* @constructor
* @ignore
*/
init: function init (currentUrl) {
init: function init (currentUrl, UrlAppParams) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Tiny bit of human linting...

Suggested change
init: function init (currentUrl, UrlAppParams) {
init: function init (currentUrl, urlAppParams) {

var i;

this._urlParams = UrlAppParams;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
this._urlParams = UrlAppParams;
this._urlParams = urlAppParams;

Preparing to remove Historian.hasBroadcastOrigin()
Has now been replaced by application.hasBroadcastOrigin(). It is
necessary to pass broadcast=true to any new URL launched via
Historian.forward() if you want to propagate broadcast trust to the
TAL child app.
@dhurrell
Copy link
Contributor

After discussion, we decided we could remove the broadcast-history related stuff from Historian straight away. Awareness of whether the app has a 'broadcast origin' is now moved up a level, to Application. It would be good if you can take another look, @acarlson0000!

Copy link
Contributor

@cheunr02 cheunr02 left a comment

Choose a reason for hiding this comment

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

All good - although i feel this will set a precedence to add other getters in the application :-P

@acarlson0000
Copy link
Contributor Author

After discussion, we decided we could remove the broadcast-history related stuff from Historian straight away. Awareness of whether the app has a 'broadcast origin' is now moved up a level, to Application. It would be good if you can take another look, @acarlson0000!

Yep, agree this is much cleaner. LGTM

@dhurrell dhurrell merged commit 877d76b into master Jan 3, 2019
@dhurrell dhurrell deleted the ITV-2200 branch January 3, 2019 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants