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

Rename descriptionEditable to description_overwrite with backwards compatibility #275

Open
3 tasks
wei opened this issue Apr 13, 2024 · 0 comments
Open
3 tasks
Labels
good first issue Good for newcomers

Comments

@wei
Copy link
Owner

wei commented Apr 13, 2024

  • Rename to descriptionEditable to description_overwrite to prettify url as snake_case is preferred over camelCase in urls.
  • Keep backwards compatibility so existing urls with descriptionEditable will still function as normal.
  • Instead of description_overwrite, Perhaps we can rename all variables to much shorter url parameters like i=1&f=1&d=1&do=Description%20Overwrite&t=Dark

descriptionEditable: string

if (value && value.state === true && value.editable) {
urlParams[key] = '1'
urlParams[`${key}Editable`] = value.value
} else if (value && value.state === true) {
urlParams[key] = '1'
} else if (value && value.required === true) {
urlParams[key] = value.val
} else {
urlParams[key] = '0'
}
if (!urlParams[key] || urlParams[key] === '0') {
delete urlParams[key]
if (`${key}Editable` in urlParams) {
delete urlParams[`${key}Editable`]
}
}

if (currentConfig?.editable) {
const editableValue = params.get(`${key}Editable`)
if (editableValue != null) {
Object.assign(newChange, {
value: editableValue
})
}
}

This will come handy when adding language override too (#69)

@github-project-automation github-project-automation bot moved this to To do in Socialify Aug 27, 2024
@wei wei added the good first issue Good for newcomers label Sep 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
Status: To do
Development

No branches or pull requests

1 participant