Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
},
() => {
this.collectionsStore.setError(true);
}
);
}
/**
* Currently only used from the collection page
* Grabs detailed collection information and navigates to the collection's page
*
* @param {number} organizationId The ID of the organization that the collection belongs to
* @param {number} collectionId The ID of the collection
* @memberof CollectionsService
*/
@transaction()
updateCollectionFromId(organizationId: number, collectionId: number) {
this.collectionsStore.setError(false);
this.collectionsStore.setLoading(true);
this.organizationsService
.getCollectionById(organizationId, collectionId)
.pipe(finalize(() => this.collectionsStore.setLoading(false)))
.subscribe(
(collection: Collection) => {
this.collectionsStore.setError(false);
this.collectionsStore.upsert(collection.id, collection);
this.collectionsStore.setActive(collection.id);
this.organizationService.updateOrganizationFromID(collection.organizationID);
// Navigate to the new collectionName in case the name changes.
this.router.navigate(['/organizations', collection.organizationName, 'collections', collection.name]);
},
() => {
import { BioWorkflow } from '../swagger/model/bioWorkflow';
import { Service } from '../swagger/model/service';
import { ExtendedWorkflowService } from './extended-workflow.service';
import { WorkflowStore } from './workflow.store';
@Injectable({ providedIn: 'root' })
export class WorkflowService {
workflows$: BehaviorSubject = new BehaviorSubject(null); // This contains the list of unsorted workflows
sharedWorkflows$: BehaviorSubject = new BehaviorSubject(null); // This contains the list of unsorted shared workflows
nsSharedWorkflows$: BehaviorSubject = new BehaviorSubject(null); // This contains the list of sorted shared workflows
nsWorkflows$: BehaviorSubject = new BehaviorSubject(null); // This contains the list of sorted workflows
private copyBtnSource = new BehaviorSubject(null); // This is the currently selected copy button.
copyBtn$ = this.copyBtnSource.asObservable();
constructor(private workflowStore: WorkflowStore, private extendedWorkflowService: ExtendedWorkflowService) {}
@transaction()
setWorkflow(workflow: BioWorkflow | Service | null) {
if (workflow) {
this.workflowStore.upsert(workflow.id, workflow);
this.extendedWorkflowService.update(workflow);
this.workflowStore.setActive(workflow.id);
} else {
this.workflowStore.remove();
this.extendedWorkflowService.remove();
}
}
get() {
// Placeholder
// this.http.get('https://akita.com').subscribe((entities) => this.workflowStore.set(entities));
}
ngOnInit() {
if (this.widgetsQuery.hasEntity() === false) {
this.widgetService.initWidgets();
}
this.dashoboardName$ = this.widgetsQuery.select(state => state.name);
this.widgets$ = this.widgetsQuery.selectAll();
this.activeWidgets$ = this.widgetsQuery.selectActive();
this.collection = new DirtyCheckPlugin(this.widgetsQuery, {
watchProperty: 'entities'
}).setHead();
this.widgetsSpecific = new EntityDirtyCheckPlugin(
this.widgetsQuery
).setHead();
}
ngOnInit() {
if (this.widgetsQuery.hasEntity() === false) {
this.widgetService.initWidgets();
}
this.dashoboardName$ = this.widgetsQuery.select(state => state.name);
this.widgets$ = this.widgetsQuery.selectAll();
this.activeWidgets$ = this.widgetsQuery.selectActive();
this.collection = new DirtyCheckPlugin(this.widgetsQuery, {
watchProperty: 'entities'
}).setHead();
this.widgetsSpecific = new EntityDirtyCheckPlugin(
this.widgetsQuery
).setHead();
}
ngOnInit() {
this.todos$ = this.todosQuery.selectVisibleTodos$;
this.activeFilter$ = this.todosQuery.selectVisibilityFilter$;
this.checkAll$ = this.todosQuery.checkAll$.pipe(map(numCompleted => numCompleted && numCompleted === this.todosQuery.getCount()));
this.stateHistory = new StateHistoryPlugin(this.todosQuery);
this.stateHistoryEntity = new EntityStateHistoryPlugin(this.todosQuery);
}
ngOnInit() {
this.todos$ = this.todosQuery.selectVisibleTodos$;
this.activeFilter$ = this.todosQuery.selectVisibilityFilter$;
this.checkAll$ = this.todosQuery.checkAll$.pipe(map(numCompleted => numCompleted && numCompleted === this.todosQuery.getCount()));
this.stateHistory = new StateHistoryPlugin(this.todosQuery);
this.stateHistoryEntity = new EntityStateHistoryPlugin(this.todosQuery);
}
import { Injectable } from '@angular/core';
import { Widget } from './widget.model';
import { EntityState, EntityStore, StoreConfig, MultiActiveState } from '@datorama/akita';
export interface WidgetsState extends EntityState, MultiActiveState {
name: string;
}
const initState = {
name: 'Akita widgets',
active: []
};
@Injectable({ providedIn: 'root' })
@StoreConfig({ name: 'widgets' })
export class WidgetsStore extends EntityStore {
constructor() {
super(initState);
}
}
import { Injectable } from '@angular/core';
import { EntityState, EntityStore, StoreConfig } from '@datorama/akita';
import { Contact } from './contact.model';
export interface ContactsState extends EntityState {}
@Injectable({ providedIn: 'root' })
@StoreConfig({ name: 'contacts' })
export class ContactsStore extends EntityStore {
constructor() {
super();
}
}
import { Injectable } from '@angular/core';
import { Contact } from './contact.model';
import { EntityState, EntityStore, StoreConfig } from '@datorama/akita';
export interface ContactState extends EntityState {}
@Injectable({ providedIn: 'root' })
@StoreConfig({ name: 'contacts' })
export class ContactsStore extends EntityStore {
constructor() {
super();
}
}
export function createInitialState(): EntryFileTabState {
return {
unfilteredFiles: null,
fileTypes: null,
selectedFileType: null,
files: null,
selectedFile: null,
fileContents: null,
downloadFilePath: null,
validationMessage: null
};
}
@Injectable()
@StoreConfig({ name: 'entry-file-tab' })
export class EntryFileTabStore extends Store {
constructor() {
super(createInitialState());
}
}