Skip to content

Commit

Permalink
Merge branch 'main' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
acoffman committed May 1, 2024
2 parents 339ea50 + 7231eef commit f464a35
Show file tree
Hide file tree
Showing 14 changed files with 177 additions and 74 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 @@ -7591,7 +7593,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 @@ -13362,8 +13364,11 @@ export const VariantsMenuDocument = gql`
hasPreviousPage
hasNextPage
}
nodes {
...menuVariant
edges {
cursor
node {
...menuVariant
}
}
}
}
Expand Down
68 changes: 34 additions & 34 deletions server/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -83,25 +83,25 @@ GEM
tzinfo (~> 2.0)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
airbrussh (1.5.1)
airbrussh (1.5.2)
sshkit (>= 1.6.1, != 1.7.0)
angular_rails_csrf (5.0.0)
railties (>= 3, < 8)
ast (2.4.2)
audited (5.4.3)
activerecord (>= 5.0, < 7.2)
request_store (~> 1.2)
audited (5.6.0)
activerecord (>= 5.2, < 7.2)
activesupport (>= 5.2, < 7.2)
awesome_nested_set (3.6.0)
activerecord (>= 4.0.0, < 7.2)
aws-eventstream (1.3.0)
aws-partitions (1.900.0)
aws-sdk-core (3.191.4)
aws-partitions (1.922.0)
aws-sdk-core (3.194.0)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.8)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.78.0)
aws-sdk-core (~> 3, >= 3.191.0)
aws-sdk-kms (1.80.0)
aws-sdk-core (~> 3, >= 3.193.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.94.1)
aws-sdk-core (~> 3, >= 3.112.0)
Expand Down Expand Up @@ -149,7 +149,7 @@ GEM
diff-lcs (1.5.1)
diffy (3.4.2)
docile (1.4.0)
dockerfile-rails (1.6.7)
dockerfile-rails (1.6.10)
rails (>= 3.0.0)
drb (2.2.1)
e2mmap (0.1.0)
Expand Down Expand Up @@ -191,8 +191,8 @@ GEM
faraday-rack (1.0.0)
faraday-retry (1.0.3)
ffi (1.16.3)
fugit (1.10.1)
et-orbi (~> 1, >= 1.2.7)
fugit (1.11.0)
et-orbi (~> 1, >= 1.2.11)
raabro (~> 1.4)
globalid (1.2.1)
activesupport (>= 6.1)
Expand All @@ -214,7 +214,7 @@ GEM
reline (>= 0.4.2)
jaro_winkler (1.5.6)
jmespath (1.6.2)
json (2.7.1)
json (2.7.2)
jwt (2.8.1)
base64
kaminari (1.2.2)
Expand Down Expand Up @@ -247,13 +247,14 @@ GEM
net-smtp
marcel (1.0.4)
matrix (0.4.2)
method_source (1.0.0)
method_source (1.1.0)
mini_magick (4.12.0)
mini_mime (1.1.5)
minitest (5.22.3)
msgpack (1.7.2)
multi_json (1.15.0)
multi_xml (0.6.0)
multi_xml (0.7.0)
bigdecimal (~> 3.1)
multipart-post (2.4.0)
mutex_m (0.2.0)
net-ftp (0.3.4)
Expand All @@ -270,21 +271,21 @@ GEM
net-ssh (>= 2.6.5, < 8.0.0)
net-sftp (4.0.0)
net-ssh (>= 5.0.0, < 8.0.0)
net-smtp (0.4.0.1)
net-smtp (0.5.0)
net-protocol
net-ssh (7.2.1)
net-ssh (7.2.3)
nio4r (2.7.1)
nokogiri (1.16.3-aarch64-linux)
nokogiri (1.16.4-aarch64-linux)
racc (~> 1.4)
nokogiri (1.16.3-arm-linux)
nokogiri (1.16.4-arm-linux)
racc (~> 1.4)
nokogiri (1.16.3-arm64-darwin)
nokogiri (1.16.4-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.3-x86-linux)
nokogiri (1.16.4-x86-linux)
racc (~> 1.4)
nokogiri (1.16.3-x86_64-darwin)
nokogiri (1.16.4-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.16.3-x86_64-linux)
nokogiri (1.16.4-x86_64-linux)
racc (~> 1.4)
oauth2 (1.4.11)
faraday (>= 0.17.3, < 3.0)
Expand Down Expand Up @@ -317,7 +318,7 @@ GEM
actionpack (>= 4.2)
omniauth (~> 2.0)
parallel (1.24.0)
parser (3.3.0.5)
parser (3.3.1.0)
ast (~> 2.4.1)
racc
pg (1.5.6)
Expand All @@ -329,7 +330,7 @@ GEM
pry (>= 0.10.4)
psych (5.1.2)
stringio
public_suffix (5.0.4)
public_suffix (5.0.5)
puma (5.6.8)
nio4r (~> 2.0)
raabro (1.4.0)
Expand Down Expand Up @@ -381,25 +382,23 @@ GEM
thor (~> 1.0, >= 1.2.2)
zeitwerk (~> 2.6)
rainbow (3.1.1)
rake (13.1.0)
rake (13.2.1)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
rbs (2.8.4)
rdoc (6.6.3.1)
psych (>= 4.0.0)
redis-client (0.21.1)
redis-client (0.22.1)
connection_pool
regexp_parser (2.9.0)
reline (0.5.0)
reline (0.5.4)
io-console (~> 0.5)
request_store (1.6.0)
rack (>= 1.4)
reverse_markdown (2.1.1)
nokogiri
rexml (3.2.6)
rinku (2.0.6)
rubocop (1.62.1)
rubocop (1.63.4)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
Expand All @@ -410,8 +409,8 @@ GEM
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.31.2)
parser (>= 3.3.0.4)
rubocop-ast (1.31.3)
parser (>= 3.3.1.0)
ruby-progressbar (1.13.0)
ruby-vips (2.2.1)
ffi (~> 1.12)
Expand Down Expand Up @@ -441,7 +440,7 @@ GEM
activemodel (>= 6.1)
hashie
semantic_range (3.0.0)
sidekiq (7.2.2)
sidekiq (7.2.4)
concurrent-ruby (< 2)
connection_pool (>= 2.3.0)
rack (>= 2.2.4)
Expand Down Expand Up @@ -485,7 +484,8 @@ GEM
actionpack (>= 5.2)
activesupport (>= 5.2)
sprockets (>= 3.0.0)
sshkit (1.22.0)
sshkit (1.22.2)
base64
mutex_m
net-scp (>= 1.1.2)
net-sftp (>= 2.1.2)
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
Loading

0 comments on commit f464a35

Please sign in to comment.