strophe-sample | Project template for JavaScript-based XMPP apps
kandi X-RAY | strophe-sample Summary
kandi X-RAY | strophe-sample Summary
Project template for JavaScript-based XMPP apps using Strophe and Openfire
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of strophe-sample
strophe-sample Key Features
strophe-sample Examples and Code Snippets
Community Discussions
Trending Discussions on strophe-sample
QUESTION
I am using the apostrophe-samples
Github project to do some tests regarding the pieces modal customization. So far, I've added filters as explained in the tutorials, and added columns as seen in the apostrophe-pieces
source code (I think it would be an interesting topic to add to the tutorials, IMHO).
However, I have a couple of doubts, given the example that specialists joinByArray
products and products joinByArrayReverse
specialists:
- Can columns be sorted in any way through the UI (e.g., an option that enables sorting by clicking the table header) or does it rely entirely on the piece's
defaultSort
? - Can other fields other than the title be added as filters? I was able to add
_specialists
as products filter, displaying the title, but I'm wondering if a different field could be used. - Can reverse joins be added as filters? As said, I was able to add
_specialists
as products filter, but not the other way around. - Can joins/reverse joins be added as columns? If I add '_specialists' I column, I get displayed an array like
[Object]
, not the title as in the filter.
ANSWER
Answered 2019-Feb-15 at 00:43"Can columns be sorted in any way through the UI (e.g., an option that enables sorting by clicking the table header) or does it rely entirely on the piece's defaultSort?"
Not at present, no. The intent was to provide this feature but it has not been built out so far, as surprisingly it hasn't been a pressing need for our own clients although it is certainly a common feature.
It would make a good community contribution, or it could be sponsored via apostrophe enterprise support. It likely wouldn't take long to add.
"Can other fields other than the title be added as filters? I was able to add _specialists as products filter, displaying the title, but I'm wondering if a different field could be used."
Not currently, but this one would be an easy PR. Here's the relevant line of code in apostrophe-schemas/index.js. You have access to the field
object here, so you could easily do a PR to look in a different property of doc
if field.filterLabelField
is set, let's say, still falling back to title
.
"Can reverse joins be added as filters? As said, I was able to add _specialists as products filter, but not the other way around."
Not currently. In lib/modules/apostrophe-schemas/index.js
you'll see that there is currently no addFilter
property for these. The implementation is possible. The code would need to fetch the chosen doc on the reverse side, get the id or array of ids it joins to, and chain a .and({ $in... })
call.
"Can joins/reverse joins be added as columns? If I add '_specialists' as a column, I get displayed an array like [Object], not the title as in the filter."
This one is supported today. You need to set a partial
property for the column. This is just a function that accepts the value of the column and returns a string. For instance:
QUESTION
Is it possible to edit which fields of a joined piece get loaded when using the find
cursor? For example, using the apostrophe-samples
project, I've edited the product piece join to specialists by adding the following projection:
ANSWER
Answered 2019-Feb-13 at 12:16Currently this is not possible in an elegant way. The filters configured for a join are invoked just before toArray is invoked for the query that fetches the join, which means there is currently no opportunity to override them. See the implementation of the joinDriver
method:
You could of course re-fetch the joined documents after your query, but that isn't a great solution.
An implementation that allowed for this would involve upgrading the withJoins
option, which can be used to override which joins are performed at all by passing an array of join names, to also support including objects in that array. Those objects could feature both a join name (or join dot path) and overrides for cursor filters. This would then have to be propagated through to joinDriver
without introducing bc breaks, which is possible since the methods involved do take an options
argument.
QUESTION
I was reading the tutorial found here: https://apostrophecms.org/docs/tutorials/getting-started/layout-widgets.html
It says:
An alternative to
contextualOnly
,skipInitialModal
lets you skip the widget manager modal when the widget is created (likecontextualOnly
) but preserves the Edit UI for later use. This is useful for widgets that have secondary configuration, like setting a background color.
This is EXACTLY the kind of functionality that I want to expose for my users. I have already built a much more complex version of the code found in the gist above, but the simpler version still has the same error that I am experiencing so I am including the code for that here.
Essentially, I want to have an editing dialog for my custom layout widget that allows them to change the background color, decide whether or not to add a background image, decide how that background image is displayed, all without having to touch code.
The ProblemAfter saving the changes to my custom widget, you are unable to make changes to what is inside my widget's areas. Instead, it spits out an error telling you that You were unable to take control of the document.
You can get the wanted functionality back if you refresh the page, but obviously that is not ideal.
What am I missing here?
Example CodeYou'll notice that the code below is only slightly modified example code for the tutorial page above.
Here is the simple widget's widget.html
file:
ANSWER
Answered 2018-Jun-15 at 12:38The original issue reported has been fixed in this commit https://github.com/apostrophecms/apostrophe/pull/1430 .. it is currently in master
and will be published to npm within a week or so.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install strophe-sample
On a UNIX-like operating system, using your system’s package manager is easiest. However, the packaged Ruby version may not be the newest one. There is also an installer for Windows. Managers help you to switch between multiple Ruby versions on your system. Installers can be used to install a specific or multiple Ruby versions. Please refer ruby-lang.org for more information.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page