Skip to content
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 inputs pagevar belongsto support page 4109 #3394

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .github/workflows/publish_production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,6 @@ jobs:
AZURE_BLOB_ACCOUNT: ${{ secrets.AZURE_BLOB_ACCOUNT_US2 }}
AZURE_BLOB_ACCOUNT_KEY: ${{ secrets.AZURE_BLOB_ACCOUNT_KEY_US2 }}
run: yarn upload
- name: upload vabi
env:
AZURE_BLOB_ACCOUNT: ${{ secrets.AZURE_BLOB_ACCOUNT_VABI }}
AZURE_BLOB_ACCOUNT_KEY: ${{ secrets.AZURE_BLOB_ACCOUNT_KEY_VABI }}
run: yarn upload
- name: upload vvv
env:
AZURE_BLOB_ACCOUNT: ${{ secrets.AZURE_BLOB_ACCOUNT_VVV }}
Expand Down
4 changes: 4 additions & 0 deletions src/components/autocompleteInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@
(hasDefaultLabelProperty && defaultLabelProperty) ||
idProperty;

useEffect(() => {
setValue(defaultValue.replace(/\n/g, ''));
}, [defaultValue]);

/*
* This component only works with relational or list properties.
* the value of a list property is the list item itself.
Expand Down
9 changes: 9 additions & 0 deletions src/components/radioinput.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@

const isListProperty = kind === 'list' || kind === 'LIST';
const isObjectProperty = kind === 'object' || kind === 'OBJECT';
const isPageVariableProperty = prefabValue.find(
(item) => item.type === 'PAGE_VARIABLE_MODEL_PROPERTY',
);

const isPropertyArray = Boolean(
prefabValue.length && prefabValue.some((p) => p.type === 'PROPERTY'),
Expand All @@ -76,6 +79,8 @@
resolvedCurrentValue = defaultValueText;
} else if (isPropertyArray && !isObjectProperty) {
resolvedCurrentValue = parseInt(defaultValueText, 10) || '';
} else if (isPageVariableProperty) {
resolvedCurrentValue = getValue(defaultValueText);
} else if (kind === undefined) {
// if kind is undefined, it is non property based
resolvedCurrentValue = '';
Expand All @@ -84,6 +89,10 @@
}
const [currentValue, setCurrentValue] = useState(resolvedCurrentValue);

useEffect(() => {
setCurrentValue(resolvedCurrentValue);
}, [defaultValueText]);

B.defineFunction('Clear', () => setCurrentValue(''));
B.defineFunction('Enable', () => setIsDisabled(false));
B.defineFunction('Disable', () => setIsDisabled(true));
Expand Down
5 changes: 5 additions & 0 deletions src/components/selectInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@
: defaultValueText || placeholderLabelText;

const [currentValue, setCurrentValue] = useState(resolvedCurrentValue);

useEffect(() => {
setCurrentValue(resolvedCurrentValue);
}, [defaultValueText]);

B.defineFunction('Clear', () => setCurrentValue(''));
B.defineFunction('Enable', () => setIsDisabled(false));
B.defineFunction('Disable', () => setIsDisabled(true));
Expand Down
Loading