Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Al UI #57

Merged
merged 6 commits into from
Oct 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"@angular/cli": "^8.3.29",
"@angular/compiler-cli": "^8.2.14",
"@angular/language-service": "^8.2.14",
"@babel/plugin-proposal-class-static-block": "^7.15.4",
"@types/jasmine": "~3.3.8",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
Expand All @@ -52,6 +53,7 @@
"karma-coverage-istanbul-reporter": "~2.1.1",
"karma-jasmine": "~2.0.1",
"karma-jasmine-html-reporter": "^1.5.4",
"npm-force-resolutions": "0.0.10",
"protractor": "^5.4.4",
"ts-node": "~7.0.0",
"tslint": "~5.15.0",
Expand Down
3 changes: 1 addition & 2 deletions web/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ import { AuthCallbackComponent } from './components/auth-callback/auth-callback.
const routes: Routes = [
{
path: 'cases', component: CaseComponent,
canActivate: [AuthenticatedUserGuard]
canActivate: [AuthenticatedUserGuard]
},
{ path: 'login', component: LoginComponent },
{ path: 'logout', component: LogoutComponent },
{ path: 'embrace', component: EmbraceComponent },
{ path: 'auth-callback', component: AuthCallbackComponent },
{ path: '', redirectTo: 'cases', pathMatch: 'full' },
{ path: '**', pathMatch: 'full', component: CaseComponent}
Expand Down
5 changes: 3 additions & 2 deletions web/src/app/components/login/login.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ export class LoginComponent implements OnInit {

login() {
if (this.returnRoute) {
this.authService.setOriginalUrl(this.returnRoute)
this.authService.setOriginalUrl(this.returnRoute);
}
this.authService.startAuthentication();
}

signup() {
const signupUrl = 'https://www.ibm.com/account/us-en/signup/register.html';
window.location.replace(signupUrl);
}
}
}
68 changes: 37 additions & 31 deletions web/src/app/components/modal/modal.component.html
Original file line number Diff line number Diff line change
@@ -1,30 +1,33 @@
<ibm-modal size="md" (overlaySelected)="closeModal()">
<ibm-modal size="sm" (overlaySelected)="closeModal()">
<ibm-modal-header (closeSelect)="closeModal()">
<h4 ibmModalHeaderHeading>Add a new case</h4>
<p>Specify the high level details of the case</p>
</ibm-modal-header>
<section ibmModalContent hasForm="true">
<div class="modal-layout-padding">
<ibm-progress-indicator class="bx--progress-line; bx--progress-step; bx--progress-label" [steps]="steps"
<ibm-progress-indicator class="bx--progress-line; bx--progress-step; bx--progress-label" [steps]="defaultSteps"
[current]="current">
</ibm-progress-indicator>
</div>
<div *ngIf="!isValid" class="alert alert-danger modal-layout-padding">
All the fields are required. Please enter the valid information and submit again.
</div>

<form [formGroup]="defendantAndCaseForm">
<div *ngIf="stepCounter === 'First'">
<ibm-label class="modal-text modal-layout-padding">
<div *ngIf="stepCounter ==='First'" >
<ibm-label [invalid]="!this.validateDefendantName.valid && !this.validateDefendantName.touch" invalidText="Please enter the defendant's name." class="modal-layout-padding">
<label>Defendant Name</label>
<input ibmText class="bx--text-input__field-wrapper " formControlName="defendantname"
id="defendantname" name="defendantname" aria-describedby="defendantnameHelp"
label="Defendant name">
<input ibmtext=""
autocomplete="on"

class="bx--text-input"
id="ibm-label-0"
formControlName="defendantname"
id="defendantname" name="defendantname" aria-describedby="defendantnameHelp" placeholder="Enter the defendant name"
label="Defendant name" required>
</ibm-label>
<div class="modal-input--container modal-layout-margin--bottom">

<ibm-select ibmCol [columnNumbers]="{'lg': 8, 'md': 8, 'sm': 4}" formControlName="defendantrace"
id="defendantrace" name="defendantrace" aria-describedby="defendantraceHelp"
placeholder="Defendant race" label="Defendant Race">
<ibm-select ibmCol [columnNumbers]="{'lg': 8, 'md': 8, 'sm': 4}"
id="defendantrace" [invalid]="this.validateDefendantRace.value.length < 2 || (!this.defendantAndCaseForm.touch && !this.defendantAndCaseForm.valid)" invalidText="Select the defendant's race" name="defendantrace" aria-describedby="defendantraceHelp"
placeholder="Defendant race" label="Defendant Race" formControlName="defendantrace" required>
<option value="default" disabled selected hidden>Choose an option</option>
<option value="white">White/Caucasian</option>
<option value="black">Black/African American</option>
Expand All @@ -36,24 +39,22 @@ <h4 ibmModalHeaderHeading>Add a new case</h4>



<ibm-select ibmCol [columnNumbers]="{'lg': 8, 'md': 8, 'sm': 4}" formControlName="defendantgender"
id="defendantgender" name="defendantgender" aria-describedby="defendantgenderHelp"
placeholder="Defendant gender" label="Defendant Gender">
<option value="default" disabled selected hidden>Choose an option</option>
<ibm-select ibmCol [columnNumbers]="{'lg': 8, 'md': 8, 'sm': 4}"
id="defendantgender"formControlName="defendantgender" name="defendantgender" aria-describedby="defendantg"
placeholder="Defendant gender" label="Defendant Gender" [invalid]="this.validateDefendantGender.value < 2 || (!this.defendantAndCaseForm.touch && !this.defendantAndCaseForm.valid)">
<option value="female">Female</option>
<option value="male">Male</option>
<option value="other">Other</option>
</ibm-select>


</div>




</div>
<div class="modal-layout-margin--bottom " *ngIf="stepCounter === 'Second'">
<div class="modal-layout-margin--bottom " *ngIf="stepCounter === 'Second'">
<div class="modal-layout-padding">
<ibm-combo-box formControlName="chargedescription" appendInline="true" [items]="filterCharge"
<ibm-combo-box appendInline="true" [items]="filterCharge"
(keyup)="mySearch($event)" (selected)="selected($event)">
<ibm-dropdown-list></ibm-dropdown-list>
</ibm-combo-box>
Expand All @@ -65,15 +66,15 @@ <h4 ibmModalHeaderHeading>Add a new case</h4>



<div ibmCol [columnNumbers]="{'lg': 16, 'md': 16, 'sm': 4}">
<div ibmCol [columnNumbers]="{'lg': 16, 'md': 16, 'sm': 4}">
<div>
<legend class="bx--label">Is the charge drug related?
<span *ngIf="enableRadioSelection === true" class="modal-layout--margin--right">For guidance, refer to the <a
href="https://www.ussc.gov/guidelines/2018-guidelines-manual/2018-chapter-2-d"
target="_blank" ibmLink>U.S. Sentencing Commisions guidelines</a></span>
</legend>
</div>
<ibm-radio-group aria-label="radiogroup" formControlName="radioGroup"
<ibm-radio-group aria-label="radiogroup"
(change)="radioSelection($event)">

<ibm-radio value="yes">
Expand All @@ -88,9 +89,10 @@ <h4 ibmModalHeaderHeading>Add a new case</h4>
<div class="modal-input--container" *ngIf="enableRadioSelection === true">
<div ibmCol [columnNumbers]="{'lg': 8, 'md': 8, 'sm': 4}">

<ibm-select formControlName="amountOfDrugPossessed" id="amountOfDrugPossessed"
<ibm-select id="amountOfDrugPossessed"
formControlName="amountOfDrugPossessed"
name="amountOfDrugPossessed" aria-describedby="amountOfDrugPossessedHelp"
placeholder="Select an option" label="Amount range of drug possessed">
placeholder="Select an option" label="Amount range of drug possessed" >
<option value="default" disabled selected hidden>Choose an option</option>
<option value="white">White/Caucasian</option>
<option value="black">Black/African American</option>
Expand All @@ -101,7 +103,8 @@ <h4 ibmModalHeaderHeading>Add a new case</h4>
</ibm-select>
</div>
<div ibmCol [columnNumbers]="{'lg': 8, 'md': 8, 'sm': 4}">
<ibm-select formControlName="crimialHistoryCategory" id="crimialHistoryCategory"
<ibm-select id="crimialHistoryCategory"
formControlName="crimialHistoryCategory"
name="crimialHistoryCategory" aria-describedby="crimialHistoryCategoryHelp"
placeholder="Select an option" label="Criminal History Category">
<option value="default" disabled selected hidden>Choose an option</option>
Expand All @@ -113,7 +116,8 @@ <h4 ibmModalHeaderHeading>Add a new case</h4>
</div>
<div class="modal-input--container modal-layout--margin-top" *ngIf="enableRadioSelection === true">
<div ibmCol [columnNumbers]="{'lg': 8, 'md': 8, 'sm': 4}">
<ibm-select ibmCol formControlName="estimatedSentence" id="estimatedSentence"
<ibm-select ibmCol id="estimatedSentence"
formControlName="estimatedSentence"
name="estimatedSentence" aria-describedby="estimatedSentenceHelp"
placeholder="Select an option" label="Estimated Sentence">
<option value="default" disabled selected hidden>Choose an option</option>
Expand All @@ -126,23 +130,25 @@ <h4 ibmModalHeaderHeading>Add a new case</h4>
</ibm-select>
</div>
<div ibmCol [columnNumbers]="{'lg': 8, 'md': 8, 'sm': 4}">
<ibm-select formControlName="givenSentence" id="givenSentence" name="givenSentence"
<ibm-select id="givenSentence" name="givenSentence" formControlName="givenSentence"
aria-describedby="givenSentenceHelp" placeholder="Select an option" label="Given Sentence">
<option value="default" disabled selected hidden>Choose an option</option>
<option value="female">Female</option>
<option value="male">Male</option>
<option value="other">Other</option>
</ibm-select>
</div>

</div>

</div>
</form>
</section>
<ibm-modal-footer>
<button class="bx--btn bx--btn--secondary" (click)="closeModal() ">
Cancel
</button>
<button class="bx--btn bx--btn--primary" modal-primary-focus (click)="goNextOrSave() ">
<button [disabled]="!this.defendantAndCaseForm.valid " class="bx--btn bx--btn--primary" modal-primary-focus (click)="goNextOrSave() ">
{{textForButton}}
</button>
</ibm-modal-footer>
Expand Down
Loading