Trouble showing list of users and customers in view model? - angularjs

I am creating a web app on MEAN stack and for some reason i have to save two different schema in same collection named "users" and saved the userSchema and customerSchema in that collection in mongoose but in view model while listing the data in user list it shows users as well as customers which is saved in the collection. I want to display users list in and customers list in separate pages.
Can anyone guide me for this problem ??
Thank you in advance!

You have two options: you can either separate the server side queries and have two API calls, or you can use an angular filter (ng-filter) to display only one type in your table. If you're primarily going to be displaying only one type of user per page, I would suggest separating on the server side, to reduce the data transferred to the client, and to allow for improved security (for example if details of one type of user should not be publicly visible)

Related

FaunaDB, make connection between different users, I.e. become friends

I have a use case where I want to connect two different user roles, and if they accept and want to connect, new features will open up. It is very similar to how friend requests work at Facebook or LinkedIn, opening up and showing more content. Let's call them role1 and role2.
All users are stored within a "users" collection with an id. Depending on their provided role within the document attached to the "users" collection, they can store additional data in their respective role-collection, i.e., role1 collection or role2 collection.
What is the best approach and structure to connect the two users, i.e., become "friends"? Should I have the connection stored in a new collection, named perhaps connections-collection, or multiple collections?
I'm using Next.js, NextAuth for user authentication, and FaunaDB as a database. I'm using Fauna's query language, FQL.
Have you perhaps seen fireship's video RE: fauna db? I think it covers what you want to do and how you can proceed.
Edit: There are many ways to implement this. Based on my understanding, perhaps you can have "Friends" and "Requests" arrays stored under a user document. That way you can differentiate between confirmed friends or a just request.
Example: When user1 initiates a friend request with user2, you store user1's ref under "Requests" of user2's document. When user2 confirms, you move user1's ref to the "Friends" array.
This is just a overly simplified idea and you may need to consider your options and the implications. You would need to plan and define the predicate in both roles so you would only see what is necessary.

How to set different access levels for dashboard data in Google Data Studio

Lets assume I am creating a google DataStudio dashboard for a sales data which is having sales records for countries.
For each country has a country manager and they are assign to single supervisor in Head Office.
My question is:
Can we develop a Google DataStudio DashBoard which is capable to restrict data only relevant to a particular country if it is viewing by a country manager and to show whole data relevant to all countries if it is viewing by the supervisor of country managers?
There is no easy solution to have a page-level permission, but there are three options.
Break up the report in to separate ones (this is the most simple solution, although it creates multiple reports)
Use Viewer's credentials instead of Owners’ credential (You must grand viewers access to your gbq data source, which is not ideal in most cases)
Filter by email (This works for small number of users, but quite cumbersome for multiple users)
For the option one, you can break up one "master report" that has all pages, and creating multiple sub-reports by using URL embedding by page
In your Data Source, create a column called "e-mail" and populate it with the e-mail address of the manager that you want to be able to see that particular line.
After you do this, use the "Filter by email" option in the Data Source:
And select the field you just created:
And there you are. Your data will only be searchable by the person you selected, based on the email they are using to access the dashboard.
If you want more than one person to be able to see a particular data, you'll need to duplicate the respective lines in the Data Source.

Firebase Realtime array populate div

Okay so I’m need guidance on where to start.
What I want to do is upon clicking a button in my web app which will be labelled “search” the web app will connect to my realism database and search the data base for the “search criteria” and the once found all matching cases it will create div blocks with the information inside it, in a list view and assign the ID of the div to the UID it gets back from the database.
database:
Users
--> Country
---->State
----->City
------>Post/ZipCode
------->UID
--------> Users informantion
Welcome to StackOverflow!
A great place to get started is the Firebase Realtime Database doocumentation or searching for Firecasts on YouTube (linked below).
As requested, here are some questions to ask yourself to get started and help scope out and define your new Firebase project.
What language are you going to use?
Are you planning on using any frameworks/libraries? e.g. For Javascript, these would include things like jQuery, Polymer, and React
What information are you storing in your database? e.g. user profiles, private user data/settings, public indexes, username lists, etc.
How is your database structured?
What data is being searched? The entire database? Values in a certain location?
What data needs to be displayed in your view?
Is the data accessible for just the current user or is it a public database that anyone can use?
What search criteria will be used? Is it just one filter at a time or many?
The answers to these questions aren't set in stone, but are to help you start thinking about the future of your project. They can be changed at any time as this isn't SQL where everything has to have its own schema.
If you intend on using "advanced searches" where you'll filter by multiple parameters at the same time, consider using Cloud Firestore instead.
I recommend looking at some Firecasts to help guide you through these questions. Here are some links to them:
Firebase YouTube Channel
Video: Getting Started with the Firebase Realtime Database on the Web
Playlist: Firebase on the Web

Can I use deep links for Google Data Studio report and/or pass data source parameters in the report URL?

Is it possible to build one Google data studio report (i.e., template) and use a URL that links it to a specific data-set or defines a hidden filter that creates a sample of a larger data set?
I understand Data Control allows this for users operating under the same Google domain.
However, I want to provide multiple university student teams with their personal information but not allow the other teams to see or filter for information that they should not see. Ideally I could simply share a customised URL with each team that takes care of this filtering/sampling.
Any guidance appreciated - many thanks!
You can do this with custom bookmarks and URL parameters.

Salesforce Objects available in Social Tables

My question has to do with the Salesforce integration in Social Tables and is two-fold: 1. Am I correct that only objects belonging to Contacts can be imported to Social Tables? 2. Is further integration under development?
To clarify, at present it appears that Social Tables pulls contacts from Campaigns, but does not pull other campaign data - only data stored in Contact records.
To really make use of the Salesforce integration, we'd like to import event data to Social Tables fields (e.g. Table #, Seat # etc). (Our use case is a seated fundraising breakfast.) Intuitively, that would mean Campaign Member in Salesforce would need to be imported to Social Tables along with Contacts (event-specific data can't be stored that in Contact records, since the guest data and data types would vary for different events).
Similarly, it would be great to have the option to import only the contacts in a campaign that have a specific status or "Attending?" value. I know it's possible to map Salesforce fields to event-specific fields in Social Tables, so maybe I'm missing something...thanks in advance!
Let me try to answer those for you.
Am I correct that only objects belonging to Contacts can be imported to Social Tables?
This is almost correct, for a given CampaignMember of a Campaign we are currently pulling all Lead or Contact fields (depending on the type of the CampaignMember). This does not include CampaignMember fields.
Is further integration under development?
My team is responsible for Check-In and although our focus is currently not on adding SF Integration features, we weigh customer feedback very heavily when revisiting our roadmap. You make a very valid point with including CampaignMember fields with the import and I will communicate this to our product team so they can handle accordingly.
Importing a subset of members is another great feature request that we will note. Once we have CampaignMember fields included you could accomplish this by importing all members then selecting users with unwanted statuses and deleting. Not the best but will work.
Thanks for reaching out with the fantastic feedback and hope this helps answer your questions!

Resources