Skip to content
This repository has been archived by the owner on Jan 22, 2024. It is now read-only.

ssDNA should not show reverseSequence automaticlly #898

Merged
merged 1 commit into from
Jul 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 5 additions & 1 deletion src/helperComponents/PropertiesDialog/GenbankView.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ class GenbankView extends React.Component {
state = {
fileTypeToView: "genbank"
};

select = () => this._input?.select();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change fixed the Genbank View selection and also the console warning in dev tool.


render() {
const { sequenceData = {} } = this.props;
let filestring;
Expand Down Expand Up @@ -48,7 +51,7 @@ class GenbankView extends React.Component {
<textarea
data-test="ve-genbank-text"
readOnly
onclick="this.select()"
onClick={this.select}
style={{
whiteSpace: "pre",
overflowWrap: "normal",
Expand All @@ -57,6 +60,7 @@ class GenbankView extends React.Component {
fontFamily: "monospace",
height: 350
}}
ref={(ref) => (this._input = ref)}
value={filestring}
/>
</>
Expand Down
16 changes: 13 additions & 3 deletions src/updateEditor.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { set } from "lodash";
import { set, isEqual } from "lodash";
import { tidyUpSequenceData } from "@teselagen/sequence-utils";
import { annotationTypes } from "@teselagen/sequence-utils";

Expand All @@ -23,9 +23,19 @@ export default function updateEditor(
currentEditor.sequenceData && currentEditor.sequenceData.isRna;
const isAlreadyOligoEditor =
currentEditor.sequenceData && currentEditor.sequenceData.isOligo;
const reverseSequenceShouldBeUpdate =
currentEditor.sequenceData?.isSingleStrandedDNA !==
sequenceData?.isSingleStrandedDNA;
const annotationVisibilityUpdated =
!isEqual(annotationVisibility, currentEditor.annotationVisibility) ||
!isEqual(annotationsToSupport, currentEditor.annotationsToSupport);

const isAlreadySpecialEditor =
isAlreadyProteinEditor || isAlreadyRnaEditor || isAlreadyOligoEditor;
isAlreadyProteinEditor ||
isAlreadyRnaEditor ||
isAlreadyOligoEditor ||
reverseSequenceShouldBeUpdate ||
annotationVisibilityUpdated;

let toSpread = {};
let payload;
Expand Down Expand Up @@ -139,7 +149,7 @@ export default function updateEditor(
caret: true,
...annotationVisibility, //we spread this here to allow the user to override this .. if they must!
sequence: true,
reverseSequence: true,
reverseSequence: !sequenceData?.isSingleStrandedDNA,
translations: false,
aminoAcidNumbers: false,
primaryProteinSequence: false
Expand Down
Loading