Skip to content
This repository has been archived by the owner on Dec 5, 2019. It is now read-only.

Show better ups details in MAR view #50

Merged

Conversation

aliok
Copy link

@aliok aliok commented May 24, 2018

https://issues.jboss.org/browse/AEROGEAR-2776
https://issues.jboss.org/browse/AEROGEAR-2777

Backend/configurator side: https://issues.jboss.org/browse/AEROGEAR-2850

Provision UPS on OpenShift first, using the branch below

See aerogear/ups-config-operator#38

Verification:

  1. Check "aerogear-mcp" branch of our "origin-web-common" fork: https://github.com/aerogear/origin-web-common/tree/aerogear-mcp
  2. Build it
  3. Do bower link there
  4. Go to this PR's repo and branch and do bower link origin-webcommon
  5. Start web console using this branch. See https://github.com/aerogear/origin-web-console#local-configuration
  6. Provision an Android client on OpenShift
  7. Add these annotations to "Service Binding" resource "dh-unifiedpush-apb-xxxxx-yyyyy"
annotations:
    binding.aerogear.org/consumer: myapp-android
    binding.aerogear.org/provider: dh-unifiedpush-apb-xxxxx
  1. Check MAR view, "Mobile Services" tab
  2. Create bindings / delete bindings

Some edge cases to test:

  • When an IOS binding is created, Android variant should still be shown
  • When all variants are deleted (either directly on UPS side, or on OpenShift side with deleting binding), all push related info should be deleted in the MAR view and also in the mobile client annotations.
  • Delete push app on UPS side and see what happens

Screnshot:
screenshot from 2018-05-31 14-20-30

If you don't want to start up the UPS side, add these annotations to mobile client:


1 org.aerogear.binding.dh-unifiedpush-apb-4k22f/push-application: >-
--
{"label":"Push Application","type":"href","text":"aaa",
"value":"https://ups-aaa.192.168.42.230.nip.io/#/app/5896ac3f-66cb-43be-a7e9-ddcd13229b50/variants"}
 
2 org.aerogear.binding.dh-unifiedpush-apb-w9txs/ups-url: >-
{"label":"URL","type":"href","value":"https://ups-aaa.192.168.42.230.nip.io"}
 
3 org.aerogear.binding-ext-type.dh-unifiedpush-apb-w9txs: unifiedpush
 
4 org.aerogear.binding-ext.dh-unifiedpush-apb-w9txs/variants: >-
[
{"type":"Android","url":"https://ups-aaa.192.168.42.230.nip.io/#/app/5896ac3f-66cb-43be-a7e9-ddcd13229b50/variants/5c4ce821-efcc-4585-a9f9-070edeb8d0d3", "id":"5c4ce821-efcc-4585-a9f9-070edeb8d0d3"},
{"type":"iOS",    "url":"https://ups-aaa.192.168.42.230.nip.io/#/app/5896ac3f-66cb-43be-a7e9-ddcd13229b50/variants/4635d6fb-409c-4b0d-aebc-018e028d0799", "id":"4635d6fb-409c-4b0d-aebc-018e028d0799"}
]


@aliok aliok force-pushed the AEROGEAR-2776-better-ups-details branch from be10c88 to f975ef1 Compare June 1, 2018 08:51
@aliok aliok changed the title [BLOCKED] Show better ups details in MAR view Show better ups details in MAR view Jun 1, 2018
@aliok aliok requested review from philbrookes, pb82 and sedroche June 1, 2018 09:05
</div>

<div class="col-md-6" ng-if="row.extendedAnnotationsType === 'unifiedpush'">
<h4 class="component-label section-label">Variants</h4>

Choose a reason for hiding this comment

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

I'm not thrilled with having code specific to a particular service hard-coded into the UI, I imagine we'd have a tough time getting this accepted upstream.

Copy link
Author

Choose a reason for hiding this comment

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

@philbrookes that's something I was also concerned. I was asking that to @david-martin during a meeting and he told me that Craig and him discussed about that and this is what we can do initially.

Choose a reason for hiding this comment

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

@philbrookes When discussing with @maleck13, he had no concerns about this being accepted upstream as it's a mobile specific view.

@aliok
Copy link
Author

aliok commented Jun 4, 2018

@sedroche @philbrookes how's the procedure here? am I supposed to send a PR for OpenShift upstream once this one is merged into our fork?

@@ -70,6 +72,18 @@
return 0;
});

row.extendedAnnotationsType = row.mobileClient.metadata.annotations ? row.mobileClient.metadata.annotations[extendedAnnotationTypeKey] : undefined;
Copy link

Choose a reason for hiding this comment

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

Is this to discern what service this is? We also have spec.externalMetadata.serviceName: ups available on the service class.

Copy link
Author

Choose a reason for hiding this comment

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

Yes, that's the purpose. I actually looked for something like that and couldn't find a key-value like that. Probably searched for wrong keywords.

Gonna delete that annotation in the operator side and in the UI.

thanks for the suggestion

@@ -70,6 +72,18 @@
return 0;
});

row.extendedAnnotationsType = row.mobileClient.metadata.annotations ? row.mobileClient.metadata.annotations[extendedAnnotationTypeKey] : undefined;

row.extendedAnnotations = _.pickBy(row.mobileClient.metadata.annotations, function(annotation, name){
Copy link

Choose a reason for hiding this comment

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

You can chain these if you want.

row.extendedAnnotations = _(row.mobileClient.metadata.annotations)
  .pickBy()
  .transform()
  .value();

@sedroche
Copy link

sedroche commented Jun 5, 2018

@aliok This PR will be part of the overall mobile services/binding work and a complete PR containing everything is what will be created upstream.
To mark this to be included as part of that PR can you squash these commits into one commit which has a tag [MAR] in the message. So to [MAR] Show better ups details in MAR view

@aliok
Copy link
Author

aliok commented Jun 5, 2018

Ok, changes applied. I will squash commits into a single commit when @pb82 verifies the PR.

@aliok aliok force-pushed the AEROGEAR-2776-better-ups-details branch 2 times, most recently from 8eaea4d to 1432a95 Compare June 6, 2018 15:03
@aliok aliok force-pushed the AEROGEAR-2776-better-ups-details branch from 1432a95 to 8e7b319 Compare June 6, 2018 15:05
@aliok
Copy link
Author

aliok commented Jun 6, 2018

Squashed and waiting for final approval

@aliok aliok merged commit 27208a5 into aerogear-attic:aerogear-mcp Jun 7, 2018
@aliok aliok deleted the AEROGEAR-2776-better-ups-details branch June 7, 2018 09:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants