Skip to content

Commit

Permalink
Merged verb and adverd valency functionalities -- #1128 (#1130)
Browse files Browse the repository at this point in the history
* fixes and refactoring

* common names
  • Loading branch information
vmonakhov authored Jul 12, 2024
1 parent 95d3ab9 commit fff448f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 18 deletions.
21 changes: 12 additions & 9 deletions src/pages/Adverb/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,24 +74,24 @@ export const adverbDataQuery = gql`
`;

const createAdverbDataMutation = gql`
mutation createAdverbData($perspectiveId: LingvodocID!) {
create_adverb_data(perspective_id: $perspectiveId) {
mutation createAdverbData($perspectiveId: LingvodocID!, $valencyKind: String!) {
create_valency_data(perspective_id: $perspectiveId, valency_kind: $valencyKind) {
triumph
}
}
`;

const setAdverbAnnotationMutation = gql`
mutation setAdverbAnnotation($annotationList: [AdverbInstanceAnnotation]!) {
set_adverb_annotation(annotation_list: $annotationList) {
mutation setAdverbAnnotation($annotationList: [ValencyInstanceAnnotation]!, $valencyKind: String!) {
set_valency_annotation(annotation_list: $annotationList, valency_kind: $valencyKind) {
triumph
}
}
`;

const saveAdverbDataMutation = gql`
mutation saveAdverbData($perspectiveId: LingvodocID!) {
save_adverb_data(perspective_id: $perspectiveId) {
mutation saveAdverbData($perspectiveId: LingvodocID!, $valencyKind: String!) {
save_valency_data(perspective_id: $perspectiveId, valency_kind: $valencyKind) {
triumph
data_url
}
Expand Down Expand Up @@ -738,7 +738,8 @@ class Adverb extends React.Component {
this.props
.createAdverbData({
variables: {
perspectiveId: this.state.perspective.id
perspectiveId: this.state.perspective.id,
valencyKind: 'adverb'
}
})
.then(
Expand Down Expand Up @@ -811,7 +812,8 @@ class Adverb extends React.Component {
this.props
.saveAdverbData({
variables: {
perspectiveId: this.state.perspective.id
perspectiveId: this.state.perspective.id,
valencyKind: 'adverb'
}
})
.then(
Expand Down Expand Up @@ -841,7 +843,8 @@ class Adverb extends React.Component {
this.props
.setAdverbAnnotation({
variables: {
annotationList: annotation_list
annotationList: annotation_list,
valencyKind: 'adverb'
}
})
.then(
Expand Down
21 changes: 12 additions & 9 deletions src/pages/Valency/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,25 +72,25 @@ export const valencyDataQuery = gql`
`;

const createValencyDataMutation = gql`
mutation createValencyData($perspectiveId: LingvodocID!) {
create_valency_data(perspective_id: $perspectiveId) {
mutation createValencyData($perspectiveId: LingvodocID!, $valencyKind: String!) {
create_valency_data(perspective_id: $perspectiveId, valency_kind: $valencyKind) {
triumph
}
}
`;

const saveValencyDataMutation = gql`
mutation saveValencyData($perspectiveId: LingvodocID!) {
save_valency_data(perspective_id: $perspectiveId) {
mutation saveValencyData($perspectiveId: LingvodocID!, $valencyKind: String!) {
save_valency_data(perspective_id: $perspectiveId, valency_kind: $valencyKind) {
triumph
data_url
}
}
`;

const setValencyAnnotationMutation = gql`
mutation setValencyAnnotation($annotationList: [ValencyInstanceAnnotation]!) {
set_valency_annotation(annotation_list: $annotationList) {
mutation setValencyAnnotation($annotationList: [ValencyInstanceAnnotation]!, $valencyKind: String!) {
set_valency_annotation(annotation_list: $annotationList, valency_kind: $valencyKind) {
triumph
}
}
Expand Down Expand Up @@ -706,7 +706,8 @@ class Valency extends React.Component {
this.props
.createValencyData({
variables: {
perspectiveId: this.state.perspective.id
perspectiveId: this.state.perspective.id,
valencyKind: 'verb'
}
})
.then(
Expand Down Expand Up @@ -779,7 +780,8 @@ class Valency extends React.Component {
this.props
.saveValencyData({
variables: {
perspectiveId: this.state.perspective.id
perspectiveId: this.state.perspective.id,
valencyKind: 'verb'
}
})
.then(
Expand Down Expand Up @@ -809,7 +811,8 @@ class Valency extends React.Component {
this.props
.setValencyAnnotation({
variables: {
annotationList: annotation_list
annotationList: annotation_list,
valencyKind: 'verb'
}
})
.then(
Expand Down

0 comments on commit fff448f

Please sign in to comment.