I am struggling to get the right syntax for an export.
I now have:
export default withRouter(connect(mapStateToProps, mapDispatchToProps)(withStyles(styles)(Appbar)));
Which is working like it should be. I now want to implement firestoreConnect. Something like this:
firestoreConnect([{ collection: 'users'}])
Question: How do i combine these two together into 1 export
I have seen several cases where you would use compose to combine those two lines.
I have not yet managed to do so...
Hope you guys can help.
Thanks in advance.
I made it work like this:
const enhance = compose(
withRouter,
withStyles(styles),
connect(mapStateToProps, mapDispatchToProps),
firestoreConnect([
{ collection: 'users' }
])
)
export default enhance(Appbar)
Related
I need some help importing schemas from Visual Studio Code into the Sanity console. I'm importing everything as usual and when Content Studio is successfully compiled I'm still not seeing anything in the Studio
I see Empty Schema every single time. Anyone know how to fix this?
one example of a schema im trying to import
export default{
name:'abouts',
title:'Abouts',
type: 'document',
fields:[
{
name:'title',
title:'Title',
type:'string'
},
{
name:'description',
title:'Description',
type:'string'
},
{
name:'imgUrl',
title:'ImgUrl',
type: 'image',
options: {
hotspot: true,
},
},
]
}
all my types are document
here is the schema.js
// First, we must import the schema creator
import createSchema from 'part:#sanity/base/schema-creator'
// Then import schema types from any plugins that might expose them
import schemaTypes from 'all:part:#sanity/base/schema-type'
import testimonials from './testimonials'
import about from './about'
// Then we give our schema to the builder and provide the result to Sanity
export default createSchema({
// We name our schema
name: 'default',
// Then proceed to concatenate our document type
// to the ones provided by any plugins that are installed
types: schemaTypes.concat([
testimonials,
about
]),
})
I know its super simple but I'm trying to really dig in and get a portfolio started. Thanks so much in advance!
Your schema is named abouts, but you import about in the schema.js-file. The names must match.
as stated above, make sure the names are exact. also under
types: schemaTypes.concat([
make sure each type has a comma after EVERY one, or it wont render it.
hope this helps. 45 min of digging around and testing and this is what fixed it.
so it should look like this:
types: schemaTypes.concat([
about,
testimonials,
brands,
ect....
I have create a java-function that return the full path between two OElement but I do not found the correct way to return it results.
Actually it collect all the path in ArraList<ArrayList> but it is not shown in the Studio. I suppose that I should use something like OResultSet but I don't found anythig about its.
Example:
I implemented this: fullpath(from, to, maxDepth, conditions)
select fullPath(#58:0, #65:0)
n1,path_1,n2_1,path_1,n3_1,path_1,n4
n1,path_2,n2_3,path_1,n4
n1,path_1,n2_2,path_1,n3_2,path_1,n4
n1,path_1,n2_2,path_2,n3_3,path_1,n4_1,path_2,n3_2,path_1,n4
and I'am working on this:
select fullPath(n1, n4, 100, include(path_1))
n1,path_1,n2_1,path_1,n3_1,path_1,n4
n1,path_1,n2_2,path_1,n3_2,path_1,n4
The code is here: fullPath on github
Thanks.
I think the main problem here is that the result of the function is being returned as a single result, so Studio cannot manage it.
As a first attempt, I'd try to do a
SELECT expand(fullPath(...))
This will definitely work in the tabular view in Studio, but it will still not display in the GRAPH view.
For the GRAPH view, my suggestion is to put all the RIDs in a single ArrayList and then do the expand()
With ArraList<ArrayList> did not work, but an ArrayList<OIdentifiable[ ] > did the job.
I try to extend autocomplete-content macro by own logic witch should be call some rest.
I finded autocomplete-content.js file where autocomplete-content is defined, but I dont have idea how to extend it by own autocompleteModule.
I tried create own JS file as resource in own add-on, but it execute before autocomplete-content.js on confluence, and autocompleteContent object was undefined.
In the end I need to have own autocomplete tool with own rest service witch will be fatch data from other DB.
If possible use AUI Select2.
Please note: AUI Select2 is based on older Select2. You have to refer to this documentation: http://select2.github.io/select2/
Something else would be to use QuickSearchDropDown
It is not really documented, but quite easy to use. Look for a file quicksearchdropdown.js in Confluence sources.
You can use it like this:
AJS.$('#myinput').quicksearch(URL_RELATIVE_TO_CONFLUENCE_BASE, false, {
makeParams: function (params) {
return {
username: params.term,
staticParam: 'blabla'
};
}
}
I have something like this:
{{topbar-nav}}
{{outlet}}
I have a lot of pages, where I want to render just the top-bar, and nothing else. Normally, I have to create a lot of routes, that would basically do nothing (rendering emptiness), and I don't want to pollute router like this. Is it possible to somehow handle this situation? For example a default route like:
this.default_route("default");
Well, I found it myself.
this.route('default_page', { path: '/*wildcard' });
Important part is
{ path: '/*wildcard' }
Inside embedded i18n form i need to get object.
In this example i got ArtistImageTranslation object, but i need ArtistImage.
Can somebody help me, how to get this?
class ArtistImageTranslationForm extends BaseArtistImageTranslationForm
{
public function configure()
{
$this->getObject();
....
}
}
Have you tried the following?
$artistimage = $this->getObject()->getArtistImage();
I spent half of day today on the same problem and looks like I finally found something ;)
First, if you need to access the fields which are in the "Translation" part of the table you can access them directly from the Object contained in the form. Just access the properties without using the getter (I know it's not the nice way but it works). So you can use something like:
$this->getObject()->id;
$this->getObject()->translated_name;
etc.
If you really need the original object you can access it like this:
$this->getObject()->getTable()->getRelation('ArtistImage')
->fetchRelatedFor($this->getObject());
Hope this helps.
Try :
$artistimage = $this->getObject()->artistImage;
or
$artistimage = $this->getObject()->artist_image;