How to make the parameter's "map" button turned on by default in custom Integromat app? - make.com

By default, my select parameter allows me to choose the value within options. To enter an ID from the previous app in the Scenario, I have to manually click on the 'map' button. How can the parameter's map mode be turned on by default?
Screenshot

Simply add the line "mode": "edit" to your select object, like so:
{
"name": "currencyId",
"type": "select",
"label": "Currency",
"options": "rpc://listCurrencies",
"required": true,
"mode": "edit"
}
This will turn the map button on by default.
The Integromat Best Practices docs describe the cases in which this setting should and should not be used.

Related

I need to capture jsonapi response before node is created by JSONAPI through custom code

In Drupal 8/9. Need to capture data including 'attributes', 'type' and custom created group 'translate' when other party using jsonapi POST menthod to create articles in my site. This should be captured in custom module.
For Example here is the payload:
{
"data": {
"type": "node--cars",
"attributes": {
"title": "Test article flow 1"
"body": "This is custom body"
},
"relationships": {
},
"translate": {
"custom_field1": "Text 1",
"custom_field2": "Text 2"
}
}
}
API point fo this is "/jsonapi/node/cars". So actually before the 'cars' node is created need to capture "custom_field1" and "custom_field2" in "translate" so that need to write custom validation from custom module. Tried creating normalizer "TypedDataNormalizer" and "ContentEntityNormalizer" and in "normalize" class getting data. But its empty and its not calling this normalizer. Can someone please help me in this case how to achieve this. Thanks in advance

Storybook: How to have a "select" control with options but also free text?

In storybook (React), I have set-up the following control that correctly displays iconClass as a select. I want it to provide those three "most used" options, but also give the user the ability to input a custom value. How to get this hybrid select / input text control? Thanks
argTypes: {
iconClass: {
control: {
type: 'select',
options: [
'fa-arrows-alt-v',
'fa-arrows-alt-h',
'fa-link',
]
},
}
}

Watson Conversation and Google Map Static

I'm currently giving google map static a long/lat for the location.
Is it possible to display the image of google map static on the conversation?
Thanks
You won't be able to display it in the "Try it out" UI, but if you deploy your own application you can.
In your input node you can put the following line of text:
<img src="https://maps.googleapis.com/maps/api/staticmap?center=$long,$lat&zoom=11&size=200x200&sensor=false">
Then create a context variable long and lat. For example (placed in Welcome node).
{
"context": {
"lat": 55.27088,
"long": 25.2048
},
"output": {
"text": {
"values": [
"Hello. How can I help you?"
],
"selection_policy": "sequential"
}
}
}
Your previous line will be translated to this:
<img src="https://maps.googleapis.com/maps/api/staticmap?center=25.2048,55.27088&zoom=11&size=200x200&sensor=false">
Which will render:
The solution above will allow you to render in the conversation simple application.
Another option is to pass the lat/long as context variables to your application, and let it render. It will give you more control of how the map is rendered.
The following link will show what options you have for google maps.
https://developers.google.com/maps/web/

How to add a role profile page to meteor user?

I have 2 roles in my app. Users and doctors.
I want that a doctor can edit extra fields like picture and text field on an extra profile page for doctors.
How to add this fields probably not to the profile but to an extra part of the users collection and make it then public availible as a profile page /doctor/_id
I am now experimenting with meteorkitchen, which is great, but when I add a profile.doctor.field1 and show this on an page like user_settings/profile/doctor and update it the other fields of the profile are overwritten with empty values. I assume it assumes that all profile attributes are edited on one form and when one field is empty so it deletes them. But this is not what I want.
(Can someone add a tag meteorkitchen please. I have not enough reputation. thanks)
Edit:
this are the settings for the router
var roleMap = [
...
{ route: "user_settings.doctor", roles: ["doctor","admin"] }
];
and attached this part for the form
"name": "edit_form",
"type": "form",
"mode": "update",
"title": "Edit your doctor profile",
"submit_route": "user_settings.profile.doctor",
"query": {
"name": "current_user_data",
"collection": "users",
"filter": {
"_id": "Meteor.userId()"
},
"find_one": true,
"options": {},
"params": []
},
"fields": [
{
"name": "profile.doctor.quote",
"title": "Favorite quote",
"type": "string",
"required": true
}
]
the problem is that on update some of the profile values the others are deleted.
If you want to stick with Meteor Kitchen, here is how I would proceed.
First, you need to create a "doctor" role. See your application page on kitchen designer, you can add it here.
Second, you need to add your new "doctor" role to the page roles. You can do it directly in the role map located in client/views/router.js or using the designer.
EDIT Following the discussion in the comments here is an update:
You can change the collection name directly in the section "Edit source" of the designer. You go to your page, in the query, you set
"query": {
"name": "doctor_user",
"collection": "users",
"filter": {
"_id": ":userId"
},
"find_one": false,
"options": {},
"params": []
},
The thing is that even if you do that, only admins can update the users collection. So you need to download the user-roles package from perak, put it inside your project (only put the folders) and remove the user-roles pre-installed package (meteor remove perak:user-roles).
Once you have done that, go to server/collections and replace the update part of users.js with that:
update: function (userId, doc, fieldNames, modifier) {
return Users.isInRole ("admin")|| (Users.isInRole ("doctor") &&
!_.contains(fieldNames,'roles')));
It will allow users with the doctor role to update any user field except for the "roles" field.
Last step, you edit the server\publications\users.js file and add this in it:
Meteor.publish("doctor_user", function(_id){
return Users.isInRoles ({"doctor", "admin"}) ? Users.find({_id: _id}) : this.ready();
});

How to inject into Gmail compose iframe?

I'm trying to add a button into the Gmail compose toolbar at the Insert section specifically. I've seen an extension that does just that, so I know its possible but I'm confused on how to do it.
I'm using the content_Script to javascript inject into the webpage but the compose window is in an iframe window which apparently you aren't allowed to inject into because the iframe loads after the content_script even with the "run_at": "document_end".
Also another thing I'm confused on is that Gmail has all their id tags randomizing so how could I know what tag to inject into if they are always different every time I compose an email.
So could anyone help me out with this an let me know how to go about using a content_script to inject into an iframe and how to get around GMail id tags always randomizing/being different.
{
"name": "Test Gmail",
"version": "0",
"description": "Test Gmail",
"permissions": ["tabs", "http://*/*", "https://*/*"],
"content_scripts": [
{
"matches": [ "http://*/*", "https://*/*"],
"css": ["mystyles.css"],
"js": ["myScript.js"],
"run_at": "document_end",
"all_frames": true
}
]
}
Use JQuery and listen for the even "DOMNodeInserted". After that you want to use JQuery to locate where you want to insert the button or whatever using the function $(selector, context); to search for the parent. GMail id name is all done dynamically so you have to try search for something that doesn't change such as the html tag or class name's.

Resources