Skip to content

Commit

Permalink
Merge branch 'main' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
acoffman committed Apr 26, 2024
2 parents 71fc79f + 22c7aa0 commit 5fad5be
Show file tree
Hide file tree
Showing 11 changed files with 52 additions and 40 deletions.
4 changes: 2 additions & 2 deletions client/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { GraphQLModule } from '@app/graphql/graphql.module'
import { NzIconModule } from 'ng-zorro-antd/icon'
import { CvcNetworkErrorAlertModule } from './components/app/network-error-alert/network-error-alert.module'
import { Observable } from 'rxjs'
import { AppLoadErrorHandler } from './core/utilities/app-reload-handler'
import { AppErrorHandler } from './core/utilities/app-error-handler'
import { CvcForms2Module } from '@app/forms/forms.module'

registerLocaleData(en)
Expand Down Expand Up @@ -59,7 +59,7 @@ function initializeApiFactory(httpClient: HttpClient): () => Observable<any> {
CookieService,
{
provide: ErrorHandler,
useClass: AppLoadErrorHandler,
useClass: AppErrorHandler,
},
{ provide: NZ_I18N, useValue: en_US },
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ export class CvcVariantsMenuComponent implements OnInit {
)

this.menuVariants$ = connection$.pipe(
map((c) => c.nodes),
filter(isNonNulled)
map((c) => c.edges.map((e) => e.node), filter(isNonNulled))
)

this.totalVariants$ = connection$.pipe(map((c) => c.totalCount))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@ query VariantsMenu(
hasPreviousPage
hasNextPage
}
nodes {
...menuVariant
edges{
cursor
node {
...menuVariant
}
}
}
}
Expand Down
22 changes: 22 additions & 0 deletions client/src/app/core/utilities/app-error-handler.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { ErrorHandler, Injectable } from '@angular/core'
import { environment } from 'environments/environment'

@Injectable()
export class AppErrorHandler implements ErrorHandler {
handleError(error: any): void {
if (environment.production) {
const chunkFailedMessage = /Loading chunk [\d]+ failed/
if (chunkFailedMessage.test(error.message)) {
if (
confirm(
'There is an updated version of CiVIC available. Click OK to reload.'
)
) {
window.location.reload()
}
}
} else {
console.error(error)
}
}
}
17 changes: 0 additions & 17 deletions client/src/app/core/utilities/app-reload-handler.ts

This file was deleted.

23 changes: 14 additions & 9 deletions client/src/app/generated/civic.apollo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export type ActivityInterface = {
/** The connection type for ActivityInterface. */
export type ActivityInterfaceConnection = {
__typename: 'ActivityInterfaceConnection';
/** List of activity types that have occured on this entity. */
/** List of activity types that have occurred on this entity. */
activityTypes: Array<ActivityTypeInput>;
/** A list of edges. */
edges: Array<ActivityInterfaceEdge>;
Expand Down Expand Up @@ -1594,7 +1594,7 @@ export type EventConnection = {
__typename: 'EventConnection';
/** A list of edges. */
edges: Array<EventEdge>;
/** List of event types that have occured on this entity. */
/** List of event types that have occurred on this entity. */
eventTypes: Array<EventAction>;
/** A list of nodes. */
nodes: Array<Event>;
Expand Down Expand Up @@ -3305,7 +3305,7 @@ export enum MolecularProfileDisplayFilter {
WithAccepted = 'WITH_ACCEPTED',
/** Display only molecular profiles which have evidence in either an accepted or submitted state. */
WithAcceptedOrSubmitted = 'WITH_ACCEPTED_OR_SUBMITTED',
/** Display molecular profiles which have at least one submited evidence item. */
/** Display molecular profiles which have at least one submitted evidence item. */
WithSubmitted = 'WITH_SUBMITTED'
}

Expand Down Expand Up @@ -3415,7 +3415,7 @@ export type Mutation = {
*/
rejectRevisions?: Maybe<RejectRevisionsPayload>;
/**
* Resolve a flag on a CIViC entity indicating that it was either erronously flagged or the issue has been resolved.
* Resolve a flag on a CIViC entity indicating that it was either erroneously flagged or the issue has been resolved.
* Any user may resolve their own flag however only editors with valid conflict
* of interest statements can resolve other flags.
*/
Expand Down Expand Up @@ -3448,7 +3448,7 @@ export type Mutation = {
suggestVariantGroupRevision?: Maybe<SuggestVariantGroupRevisionPayload>;
/** Unsubscribe from a CIViC entity to stop receiving notifications about it. */
unsubscribe?: Maybe<UnsubscribePayload>;
/** Update the currentlly logged in User's Conflict of Interest statement */
/** Update the currently logged in User's Conflict of Interest statement */
updateCoi?: Maybe<UpdateCoiPayload>;
/** Mark one or more notifications as read/unread. The notification IDs provided must belong to the requesting user. */
updateNotificationStatus?: Maybe<UpdateNotificationStatusPayload>;
Expand Down Expand Up @@ -3765,7 +3765,7 @@ export type NotificationConnection = {
__typename: 'NotificationConnection';
/** A list of edges. */
edges: Array<NotificationEdge>;
/** List of event types that have occured on this entity. */
/** List of event types that have occurred on this entity. */
eventTypes: Array<EventAction>;
/** Users who have mentioned you. */
mentioningUsers: Array<User>;
Expand Down Expand Up @@ -4265,6 +4265,8 @@ export type QueryActivitiesArgs = {
first?: InputMaybe<Scalars['Int']>;
last?: InputMaybe<Scalars['Int']>;
mode?: InputMaybe<EventFeedMode>;
occuredAfter?: InputMaybe<Scalars['ISO8601DateTime']>;
occuredBefore?: InputMaybe<Scalars['ISO8601DateTime']>;
organizationId?: InputMaybe<Array<Scalars['Int']>>;
sortBy?: InputMaybe<DateSort>;
subject?: InputMaybe<Array<SubscribableQueryInput>>;
Expand Down Expand Up @@ -7590,7 +7592,7 @@ export type VariantsMenuQueryVariables = Exact<{
}>;


export type VariantsMenuQuery = { __typename: 'Query', variants: { __typename: 'VariantInterfaceConnection', totalCount: number, pageInfo: { __typename: 'PageInfo', startCursor?: string | undefined, endCursor?: string | undefined, hasPreviousPage: boolean, hasNextPage: boolean }, nodes: Array<{ __typename: 'FactorVariant', id: number, name: string, link: string, flagged: boolean } | { __typename: 'GeneVariant', id: number, name: string, link: string, flagged: boolean } | { __typename: 'Variant', id: number, name: string, link: string, flagged: boolean }> } };
export type VariantsMenuQuery = { __typename: 'Query', variants: { __typename: 'VariantInterfaceConnection', totalCount: number, pageInfo: { __typename: 'PageInfo', startCursor?: string | undefined, endCursor?: string | undefined, hasPreviousPage: boolean, hasNextPage: boolean }, edges: Array<{ __typename: 'VariantInterfaceEdge', cursor: string, node?: { __typename: 'FactorVariant', id: number, name: string, link: string, flagged: boolean } | { __typename: 'GeneVariant', id: number, name: string, link: string, flagged: boolean } | { __typename: 'Variant', id: number, name: string, link: string, flagged: boolean } | undefined }> } };

export type VariantTypesForFeatureQueryVariables = Exact<{
featureId?: InputMaybe<Scalars['Int']>;
Expand Down Expand Up @@ -13347,8 +13349,11 @@ export const VariantsMenuDocument = gql`
hasPreviousPage
hasNextPage
}
nodes {
...menuVariant
edges {
cursor
node {
...menuVariant
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion server/app/jobs/flag_duplicate_allele_registry_ids.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def perform
variants = Variant.where(id: ids)
variants.each do |variant|
if variant.flags.select{|f| f.state == 'open' && f.open_activity.note =~ /This Variant may be a duplicate and may need to be deprecated/ && f.open_activity.user_id == 385}.count == 0
Activity::FlagEntity.new(
Activities::FlagEntity.new(
flagging_user: civicbot_user,
flaggable: variant,
organization_id: nil,
Expand Down
4 changes: 2 additions & 2 deletions server/app/lib/importer/disease_ontology_mirror.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ def url_from_doid(doid)
def add_flags(disease, text)
civicbot_user = User.find(385)
(disease.evidence_items + disease.assertions).each do |obj|
if obj.flags.select{|f| f.state == 'open' && f.open_activity.note == text && c.open_activity.user_id == 385}.count == 0
Activity::FlagEntity.new(
if obj.flags.select{|f| f.state == 'open' && f.open_activity.note == text && f.open_activity.user_id == 385}.count == 0
Activities::FlagEntity.new(
flagging_user: civicbot_user,
flaggable: obj,
organization_id: nil,
Expand Down
6 changes: 3 additions & 3 deletions server/app/lib/importer/sequence_ontology_mirror.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@ def process_obsolete_terms
text += " Replaced by #{term['replaced_by']}."
end
obsolete_type.variants.each do |variant|
if variant.flags.select{|f| f.state == 'open' && f.comments.select{|c| c.text =~ /obsolete Sequence Ontology term/ && c.user_id == 385}.count > 0}.count == 0
Actions::FlagEntity.new(
if variant.flags.select{|f| f.state == 'open' && f.open_activity.note =~ /obsolete Sequence Ontology term/ && f.open_activity.user_id == 385}.count == 0
Activities::FlagEntity.new(
flagging_user: civicbot_user,
flaggable: variant,
organization_id: nil,
comment: text
note: text
).perform
end
end
Expand Down
2 changes: 1 addition & 1 deletion server/app/lib/scrapers/human_phenotype_ontology.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def self.update
civicbot_user = User.find(385)
(p.evidence_items + p.assertions).each do |obj|
if obj.flags.select{|f| f.state == 'open' && f.open_activity.note =~ /deprecated HPO term/ && f.open_activity.user_id == 385}.count == 0
Activity::FlagEntity.new(
Activities::FlagEntity.new(
flagging_user: civicbot_user,
flaggable: obj,
organization_id: nil,
Expand Down
2 changes: 1 addition & 1 deletion server/config/initializers/sidekiq.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
config.on(:startup) do
schedule_file = Rails.root.join("config", "scheduled_tasks.yml")

if File.exists?(schedule_file) && Rails.env.production?
if File.exist?(schedule_file) && Rails.env.production?
Sidekiq::Cron::Job.load_from_hash YAML.load_file(schedule_file)
end
end
Expand Down

0 comments on commit 5fad5be

Please sign in to comment.