File tree Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change 2929 depends-on ="mgt-teams-provider "
3030 > </ mgt-msal-provider >
3131
32- <!-- <mgt-mock-provider></mgt-mock-provider> -->
32+ <!-- <mgt-mock-provider signed-in ></mgt-mock-provider> -->
3333
3434 < mgt-login > </ mgt-login >
3535 < mgt-person person-query ="me " show-name show-email person-card ="hover "> </ mgt-person >
Original file line number Diff line number Diff line change 55 * -------------------------------------------------------------------------------------------
66 */
77
8- import { customElement , LitElement } from 'lit-element' ;
8+ import { customElement , LitElement , property } from 'lit-element' ;
99import { Providers } from '../Providers' ;
1010import { MockProvider } from './MockProvider' ;
1111/**
@@ -17,8 +17,25 @@ import { MockProvider } from './MockProvider';
1717 */
1818@customElement ( 'mgt-mock-provider' )
1919export class MgtMockProvider extends LitElement {
20+ /**
21+ * A property to allow the developer to start the sample logged out if they desired.
22+ *
23+ * @memberof MgtMockProvider
24+ */
25+ @property ( {
26+ attribute : 'signed-in' ,
27+ type : Boolean
28+ } )
29+ public signedIn ;
30+
2031 constructor ( ) {
2132 super ( ) ;
22- Providers . globalProvider = new MockProvider ( true ) ;
33+
34+ // Access the 'signed-in' attribute directly.
35+ // LitElement doesn't parse attributes early enough for us enact on them from the constructor.
36+ const signedInVal = ( < any > this ) . getAttribute ( 'signed-in' ) ;
37+ this . signedIn = signedInVal !== 'false' && signedInVal !== null ;
38+
39+ Providers . globalProvider = new MockProvider ( this . signedIn ) ;
2340 }
2441}
You can’t perform that action at this time.
0 commit comments