diff --git a/src/app/launcher/import-app/gitprovider-importapp-step/gitprovider-importapp-step.component.html b/src/app/launcher/import-app/gitprovider-importapp-step/gitprovider-importapp-step.component.html index ce2339cf..371ad39d 100644 --- a/src/app/launcher/import-app/gitprovider-importapp-step/gitprovider-importapp-step.component.html +++ b/src/app/launcher/import-app/gitprovider-importapp-step/gitprovider-importapp-step.component.html @@ -3,9 +3,9 @@

Authorize Git Provider

+ [debounce]="500">Import Existing Application

- Authorize your Git Provider account to connect the Launcher to your service. + To import an existing application, you must include the necessary GitHub information to complete the importing proces.

@@ -13,27 +13,35 @@
-

GitHub

+

GitHub Information

- -

Authorized Account

-
- - - {{launcherComponent.summary?.gitHubDetails?.login}} - - - None - - -
+
+ + + +
+ + + {{launcherComponent.summary?.gitHubDetails?.login}} + + + + + +
+ Something went wrong. Please try to reconnect your GitHub account. +
+
+
@@ -69,13 +77,19 @@

Authorized Account

+
+ + +
+ (click)="navToNextStep()">Import Repository
diff --git a/src/app/launcher/import-app/gitprovider-importapp-step/gitprovider-importapp-step.component.less b/src/app/launcher/import-app/gitprovider-importapp-step/gitprovider-importapp-step.component.less index ebb0f3a2..aca65d37 100644 --- a/src/app/launcher/import-app/gitprovider-importapp-step/gitprovider-importapp-step.component.less +++ b/src/app/launcher/import-app/gitprovider-importapp-step/gitprovider-importapp-step.component.less @@ -7,6 +7,14 @@ padding-left: 0; padding-right: 0; box-shadow: .5px 1px 0 rgba(0, 0, 0, .3), 0 -.5px 1px 0 rgba(0, 0, 0, .3); + &-toolbar { + margin-right: 20px; + margin-left: 20px; + .toolbar-pf-actions { + display: inline-flex; + justify-content: flex-end; + } + } &-icon { min-height: 300px; background-color: @color-pf-black-200; @@ -20,26 +28,14 @@ } } &-information { - padding-left: 15px; + padding-top: 25px; padding-right: 15px; + padding-bottom: 25px; + padding-left: 15px; min-height: 300px; h3 { font-weight: 600; } - &-authorize { - padding-top: 10px; - margin-bottom: 65px; - .f8launcher { - &-username { - vertical-align: bottom; - font-style: italic; - font-size: 1.4em; - } - &-authorize-account { - float: right; - } - } - } } } } diff --git a/src/app/launcher/import-app/gitprovider-importapp-step/gitprovider-importapp-step.component.ts b/src/app/launcher/import-app/gitprovider-importapp-step/gitprovider-importapp-step.component.ts index 1c740a30..17e1a8ad 100644 --- a/src/app/launcher/import-app/gitprovider-importapp-step/gitprovider-importapp-step.component.ts +++ b/src/app/launcher/import-app/gitprovider-importapp-step/gitprovider-importapp-step.component.ts @@ -8,6 +8,19 @@ import { ViewChild, ViewEncapsulation } from '@angular/core'; + +import { + Filter, + FilterConfig, + FilterField, + FilterEvent, + FilterType, + SortConfig, + SortField, + SortEvent, + ToolbarConfig +} from 'patternfly-ng'; + import { Subscription } from 'rxjs/Subscription'; import { GitProviderService } from '../../service/git-provider.service'; @@ -24,6 +37,12 @@ import { LauncherStep } from '../../launcher-step'; export class GitproviderImportappStepComponent extends LauncherStep implements AfterViewInit, OnDestroy, OnInit { @ViewChild('versionSelect') versionSelect: ElementRef; + toolbarConfig: ToolbarConfig; + + private currentSortField: SortField; + private filterConfig: FilterConfig; + private isAscendingSort: boolean = true; + private sortConfig: SortConfig; private subscriptions: Subscription[] = []; constructor(@Host() public launcherComponent: LauncherComponent, @@ -40,6 +59,30 @@ export class GitproviderImportappStepComponent extends LauncherStep implements A } ngOnInit() { + this.filterConfig = { + fields: [{ + id: 'name', + title: 'Name', + placeholder: 'Filter by Name...', + type: FilterType.TEXT + }] as FilterField[], + appliedFilters: [] + } as FilterConfig; + + this.sortConfig = { + fields: [{ + id: 'name', + title: 'Name', + sortType: 'alpha' + }], + isAscending: this.isAscendingSort + } as SortConfig; + + this.toolbarConfig = { + filterConfig: this.filterConfig, + sortConfig: this.sortConfig + } as ToolbarConfig; + this.launcherComponent.addStep(this); this.subscriptions.push(this.gitProviderService.getGitHubDetails().subscribe((val) => { @@ -83,6 +126,53 @@ export class GitproviderImportappStepComponent extends LauncherStep implements A && this.launcherComponent.summary.gitHubDetails.repositoryAvailable === true); } + // Filter + + applyFilters(filters: Filter[]): void { } + + // Handle filter changes + filterChanged($event: FilterEvent): void { + this.applyFilters($event.appliedFilters); + } + + matchesFilter(item: any, filter: Filter): boolean { + let match = true; + if (filter.field.id === 'name') { + match = item.name.match(filter.value) !== null; + } + return match; + } + + matchesFilters(item: any, filters: Filter[]): boolean { + let matches = true; + filters.forEach((filter) => { + if (!this.matchesFilter(item, filter)) { + matches = false; + return matches; + } + }); + return matches; + } + + // Sort + + compare(item1: any, item2: any): number { + let compValue = 0; + if (this.currentSortField.id === 'name') { + compValue = item1.name.localeCompare(item2.name); + } + if (!this.isAscendingSort) { + compValue = compValue * -1; + } + return compValue; + } + + // Handle sort changes + sortChanged($event: SortEvent): void { + this.currentSortField = $event.field; + this.isAscendingSort = $event.isAscending; + } + // Steps /** diff --git a/src/app/launcher/import-app/project-summary-importapp-step/project-summary-importapp-step.component.html b/src/app/launcher/import-app/project-summary-importapp-step/project-summary-importapp-step.component.html index 5ddf1d87..db949002 100644 --- a/src/app/launcher/import-app/project-summary-importapp-step/project-summary-importapp-step.component.html +++ b/src/app/launcher/import-app/project-summary-importapp-step/project-summary-importapp-step.component.html @@ -76,64 +76,83 @@

-
+
-
-

- Application Information -

-
-
-
- -
- -
- +
+ +
+

+ GitHub +

+
+
+

+ Incomplete +

+

To proceed with setting up this application, this section must be completed.

+ +
+
+ +
+

+ GitHub +

+
+
+
+ +
+ +
+ {{this.launcherComponent.summary.gitHubDetails.url}} +
-
-
- -
- {{this.launcherComponent.summary?.dependencyCheck?.mavenArtifact}} +
+ +
+ {{this.launcherComponent.summary.gitHubDetails.organization}} +
-
-
- -
- +
+ +
+ {{this.launcherComponent.summary.gitHubDetails.htmlUrl}} +
-
-
- -
- +
+ +
+ + {{this.launcherComponent.summary?.gitHubDetails?.description}} + +
-
-
- -
- +
+ +
+ + + Private + + + Public + +
-
- + +
-
+
-
+
diff --git a/src/app/launcher/import-app/project-summary-importapp-step/project-summary-importapp-step.component.ts b/src/app/launcher/import-app/project-summary-importapp-step/project-summary-importapp-step.component.ts index 1fbca2bd..baec99e2 100644 --- a/src/app/launcher/import-app/project-summary-importapp-step/project-summary-importapp-step.component.ts +++ b/src/app/launcher/import-app/project-summary-importapp-step/project-summary-importapp-step.component.ts @@ -9,6 +9,7 @@ import { import { Subscription } from 'rxjs/Subscription'; import { DomSanitizer } from '@angular/platform-browser'; +import { GitProviderService } from '../../service/git-provider.service'; import { DependencyCheckService } from '../../service/dependency-check.service'; import { ProjectSummaryService } from '../../service/project-summary.service'; import { Selection } from '../../model/selection.model'; @@ -28,6 +29,7 @@ export class ProjectSummaryImportappStepComponent extends LauncherStep implement constructor(@Host() public launcherComponent: LauncherComponent, private dependencyCheckService: DependencyCheckService, + private gitProviderService: GitProviderService, private projectSummaryService: ProjectSummaryService, public _DomSanitizer: DomSanitizer) { super(); diff --git a/src/app/launcher/import-app/release-strategy-importapp-step/release-strategy-importapp-step.component.html b/src/app/launcher/import-app/release-strategy-importapp-step/release-strategy-importapp-step.component.html index 20eaa53b..a281efe2 100644 --- a/src/app/launcher/import-app/release-strategy-importapp-step/release-strategy-importapp-step.component.html +++ b/src/app/launcher/import-app/release-strategy-importapp-step/release-strategy-importapp-step.component.html @@ -3,9 +3,13 @@

Select Pipeline

+ [debounce]="500">Select a Pipeline (optional)

- Pipelines define how your application is deployed. Each pipeline has multiple stages with a varying set of capabilities. + There are multiple different pipeliens that you can choose to deploy your application on. Each pipeline is comprised of different stages and has + its own set of capabilities. Different stages of the pipeline include build releases, integration testing, staging, and running an application. +

+

+ We have provided a suggested pipeline based off of the mission and technology that you have selected.

@@ -16,16 +20,81 @@

- Pipeline + Suggested Pipeline

-
+
+
+
+
+
+
+ +
+
+ + +
+
+ +
+
+
+
+
+ {{pipeline.name}} +
+
+ {{pipeline.stages.length}} Stages +
+
+
+ {{pipeline.description}} +
+
+
+
+
+
+
+
+
+ + {{stage}} + + +
+
+
+
+
+
+
+

+ All Other Pipelines +

+
+
+ + +
diff --git a/src/app/launcher/model/github-details.model.ts b/src/app/launcher/model/github-details.model.ts index 3b335bc7..de4e375c 100644 --- a/src/app/launcher/model/github-details.model.ts +++ b/src/app/launcher/model/github-details.model.ts @@ -6,4 +6,7 @@ export class GitHubDetails { organizations?: string[]; repositoryAvailable?: boolean; repository?: string; + htmlUrl?: string; + description?: string[]; + visibility?: string; } diff --git a/src/demo/service/demo-git-provider.service.ts b/src/demo/service/demo-git-provider.service.ts index 578f6e96..70543d59 100644 --- a/src/demo/service/demo-git-provider.service.ts +++ b/src/demo/service/demo-git-provider.service.ts @@ -31,11 +31,19 @@ export class DemoGitProviderService implements GitProviderService { for (let i = 0; i < GitHubMock.ORGS.length; i++) { orgs.push(GitHubMock.ORGS[i].login); } + let describe = []; + for (let i = 0; i < GitHubMock.ORGS.length; i++) { + describe.push(GitHubMock.ORGS[i].login); + } let gitHubDetails = { authenticated: this.isPageRedirect() ? true : false, avatar: GitHubMock.USER.avatar_url, login: GitHubMock.USER.login, - organizations: orgs + organizations: orgs, + htmlUrl: GitHubMock.PATTERNFLY.html_url, + url: GitHubMock.USER.url, + description: describe, + visibility: GitHubMock.PATTERNFLY.private } as GitHubDetails; return this.isPageRedirect() ? Observable.of(gitHubDetails) : Observable.empty(); }