Built-In Actions UIDocumentBrowserViewController - uidocument

Is it possible to control which built-in actions appear in the UIDocumentBrowserActionAvailabilityMenu / UIDcoumentBrowserActionAvailabilityNavigationBar associated with a UIDocumentBrowserViewController?
I'd like to convert my app's custom browser to the UIDocumentBrowserViewController. Although I'm new to UIDocumentBrowserViewController, its sharing feature seems inconsistent with selling in-app purchases which, in my app, can be represented as a documents.

You can only add custom actions, but you don't have control over the built-in actions

Related

Is there a tool to generate a React UI from an OpenAPI specification?

I'd like to generate an "out of the box, customer facing" (within reason!) React UI from an OpenAPI specification - here is my shopping list of nice-to-haves:
Show a list of API entities with some sort of hierarchy where they are related
Clicking on an entity would display a paged, sortable, filterable grid for that entity
Basic UI for adding/editing new entity complete with type editors/validation for each entity property
Allowing for styling/logic customisations whilst still allowing re-generation of the UI
I am aware of the Swagger UI project and even the React version, but it generates a very tech-centric output which is great for experimenting with the API but not quite what I am after here in terms of a customer-facing application - perhaps it can be customised, or does anyone know of alternatives?

Using abp-page-toolbar and abp-extensible-table

I am trying to use both components in my angular application. I am a backend developper and absolutely newbie in angular. I have been reading the roles and users components in the source code and I think I cloned it for my Customers component. I have guards, defaults and all the code like Roles and Users but, although the code compiles and the API call is done, I have nothing in the screen, only the Total records are displayed. No action buttons, no table rows, no pagination...
Is there anyone who has use these components and can bring me some help?
Many thanks
Those components are needed for customizing built-in modules. Let's talk about Users for example. The Users component is a built-in page and you do not have access to its code. However, you may still need to make some changes like adding a New User button on the toolbar or changing its columns, form fields etc. That's why ABP Framework provides some injection tokens to override/extend/customize these features. Since you are developing your own page, you do not need any of this. You can directly use ngx-datatable in your own component, add or remove columns and so on.

Is posible get the values from react-stripe-elements to display it in react-credit-cards component

I would like to use the security and functionalities provided by react-stripe-elements, but show it as the data is entered in the react-credit-cards component. For this I would need to access the values that these fields would have. So it looked something like this:
How can I access the values entered in CardNumberElement, CardExpiryElement, CardCVCElement, etc. to show them in the visual component?
Is this posible? Thx in advance.
This is not possible. You must provide CSS selectors to Elements for where your sensitive inputs (credit card number, expiration date and cvc) are to be displayed on your page, and then Stripe injects an iframe into your page to create each input. You cannot access the contents of these iframes from your code.
From the Stripe docs:
To securely collect card details from your customers, Elements creates UI components for you that are hosted by Stripe. They are then placed into your payment form, rather than you creating them directly.
Not being able to access this data is actually a very good thing. There are strict and complex regulations around direct handling of credit card data, with hefty fines for failing to meet them (PCI compliance).
That being said, it is possible to customize the appearance of Stripe's injected inputs with CSS. See their custom styles docs for more details. I've found this to meet my use cases for making custom forms. You could potentially leverage some of the CSS of a design you like from the react-credit-cards library you linked.
Finally, Stripe provides their own React library that might meet your use case or at least serve as a good starting point to apply your own customizations: react-stripe-elements.

How do I reuse an object used by a number of stores?

I'm developing a react native application using flux which has a number of components and a number of stores. The application uses a javascript SDK which authenticates once against an online rest API. The SDK object returned is then authenticated for any future calls.
I can either call the rest API from actions or stores. How do I share that authenticated SDK object against a number of stores or actions? And which of the two places are best to call the API?
Use a Singleton.
If you are packing your modules with Browserify or Webpack, it should be simple to make a module exports object which encapsulates the SDK interface.
The Singleton approach is how it should be but it also should have some architectural pattern :). In fact the logic for creating API call, authenticating etc. should be neither in action itself, nor in the store.
In the flux architecture the guys from Facebook introduced also some "helper utilities" called Action creators - those are responsible for creating the right action and passing it to the dispatcher (they might need to have some web api call behind to get the action). A very nice explanation of this part of Flux is available here - including visual explanation:
http://facebook.github.io/react/blog/2014/07/30/flux-actions-and-the-dispatcher.html
So - all in all - have an ActionCreator singleton to prepare the actions for you and use it in your views in the place where you want to send action to the dispatcher.

in backbone.js can a Model be without any url?

I have an app where the menu system is built dynamically using metadata fetched at startup. Based on this data, and menu selections, I need to craft a "filter box" where user can input search criteria. The "main" View consists of a filter box plus a search results panel where result(s) are rendered in accordance with their classes.
Can I model the Filter Box as a Backbone.js Model? It does not have any data fetches from the backend as its composition depends entirely on the menu selections + the metadata? E.g. when user selects "Sales" menu then the filter box might prompt for "Sales Order Number" whereas when user selects "Material" then the filter box might prompt for something else.
I would then use this widget as component of the "main" View, along with a set of results views made up on the fly. As users make their menu selections, this main View will un-render the existing filter box and recompute and re-render a new one. Other components on the screen could query the Filter Box for its settings.
The examples I have seen so far always have a url and a server fetch, save, etc. The only url-free example on the tutorial page says it is a "contrived" example. I was wondering if a backend provider is necessary and programming will be full of gotchas without conforming to this requirement.
Thanks.
You can have models without url property defined. One of the building blocks of Backbone is the Sync object, that will help you when pulling and pushing data, ideally from/to REST endpoints. For this to work you need to tell where the data are served, and to do so you set a value to url on Models or Collections.
If you don't need server comunication but you just want to use the utilities provided by simple Model or Collection (such as event handling, filtering, etc..) you just don't set url and you are good to go (just keep in mind that methods like fetch or save won't work).
Yes you can use Backbone for your DOM logic too. A model doesn't need to represent data from the server. Do whatever you like with the few basic elements of Backbone, simply use them when you feel like it'd do a great job :)

Resources