-
Notifications
You must be signed in to change notification settings - Fork 241
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
Feat/update interface subj dom and some interface features #253
Open
needslyp
wants to merge
12
commits into
ostis-apps:main
Choose a base branch
from
needslyp:feat/update_interdace_subj_dom
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 9 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
a47ecc1
feat(kb):update subj domain interfaces
needslyp 833ea4d
fix(kb): update tab_bar
needslyp 1d6de98
feat(int): add feature to change interface
needslyp 57afcc6
feat(kb):update subj domain interfaces
needslyp cc7df17
fix(kb): update tab_bar
needslyp d66fbbf
feat(int): add feature to change interface
needslyp f45040c
Merge branch 'feat/update_interdace_subj_dom' of github.com:needslyp/…
needslyp 89cc2e6
resolve conflict
needslyp fc8a629
Merge branch 'develop' into feat/update_interdace_subj_dom
needslyp 387f77e
fix after review
needslyp f6599c8
update documentation and features
needslyp 0eb1425
Merge branch 'develop' into feat/update_interdace_subj_dom
needslyp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After reloading page I see the old values for a second, then they change to the actual from KB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ import { Route, Redirect } from "react-router-dom"; | |
import { loadingComponent } from '@components/LoadingComponent'; | ||
import { routes } from '@constants'; | ||
import { client } from "@api"; | ||
import { ScAddr, ScEventParams, ScEventType, ScTemplate, ScType } from "ts-sc-client"; | ||
import { ScEventParams, ScEventType, ScTemplate, ScType } from "ts-sc-client"; | ||
|
||
import 'antd/dist/antd.css'; | ||
import './assets/main.css'; | ||
|
@@ -38,6 +38,8 @@ export const App = () => { | |
const [headerBgColor, setHeaderBgColor] = useState<string>('#39494C'); | ||
const [mainBgColor, setMainBgColor] = useState<string>('#fcfafa'); | ||
const [footerBgColor, setFooterBgColor] = useState<string>('#39494C'); | ||
|
||
const [fontFamily, setFontFamily] = useState<string>('Roboto'); | ||
|
||
const funcChange = [setHeaderBgColor, setMainBgColor, setFooterBgColor] | ||
|
||
|
@@ -91,13 +93,60 @@ export const App = () => { | |
} | ||
} | ||
} | ||
|
||
|
||
async function fetchFontFamily() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Write what possible values are for font type |
||
const fontType = 'nrel_font_type'; | ||
const visualInter = 'nrel_visual_interface' | ||
|
||
const helpKeynodes = [ | ||
{ id: fontType, type: ScType.NodeConstNoRole }, | ||
{ id: visualInter, type: ScType.NodeConstNoRole }, | ||
]; | ||
|
||
const fontAlias = '_font'; | ||
const componentAlias = '_component'; | ||
|
||
const hKeynodes = await client.resolveKeynodes(helpKeynodes); | ||
|
||
|
||
const template = new ScTemplate(); | ||
template.tripleWithRelation( | ||
ScType.NodeVar, | ||
ScType.EdgeDCommonVar, | ||
[ScType.NodeVar, componentAlias], | ||
ScType.EdgeAccessVarPosPerm, | ||
hKeynodes[visualInter], | ||
); | ||
template.tripleWithRelation( | ||
componentAlias, | ||
ScType.EdgeDCommonVar, | ||
[ScType.LinkVar, fontAlias], | ||
ScType.EdgeAccessVarPosPerm, | ||
hKeynodes[fontType], | ||
); | ||
const resultFontLink = await client.templateSearch(template); | ||
|
||
if (resultFontLink.length) { | ||
const fontLink = resultFontLink[0].get(fontAlias); | ||
const resultFont = await client.getLinkContents([fontLink]); | ||
if (resultFont.length) { | ||
let font = resultFont[0].data; | ||
setFontFamily(font as any); | ||
const eventParams = new ScEventParams(fontLink, ScEventType.ChangeContent, fetchFontFamily); | ||
await client.eventsCreate([eventParams]); | ||
} | ||
} | ||
|
||
} | ||
|
||
useEffect(() => { | ||
fetchColorValue(); | ||
fetchFontFamily(); | ||
}, []); | ||
|
||
const headerStyles = { | ||
background: headerBgColor, | ||
'font-family': fontFamily, | ||
}; | ||
|
||
const mainStyles = { | ||
|
@@ -106,6 +155,7 @@ export const App = () => { | |
|
||
const footerStyles = { | ||
background: footerBgColor, | ||
'font-family': fontFamily, | ||
}; | ||
|
||
return ( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,85 @@ | ||
import * as React from 'react'; | ||
import { useEffect, useState } from "react"; | ||
import { client } from "@api"; | ||
import { ScEventParams, ScEventType, ScTemplate, ScType } from "ts-sc-client"; | ||
|
||
|
||
export const FooterPanel = () => { | ||
|
||
const [footerText, setFooterText] = useState<string>('Авторское право © Intelligent Semantic Systems LLC, Все права защищены'); | ||
const [systemNameSize, setSystemNameSize] = useState<number>(22); | ||
|
||
async function fetchTextValue() { | ||
const conceptFooter = 'concept_footer'; | ||
const copyrightText = 'nrel_copyright_text'; | ||
const fontSizeRel = 'nrel_font_size'; | ||
|
||
const baseKeynodes = [ | ||
{ id: conceptFooter, type: ScType.NodeConstClass }, | ||
]; | ||
|
||
const helpKeynodes = [ | ||
{ id: copyrightText, type: ScType.NodeConstNoRole }, | ||
{ id: fontSizeRel, type: ScType.NodeConstNoRole }, | ||
]; | ||
|
||
const textAlias = '_text'; | ||
const fontSize = '_size'; | ||
const componentAlias = '_component' | ||
|
||
const keynodes = await client.resolveKeynodes(baseKeynodes); | ||
const hKeynodes = await client.resolveKeynodes(helpKeynodes); | ||
|
||
for (var i = 0; i < baseKeynodes.length; i++) { | ||
const template = new ScTemplate(); | ||
template.triple( | ||
keynodes[baseKeynodes[i].id], | ||
ScType.EdgeAccessVarPosPerm, | ||
[ScType.NodeVar, componentAlias], | ||
); | ||
template.tripleWithRelation( | ||
componentAlias, | ||
ScType.EdgeDCommonVar, | ||
[ScType.LinkVar, textAlias], | ||
ScType.EdgeAccessVarPosPerm, | ||
hKeynodes[copyrightText], | ||
); | ||
template.tripleWithRelation( | ||
componentAlias, | ||
ScType.EdgeDCommonVar, | ||
[ScType.LinkVar, fontSize], | ||
ScType.EdgeAccessVarPosPerm, | ||
hKeynodes[fontSizeRel], | ||
); | ||
const resultTextLink = await client.templateSearch(template); | ||
|
||
if (resultTextLink.length) { | ||
const textLink = resultTextLink[0].get(textAlias); | ||
const resultText = await client.getLinkContents([textLink]); | ||
const sizeLink = resultTextLink[0].get(fontSize); | ||
const resultSize = await client.getLinkContents([sizeLink]); | ||
if (resultText.length && resultSize.length) { | ||
let text = resultText[0].data; | ||
let size = resultText[0].data; | ||
setFooterText(text as any); | ||
setSystemNameSize(size as number); | ||
const eventParams = new ScEventParams(textLink, ScEventType.ChangeContent, fetchTextValue); | ||
await client.eventsCreate([eventParams]); | ||
} | ||
} | ||
} | ||
} | ||
|
||
const copyrightStyles = { | ||
'font-size': systemNameSize, | ||
}; | ||
|
||
useEffect(() => { | ||
fetchTextValue(); | ||
}, []); | ||
|
||
return ( | ||
<span className="copyright"> | ||
Авторское право © Intelligent Semantic Systems LLC, Все права защищены | ||
<span className="copyright" /*style={copyrightStyles}*/> | ||
{footerText} | ||
</span> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Font size is not adaptive. I change it in the KB and see no difference on the interface