mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
feat: support all fields type and filters in grid of tauri
* feat: support the single select field actions in grid of tauri * feat: support multiselect * feat: support number field and number filter * feat: support url field * fix: eslint error * feat: support checkbox filter * feat: support checklist field * fix: adjusting keydown event * fix: edit record ui * feat: support date field * fix: url field bugs * fix: the bug of the type option wasn't update * chore: make plural tokens compatible with tauri * fix: plural key * fix: optimize get cell performance * fix: update ts error * fix: update select option bugs * fix: grid calculate css * fix: add DidUpdateFieldSettings --------- Co-authored-by: Richard Shiue <71320345+richardshiue@users.noreply.github.com>
This commit is contained in:
@ -36,17 +36,25 @@ languages.forEach(language => {
|
||||
console.error(res);
|
||||
}
|
||||
})
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
function flattenJSON(obj, prefix = '') {
|
||||
let result = {};
|
||||
const pluralsKey = ["one", "other", "few", "many", "two", "zero"];
|
||||
|
||||
for (let key in obj) {
|
||||
if (typeof obj[key] === 'object' && obj[key] !== null) {
|
||||
|
||||
const nestedKeys = flattenJSON(obj[key], `${prefix}${key}.`);
|
||||
result = { ...result, ...nestedKeys };
|
||||
} else {
|
||||
|
||||
result[`${prefix}${key}`] = obj[key].replaceAll('{', '{{').replaceAll('}', '}}');
|
||||
let newKey = `${prefix}${key}`;
|
||||
let replaceChar = '{'
|
||||
if (pluralsKey.includes(key)) {
|
||||
newKey = `${prefix.slice(0, -1)}_${key}`;
|
||||
}
|
||||
result[newKey] = obj[key].replaceAll('{', '{{').replaceAll('}', '}}');
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user