Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/fix submit to core #439

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
ce5ea2e
Handle when Instant json element is a json object
zhx828 Aug 22, 2024
c3ce224
Merge pull request #424 from zhx828/hot-fix
zhx828 Aug 22, 2024
462c4c4
Textarea in review mode should fit text content (#427)
calvinlu3 Aug 23, 2024
565bc5b
Update pom version
Aug 23, 2024
f661d40
Fix reject cancer type name review (#428)
calvinlu3 Aug 23, 2024
2d1016a
Add reference to oncokb sop alteration nomenclature in add mutation m…
calvinlu3 Aug 30, 2024
d831031
Update pom version
Aug 30, 2024
7f64f9b
Avoid fetching management info repeatedly
zhx828 Sep 9, 2024
6575c8c
Do not rerender the side bar when loading session
zhx828 Sep 9, 2024
fee10a2
Fix drug code not selectable (#435)
calvinlu3 Sep 10, 2024
e0d7e91
Merge pull request #434 from zhx828/fix-user-page
zhx828 Sep 10, 2024
860dbab
Bump actions to latest version (#438)
calvinlu3 Sep 13, 2024
5cc5a79
resize text area when input changes (#440)
bprize15 Sep 19, 2024
8f0b194
add sorting by firebase index (#443)
bprize15 Sep 20, 2024
f269cf8
Delete mutation/tumor/treatment as last step to avoid stale index (#444)
calvinlu3 Sep 23, 2024
73a11ba
Review no longer removes data for core submission
jfkonecn Sep 17, 2024
277f1cf
Added comments to useLastReviewOnly
jfkonecn Sep 19, 2024
a449744
Add children review paths
jfkonecn Sep 20, 2024
db4da7b
Fixed approve all
jfkonecn Sep 23, 2024
f03fd79
Fixed UI tests
jfkonecn Sep 23, 2024
67e996c
Fixed UI tests
jfkonecn Sep 23, 2024
908422a
break in middle of word to fix collapsible title overlfow (#442)
bprize15 Sep 24, 2024
79bcf58
Change searchEntities to readHandler instead of updateHandler (#445)
calvinlu3 Sep 24, 2024
452c9ba
Fixed merge conflicts
jfkonecn Sep 25, 2024
00878aa
Fixed submit all
jfkonecn Sep 25, 2024
c61d25c
Fixed submission bug
jfkonecn Sep 25, 2024
f3e0d76
Fixed data validation tool (#447)
jfkonecn Sep 25, 2024
0d93628
Allow curating mutation summary (#433)
zhx828 Sep 25, 2024
d15bb26
Fixed merge conflicts
jfkonecn Sep 25, 2024
7eab67a
Fixed submit all
jfkonecn Sep 25, 2024
eed47b0
Fixed tests
jfkonecn Sep 26, 2024
9bb39ae
Fixed gene type submissions
jfkonecn Sep 27, 2024
908b2f1
Removed last review check inside getevidences and gene type
jfkonecn Sep 27, 2024
9cc51f0
Added mutation summary
jfkonecn Sep 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/after-branch-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
version: ${{ steps.find_release.outputs.tag }}

- name: 'Setup Java'
uses: actions/setup-java@v1
uses: actions/setup-java@v4
with:
java-version: 8

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/docker-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ jobs:
name: Build and Push
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20.12.2'
- uses: actions/setup-java@v2
- uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '17'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/github-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ jobs:
name: OncoKB Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20.12.2"
- uses: actions/setup-java@v2
- uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '17'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/webdriver-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Build Docker images
run: docker compose build
Expand All @@ -19,7 +19,7 @@ jobs:

- name: Archive screenshots
if: failure()
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: visual-regression-screenshots
path: ./src/test/javascript/screenshots
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<groupId>org.mskcc.oncokb.curation</groupId>
<artifactId>oncokb-curation</artifactId>
<version>2.0.21</version>
<version>2.0.23</version>
<packaging>jar</packaging>
<name>OncoKB Curation</name>
<description>Description for oncokb-curation</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,18 @@ public class InstantTypeAdapter implements JsonSerializer<Instant>, JsonDeserial

@Override
public Instant deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) {
return Instant.parse(json.getAsString());
if (json.isJsonPrimitive()) {
// Handle the ISO 8601 string format
return Instant.parse(json.getAsString());
} else if (json.isJsonObject()) {
// Handle the {"seconds":..., "nanos":...} object format
JsonObject jsonObject = json.getAsJsonObject();
long seconds = jsonObject.get("seconds").getAsLong();
int nanos = jsonObject.get("nanos").getAsInt();
return Instant.ofEpochSecond(seconds, nanos);
} else {
throw new JsonParseException("Unexpected JSON type: " + json.getClass().getSimpleName());
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse
!path.startsWith("/login") &&
!path.startsWith("/oauth2") &&
!path.startsWith("/legacy-api") &&
!path.startsWith("/websocket") &&
!path.contains(".") &&
path.matches("/(.*)")
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public ProxyWebSocketHandler(ApplicationProperties applicationProperties) {
@Override
public void afterConnectionEstablished(WebSocketSession session) throws Exception {
try {
String incomingUri = session.getUri().toString();
String incomingUri = session.getUri().getPath();
StandardWebSocketClient client = new StandardWebSocketClient();
OncoCoreWebSocketHandler handler = new OncoCoreWebSocketHandler(session);
client.doHandshake(handler, this.baseUrl + "/api" + incomingUri);
Expand Down
6 changes: 3 additions & 3 deletions src/main/webapp/app/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@ const App: React.FunctionComponent<IAppProps> = (props: IAppProps) => {
pauseOnFocusLoss
/>
<BetaSiteMessage />
{props.loadingAuth ? (
<LoadingIndicator isLoading size={LoaderSize.LARGE} center={true} />
) : (
{props.loadingAuth && <LoadingIndicator isLoading size={LoaderSize.LARGE} center={true} />}
{props.authAccount && (
<div>
{props.isAuthorized && <NavigationSidebar />}
<div className="app-center-content-wrapper" style={{ margin: props.centerContentMargin }}>
Expand All @@ -63,6 +62,7 @@ const mapStoreToProps = ({ authStore, layoutStore, firebaseAppStore }: IRootStor
authorities: authStore.account.authorities,
isCurator: hasAnyAuthority(authStore.account.authorities ?? [], [AUTHORITIES.CURATOR]),
loadingAuth: authStore.loading,
authAccount: authStore.account,
navigationSidebarWidth: layoutStore.navigationSidebarWidth,
toggleNavSidebar: layoutStore.toggleNavigationSidebar,
centerContentMargin: layoutStore.centerContentMargin,
Expand Down
6 changes: 3 additions & 3 deletions src/main/webapp/app/components/sidebar/NavigationSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,9 @@ export const NavigationSidebar: React.FunctionComponent<StoreProps> = ({ isNavSi
.value();

setEntityMenuOrder(order);
}, []);

props.fetchManagementInfo!();
props.getManagementInfo!();
}, []);

return (
<Sidebar
Expand Down Expand Up @@ -318,7 +318,7 @@ const mapStoreToProps = ({ layoutStore, authStore, managementStore }: IRootStore
account: authStore.account,
managementVersion: managementStore.version,
managementCommit: managementStore.commit,
fetchManagementInfo: flow(managementStore.fetchManagementInfo),
getManagementInfo: managementStore.getManagementInfo,
});

type StoreProps = Partial<ReturnType<typeof mapStoreToProps>>;
Expand Down
9 changes: 3 additions & 6 deletions src/main/webapp/app/entities/drug/drug-update.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { IRootStore } from 'app/stores';
import { SaveButton } from 'app/shared/button/SaveButton';
import { getEntityActionRoute } from 'app/shared/util/RouteUtils';
import { ENTITY_ACTION, ENTITY_TYPE } from 'app/config/constants/constants';
import NcitCodeSelect, { parseNcitUniqId } from 'app/shared/select/NcitCodeSelect';
import NcitCodeSelect from 'app/shared/select/NcitCodeSelect';
import { mapIdList } from 'app/shared/util/entity-utils';
import { IDrug } from 'app/shared/model/drug.model';
import { INciThesaurus } from 'app/shared/model/nci-thesaurus.model';
Expand Down Expand Up @@ -46,7 +46,6 @@ export const DrugUpdate = (props: IDrugUpdateProps) => {
props.getEntity(props.match.params.id);
}

props.getNciThesauruses({});
props.getFlags({});
props.getAssociations({});
}, []);
Expand Down Expand Up @@ -148,9 +147,9 @@ export const DrugUpdate = (props: IDrugUpdateProps) => {
<FormGroup>
<Label>Code</Label>
<NcitCodeSelect
ncit={drugEntity.nciThesaurus}
ncit={drugEntity.nciThesaurus ?? selectedNcit}
onChange={selectedOption => {
setSelectedNcit(selectedOption ? parseNcitUniqId(selectedOption.value) : undefined);
setSelectedNcit(selectedOption ? selectedOption.ncit : undefined);
}}
/>
</FormGroup>
Expand All @@ -164,14 +163,12 @@ export const DrugUpdate = (props: IDrugUpdateProps) => {
};

const mapStoreToProps = (storeState: IRootStore) => ({
nciThesauruses: storeState.nciThesaurusStore.entities,
flags: storeState.flagStore.entities,
associations: storeState.associationStore.entities,
drugEntity: storeState.drugStore.entity,
loading: storeState.drugStore.loading,
updating: storeState.drugStore.updating,
updateSuccess: storeState.drugStore.updateSuccess,
getNciThesauruses: storeState.nciThesaurusStore.getEntities,
getFlags: storeState.flagStore.getEntities,
getAssociations: storeState.associationStore.getEntities,
getEntity: storeState.drugStore.getEntity,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { isSectionRemovableWithoutReview } from 'app/shared/util/firebase/fireba
import EditIcon from 'app/shared/icons/EditIcon';
import ModifyCancerTypeModal from 'app/shared/modal/ModifyCancerTypeModal';
import { notifyError } from 'app/oncokb-commons/components/util/NotificationUtils';
import _ from 'lodash';
import { getLevelDropdownOptions } from 'app/shared/util/firebase/firebase-level-utils';
import { DIAGNOSTIC_LEVELS_ORDERING, READABLE_FIELD, PROGNOSTIC_LEVELS_ORDERING } from 'app/config/constants/firebase';
import { RealtimeTextAreaInput } from 'app/shared/firebase/input/RealtimeInputs';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import { IRootStore } from 'app/stores';
import { get, onValue, ref } from 'firebase/database';
import _ from 'lodash';
import { observer } from 'mobx-react';
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { Button } from 'reactstrap';
import BadgeGroup from '../BadgeGroup';
import { DeleteSectionButton } from '../button/DeleteSectionButton';
Expand All @@ -49,6 +49,7 @@ import { NestLevelColor, NestLevelMapping, NestLevelType } from './NestLevel';
import { RemovableCollapsible } from './RemovableCollapsible';
import { Unsubscribe } from 'firebase/database';
import { getLocationIdentifier } from 'app/components/geneHistoryTooltip/gene-history-tooltip-utils';
import { SimpleConfirmModal } from 'app/shared/modal/SimpleConfirmModal';

export interface IMutationCollapsibleProps extends StoreProps {
mutationPath: string;
Expand Down Expand Up @@ -77,15 +78,21 @@ const MutationCollapsible = ({
annotatedAltsCache,
genomicIndicators,
showLastModified,
handleFirebaseUpdate,
}: IMutationCollapsibleProps) => {
const firebaseMutationsPath = `${getFirebaseGenePath(isGermline, hugoSymbol)}/mutations`;

const [mutationUuid, setMutationUuid] = useState<string>('');
const [mutationName, setMutationName] = useState<string>('');
const [mutationNameReview, setMutationNameReview] = useState<Review | null>(null);
const [mutationSummary, setMutationSummary] = useState<string>('');
const [mutationAlterations, setMutationAlterations] = useState<Alteration[] | null>(null);
const [isRemovableWithoutReview, setIsRemovableWithoutReview] = useState(false);
const [relatedAnnotationResult, setRelatedAnnotationResult] = useState<AlterationAnnotationStatus[]>([]);
const [oncogenicity, setOncogenicity] = useState<string>('');
const [showSimpleConfirmModal, setShowSimpleConfirmModal] = useState<boolean>(false);
const [simpleConfirmModalBody, setSimpleConfirmModalBody] = useState<string | undefined>(undefined);
const [mutationSummaryRef, setMutationSummaryRef] = useState<HTMLElement | null>(null);

useEffect(() => {
const arr = annotatedAltsCache?.get(hugoSymbol ?? '', [{ name: mutationName, alterations: mutationAlterations }]) ?? [];
Expand Down Expand Up @@ -157,6 +164,11 @@ const MutationCollapsible = ({
setMutationName(snapshot.val());
}),
);
callbacks.push(
onValue(ref(firebaseDb, `${mutationPath}/summary`), snapshot => {
setMutationSummary(snapshot.val());
}),
);
callbacks.push(
onValue(ref(firebaseDb, `${mutationPath}/alterations`), snapshot => {
setMutationAlterations(snapshot.val());
Expand All @@ -169,6 +181,11 @@ const MutationCollapsible = ({
setIsRemovableWithoutReview(isSectionRemovableWithoutReview(review));
}),
);
callbacks.push(
onValue(ref(firebaseDb, `${mutationPath}/mutation_effect/oncogenic`), snapshot => {
setOncogenicity(snapshot.val());
}),
);

onValue(
ref(firebaseDb, `${mutationPath}/name_uuid`),
Expand Down Expand Up @@ -197,6 +214,34 @@ const MutationCollapsible = ({
[mutationPath, mutationName, parsedHistoryList],
);

async function simpleConfirmModalOnConfirm() {
await handleFirebaseUpdate?.(mutationPath, { summary: '' });
if (mutationSummaryRef) {
mutationSummaryRef.click();
}
setShowSimpleConfirmModal(false);
setSimpleConfirmModalBody(undefined);
}

function oncogenicityRadioOnClick(
event: React.MouseEvent<HTMLInputElement> | React.MouseEvent<HTMLLabelElement> | React.MouseEvent<HTMLDivElement>,
) {
if (mutationSummary && event.target) {
let newOncogenicityVal;
if (event.target instanceof HTMLInputElement) {
newOncogenicityVal = event.target.value;
} else if (event.target instanceof HTMLDivElement || event.target instanceof HTMLLabelElement) {
newOncogenicityVal = event.target.innerText;
}
if (newOncogenicityVal === RADIO_OPTION_NONE) {
event.preventDefault();
setMutationSummaryRef(event.target as HTMLElement);
setShowSimpleConfirmModal(true);
setSimpleConfirmModalBody(`Mutation summary will be removed after removing oncogenicity.`);
}
}
}

async function handleDeleteMutation(toVus = false) {
if (!firebaseDb) {
return;
Expand Down Expand Up @@ -308,6 +353,25 @@ const MutationCollapsible = ({
}
isPendingDelete={isMutationPendingDelete}
>
<RealtimeTextAreaInput
firebasePath={`${mutationPath}/summary`}
inputClass={styles.summaryTextarea}
label="Mutation Summary (Optional)"
labelIcon={
<GeneHistoryTooltip
historyData={parsedHistoryList}
location={`${getMutationName(mutationName, mutationAlterations)}, ${READABLE_FIELD.SUMMARY}`}
locationIdentifier={getLocationIdentifier({
mutationUuid,
fields: [READABLE_FIELD.SUMMARY],
})}
/>
}
name="mutationSummary"
parseRefs
disabled={oncogenicity === ''}
disabledMessage={'Not curatable: mutation summary is only curatable when oncogenicity is specified.'}
/>
<Collapsible
idPrefix={`${mutationName}-mutation-effect`}
title="Mutation Effect"
Expand Down Expand Up @@ -369,6 +433,10 @@ const MutationCollapsible = ({
}
</>
}
/** Radio a bit tricky. Have to use onMouseDown event to cancel the default event.
* The onclick event does not like to be overwritten **/
onMouseDown={oncogenicityRadioOnClick}
labelOnClick={oncogenicityRadioOnClick}
isRadio
options={[...ONCOGENICITY_OPTIONS, RADIO_OPTION_NONE].map(label => ({
label,
Expand Down Expand Up @@ -598,6 +666,12 @@ const MutationCollapsible = ({
}}
/>
) : undefined}
<SimpleConfirmModal
show={showSimpleConfirmModal}
body={simpleConfirmModalBody}
onConfirm={simpleConfirmModalOnConfirm}
onCancel={() => setShowSimpleConfirmModal(false)}
/>
</>
);
};
Expand All @@ -623,6 +697,7 @@ const mapStoreToProps = ({
firebaseDb: firebaseAppStore.firebaseDb,
annotatedAltsCache: curationPageStore.annotatedAltsCache,
genomicIndicators: firebaseGenomicIndicatorsStore.data,
handleFirebaseUpdate: firebaseGeneService.updateObject,
});

type StoreProps = Partial<ReturnType<typeof mapStoreToProps>>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@

.collapsibleTitleWrapper {
display: flex;
word-break: break-word;
align-items: center;
:hover {
cursor: pointer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export enum SortOptions {
LAST_MODIFIED = 'Last Modified',
POSITION_INCREASING = 'Position Increasing',
POSITION_DECREASING = 'Position Decreasing',
FIREBASE = 'Firebase',
}

const YES = 'Yes';
Expand Down
Loading