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

Commit

Permalink
#719 backport broken partial in part (#721)
Browse files Browse the repository at this point in the history
v 2.2.1

Co-authored-by: Fred Lefévère-Laoide <[email protected]>
  • Loading branch information
FredLL-Avaiga and Fred Lefévère-Laoide authored Apr 14, 2023
1 parent 03f8b1d commit 118b4e6
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion gui/dom/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "taipy-gui-dom",
"version": "2.2.0",
"version": "2.2.1",
"private": true,
"dependencies": {
"react": "^18.2.0",
Expand Down
2 changes: 1 addition & 1 deletion gui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "taipy-gui",
"version": "2.2.0",
"version": "2.2.1",
"private": true,
"dependencies": {
"@emotion/react": "^11.10.0",
Expand Down
2 changes: 1 addition & 1 deletion gui/packaging/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "taipy-gui",
"version": "2.2.0",
"version": "2.2.1",
"private": true,
"main": "./taipy-gui.js",
"types": "./taipy-gui.d.ts"
Expand Down
7 changes: 4 additions & 3 deletions gui/src/components/Taipy/Part.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,27 @@ interface PartProps extends TaipyBaseProps {
page?: string;
defaultPage?: string;
children?: ReactNode;
defaultPartial?: boolean;
partial?: boolean;
}

const Part = (props: PartProps) => {
const { id, children, partial } = props;
const { id, children, partial, defaultPartial } = props;
const { state } = useContext(TaipyContext);

const className = useClassNames(props.libClassName, props.dynamicClassName, props.className);
const render = useDynamicProperty(props.render, props.defaultRender, true);
const page = useDynamicProperty(props.page, props.defaultPage, "");
const iFrame = useMemo(() => {
if (page && !partial) {
if (page && !defaultPartial) {
if (/^https?\:\/\//.test(page)) {
return true;
}
const sPage = "/" + page;
return !Object.keys(state.locations || {}).some((route) => sPage === route);
}
return false;
}, [state.locations, page, partial]);
}, [state.locations, page, defaultPartial]);

return render ? (
<Box id={id} className={className}>
Expand Down
1 change: 1 addition & 0 deletions src/taipy/gui/renderers/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,7 @@ def _set_partial(self):
if isinstance(partial, Partial):
self.__attributes["page"] = partial._route
self.__set_react_attribute("partial", partial._route)
self.__set_react_attribute("defaultPartial", True)
return self

def _set_propagate(self):
Expand Down
2 changes: 1 addition & 1 deletion src/taipy/gui/version.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"major": 2, "minor": 2, "patch": 0, "ext": ""}
{"major": 2, "minor": 2, "patch": 1, "ext": ""}

0 comments on commit 118b4e6

Please sign in to comment.