Commit Graph

32 Commits

Author SHA1 Message Date
Keegan George b740ebd4ed
FIX: Broken locales in context menu (#63) 2023-09-01 11:55:36 -07:00
Keegan George c050e072e9
UX: Full width/height modal (#61) 2023-08-31 09:28:05 -07:00
Keegan George 116bcb9c3a
DEV: Use new component based modal API and other modernizations (#60) 2023-08-30 13:36:22 -07:00
David Taylor 8599bfcaff
DEV: Update import paths following core fix (#56)
https://github.com/discourse/discourse/pull/23148
2023-08-18 18:30:20 +01:00
Penar Musaraj a6b221ddfa
FIX: Table editing sometimes not working (#50)
We were relying on the `event.target`, and sometimes that target was not the button element with the `table-id` data attribute, but the svg. 

This commit makes a few changes: 

- renames `tableId` to `tableIndex`
- passes the index as part of the attributes to the `generateModal` function
2023-04-25 10:23:28 -04:00
Penar Musaraj b45ffe48b7
FIX: Allow headings to have the same label (#46)
Fixes an issue where multiple headings with the same value would remove
columns from displaying.
2023-02-16 21:16:48 -05:00
Keegan George 6707473520
DEV: Map Discourse locales to vendor spreadsheet locales (#42) 2023-01-19 09:24:31 -08:00
David Taylor 8285be7618
DEV: Update eslint-config-discourse, use prettier for hbs (#40) 2023-01-04 12:54:43 +00:00
Penar Musaraj fdc79d0cbf
FIX: do not edit wrong table when post has uploads (#37)
Previously, the regex was catching uploads as well as tables.

This change ensures only strict tables are matched by requiring that
matches start with the pipe character.

Also adds a unit test for `findTableRegex` to describe the expected
behaviour of the helper.
2023-01-04 08:06:25 +01:00
Keegan George 7e65777187
FIX: Misalignment of table after edit (#30)
See Meta bug report: https://meta.discourse.org/t/table-builder/236016/54
2022-10-13 14:37:01 -07:00
Keegan George be968d9158
DEV: Add loading spinner (#20)
* WIP: Add loading spinner

* DEV: Linting fixes

* DEV: Make `loading` a `@tracked` property
2022-08-15 08:47:33 -07:00
Keegan George f68a599e87
DEV: Add unique filename for table exports (#19) 2022-08-12 12:10:04 -07:00
Penar Musaraj 9abd57e5b5
FIX: Strip null characters (#17) 2022-08-12 14:14:01 -04:00
Penar Musaraj a8f27d9131
UX: Default to wide tables (#16)
* UX: Default to 100% wide tables

* DEV: Change default spreadsheet rows/columns

Co-authored-by: Keegan George <kgeorge13@gmail.com>
2022-08-12 11:11:27 -07:00
Keegan George 388c4a58e5
DEV: Update `SpreadsheetEditor` to use `@glimmer/component` (#13)
Now that all of our singletons have been converted to true Ember Services, we can remove our custom `discourse/component/glimmer` superclass and use explicit injection
2022-08-11 11:59:08 -07:00
Keegan George 7b37c6acc1
FIX: Special character alignment issue (#10)
* DEV: Use alternate fork of `array-to-table`

* DEV: Add unit test for `arrayToTable()` method

* Move `arrayToTable` so it is available for unit tests

* DEV: Add assertion for creating a markdown table with special chars

When a table with special characters (such as `$`) is inserted in a cell to the right of a blank cell. The alignment of the table gets ruined if the table doesn't have surrounding pipes. This check ensures this alignment is correct.

Co-authored-by: Penar Musaraj <pmusaraj@gmail.com>
2022-08-11 11:33:34 -07:00
Keegan George 4289145268
UX: Wrap words instead of dynamic widths and align left (#11)
* UX: Wrap words instead of dynamic widths and align left

* UX: Improve sticky header on scroll

* DEV: Convert default column text to localizable strings
2022-08-10 13:50:38 -07:00
Keegan George d25736adad
DEV: Remove Table HTML usage (#9)
* DEV: Remove Table HTML usage

* DEV: Apply ember linting
2022-08-09 17:14:35 -07:00
Keegan George 98a9081e25
DEV: Populate table content using raw markdown (#7)
* Very exploratory MD work

* DEV: Populate table content using raw markdown

* DEV: 💄 Linting Fixes

Co-authored-by: Penar Musaraj <pmusaraj@gmail.com>
2022-08-09 16:51:17 -07:00
Keegan George 52710496ed
FIX: conflicting class declaration with core (#4)
* DEV: Remove `fade-in` and use `jsuites.basic.css` instead

* FIX: Linting issues with jspreadsheet-theme

* WIP: Add bash script to handle vendor assets

* FIX: Ember Linting fixes

* DEV: Cleanup comments and commented code
2022-07-28 07:33:25 -07:00
Penar Musaraj f8a914c8cc
FIX: Use local theme files for external libs
This also makes sure we don't need any CSP rules for the loaded JS files.
2022-07-26 13:35:02 -04:00
Keegan George 57d7f1bf0c DEV: Update `<SpreadsheetEditor/>` to Glimmer Component
As of [this commit](327dd0beb3), render-modifiers have been introduced, allowing the spreadsheet component to be successfully converted into a Glimmer Component.
2022-07-21 14:19:01 -07:00
Keegan George 3eee3da853 FEATURE: Use spreadsheet editor for building tables 2022-07-19 16:33:10 -07:00
Keegan George b7a0a22e95 DEV: Cleanup
- Linting Fixes (prettier, eslint, ember template lint)
- Reorganize code, moving declarations, consolidating functionality into separate methods
- Add default edit reason locale vs hard-coded string
2022-07-18 11:18:58 -07:00
Keegan George 2ddb6de654 FIX: Only update table portion from raw post 2022-07-18 11:03:57 -07:00
Keegan George d74b713d0b FEATURE: Update post contents with edited table (WIP)
Known issue: overrides other content on the post and replaces the post with only the table
2022-07-16 11:00:05 -07:00
Keegan George 669be70f18 DEV: Add logic to build markdown table 2022-07-14 17:07:05 -07:00
Keegan George 4bbb3a9647 FEATURE: Column width dynamically set based on heading length 2022-07-14 10:05:27 -07:00
Keegan George 05cd2ada7e DEV: Remove comments and unused code 2022-07-14 10:05:07 -07:00
Keegan George 40f42a92d2 DEV: Move jsuites library to separate file 2022-07-14 09:21:22 -07:00
Keegan George 86af126978 FIX: Spreadsheet only loading for one instance
This commit moves spreadsheet logic to a component which resolves the issue where the spreadsheet only loads the first time the edit modal appears.
2022-07-14 08:56:11 -07:00
Keegan George 4c8cfa9559 FEATURE: Ability to build a table in the composer
- Adds a button to the composer tools which triggers a modal window for a table builder
- Table builder contains fields to add table contents, as well as buttons to align contents, and add additional tables/rows
2022-07-04 14:58:50 -07:00