initialize path and context component members to avoid null exception
This commit is contained in:
parent
a8ec7865a7
commit
49c04eb7af
4 changed files with 41 additions and 42 deletions
|
@ -11,7 +11,7 @@ import { Input, Component, OnChanges, SimpleChanges } from 'ng-metadata/core';
|
||||||
export class ContextPathSelectComponent implements OnChanges {
|
export class ContextPathSelectComponent implements OnChanges {
|
||||||
|
|
||||||
// FIXME: Use one-way data binding
|
// FIXME: Use one-way data binding
|
||||||
@Input('=') public currentContext: string;
|
@Input('=') public currentContext: string = '';
|
||||||
@Input('=') public isValidContext: boolean;
|
@Input('=') public isValidContext: boolean;
|
||||||
@Input('=') public contexts: string[];
|
@Input('=') public contexts: string[];
|
||||||
private isUnknownContext: boolean = true;
|
private isUnknownContext: boolean = true;
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<div class="dockerfile-path-select-element">
|
<div class="dockerfile-path-select-element">
|
||||||
<div class="dropdown-select" placeholder="'Enter path containing a Dockerfile'"
|
<div class="dropdown-select"
|
||||||
|
placeholder="'Enter path containing a Dockerfile'"
|
||||||
selected-item="$ctrl.selectedPath"
|
selected-item="$ctrl.selectedPath"
|
||||||
lookahead-items="$ctrl.paths"
|
lookahead-items="$ctrl.paths"
|
||||||
handle-input="$ctrl.setPath(input)"
|
handle-input="$ctrl.setPath(input)"
|
||||||
|
|
|
@ -11,7 +11,7 @@ import { Input, Component, OnChanges, SimpleChanges } from 'ng-metadata/core';
|
||||||
export class DockerfilePathSelectComponent implements OnChanges {
|
export class DockerfilePathSelectComponent implements OnChanges {
|
||||||
|
|
||||||
// FIXME: Use one-way data binding
|
// FIXME: Use one-way data binding
|
||||||
@Input('=') public currentPath: string;
|
@Input('=') public currentPath: string = '';
|
||||||
@Input('=') public isValidPath: boolean;
|
@Input('=') public isValidPath: boolean;
|
||||||
@Input('=') public paths: string[];
|
@Input('=') public paths: string[];
|
||||||
@Input('=') public supportsFullListing: boolean;
|
@Input('=') public supportsFullListing: boolean;
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
<div class="manage-trigger-githost-element manage-trigger-control">
|
<div class="manage-trigger-githost-element manage-trigger-control">
|
||||||
<linear-workflow
|
<linear-workflow done-title="Create Trigger"
|
||||||
done-title="Create Trigger"
|
(on-workflow-complete)="$ctrl.createTrigger($event)">
|
||||||
(on-workflow-complete)="$ctrl.createTrigger($event)">
|
|
||||||
|
|
||||||
<!-- Section: Namespace -->
|
<!-- Section: Namespace -->
|
||||||
<linear-workflow-section class="row"
|
<linear-workflow-section class="row"
|
||||||
section-id="namespace"
|
section-id="namespace"
|
||||||
section-title="{{ 'Select ' + $ctrl.namespaceTitle }}"
|
section-title="{{ 'Select ' + $ctrl.namespaceTitle }}"
|
||||||
section-valid="$ctrl.local.selectedNamespace">
|
section-valid="$ctrl.local.selectedNamespace">
|
||||||
<div class="col-lg-7 col-md-7 col-sm-12 main-col"
|
<div class="col-lg-7 col-md-7 col-sm-12 main-col"
|
||||||
ng-if="$ctrl.local.namespaces">
|
ng-if="$ctrl.local.namespaces">
|
||||||
<h3>Select {{ $ctrl.namespaceTitle }}</h3>
|
<h3>Select {{ $ctrl.namespaceTitle }}</h3>
|
||||||
|
@ -81,9 +80,9 @@
|
||||||
|
|
||||||
<!-- Section: Repository -->
|
<!-- Section: Repository -->
|
||||||
<linear-workflow-section class="row"
|
<linear-workflow-section class="row"
|
||||||
section-id="repo"
|
section-id="repo"
|
||||||
section-title="Select Repository"
|
section-title="Select Repository"
|
||||||
section-valid="$ctrl.local.selectedRepository">
|
section-valid="$ctrl.local.selectedRepository">
|
||||||
|
|
||||||
<div class="col-lg-7 col-md-7 col-sm-12 main-col" ng-if="$ctrl.local.repositories">
|
<div class="col-lg-7 col-md-7 col-sm-12 main-col" ng-if="$ctrl.local.repositories">
|
||||||
<h3>Select Repository</h3>
|
<h3>Select Repository</h3>
|
||||||
|
@ -180,9 +179,9 @@
|
||||||
|
|
||||||
<!-- Section: Trigger Options -->
|
<!-- Section: Trigger Options -->
|
||||||
<linear-workflow-section class="row"
|
<linear-workflow-section class="row"
|
||||||
section-id="triggeroptions"
|
section-id="triggeroptions"
|
||||||
section-title="Configure Trigger"
|
section-title="Configure Trigger"
|
||||||
section-valid="$ctrl.local.triggerOptions">
|
section-valid="$ctrl.local.triggerOptions">
|
||||||
<div class="col-lg-7 col-md-7 col-sm-12 main-col" ng-if="$ctrl.local.repositoryRefs">
|
<div class="col-lg-7 col-md-7 col-sm-12 main-col" ng-if="$ctrl.local.repositoryRefs">
|
||||||
<h3>Configure Trigger</h3>
|
<h3>Configure Trigger</h3>
|
||||||
<strong>
|
<strong>
|
||||||
|
@ -202,7 +201,10 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="radio">
|
<div class="radio">
|
||||||
<label>
|
<label>
|
||||||
<input type="radio" name="optionRadio" ng-model="$ctrl.local.triggerOptions.hasBranchTagFilter" ng-value="true">
|
<input type="radio"
|
||||||
|
name="optionRadio"
|
||||||
|
ng-model="$ctrl.local.triggerOptions.hasBranchTagFilter"
|
||||||
|
ng-value="true">
|
||||||
<div class="title">Trigger only on branches and tags matching a regular expression</div>
|
<div class="title">Trigger only on branches and tags matching a regular expression</div>
|
||||||
<div class="description">Only build container images for a subset of branches and/or tags.</div>
|
<div class="description">Only build container images for a subset of branches and/or tags.</div>
|
||||||
<div class="extended" ng-if="$ctrl.local.triggerOptions.hasBranchTagFilter">
|
<div class="extended" ng-if="$ctrl.local.triggerOptions.hasBranchTagFilter">
|
||||||
|
@ -214,10 +216,9 @@
|
||||||
ng-model="$ctrl.local.triggerOptions.branchTagFilter"
|
ng-model="$ctrl.local.triggerOptions.branchTagFilter"
|
||||||
required>
|
required>
|
||||||
<div class="description">Examples: heads/master, tags/tagname, heads/.+</div>
|
<div class="description">Examples: heads/master, tags/tagname, heads/.+</div>
|
||||||
<regex-match-view
|
<regex-match-view items="$ctrl.local.repositoryFullRefs"
|
||||||
items="$ctrl.local.repositoryFullRefs"
|
regex="$ctrl.local.triggerOptions.branchTagFilter"
|
||||||
regex="$ctrl.local.triggerOptions.branchTagFilter"
|
ng-if="$ctrl.local.triggerOptions.branchTagFilter"></regex-match-view>
|
||||||
ng-if="$ctrl.local.triggerOptions.branchTagFilter"></regex-match-view>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
@ -239,9 +240,9 @@
|
||||||
|
|
||||||
<!-- Section: Dockerfile Location -->
|
<!-- Section: Dockerfile Location -->
|
||||||
<linear-workflow-section class="row"
|
<linear-workflow-section class="row"
|
||||||
section-id="dockerfilelocation"
|
section-id="dockerfilelocation"
|
||||||
section-title="Select Dockerfile"
|
section-title="Select Dockerfile"
|
||||||
section-valid="$ctrl.local.hasValidDockerfilePath">
|
section-valid="$ctrl.local.hasValidDockerfilePath">
|
||||||
<div class="col-lg-7 col-md-7 col-sm-12 main-col"
|
<div class="col-lg-7 col-md-7 col-sm-12 main-col"
|
||||||
ng-if="$ctrl.local.dockerfileLocations.status == 'error'">
|
ng-if="$ctrl.local.dockerfileLocations.status == 'error'">
|
||||||
<div class="co-alert co-alert-warning">
|
<div class="co-alert co-alert-warning">
|
||||||
|
@ -255,12 +256,10 @@
|
||||||
Please select the location of the Dockerfile to build when this trigger is invoked
|
Please select the location of the Dockerfile to build when this trigger is invoked
|
||||||
</strong>
|
</strong>
|
||||||
|
|
||||||
<dockerfile-path-select
|
<dockerfile-path-select current-path="$ctrl.local.dockerfilePath"
|
||||||
current-path="$ctrl.local.dockerfilePath"
|
paths="$ctrl.local.dockerfileLocations.dockerfile_paths"
|
||||||
paths="$ctrl.local.dockerfileLocations.dockerfile_paths"
|
supports-full-listing="true"
|
||||||
supports-full-listing="true"
|
is-valid-path="$ctrl.local.hasValidDockerfilePath"></dockerfile-path-select>
|
||||||
is-valid-path="$ctrl.local.hasValidDockerfilePath">
|
|
||||||
</dockerfile-path-select>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-lg-8 col-md-8 col-sm-12 main-col"
|
<div class="col-lg-8 col-md-8 col-sm-12 main-col"
|
||||||
|
@ -272,11 +271,11 @@
|
||||||
</div>
|
</div>
|
||||||
</linear-workflow-section><!-- /Section: Dockerfile Location -->
|
</linear-workflow-section><!-- /Section: Dockerfile Location -->
|
||||||
|
|
||||||
<!-- Section: Context Location -->
|
<!-- Section: Context Location -->
|
||||||
<linear-workflow-section class="row"
|
<linear-workflow-section class="row"
|
||||||
section-id="contextlocation"
|
section-id="contextlocation"
|
||||||
section-title="Select Docker Context"
|
section-title="Select Docker Context"
|
||||||
section-valid="$ctrl.local.hasValidContextLocation">
|
section-valid="$ctrl.local.hasValidContextLocation">
|
||||||
<div class="col-lg-7 col-md-7 col-sm-12 main-col"
|
<div class="col-lg-7 col-md-7 col-sm-12 main-col"
|
||||||
ng-if="$ctrl.local.dockerfileLocations.status == 'error'">
|
ng-if="$ctrl.local.dockerfileLocations.status == 'error'">
|
||||||
<div class="co-alert co-alert-warning">
|
<div class="co-alert co-alert-warning">
|
||||||
|
@ -290,12 +289,10 @@
|
||||||
Please select the context for the docker build
|
Please select the context for the docker build
|
||||||
</strong>
|
</strong>
|
||||||
|
|
||||||
<context-path-select
|
<context-path-select current-context="$ctrl.local.dockerContext"
|
||||||
current-context="$ctrl.local.dockerContext"
|
current-path="$ctrl.local.dockerfilePath"
|
||||||
current-path="$ctrl.local.dockerfilePath"
|
contexts="$ctrl.local.contexts"
|
||||||
contexts="$ctrl.local.contexts"
|
is-valid-context="$ctrl.local.hasValidContextLocation"></context-path-select>
|
||||||
is-valid-context="$ctrl.local.hasValidContextLocation">
|
|
||||||
</context-path-select>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-lg-8 col-md-8 col-sm-12 main-col"
|
<div class="col-lg-8 col-md-8 col-sm-12 main-col"
|
||||||
|
@ -309,9 +306,10 @@
|
||||||
|
|
||||||
<!-- Section: Robot Account -->
|
<!-- Section: Robot Account -->
|
||||||
<linear-workflow-section class="row"
|
<linear-workflow-section class="row"
|
||||||
section-id="verification"
|
section-id="verification"
|
||||||
section-title="Robot Account"
|
section-title="Robot Account"
|
||||||
section-valid="$ctrl.local.triggerAnalysis.status != 'error' && ($ctrl.local.triggerAnalysis.status != 'requiresrobot' || $ctrl.local.robotAccount != null)">
|
section-valid="$ctrl.local.triggerAnalysis.status != 'error' &&
|
||||||
|
($ctrl.local.triggerAnalysis.status != 'requiresrobot' || $ctrl.local.robotAccount != null)">
|
||||||
<!-- Error -->
|
<!-- Error -->
|
||||||
<div class="col-lg-7 col-md-7 col-sm-12 main-col"
|
<div class="col-lg-7 col-md-7 col-sm-12 main-col"
|
||||||
ng-if="$ctrl.local.triggerAnalysis.status == 'error'">
|
ng-if="$ctrl.local.triggerAnalysis.status == 'error'">
|
||||||
|
|
Reference in a new issue