Commit c09326f1 authored by David Burke's avatar David Burke

Login component mostly works

parent 62f001e3
Pipeline #36973006 failed with stage
in 2 minutes and 39 seconds
......@@ -8419,8 +8419,7 @@
},
"ansi-regex": {
"version": "2.1.1",
"bundled": true,
"optional": true
"bundled": true
},
"aproba": {
"version": "1.2.0",
......@@ -8438,13 +8437,11 @@
},
"balanced-match": {
"version": "1.0.0",
"bundled": true,
"optional": true
"bundled": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
......@@ -8457,18 +8454,15 @@
},
"code-point-at": {
"version": "1.1.0",
"bundled": true,
"optional": true
"bundled": true
},
"concat-map": {
"version": "0.0.1",
"bundled": true,
"optional": true
"bundled": true
},
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
"optional": true
"bundled": true
},
"core-util-is": {
"version": "1.0.2",
......@@ -8571,8 +8565,7 @@
},
"inherits": {
"version": "2.0.3",
"bundled": true,
"optional": true
"bundled": true
},
"ini": {
"version": "1.3.5",
......@@ -8582,7 +8575,6 @@
"is-fullwidth-code-point": {
"version": "1.0.0",
"bundled": true,
"optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
......@@ -8595,20 +8587,17 @@
"minimatch": {
"version": "3.0.4",
"bundled": true,
"optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
},
"minimist": {
"version": "0.0.8",
"bundled": true,
"optional": true
"bundled": true
},
"minipass": {
"version": "2.2.4",
"bundled": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.1",
"yallist": "^3.0.0"
......@@ -8625,7 +8614,6 @@
"mkdirp": {
"version": "0.5.1",
"bundled": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
}
......@@ -8698,8 +8686,7 @@
},
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
"optional": true
"bundled": true
},
"object-assign": {
"version": "4.1.1",
......@@ -8709,7 +8696,6 @@
"once": {
"version": "1.4.0",
"bundled": true,
"optional": true,
"requires": {
"wrappy": "1"
}
......@@ -8785,8 +8771,7 @@
},
"safe-buffer": {
"version": "5.1.1",
"bundled": true,
"optional": true
"bundled": true
},
"safer-buffer": {
"version": "2.1.2",
......@@ -8816,7 +8801,6 @@
"string-width": {
"version": "1.0.2",
"bundled": true,
"optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
......@@ -8834,7 +8818,6 @@
"strip-ansi": {
"version": "3.0.1",
"bundled": true,
"optional": true,
"requires": {
"ansi-regex": "^2.0.0"
}
......@@ -8873,13 +8856,11 @@
},
"wrappy": {
"version": "1.0.2",
"bundled": true,
"optional": true
"bundled": true
},
"yallist": {
"version": "3.0.2",
"bundled": true,
"optional": true
"bundled": true
}
}
},
......@@ -12650,6 +12631,16 @@
}
}
},
"nativescript-dom": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/nativescript-dom/-/nativescript-dom-2.0.2.tgz",
"integrity": "sha512-VEY1X10QRZlJEeZUdrwrGoslKqeS03BloaL5OWaXeHmdtmgzaTo3yjIg4ZJOLFWpHme3xAmn+mEn5HLtUJH+NQ=="
},
"nativescript-globalevents": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/nativescript-globalevents/-/nativescript-globalevents-1.2.2.tgz",
"integrity": "sha512-fX1QEe5qnhDnfHPToDisY64sIqi3A5YQc7mW6TNs1iOTSBS0oMRiq2rRLy3DnPrkEVxRYAaL9yCKDkbD12W7UQ=="
},
"nativescript-hook": {
"version": "0.2.4",
"resolved": "https://registry.npmjs.org/nativescript-hook/-/nativescript-hook-0.2.4.tgz",
......@@ -12693,6 +12684,15 @@
"resolved": "https://registry.npmjs.org/nativescript-localstorage/-/nativescript-localstorage-2.0.0.tgz",
"integrity": "sha512-5iwwCrXp4CugQlRV6Ic4upUy/MsBw4P9lg2mrnPoaDWwrUu4yOaJzFiUZVmFPJXTAF8KiJPpWXx287ImbkDjsg=="
},
"nativescript-orientation": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/nativescript-orientation/-/nativescript-orientation-2.2.1.tgz",
"integrity": "sha512-VnQ6QTzyAex6arb5Pw6GXSFZzyj/KkAI6gdkLApFiwQq6pi/wYoTGTxL28zFCDb22J669wnZHEZeedfrWgu22g==",
"requires": {
"nativescript-dom": "^2.0.0",
"nativescript-globalevents": "^1.2.1"
}
},
"nativescript-theme-core": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/nativescript-theme-core/-/nativescript-theme-core-1.0.4.tgz",
......
......@@ -66,6 +66,7 @@
"nativescript-angular": "~7.0.0",
"nativescript-libsodium": "^1.3.3",
"nativescript-localstorage": "^2.0.0",
"nativescript-orientation": "^2.2.1",
"nativescript-theme-core": "~1.0.4",
"ng-inline-svg": "~8.1.0",
"ng-select": "~1.0.1",
......@@ -130,4 +131,4 @@
"version": "5.0.0"
}
}
}
\ No newline at end of file
}
......@@ -10,6 +10,7 @@ import { LoginComponent } from "./login/login.component";
import { reducers } from "./account.reducer";
import { SharedModule } from "../shared/shared.module";
import { DirectivesModule } from "../directives";
import { ProgressIndicatorModule } from "../progress-indicator";
export const COMPONENTS = [LoginContainer, LoginComponent];
......@@ -23,6 +24,7 @@ export const SERVICES = [];
NativeScriptHttpModule,
NgrxFormsModule,
SharedModule,
ProgressIndicatorModule,
StoreModule.forFeature("account", reducers)
],
declarations: COMPONENTS,
......
require("nativescript-localstorage");
require("nativescript-orientation");
import { NgModule, NO_ERRORS_SCHEMA } from "@angular/core";
import { NativeScriptModule } from "nativescript-angular/nativescript.module";
......@@ -7,7 +8,6 @@ import { StoreModule } from "@ngrx/store";
import { AppRoutingModule } from "./app-routing.module.tns";
import { AppComponent } from "./app.component";
import { AccountModule } from "./account";
import { AutoGeneratedComponent } from "./auto-generated/auto-generated.component";
import { reducers, metaReducers } from "./app.reducers";
// Uncomment and add to NgModule imports if you need to use two-way binding
......@@ -17,7 +17,7 @@ import { reducers, metaReducers } from "./app.reducers";
// import { NativeScriptHttpClientModule } from 'nativescript-angular/http-client';
@NgModule({
declarations: [AppComponent, AutoGeneratedComponent],
declarations: [AppComponent],
imports: [
NativeScriptModule,
AppRoutingModule,
......
/* Add mobile styles for the component here. */
<Button text="auto-generated works!" class="btn btn-primary"></Button>
\ No newline at end of file
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'auto-generated',
templateUrl: './auto-generated.component.html',
styleUrls: ['./auto-generated.component.css']
})
export class AutoGeneratedComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}
<StackLayout>
<ActivityIndicator
[busy]="inProgress"
width="25"
height="25"
class="activity-indicator"
></ActivityIndicator>
<Label *ngIf="inProgress" [text]="inProgressText"></Label>
<Label *ngIf="completed" [text]="completedText"></Label>
</StackLayout>
......@@ -6,9 +6,14 @@ import { Component, Input } from "@angular/core";
styleUrls: ["./progress-indicator.styles.scss"]
})
export class ProgressIndicatorComponent {
@Input() inProgress: boolean;
@Input() inProgressText: string;
@Input() completed: boolean;
@Input() completedText: string;
@Input() inputAction = false;
@Input()
inProgress: boolean;
@Input()
inProgressText: string;
@Input()
completed: boolean;
@Input()
completedText: string;
@Input()
inputAction = false;
}
import {
Component,
ChangeDetectionStrategy,
Input,
ViewChild,
ElementRef
} from "@angular/core";
import { AbstractControlState } from "ngrx-forms";
@Component({
selector: "app-checkbox",
template: `
<FlexboxLayout flexDirection="row" alignItems="flex-start" justifyContent="space-between">
<StackLayout>
<Label
class="text-label m-b-5 m-t-2"
[text]="title"
textWrap="true"
></Label>
<Label
class="text-label text-label--light m-r-5"
[text]="subtext"
textWrap="true"
></Label>
</StackLayout>
<Switch #switch
[ngrxFormControlState]="control"
class="app-switch"
></Switch>
</FlexboxLayout>
`,
styles: [
`
.app-switch {
width: 100;
background-color: #6f989e;
color: #6f989e;
}
.app-switch[checked="true"] {
width: 100;
background-color: #0092a8;
color: #0092a8;
}
`
],
moduleId: module.id,
changeDetection: ChangeDetectionStrategy.OnPush
})
export class CheckboxComponent {
@Input()
title: string;
@Input()
subtext: string;
@Input()
inline = false;
@Input()
control: AbstractControlState<boolean>;
@ViewChild("switch")
switch: ElementRef;
focusInput = () => {
this.switch.nativeElement.focus();
};
}
<Label [text]="text" class="app-heading"></Label>
import { ChangeDetectionStrategy, Component, Input } from "@angular/core";
@Component({
selector: "app-heading",
templateUrl: "./heading.component.html",
styles: [`.app-heading {
color: #413741;
font-size: 24;
font-weight: bold;
}`],
moduleId: module.id,
changeDetection: ChangeDetectionStrategy.OnPush
})
export class HeadingComponent {
@Input() text: string;
constructor() {}
}
......@@ -3,10 +3,17 @@ import { NativeScriptCommonModule } from "nativescript-angular/common";
import { NgrxFormsModule } from "ngrx-forms";
import { ButtonComponent } from "./button/button.component";
import { AppTextFieldComponent } from "./text-field/text-field.component";
import { TextFieldComponent } from "./text-field/text-field.component";
import { HeadingComponent } from "./heading/heading.component";
import { DirectivesModule } from "../directives";
import { CheckboxComponent } from "./checkbox/checkbox.component";
export const COMPONENTS = [ButtonComponent, AppTextFieldComponent];
export const COMPONENTS = [
ButtonComponent,
TextFieldComponent,
HeadingComponent,
CheckboxComponent
];
@NgModule({
imports: [NativeScriptCommonModule, NgrxFormsModule, DirectivesModule],
......
......@@ -30,51 +30,72 @@ import { AbstractControlState } from "ngrx-forms";
(focus)="focus.emit()"
(returnPress)="returnPress.emit()"></TextField>
</StackLayout>`,
styles: [`.text-label {
color: #413741;
font-size: 14;
letter-spacing: 0.04;
line-height: 1.333;
}
.text-field {
padding: 10 0;
border-bottom-width: 2;
border-bottom-color: #6F989E;
}
.text-field::highlighted {
border-bottom-color: #0092A8;
}
.text-field--error::highlighted {
border-bottom-color: #B92855;
}
.text-field--valid::highlighted {
border-bottom-color: #6CC780;
}`],
styles: [
`
.text-label {
color: #413741;
font-size: 14;
letter-spacing: 0.04;
line-height: 1.333;
}
.text-field {
padding: 10 0;
border-bottom-width: 2;
border-bottom-color: #6f989e;
}
.text-field::highlighted {
border-bottom-color: #0092a8;
}
.text-field--error::highlighted {
border-bottom-color: #b92855;
}
.text-field--valid::highlighted {
border-bottom-color: #6cc780;
}
`
],
moduleId: module.id,
changeDetection: ChangeDetectionStrategy.OnPush
})
export class AppTextFieldComponent {
@Input() autocapitalizationType: string;
@Input() autocorrect: boolean;
@Input() editable: boolean = true;
@Input() isFormSubmitted: boolean;
@Input() hint: string = "";
@Input() keyboardType: string;
@Input() label: string;
@Input() ngrxFormControl: AbstractControlState<string>;
@Input() returnKeyType: string;
@Input() secure: boolean = false;
@Input() width: number;
@Input() extraValidations: boolean = true;
@Input() overrideValidStyling: boolean = false;
@Input() showErrorBeforeSubmit: boolean = false;
@Output() returnPress = new EventEmitter();
@Output() focus = new EventEmitter();
@ViewChild("textFieldInput") textFieldInput: ElementRef;
export class TextFieldComponent {
@Input()
autocapitalizationType: string;
@Input()
autocorrect: boolean;
@Input()
editable = true;
@Input()
isFormSubmitted: boolean;
@Input()
hint = "";
@Input()
keyboardType: string;
@Input()
label: string;
@Input()
ngrxFormControl: AbstractControlState<string>;
@Input()
returnKeyType: string;
@Input()
secure = false;
@Input()
width: number;
@Input()
extraValidations = true;
@Input()
overrideValidStyling = false;
@Input()
showErrorBeforeSubmit = false;
@Output()
returnPress = new EventEmitter();
@Output()
focus = new EventEmitter();
@ViewChild("textFieldInput")
textFieldInput: ElementRef;
constructor() { }
constructor() {}
focusInput = () => {
this.textFieldInput.nativeElement.focus();
}
};
}
This diff is collapsed.
This diff is collapsed.
export const environment = {
production: false,
extension: false,
docker: false,
nativescript: true,
VERSION: require("../../package.json").version
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment