Displaying multiple resources under one - react-admin

I would like to know whether it's possible to have two resources under one.
Example:
<Resource name="notifications" options={{ label: "Push Notifications"}} icon={NotificationsActiveIcon} list={NotificationsList} create={NotificationsCreate} edit={NotificationsEdit} />
Now I would like to have something like Resource name="notificationAudience but to access that data in the notifications resource. So pretty much create data in one Create for two resources. Is something like this possible in React Admin? If so please do share an accurate/detailed explanation on how something like this would be possible. So far I couldn't find what is satisfying in React Admin documentation
Thank a lot!

Related

How can I gain permission in HealthKit for writing workout routes?

I'm trying to add map data to my saved runs and bike rides for an Apple Watch app. I'm using CLLocationManager and HKWorkoutRouteBuilder.
Apple seems to have a pretty decent guide on building workout routes here. However, I'm struggling with the sentence in the documentation that says: "Specifically for route data, you must request permission to read and share both HKWorkout and HKWorkoutRoute samples."
Below are my app's current permissions. I know I still need "Workout Routes" to show up as an option, but am struggling to do so. On top of that, I'm not exactly sure if there are other permissions that I would need to obtain as well.
Thank you so much for your help!!
-David
Whelp... this seems to answer my question!
let sampleTypes: Set<HKSampleType> = [
HKSampleType.quantityType(forIdentifier: .heartRate)!,
HKSampleType.quantityType(forIdentifier: .activeEnergyBurned)!,
HKSampleType.quantityType(forIdentifier: .distanceWalkingRunning)!,
HKSampleType.quantityType(forIdentifier: .distanceCycling)!,
HKSeriesType.workoutType(),
HKSeriesType.workoutRoute(),
]
Just had to add the last two lines to the array of sample types. I hope this helps at least one other person!

django-avatar, 1 query per avatar loaded

I'm displaying a page with around 60 avatars using django-avatar and a query is made for each one of them.
I cannot use User.objects.select_related('avatar') because there is no link between my user and his avatar. So how do I optimize this?
EDIT:
Avatars are retrieved in the template using {% avatar user %} (this is a template tag specific to github.com/jezdez/django-avatar, which seems to be the most used application for handling user avatars. I'm asking this question because some people certainly already had to face the issue of displaying many avatars using this application and I would like to know their solution).
Using the cache (like memcached) is the answer.

Umbraco: A/B testing, links in structure

I'm having a problem when trying to A/B test certain nodes in my node-tree in Umbraco.
What I want to do is to copy a node in the node-tree to a specific spot and use that B-structure to see which of the structures works best, using Google analytics.
For example we have two node structures, let's call them "Private" and "Sweden".
Their structure with childnodes and properties are exactly the same. The only difference between them is the propertyvalues (content). The "Private"-URL is www.mysite.com/Private and the "Sweden"-URL is www.mysite.com/Sweden.
What I would like to do is to change every link on the B-structure, so that it points to its match at the A-structure. The problem is that since it's two different structures, it will have two different alternative links.
With other words, it should be a coinsidence that it enters the B-structure, then be moved back to the A-structure in the next click.
We manage what page it should load (either the A-node or the B-node) with scripts, so that it has a 50% chance for each node, and if it lands on the B-node, Google analytics will save data. What we can't manage is that every link on that page will be to the A-node.
I'd appreciate any help I can get.
Regards,
David
There's a couple of ways that seem likely to give you a start at least.
The /config/urlrewriting.config file allows you to set up multiple redirect rules within umbraco so a section like the following might work in sending all requests (whether (/sweden/pagename/ or /private/pagename/) back to the private structure. Not sure how GA will handle it:
rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="http://www.mysite.com/private/$1" redirect="Domain" redirectMode="Permanent" ignoreCase="true" />
Secondly a simple httpmodule (http://support.microsoft.com/kb/307996) can process all page requests and redirect as required - you could do a gaq_push here directly or indirectly.
I'd be interested to know how you get on - it seems a good area for extension to Umbraco.
I'm not sure I have understood perfectly what you need to do, so please excuse any assumptions that may prove mistaken. Here's what I think:
Since A & B nodes should share the same html content (besides the links of course), why don't you make the link href attribute dynamic by using a bit of razor in the template or macro:
#{var isANode = CurrentPage.Parent.Name == "Sweden"; }
A similar approach would work if you are using web forms.
We finally came to the final decision to use the alternative template-solution. Since there seem to be no generic solution for my case of this problem we had to create an alternative template with specific macros to render the different information for every documenttype we're using.
Creating dynamic links for every page is a hell of a job in this stage in the project, since there are so many pages and links. Also some links are made in javascript, so there's another problem.
I copied the a-structure to another node, only for the reason to be able to change propertyvalues. There might be a problem logging and track the information with Google Analytics though, so that's the next step for us in this project. In our alternative templates we're getting the propertyvalues from the b-structure.
Still, if anyone have some better solution I'd highly appreciate it!
Regards,
David

Grails: How to get information about the currently logged in user?

I am actually feeling a bit dumb for asking this but I tried for half a day now and can't find a way to get information on the currently logged in user in my controllers as well as my views.
I tried several suggestions I found on the web like "authenticateService" etc.
Now, it is possible that I have a misconception about the basics of Grails there. I come from other frameworks where a task like this is a matter of {{ request.user }} and I am done with it.
My exact need is to be able to access the ID of the currently logged in user in order to serve a custom navigation.
Thx in advance for your help.
def user = springSecurityService.currentUser
always good to try the docs:
http://burtbeckwith.github.com/grails-spring-security-core/docs/manual/index.html
In gsps, there is a specific tag, which we use like
<sec:loggedInUserInfo field='firstName'/>
again, its in the docs posted above.
Nowadays, I think the way to do it is:
def user = getAuthenticatedUser()

Apple Appstore name search via the API?

Is it possible to do a search for apps by title via the API? For example, the equivalent of "Return a list of apps (if any) with the word 'dog' in the title".
I've seen two access points that come close, but don't seem to offer this:
The RSS feed; it lists apps, but apparently only groupings like, "top 100..."
The query interface; but it doesn't seem to query over the app media type. (?)
I found the answer. Although not explicitly documented, it's possible to search by app name.
http://www.apple.com/itunes/affiliates/resources/documentation/itunes-store-web-service-search-api.html
You're right, it wasn't very clear on that iTunes page at all. The parameter entity=software is the key. For example, here's a search for my app, TypeLink:
http://itunes.apple.com/search?entity=software&term=typelink&callback=myCallbackFunction
If you're wondering what the callback is for, here's some more info on the JSONP format it uses:
http://en.wikipedia.org/wiki/JSONP
For any future person who wants to link to the App Store keyword search result page directly from a web link - this format works as of April 2013:
http://phobos.apple.com/WebObjects/MZSearch.woa/wa/search?media=software&submit=media&term=KEYWORD%20GOES%20HERE
Was a PITA to figure out but finally got the syntax right... Needed this because a client has apps made by multiple developers so I couldn't just use the suggested Appstore.com/DeveloperName link to return all their apps.
Thanks all for sharing wisdom. Hope this helps someone.