Skip to content

Commit

Permalink
Check all translations for Affix word to allow morphology tools -- #1113
Browse files Browse the repository at this point in the history
 (#1114)

* count all existent columns on create new one

* check all translations for Affix
  • Loading branch information
vmonakhov authored Mar 26, 2024
1 parent 56ea24b commit 9d00c1e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/Columns/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ class Columns extends React.Component {
// calculate next position
const pos =
columns
.filter(c => !c.self_id)
//.filter(c => !c.self_id)
.map(c => c.position)
.reduce((x, y) => (x > y ? x : y), 1) + 1;

Expand Down
5 changes: 3 additions & 2 deletions src/pages/Perspective/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ const toolsQuery = gql`
edit_check: role_check(subject: "perspective", action: "edit")
columns {
field {
english_translation: translation(locale_id: 2)
translations
}
}
}
Expand Down Expand Up @@ -948,7 +948,8 @@ const Tools = ({
}
} = data;

const isMorphology = ({ field: { english_translation: field_name } }) => field_name.toLowerCase().includes("affix");
const isMorphology = ({ field: { translations: tt } }) =>
Object.values(tt).some(t => t.toLowerCase().includes("affix") || t.toLowerCase().includes("аффикс"));
const glottMode = columns.some(isMorphology) ? "morphology" : "swadesh";
const glottMenu = columns.some(isMorphology) ? "Morphology distance" : "Glottochronology (Swadesh-Starostin)";
const published = english_status === "Published" || english_status === "Limited access";
Expand Down

0 comments on commit 9d00c1e

Please sign in to comment.