Skip to content

Commit bc68f44

Browse files
committed
Some fix
1 parent 9e3493f commit bc68f44

File tree

1 file changed

+34
-1
lines changed

1 file changed

+34
-1
lines changed

src/components/PerspectiveView/index.js

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,27 @@ const ModalContentWrapper = styled("div")`
3535
min-height: 15vh;
3636
`;
3737

38+
export const queryListChanges = gql `
39+
query listChanges(
40+
$proxy: String,
41+
$stamps: ObjectVal!
42+
) {
43+
list_changes(
44+
proxy: $proxy,
45+
stamps: $stamps
46+
) {
47+
language
48+
dictionary
49+
perspective {
50+
lexical_entries {
51+
entities
52+
}
53+
}
54+
}
55+
56+
}
57+
`;
58+
3859
export const queryPerspective = gql`
3960
query queryPerspective1($id: LingvodocID!) {
4061
perspective(id: $id) {
@@ -558,6 +579,9 @@ class P extends React.Component {
558579
});
559580
};
560581

582+
const doSync = () => {
583+
};
584+
561585
const mergeEntries = () => {
562586
const groupList = [selectedEntries];
563587

@@ -607,7 +631,8 @@ class P extends React.Component {
607631
);
608632
}
609633
/* eslint-enable no-shadow */
610-
const isAuthenticated = user && user.user.id;
634+
const isAuthenticated = user?.user?.id;
635+
const allowedSync = user?.user?.allowed_sync;
611636

612637
const isTableLanguages = JSON.stringify(id) === JSON.stringify([4839, 2]);
613638

@@ -713,6 +738,14 @@ class P extends React.Component {
713738
(mode === "publish" && isAuthenticated) ||
714739
(mode === "contributions" && isAuthenticated)) && (
715740
<div className="lingvo-perspective-buttons">
741+
{mode === "edit" && allowedSync && (
742+
<Button
743+
icon={<i className="lingvo-icon lingvo-icon_refresh" />}
744+
content={this.context("Synchronize")}
745+
onClick={doSync}
746+
className="lingvo-button-green lingvo-perspective-button"
747+
/>
748+
)}
716749
{mode === "edit" && (
717750
<Button
718751
icon={<i className="lingvo-icon lingvo-icon_add" />}

0 commit comments

Comments
 (0)