Skip to content

Commit

Permalink
Send this up for tests and see what happens (#872)
Browse files Browse the repository at this point in the history
  • Loading branch information
denis-yuen authored Jan 9, 2020
1 parent bb3aa2c commit a6029e0
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 19 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "2.3.0",
"license": "Apache License 2.0",
"config": {
"webservice_version": "1.8.0-alpha.2"
"webservice_version": "1.8.0-beta.5"
},
"scripts": {
"ng": "npx ng",
Expand Down
8 changes: 4 additions & 4 deletions src/app/home-page/widget/entries/entries.component.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Component } from '@angular/core';
import { UserQuery } from 'app/shared/user/user.query';
import { DefaultService } from 'app/shared/openapi';
import { EntryUpdateTime } from 'app/shared/openapi/model/entryUpdateTime';
import { debounceTime, takeUntil } from 'rxjs/operators';
import { formInputDebounceTime } from 'app/shared/constants';
import { FilteredList } from '../filtered-list';
import { EntriesService, UsersService } from '../../../shared/openapi';

@Component({
selector: 'app-entries',
Expand All @@ -13,12 +13,12 @@ import { FilteredList } from '../filtered-list';
})
export class EntriesComponent extends FilteredList {
public entryTypeEnum = EntryUpdateTime.EntryTypeEnum;
constructor(userQuery: UserQuery, defaultService: DefaultService) {
super(userQuery, defaultService);
constructor(userQuery: UserQuery, usersService: UsersService, entriesService: EntriesService) {
super(userQuery, entriesService, usersService);
}

getMyList(): void {
this.defaultService
this.usersService
.getUserEntries(10, this.filterText)
.pipe(
debounceTime(formInputDebounceTime),
Expand Down
4 changes: 2 additions & 2 deletions src/app/home-page/widget/filtered-list.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { OnInit } from '@angular/core';
import { Observable } from 'rxjs';
import { UserQuery } from 'app/shared/user/user.query';
import { DefaultService } from 'app/shared/openapi';
import { Base } from 'app/shared/base';
import { EntriesService, UsersService } from '../../shared/openapi';

/**
* Base class for logged in homepage widgets that have a filter list
Expand All @@ -14,7 +14,7 @@ export abstract class FilteredList extends Base implements OnInit {
public myItems;
public filterText;

constructor(protected userQuery: UserQuery, protected defaultService: DefaultService) {
constructor(protected userQuery: UserQuery, protected entriesService: EntriesService, protected usersService: UsersService) {
super();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import { Component } from '@angular/core';
import { UserQuery } from 'app/shared/user/user.query';
import { DefaultService } from 'app/shared/openapi';
import { OrganizationUpdateTime } from 'app/shared/openapi/model/organizationUpdateTime';
import { debounceTime, takeUntil } from 'rxjs/operators';
import { formInputDebounceTime } from 'app/shared/constants';
import { FilteredList } from '../filtered-list';
import { EntriesService, UsersService } from '../../../shared/openapi';

@Component({
selector: 'app-organizations',
templateUrl: './organizations.component.html',
styleUrls: ['./organizations.component.scss']
})
export class OrganizationsComponent extends FilteredList {
constructor(userQuery: UserQuery, defaultService: DefaultService) {
super(userQuery, defaultService);
constructor(userQuery: UserQuery, usersService: UsersService, entriesService: EntriesService) {
super(userQuery, entriesService, usersService);
}

getMyList(): void {
this.defaultService
this.usersService
.getUserDockstoreOrganizations(10, this.filterText)
.pipe(
debounceTime(formInputDebounceTime),
Expand Down
17 changes: 9 additions & 8 deletions src/app/shared/state/entry-wizard.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Injectable } from '@angular/core';
import { EntryWizardStore } from './entry-wizard.store';
import { DefaultService, BioWorkflow } from '../openapi';
import { BioWorkflow, WorkflowsService, UsersService } from '../openapi';
import { AlertService } from '../alert/state/alert.service';
import { Repository } from '../openapi/model/repository';
import { HttpErrorResponse } from '@angular/common/http';
Expand All @@ -14,16 +14,17 @@ export class EntryWizardService {
constructor(
private entryWizardStore: EntryWizardStore,
private entryWizardQuery: EntryWizardQuery,
private defaultService: DefaultService,
private alertService: AlertService
private usersService: UsersService,
private alertService: AlertService,
private workflowsService: WorkflowsService
) {}

/**
* Updates the list of git registries
*/
updateGitRegistryStore() {
this.entryWizardStore.setLoading(true);
this.defaultService
this.usersService
.getUserRegistries()
.pipe(finalize(() => this.entryWizardStore.setLoading(false)))
.subscribe(
Expand All @@ -44,7 +45,7 @@ export class EntryWizardService {
this.entryWizardStore.setLoading(true);
this.entryWizardStore.update({ gitOrganizations: undefined, gitRepositories: undefined });
const registryEnum = this.convertSourceControlStringToEnum(registry);
this.defaultService
this.usersService
.getUserOrganizations(registryEnum)
.pipe(finalize(() => this.entryWizardStore.setLoading(false)))
.subscribe(
Expand All @@ -66,7 +67,7 @@ export class EntryWizardService {
this.entryWizardStore.setLoading(true);
const registryEnum = this.convertSourceControlStringToEnum(registry);

this.defaultService
this.usersService
.getUserOrganizationRepositories(registryEnum, organization)
.pipe(finalize(() => this.entryWizardStore.setLoading(false)))
.subscribe(
Expand All @@ -87,7 +88,7 @@ export class EntryWizardService {
this.updateRepoIsPresent(repository, true, true);
this.entryWizardStore.setLoading(true);
const registryEnum = this.convertSourceControlStringToEnum(repository.gitRegistry);
this.defaultService
this.workflowsService
.addWorkflow(registryEnum, repository.organization, repository.repositoryName)
.pipe(finalize(() => this.entryWizardStore.setLoading(false)))
.subscribe(
Expand All @@ -109,7 +110,7 @@ export class EntryWizardService {
this.updateRepoIsPresent(repository, false, false);
this.entryWizardStore.setLoading(true);
const registryEnum = this.convertSourceControlStringToEnum(repository.gitRegistry);
this.defaultService
this.workflowsService
.deleteWorkflow(registryEnum, repository.organization, repository.repositoryName)
.pipe(finalize(() => this.entryWizardStore.setLoading(false)))
.subscribe(
Expand Down

0 comments on commit a6029e0

Please sign in to comment.