88import { customElement , LitElement , property } from 'lit-element' ;
99import { Providers } from '../Providers' ;
1010import { MockProvider } from './MockProvider' ;
11+ import { MgtBaseProvider } from '../components/providers/baseProvider' ;
1112/**
1213 * Sets global provider to a mock Provider
1314 *
@@ -16,26 +17,26 @@ import { MockProvider } from './MockProvider';
1617 * @extends {LitElement }
1718 */
1819@customElement ( 'mgt-mock-provider' )
19- export class MgtMockProvider extends LitElement {
20+ export class MgtMockProvider extends MgtBaseProvider {
2021 /**
2122 * A property to allow the developer to start the sample logged out if they desired.
2223 *
2324 * @memberof MgtMockProvider
2425 */
2526 @property ( {
26- attribute : 'signed-in ' ,
27+ attribute : 'signed-out ' ,
2728 type : Boolean
2829 } )
29- public signedIn ;
30+ public signedOut ;
3031
31- constructor ( ) {
32- super ( ) ;
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 ) ;
32+ /**
33+ * method called to initialize the provider. Each derived class should provide
34+ * their own implementation
35+ *
36+ * @protected
37+ * @memberof MgtBaseProvider
38+ */
39+ protected initializeProvider ( ) {
40+ Providers . globalProvider = new MockProvider ( ! this . signedOut ) ;
4041 }
4142}
0 commit comments