Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

feat(warning-page): Implement new design and action on opt-in button click #22

Merged
merged 9 commits into from
Jan 14, 2019

Conversation

divyanshiGupta
Copy link
Collaborator

@divyanshiGupta divyanshiGupta commented Jan 2, 2019

Parent Story: https://openshift.io/openshiftio/Openshift_io/plan/detail/1110

This PR adds :

  • New design of the warning page.
  • Service for enabling feature when user opts-in by clicking on the opt-in button.
  • Option in the feature-wrapper to either show the default warning page with the option to opt-in the feature or a different template provided by the parent component when the feature is not enabled.

Note :
I have tested the above changes with the ngx-feature-flag demo app. I also tried to test these changes with fabric8-ui and planner by linking but I am getting Null Injector for HttpClient error. This might be due to something going wrong while linking or because of the way the dependencies are being resolved in the new monorepo structure.
I think the linking issues will be resolved once we move ngx-feature-flag to monorepo.
@christianvogt what do you think about it?
feature-toggle

@divyanshiGupta divyanshiGupta changed the title [WIP]fix(warning-page): Implement new design and action on opt-in button click fix(warning-page): Implement new design and action on opt-in button click Jan 8, 2019
@divyanshiGupta
Copy link
Collaborator Author

@rohitkrai03 please review the PR

@divyanshiGupta divyanshiGupta changed the title fix(warning-page): Implement new design and action on opt-in button click feat(warning-page): Implement new design and action on opt-in button click Jan 8, 2019
@@ -0,0 +1,92 @@
import { HttpClient, HttpErrorResponse, HttpHeaders } from '@angular/common/http';
Copy link
Contributor

Choose a reason for hiding this comment

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

@divyanshiGupta I guess this is a duplicate service from fabric8-ui. I am thinking if there is a way to reuse the same service here but because of cyclic dependency it would not be easy. We could have it done the way PipelineService is done in ngx-launcher but thats not the best way for me as well. I think this will be solved by the SDK refactoring.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@rohitkrai03 this is a duplicate service because at this point I didnt find any better and less time consuming way of doing this. You are right about the cyclic dependency issue and hence I tried to do it by creating the service interface in ngx-feature-flag and implementing it in fabric8-ui the way PipelineService is done in ngx-launcher but this also didnt worked out for me as some other issues were coming up. I agree with you that this can be solved once we get all the services in the SDK and we can use this service both in fabric8-ui and ngx-feature-flag from the SDK.

Copy link
Contributor

Choose a reason for hiding this comment

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

@divyanshiGupta Understood. I'll add this use case in SDK doc.

<i class="fa fa-flask fa-5x"></i>
<h2>Ooops</h2>
<p>This feature has been disabled by your admin page.</p>
<div *ngIf="featureWarning" class="container-fluid container-cards-pf">
Copy link
Contributor

Choose a reason for hiding this comment

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

@divyanshiGupta Is this backwards compatible with the way it was being used earlier with FeatureFlagResolver?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes @rohitkrai03 this is backwards compatible, I have implemented this in a way that it doesn't breaks when used with FeatureFlagResolver. I have also tested it with a feature using FeatureFlagResolver at the route level.

Copy link
Contributor

Choose a reason for hiding this comment

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

That's good. Nice work there.

Copy link
Contributor

@rohitkrai03 rohitkrai03 left a comment

Choose a reason for hiding this comment

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

Tried it with the demo app. Works fine. Code looks good to me.

@christianvogt christianvogt merged commit 8b5f018 into fabric8-ui:master Jan 14, 2019
@fabric8cd
Copy link

🎉 This PR is included in version 1.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

4 participants