-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(picker): allow headless use of this lib
This change will mean developers can now use the firebase service directly to render their own UI. Only thing devs will have to do is the following - Set hide-customer-picker="true" on eva-config-picker, this will hide the picker if you're logged in / after login - Listen for authStateChange before trying to fetch any data from the firebase service - Fetch data from firebase and render their own UI
- Loading branch information
realappie
committed
Nov 9, 2021
1 parent
834a2fb
commit a232e4f
Showing
9 changed files
with
165 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// Ideally this file is placed in typings.d.ts but thats not possible | ||
// https://stackoverflow.com/questions/52351620/stenciljs-typescript-cannot-find-name-when-exporting-an-enum | ||
// | ||
export enum AuthState { | ||
LOADING = 'loading', | ||
LOGGED_IN = 'logged_in', | ||
LOGGED_OUT = 'logged_out' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
export * from './components'; | ||
export { BaseEnvironment } from './components/picker-customers/picker-customers'; | ||
export * from './typings'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { DocumentReference} from "@firebase/firestore"; | ||
|
||
export { AuthState } from './components/picker/auth-state.enum' | ||
|
||
export interface BaseCustomer { | ||
logoPath: string; | ||
name: string; | ||
} | ||
|
||
|
||
/** | ||
* This will contain a summary of the customer, with only a reference to the base environments | ||
*/ | ||
export interface SummarisedViewCustomer extends BaseCustomer { | ||
baseEnvironments: DocumentReference[]; | ||
} | ||
|
||
|
||
/** | ||
* will contain all the information in the summary, but with the base environments fetched | ||
*/ | ||
export interface ExtendedViewCustomer extends BaseCustomer { | ||
baseEnvironments: BaseEnvironment[]; | ||
} | ||
|
||
export interface BaseEnvironment { | ||
endpoint: string; | ||
type: string; | ||
customerName: string; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters