Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
a114e30
Forms system
Defective4 Sep 7, 2025
bdf0b1a
Store form fields in a separate table
Defective4 Sep 17, 2025
b62574d
Use default values for all `NOT NULL` fields
Defective4 Sep 17, 2025
2c97172
Store form's message channel and id as longs instead of Strings
Defective4 Sep 17, 2025
7db911a
Changed submissions table structure to use unique ids
Defective4 Sep 17, 2025
e2c6372
Correct `FormsRepository` javadoc
Defective4 Sep 17, 2025
7cb72ed
Adjustments to the `FormsRepository` class
Defective4 Sep 17, 2025
61d7e36
Fix javadoc spelling mistakes
Defective4 Sep 17, 2025
21d9a42
Make the `FormField` into a record
Defective4 Sep 17, 2025
3425fa0
Convert `FormData` into a record and use `Instants` for expiration
Defective4 Sep 18, 2025
fdd328e
Form field javadoc
Defective4 Sep 20, 2025
123282b
Convert `FormUser` to a `record`
Defective4 Sep 20, 2025
7fccf8e
`FormCommand` javadoc
Defective4 Sep 20, 2025
385820d
Fix checkstyle
Defective4 Sep 20, 2025
2763a57
Merge branch 'Java-Discord:main' into forms-feature
Defective4 Mar 15, 2026
f6f2149
Migrate forms feature to new JDA and Java version
Defective4 Mar 15, 2026
71aa7fc
Fix indentation in forms-related classes
Defective4 Mar 15, 2026
6cc7b9e
Properly document form commands
Defective4 Mar 15, 2026
f13bae7
Add a staff role check to all form commands
Defective4 Mar 15, 2026
b421eb0
Rename `checkNotClosed` to `isOpen` in the form interaction manager
Defective4 Mar 15, 2026
85b8d9e
Add a user ID to form submission embeds
Defective4 Mar 15, 2026
2a78356
Replace codeblocks in user submissions
Defective4 Mar 15, 2026
7c2b156
Extract some of the common form logic to `FormSubcommand`
Defective4 Mar 15, 2026
598a95c
Update detach and attach command descriptions
Defective4 Mar 15, 2026
763af6d
Log the exception in form detach subcommand
Defective4 Mar 15, 2026
0741915
Remove useless timestamp field from form details embed
Defective4 Mar 15, 2026
be9b2c5
Improve form details subcommand
Defective4 Mar 15, 2026
8d35fc7
Change form modify subcommand javadoc
Defective4 Mar 15, 2026
1614da9
Allow for disabling form expiration time
Defective4 Mar 15, 2026
c5bdea8
Remove leftover `EXPIRATION_PERMANENT` field from `FormData`
Defective4 Mar 15, 2026
4cb7103
Disallow form deleting if it's attached to a message
Defective4 Mar 15, 2026
3b24656
Fix option to modify form expiration date
Defective4 Mar 15, 2026
135108f
Include info that field indexes are 0-indexed in form field remove
Defective4 Mar 15, 2026
3a5367d
Fix javadocs
Defective4 Mar 15, 2026
462138d
Fix message not being able to be detached if the og channel was deleted
Defective4 Mar 15, 2026
78624bb
Field removal subcommand improvements
Defective4 Mar 15, 2026
e4a7c0b
Use `filterChoices` in forms commands where possible
Defective4 Mar 16, 2026
05ebe4f
Update reopen command description
Defective4 Mar 16, 2026
af0c407
Fix checkstyle errors
Defective4 Mar 16, 2026
1e2e788
Update form export subcommand javadoc
Defective4 Mar 16, 2026
2ddea7d
Use `Map#forEach` in form export subcommand
Defective4 Mar 16, 2026
e2a54ab
Correct javadoc in forms repository
Defective4 Mar 16, 2026
fd0b13f
Change components array in `FormData` to an unmodifiable list
Defective4 Mar 16, 2026
f03aa15
Use optional for form attachment info
Defective4 Mar 16, 2026
037061d
Fix form submissions delete subcommand description
Defective4 Mar 16, 2026
cc20300
Add missing javadoc comments
Defective4 Mar 16, 2026
40728f5
Resolve TODO comments in forms feature classes
Defective4 Mar 16, 2026
f43f7df
Extract subcommand field ids to constants
Defective4 Mar 16, 2026
4ef2c89
Fix an issue with form fields not being added to the modal
Defective4 Mar 16, 2026
d03f90d
Improve form commands descriptions and add missing javadocs
Defective4 Mar 16, 2026
15dee0b
Make changes requested in the review
Defective4 Mar 16, 2026
ed3b3d3
Use `DateTimeFormatter` in forms
Defective4 Mar 16, 2026
1786843
Change time format in forms
Defective4 Mar 16, 2026
ac9e2ff
Change the button "mapping" method name
Defective4 Mar 16, 2026
90e8a37
Log failed form submission attempts
Defective4 Mar 16, 2026
00102a1
Log form submission errors
Defective4 Mar 16, 2026
23a38e8
Fix javadoc type in form interaction manager
Defective4 Mar 16, 2026
fa3c43e
Rename `createFormModal`
Defective4 Mar 16, 2026
0a0c877
Fix checkstyle errors
Defective4 Mar 16, 2026
694c2b9
Use `Responses#error` where possible in forms commands
Defective4 Mar 17, 2026
4dc6fe3
Remove "created at" field from form details embed
Defective4 Mar 17, 2026
7d657ce
Merge branch 'Java-Discord:main' into forms-feature
Defective4 Mar 17, 2026
b7c6552
Address the remaining issues
Defective4 Mar 17, 2026
d8304fd
Merge branch 'forms-feature' of https://github.com/Defective4/JavaBot…
Defective4 Mar 17, 2026
0556dda
Disallow attaching forms to messages not sent by the bot
Defective4 Mar 17, 2026
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
Prev Previous commit
Next Next commit
Change components array in FormData to an unmodifiable list
  • Loading branch information
Defective4 committed Mar 16, 2026
commit fd0b13fc33f523b56edbc3319c0505e5bf6944eb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package net.discordjug.javabot.systems.staff_commands.forms.model;

import java.time.Instant;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Objects;
Expand Down Expand Up @@ -54,15 +56,16 @@ public boolean isAttached() {
/**
* Creates text components for use in the submission modal.
*
* @return List of layout components for use in the submission modal.
* @return An unmodifiable list of layout components for use in the submission
* modal.
*/
public Label[] createComponents() {
Label[] array = new Label[fields.size()];
for (int i = 0; i < array.length; i++) {
public List<Label> createComponents() {
List<Label> list = new ArrayList<>(fields.size());
for (int i = 0; i < list.size(); i++) {
FormField field = fields.get(i);
array[i] = Label.of(fields.get(i).label(), field.createTextInput("text" + i));
list.add(Label.of(fields.get(i).label(), field.createTextInput("text" + i)));
}
return array;
return Collections.unmodifiableList(list);
}

/**
Expand Down
Loading