Skip to content

Commit

Permalink
feat(jira): improve mobile experience for config stepper
Browse files Browse the repository at this point in the history
  • Loading branch information
johannesjo committed Dec 6, 2018
1 parent 58ceab8 commit 639cbfd
Show file tree
Hide file tree
Showing 2 changed files with 114 additions and 102 deletions.
210 changes: 108 additions & 102 deletions src/app/issue/jira/jira-cfg-stepper/jira-cfg-stepper.component.html
@@ -1,113 +1,119 @@
<!--<pre><code>{{jiraCfg|json}}</code></pre>-->

<mat-horizontal-stepper [linear]="true"
dynamicHeight
#stepper>
<mat-step [stepControl]="credentialsFormGroup">
<form [formGroup]="credentialsFormGroup"
(submit)="saveStepForm(jiraCfg)">
<ng-template matStepLabel>Credentials</ng-template>
<div class="wrapper">
<mat-horizontal-stepper [linear]="true"
dynamicHeight
#stepper>
<mat-step [stepControl]="credentialsFormGroup">
<form [formGroup]="credentialsFormGroup"
(submit)="saveStepForm(jiraCfg)">
<ng-template matStepLabel>Credentials</ng-template>

<p class="isHideWhenJiraSupport">Please
<a href="https://chrome.google.com/webstore/detail/super-productivity/ljkbjodfmekklcoibdnhahlaalhihmlb">
download the chrome extension</a> in order to allow communication with the Jira Api. Note that this doesn't work for mobile.
</p>

<formly-form [model]="jiraCfg"
[fields]="credentialsFormConfig"
[form]="credentialsFormGroup">
<formly-form [model]="jiraCfg"
[fields]="credentialsFormConfig"
[form]="credentialsFormGroup">

<div class="welcome"
[@expand]
*ngIf="user">
<img [src]="user.avatarUrls['48x48']"
class="user-avatar"
alt="User Avatar">
<div class="welcome-txt">Login successful!<br>Welcome {{user.displayName}}!</div>
</div>
<div class="welcome"
[@expand]
*ngIf="user">
<img [src]="user.avatarUrls['48x48']"
class="user-avatar"
alt="User Avatar">
<div class="welcome-txt">Login successful!<br>Welcome {{user.displayName}}!</div>
</div>

<div class="center-wrapper">
<button mat-raised-button
(click)="testCredentials()"
[disabled]="!credentialsFormGroup.valid">
<mat-icon *ngIf="!isTestCredentialsSuccess">import_export</mat-icon>
<mat-icon *ngIf="isTestCredentialsSuccess">checkmark</mat-icon>
Test Credentials
</button>
<button mat-raised-button
type="submit"
color="primary"
matStepperNext
[disabled]="!credentialsFormGroup.valid">
Next
<mat-icon>arrow_forward</mat-icon>
</button>
</div>
</formly-form>
<div class="center-wrapper">
<button mat-raised-button
(click)="testCredentials()"
[disabled]="!credentialsFormGroup.valid">
<mat-icon *ngIf="!isTestCredentialsSuccess">import_export</mat-icon>
<mat-icon *ngIf="isTestCredentialsSuccess">checkmark</mat-icon>
Test Credentials
</button>
<button mat-raised-button
type="submit"
color="primary"
matStepperNext
[disabled]="!credentialsFormGroup.valid">
Next
<mat-icon>arrow_forward</mat-icon>
</button>
</div>
</formly-form>

</form>
</mat-step>
</form>
</mat-step>


<mat-step [stepControl]="advancedSettingsFormGroup">
<form [formGroup]="advancedSettingsFormGroup"
(submit)="saveStepForm(jiraCfg)">
<ng-template matStepLabel>Advanced</ng-template>
<formly-form [model]="jiraCfg"
[fields]="advancedSettingsFormConfig"
[form]="advancedSettingsFormGroup">
<mat-step [stepControl]="advancedSettingsFormGroup">
<form [formGroup]="advancedSettingsFormGroup"
(submit)="saveStepForm(jiraCfg)">
<ng-template matStepLabel>Advanced</ng-template>
<formly-form [model]="jiraCfg"
[fields]="advancedSettingsFormConfig"
[form]="advancedSettingsFormGroup">

<div class="center-wrapper">
<button mat-raised-button=""
matStepperPrevious>
<mat-icon>arrow_backward</mat-icon>
Back
</button>
<button mat-raised-button
type="submit"
[disabled]="!advancedSettingsFormGroup.valid"
color="primary"
matStepperNext>
<mat-icon>arrow_forward</mat-icon>
Next
</button>
</div>
</formly-form>
</form>
</mat-step>
<div class="center-wrapper">
<button mat-raised-button=""
matStepperPrevious>
<mat-icon>arrow_backward</mat-icon>
Back
</button>
<button mat-raised-button
type="submit"
[disabled]="!advancedSettingsFormGroup.valid"
color="primary"
matStepperNext>
<mat-icon>arrow_forward</mat-icon>
Next
</button>
</div>
</formly-form>
</form>
</mat-step>

<!--<mat-step [stepControl]="thirdFormGroup">-->
<!--<form [formGroup]="thirdFormGroup">-->
<!--<ng-template matStepLabel>Advanced</ng-template>-->
<!--<mat-form-field>-->
<!--&lt;!&ndash;<input matInput&ndash;&gt;-->
<!--&lt;!&ndash;placeholder="Address"&ndash;&gt;-->
<!--&lt;!&ndash;formControlName="secondCtrl"&ndash;&gt;-->
<!--&lt;!&ndash;required>&ndash;&gt;-->
<!--</mat-form-field>-->
<!--<div class="center-wrapper">-->
<!--<button mat-raised-button=""-->
<!--matStepperPrevious>Back-->
<!--</button>-->
<!--<button mat-raised-button=""-->
<!--matStepperNext>Save-->
<!--</button>-->
<!--</div>-->
<!--</form>-->
<!--</mat-step>
-->
<mat-step>
<ng-template matStepLabel>Done</ng-template>
You are now done.
<div class="center-wrapper">
<button mat-raised-button=""
matStepperPrevious>
<mat-icon>arrow_backward</mat-icon>
Back
</button>
<button mat-raised-button=""
color="primary"
type="button"
(click)="saveCfg()">
<mat-icon>save</mat-icon>
Save
</button>
</div>
</mat-step>
</mat-horizontal-stepper>
<!--<mat-step [stepControl]="thirdFormGroup">-->
<!--<form [formGroup]="thirdFormGroup">-->
<!--<ng-template matStepLabel>Advanced</ng-template>-->
<!--<mat-form-field>-->
<!--&lt;!&ndash;<input matInput&ndash;&gt;-->
<!--&lt;!&ndash;placeholder="Address"&ndash;&gt;-->
<!--&lt;!&ndash;formControlName="secondCtrl"&ndash;&gt;-->
<!--&lt;!&ndash;required>&ndash;&gt;-->
<!--</mat-form-field>-->
<!--<div class="center-wrapper">-->
<!--<button mat-raised-button=""-->
<!--matStepperPrevious>Back-->
<!--</button>-->
<!--<button mat-raised-button=""-->
<!--matStepperNext>Save-->
<!--</button>-->
<!--</div>-->
<!--</form>-->
<!--</mat-step>
-->
<mat-step>
<ng-template matStepLabel>Done</ng-template>
You are now done.
<div class="center-wrapper">
<button mat-raised-button=""
matStepperPrevious>
<mat-icon>arrow_backward</mat-icon>
Back
</button>
<button mat-raised-button=""
color="primary"
type="button"
(click)="saveCfg()">
<mat-icon>save</mat-icon>
Save
</button>
</div>
</mat-step>
</mat-horizontal-stepper>
</div>
Expand Up @@ -6,7 +6,13 @@
align-items: center;
margin-top: $s;
margin-bottom: $s;

img {
margin-right: $s;
}
}


.wrapper {
margin: 0 -24px;
}

0 comments on commit 639cbfd

Please sign in to comment.