Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-cox committed Sep 23, 2019
1 parent 0659b5a commit ac68d33
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ import {

export const gitRepoActionBuilders = {
getRepoInfo: (
repoEntityID: string,
endpointGuid: string,
projectEnvVars: EnvVarStratosProject
) => new FetchGitHubRepoInfo(projectEnvVars)
} as OrchestratedActionBuilders;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
withLatestFrom,
} from 'rxjs/operators';

import { CFEntityConfig, CF_ENDPOINT_TYPE } from '../../../../../../cloud-foundry/cf-types';
import { CF_ENDPOINT_TYPE, CFEntityConfig } from '../../../../../../cloud-foundry/cf-types';
import {
FetchBranchesForProject,
FetchCommit,
Expand All @@ -47,6 +47,7 @@ import {
import { GitAppDetails, SourceType } from '../../../../../../cloud-foundry/src/store/types/deploy-application.types';
import { GitCommit, GitRepo } from '../../../../../../cloud-foundry/src/store/types/git.types';
import { GitBranch } from '../../../../../../cloud-foundry/src/store/types/github.types';
import { entityCatalogue } from '../../../../../../core/src/core/entity-catalogue/entity-catalogue.service';
import { EntityServiceFactory } from '../../../../../../core/src/core/entity-service-factory.service';
import { StepOnNextFunction } from '../../../../../../core/src/shared/components/stepper/step/step.component';
import { GitSCM } from '../../../../../../core/src/shared/data-services/scm/scm';
Expand All @@ -59,8 +60,6 @@ import {
getApplicationDeploySourceTypes,
getAutoSelectedDeployType,
} from '../deploy-application-steps.types';
import { entityCatalogue } from '../../../../../../core/src/core/entity-catalogue/entity-catalogue.service';
import { STRATOS_ENDPOINT_TYPE } from '../../../../../../core/src/base-entity-schemas';

@Component({
selector: 'app-deploy-application-step2',
Expand Down Expand Up @@ -231,8 +230,13 @@ export class DeployApplicationStep2Component
const commitSha = commit || branch.commit.sha;
const entityID = projectInfo.full_name + '-' + commitSha;
const gitCommitEntity = entityCatalogue.getEntity(CF_ENDPOINT_TYPE, gitCommitEntityType);
const fetchCommitActionBuilder = gitCommitEntity.actionOrchestrator.getActionBuilder('fetchCommit');
const fetchCommitAction = fetchCommitActionBuilder(this.scm, commitSha, projectInfo.full_name) as FetchCommit;
const fetchCommitActionBuilder = gitCommitEntity.actionOrchestrator.getActionBuilder('get');
const fetchCommitAction = fetchCommitActionBuilder(null, null, {
scm: this.scm,
projectName: projectInfo.full_name,
commitId: commitSha
}) as FetchCommit;
// const fetchCommitAction = fetchCommitActionBuilder(this.scm, commitSha, projectInfo.full_name) as FetchCommit;
const commitEntityService = this.entityServiceFactory.create<EntityInfo>(
entityID,
fetchCommitAction
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
import { Store } from '@ngrx/store';
import { of as observableOf } from 'rxjs';

import { FetchCommits } from '../../../../../../../cloud-foundry/src/actions/deploy-applications.actions';
import { CF_ENDPOINT_TYPE } from '../../../../../../../cloud-foundry/cf-types';
import { CFAppState } from '../../../../../../../cloud-foundry/src/cf-app-state';
import { CFEntitySchema, gitCommitEntityType } from '../../../../../../../cloud-foundry/src/cf-entity-factory';
import { GitCommit } from '../../../../../../../cloud-foundry/src/store/types/git.types';
import { PaginatedAction } from '../../../../../../../store/src/types/pagination.types';
import { entityCatalogue } from '../../../../../core/entity-catalogue/entity-catalogue.service';
import { GitSCM } from '../../../../data-services/scm/scm';
import { ListDataSource } from '../../data-sources-controllers/list-data-source';
import { IListConfig } from '../../list.component.types';
import { entityCatalogue } from '../../../../../core/entity-catalogue/entity-catalogue.service';
import { STRATOS_ENDPOINT_TYPE } from '../../../../../base-entity-schemas';
import { PaginatedAction } from '../../../../../../../store/src/types/pagination.types';
import { CF_ENDPOINT_TYPE } from '../../../../../../../cloud-foundry/cf-types';


export class GithubCommitsDataSource extends ListDataSource<GitCommit> {
Expand All @@ -31,8 +29,12 @@ export class GithubCommitsDataSource extends ListDataSource<GitCommit> {
commitSha?: string,
) {
const gitCommitEntity = entityCatalogue.getEntity(CF_ENDPOINT_TYPE, gitCommitEntityType);
const fetchCommitActionBuilder = gitCommitEntity.actionOrchestrator.getActionBuilder('fetchCommit');
const fetchCommitAction = fetchCommitActionBuilder(scm, projectName, sha) as PaginatedAction;
const fetchCommitActionBuilder = gitCommitEntity.actionOrchestrator.getActionBuilder('getMultiple');
const fetchCommitAction = fetchCommitActionBuilder(sha, null, {
scm,
projectName,
commitId: sha
}) as PaginatedAction;
const action = fetchCommitAction;
const paginationKey = action.paginationKey;
const rowsState = observableOf(commitSha ? {
Expand Down

0 comments on commit ac68d33

Please sign in to comment.