Skip to content

Conversation

admdly
Copy link
Contributor

@admdly admdly commented May 11, 2025

Refactor JavaScript by removing deprecated/unused functions and centralising API functionality within the API wrapper, which now uses HTML data attributes. Additionally, unnecessary CSRF tokens have been removed, and relevant UX changes implemented where applicable.

Update (14-May-25): data-fb-api data attribute JSON type definition validation added and API modal options made future-proof.

Docs Pending - see fossbilling.org - (following merge).

@admdly admdly changed the title Refector Javascript and related API functions Refactor Javascript and related API functions May 11, 2025
@admdly admdly self-assigned this May 11, 2025
@admdly admdly requested a review from Copilot May 12, 2025 00:49
Copilot

This comment was marked as outdated.

@admdly admdly marked this pull request as ready for review May 12, 2025 01:56
@admdly admdly requested a review from Copilot May 12, 2025 02:19
Copilot

This comment was marked as outdated.

Copilot

This comment was marked as outdated.

@admdly admdly requested a review from Copilot May 12, 2025 05:26
Copilot

This comment was marked as outdated.

@j-a-pope
Copy link
Contributor

@admdly Does this completelly close #907 ?

Copy link
Contributor

@j-a-pope j-a-pope left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a huge amount of file changes in here. I have skimmed the 163 files (that was a slow moving scrollbar) and everything seems logical and nothing jumps out as potentially wrong.

Also nothing seemed obviously broken on a quick test install, so everything seems good to me, and if there are any issues then we should pick them up in the upcoming testing for new release.

Nicely done Adam :)

@j-a-pope
Copy link
Contributor

j-a-pope commented May 12, 2025

Noticed the change of case to Title Case in a lot of messages. Is that what we are standardising on?

I don't mind either way, but do want to make sure we move towards consistency in these.

@admdly
Copy link
Contributor Author

admdly commented May 12, 2025

@admdly Does this completelly close #907 ?

As far as I'm aware, yes. 🙂

@admdly
Copy link
Contributor Author

admdly commented May 12, 2025

Noticed the change of case to Title Case in a lot of messages. Is that what we are standardising on?

I don't mind either way, but do want to make sure we move towards consistency in these.

I support sticking with Title Case, as I believe it looks better and more professional.

I'm sure there's a ton of areas remaining to be updated for consistency though as I only updated things as I noticed it with this PR.

@admdly admdly linked an issue May 12, 2025 that may be closed by this pull request
48 tasks
@j-a-pope j-a-pope requested a review from jaapmarcus May 13, 2025 05:41
Copilot

This comment was marked as outdated.

@admdly admdly force-pushed the refactor/js branch 4 times, most recently from 84de19b to 6f6c0eb Compare May 14, 2025 14:42
@github-actions github-actions bot removed the tests/CI label May 14, 2025
Copy link
Member

@BelleNottelling BelleNottelling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lots of changes, awesome progress and cleanup, but in my quick testing I am running into issues.

The buttons on the product mange tab are slightly broken:
image

The update button for product configurations is staying disabled after the settings are saved.

WYSIWYG editor fields are broken and not passing the contents that were written.

In the client area, trying to create a new support ticket results in a 404. Ticket is not created. (Also I guess I had forgotten to configure the WYSIWYG editor here somehow, oops)

@admdly
Copy link
Contributor Author

admdly commented May 14, 2025

Lots of changes, awesome progress and cleanup, but in my quick testing I am running into issues.

The buttons on the product mange tab are slightly broken: image

The update button for product configurations is staying disabled after the settings are saved.

WYSIWYG editor fields are broken and not passing the contents that were written.

In the client area, trying to create a new support ticket results in a 404. Ticket is not created. (Also I guess I had forgotten to configure the WYSIWYG editor here somehow, oops)

On it. Thanks for testing - will let you know when sorted. ❤️

@admdly admdly force-pushed the refactor/js branch 3 times, most recently from a3d6d56 to a7b8f83 Compare May 16, 2025 18:26
@admdly admdly requested a review from Copilot May 16, 2025 18:27
Copilot

This comment was marked as outdated.

admdly and others added 2 commits May 17, 2025 18:43
Remove depreciated and unused JavaScript functions, replacing with `FOSSBilling.*` functions or vanilla JS where appropriate.

Co-Authored-By: Copilot <[email protected]>
admdly and others added 4 commits May 19, 2025 18:49
Update Javascript API wrapper to use HTML `data` attributes. Also move Javascript API functionality to API wrapper.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

Getting rid of jQuery megaissue
3 participants