Fixes a regression introduced in https://github.com/flarum/framework/pull/4078 in relation to composer auth.
It appears as if explicitly defining it in the job interferes with how actions such as shivammathur/setup-php@v2 authenticate with composer.
* test: write failing tests for email length
* style: formatting
* style: formatting
* fix: change length of email field
* test: write test for email with too long local part
* style: formatting
* chore: remove unnecessary tests
* test(core): implement test for creating discussion without content
* fix(core): handle `null` case in XML parser
* fix(mentions): change/remove typings in unparser
* fix(mentions): return early if xml null
* chore: fix PHPStan
* chore: move tests to mentions
* chore: remove unused import
* chore: remove unused imports
* test(mentions): implement test for post editing with content empty
* test(mentions): change post edit tests
* test(mentions): add test for creating discussion with empty string
* refactor(core): allow labels to be customized
* chore: change type annotation
* chore: remove type annotations
Importing `NestedStringArray` did cause issues in the CI
* chore(emoji): export missing modules in compat API
* chore(flags): export missing modules in compat API
* chore(likes): export missing modules in compat API
* chore(lock): export missing modules in compat API
* chore(markdown): export missing modules in compat API
* chore(mentions): export missing modules in compat API
* chore(nicknames): export missing modules in compat API
* chore(extension-manager): export missing modules in compat API
* chore(statistics): export missing modules in compat API
* chore(sticky): export missing modules in compat API
* chore(subscriptions): export missing modules in compat API
* chore(suspend): export missing modules in compat API
* chore(tags): export missing modules in compat API
* chore(core): export missing modules in compat API
* chore: fix tsconfig
* refactor(core): improve extensibility of `CommentPost`
* refactor(core): rename method to more appropriate name
* refactor(core): further improve extensibility of `CommentPost`
* refactor(core): improve extensibility of `Post`
* refactor(flags): use new extensibility for flagged posts
* feat: allow classes that extends AbstractJob to be placed on a specific queue
* Apply fixes from StyleCI
* php 7.3 compat
* Apply fixes from StyleCI
* change to to avoid conflicts with extensions that already do this
* chore: add docblock explaining that this solution only works for Redis queues
* Apply fixes from StyleCI
* chore: update docblock
* Apply fixes from StyleCI
---------
Co-authored-by: StyleCI Bot <bot@styleci.io>
* chore(emoji): export missing modules in compat API
* chore(flags): export missing modules in compat API
* chore(likes): export missing modules in compat API
* chore(lock): export missing modules in compat API
* chore(markdown): export missing modules in compat API
* chore(mentions): export missing modules in compat API
* chore(nicknames): export missing modules in compat API
* chore(extension-manager): export missing modules in compat API
* chore(statistics): export missing modules in compat API
* chore(sticky): export missing modules in compat API
* chore(subscriptions): export missing modules in compat API
* chore(suspend): export missing modules in compat API
* chore(tags): export missing modules in compat API
* chore(core): export missing modules in compat API
Seems composer has a vulnerability, see https://github.com/advisories/GHSA-7c6p-848j-wh5h
Affected versions
>= 2.0.0-alpha1, < 2.2.23 -- patched in 2.2.23
>= 2.3.0-rc1, < 2.7.0 -- patched in 2.7.0
---
Let's raise the minimum to enforce the latest.
Thank you @peopleinside for reporting this.
(cherry picked from commit e771b908d5)
* fix: prevent open redirects on logout controller
* use clearer config key
* cast url as string, reinstate guest redirect
* clean up a little
* simplify
* return Uri
* resolve ternary always true
* simplify some more
* remove extra newline
* handle malformed uri
* chore: requested changes
* chore: create tests to highlight the conditional instantiation problem
* Apply fixes from StyleCI
* add callback and invokable class + tests
* Apply fixes from StyleCI
* address stan issue on php 8.2
* Revert "address stan issue on php 8.2"
This reverts commit 1fc2c8801a.
* attempt to make stan happy
* Revert "attempt to make stan happy"
This reverts commit 1cc327bb3b.
* is it really that simple?
* Revert "is it really that simple?"
This reverts commit 2006755cf1.
* let's try this
* Update framework/core/src/Extend/Conditional.php
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
---------
Co-authored-by: StyleCI Bot <bot@styleci.io>
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
* fix(bbcode): highlight.js does not work after changing post content
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* chore(bbcode): organize bbcode code
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* Apply fixes from StyleCI
---------
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
Co-authored-by: StyleCI Bot <bot@styleci.io>
* Make isDark() not fail as easily with invalid input
Add early return if input looks fishy, minor refactoring and improvements of the entire method.
* Fix double quotes
* Run prettier 🙄
* chore: review
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
---------
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
* feat: add tag search
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* feat(mentions): tag mentions backend
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* feat: tag mention design
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* refactor: revamp mentions autocomplete
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* fix: unauthorized mention of hidden groups
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* feat(mentions,tags): use hash format for tag mentions
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* refactor: frontend mention format API with mentionable models
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* feat: implement tag search on the frontend
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* fix: tag color contrast
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* fix: tag suggestions styling
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* test: works with disabled tags extension
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* chore: move `MentionFormats` to `formats`
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* fix: mentions preview bad styling
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* docs: further migration location clarification
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* Apply fixes from StyleCI
* fix: bad test namespace
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* fix: phpstan
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* fix: conditionally add tag related extenders
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* Apply fixes from StyleCI
* feat(phpstan): evaluate conditional extenders
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* feat: use mithril routing for tag mentions
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
---------
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
Co-authored-by: StyleCI Bot <bot@styleci.io>
* perf(core,mentions): limit `mentionedBy` post relation results
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* Apply fixes from StyleCI
* chore: use a static property to allow customization
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* chore: use a static property to allow customization
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* chore: include count in show post endpoint
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* chore: consistent locale key format
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* chore: forgot to delete `FilterVisiblePosts`
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* test: `mentionedByCount` must not include invisible posts to actor
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* fix: visibility scoping on `mentionedByCount`
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* fix: `loadAggregates` conflicts with visibility scopers
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* Apply fixes from StyleCI
* chore: phpstan
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* perf(likes): limit `likes` relationship results
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* Apply fixes from StyleCI
* chore: simplify
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* test: `likesCount` is as expected
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* Apply fixes from StyleCI
---------
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
Co-authored-by: StyleCI Bot <bot@styleci.io>
Co-authored-by: IanM <16573496+imorland@users.noreply.github.com>
* perf(core,mentions): limit `mentionedBy` post relation results
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* Apply fixes from StyleCI
* chore: use a static property to allow customization
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* chore: use a static property to allow customization
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* chore: include count in show post endpoint
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* chore: consistent locale key format
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* chore: forgot to delete `FilterVisiblePosts`
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* test: `mentionedByCount` must not include invisible posts to actor
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* fix: visibility scoping on `mentionedByCount`
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* fix: `loadAggregates` conflicts with visibility scopers
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* Apply fixes from StyleCI
* chore: phpstan
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
---------
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
Co-authored-by: StyleCI Bot <bot@styleci.io>
* chore: re-organize security locale keys alphabetically
* test: can globally logout
* feat: add global logout controller
* feat: add global logout UI to user security page
* test: re-adapt tests to changes
* feat: add boolean to indicate if logout even is global
* chore(review): split loading property
* chore: follow-up branch update
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* Use H2 header for discussions on discussions list.
* Put `DiscussionListPane` in `aside` tag to indicate that its content should not be treated as part of discussion content.
* Update markup for views generated by PHP.
* feat(seo): shift h1 tag from logo to discussion title
Many times have we seen opponents of using h2 as the discussion title. Although
my own SEO knowledge is limited, I have seen the importance of structuring pages
according to the content you wish to prioritize. If we only take that into consideration
there is zero reason for the app-wide identical logo to take precedence over any
other heading.
This change makes the logo a standard (visually identical) element, and
makes the discussion hero title a h1.
* feat(seo): rewrite remainder of hero titles and subtitles
* feat(jest): create jest config package for unit testing
* chore: housekeeping
* fix: now we need to explicitly allow importing without extension
* fix: recover EditorDriverInterface import
* feat(jest): mithril component testing
* fix: use separate `tsconfig.test.json`
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* feat(jest): create jest config package for unit testing
* chore: housekeeping
* fix: now we need to explicitly allow importing without extension
* fix: recover EditorDriverInterface import
* Apply suggestions from code review
* chore: yarn
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* chore: improve group mentions color handling
* Avoid storing the `GroupMention--dark` and light classes on the database.
* Avoid recreating YIQ logic on the backend.
* Improve text color flexibility through CSS variables.
* Apply fixes from StyleCI
* chore: tweak tests
* chre: unused import
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
e.g. This allows you to
`/api/posts?sort=-createdAt&filter[tag]=14` to include tag 14 and `/api/posts?sort=-createdAt&filter[tag]=-14` to exclude tag 14
* add yiq calculator util
* use the new contast util to differentiate light/dark tags
* fix: invert logic
* feat: add tag-dark and tag-light less config
* fix: convert 3 chars hex to 6 chars hex
* fix: rename import
* fix: clarify util name
* fix: rename function
* fix: invert less variables when dark mode is enabled
* fix: TagTiles contrast
* refactor: simplify logic with a unique variable
* refactor: simplify logic with a unique variable
* feat: add text color variables not depending on the dark/light mode
* refactor: use isDark rather than getContrast
* refactor: change getContrast to isDark with for a more direct approach
* fix: adjust snippet description
* refactor: change getContrast to isDark with for a more direct approach
* fix: adjust snippet description
* fix: TagHero contrast
* fix: DiscussionHero contrast
* fix: newDiscussion contrast
* fix(newDiscussion): restore less rule when tag is not colored
* fix: TagTiles description
* fix: TagTiles last posted
* chore: change `var` to `let`
* refactor: keep it for backwards compatibility
* refactor: keep it for backwards compatibility
* Apply suggestions from code review
* fix: missed this when I was resolving
* fix: remove dist files from pull request
* Revert "Resolved merge conflict"
This reverts commit c7f0d14aa8, reversing
changes made to 6753dfc2af.
* fix: missed this when I was resolving
* fix
* Update isDark.ts
* chore: flexible contrast color fixing
* refactor(isDark): clarify the doc block
* fix(isDark): increase the yiq threshold
* typo
* fix: preserve design coloring through light and dark modes
Co-authored-by: David Wheatley <david@davwheat.dev>
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
* feat(phpstan): pick up extended model relations typings
* feat(phpstan): pick up extended model date attributes
* feat(core): introduce `castAttribute` extender
Stops using `dates` as it's deprecated in laravel 8
* feat(phpstan): pick up extended model attributes through casts
* fix: extenders not resolved when declared namespace
* fix(phpstan): new model attributes are always nullable
* chore(phpstan): add helpful cache clearing command
* Apply fixes from StyleCI
* chore: improve extend files provider logic
* chore: rename `castAttribute` to just `cast`
* chore: update phpstan package to detect `cast` method
* Update framework/core/src/Extend/Model.php
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* test: add reply creation tests
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* fix: access checking being bypassed for post creation when first post is deleted
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* chore: recover tests
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* chore: make provider public
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* fix: notifications grant access to private data of posts
* chore: fix tests
* test: start with tests about notification subject visibility
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* fix: check subject access before sending notification to user
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
Co-authored-by: Daniël Klabbers <daniel@klabbers.email>
* fix: check post visibility when mentioning
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* fix: `mentionsPosts` include is not used and leaks private posts
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* chre: use `PostRepository`
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* feat: allow using utf8 characters in slugs
url-encoded slugs are not read by the backend.
* chore: use as a slug driver
* chore: refactor tests to use data provider
* Apply fixes from StyleCI
* fix: wrong resource used
* fix: forgotten slug from slug manager in serializer
* chore(review): adapt tag slug suggestions on the UI
* chore: introduce modes for slugging
* chore: `yarn format`
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* feat: include current user as forum relation
* Update framework/core/src/Api/Controller/ShowForumController.php
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
* Update framework/core/src/Api/Controller/ShowForumController.php
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
* Update framework/core/src/Api/Serializer/ForumSerializer.php
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
* Update framework/core/tests/integration/api/forum/ShowTest.php
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
* Update framework/core/tests/integration/api/forum/ShowTest.php
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
* No need to call the user endpoint as we already have the data loaded
* chore: return types
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
* feat: allow push additional items to the end of the poststream
* Update framework/core/js/src/forum/components/PostStream.js
Co-authored-by: David Wheatley <hi@davwheat.dev>
* chore: prettier
* Update framework/core/js/src/forum/components/PostStream.js
Co-authored-by: David Wheatley <hi@davwheat.dev>
Co-authored-by: David Wheatley <hi@davwheat.dev>
* Indicate cross-origin request in generic error message
* Run javascript format
* Move text to beginning of error message
* Update framework/core/locale/core.yml
Co-authored-by: David Wheatley <hi@davwheat.dev>
* feat: expose queue driver, schedule status
* Apply fixes from StyleCI
* docblock
* fix inheritdoc
* Add info link for scheduler setup
* Remove unsed import
* fix: phpstan error
* Only show scheduler status when jobs are registered
* Apply fixes from StyleCI
* add ItemList priorities
* Add translations
* Include schedule status in info console cmd
* Apply fixes from StyleCI
* Move identifyX logic into shared 'ApplicationInfoProvider'
* Apply fixes from StyleCI
* uniform data layout
* inject queue
Co-authored-by: StyleCI Bot <bot@styleci.io>
* fix: evaluated page title content
* chore: add comment
* chore: use DOMParser instead
* fix: use `innerHTML` for the actual value
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
Co-authored-by: David Wheatley <hi@davwheat.dev>
* fix: evaluated page title content
* chore: add comment
* chore: use DOMParser instead
* fix: use `innerHTML` for the actual value
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
Co-authored-by: David Wheatley <hi@davwheat.dev>
* test(subscriptions): approved reply sends out notifications to users
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* feat: send notifications when a post is approved
The code in approval was extracted into a listener because no matter what listeners are always executed before subscribers even if the extension is set to load before.
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* add yiq calculator util
* fix: convert 3 chars hex to 6 chars hex
* fix: clarify util name
* feat: add text color variables not depending on the dark/light mode
* refactor: change getContrast to isDark with for a more direct approach
* fix: adjust snippet description
* chore: change `var` to `let`
Co-authored-by: David Wheatley <david@davwheat.dev>
* feat: allow specifying extensions when installing an instance
Useful when doing migrations where more than the default extensions are required to migrate the data to flarum. This allows quickly spinning up a flarum database with the necessary schema.
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* fix: consider dependency graph before running migrations
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* fix: last node in previous data matches first node of current data
* fix: add previous period support for custom periods
* test: update to show previous period for custom range
* wip: group mentions
* Apply fixes from StyleCI
* chore: format
* group mention autocomplete
* chore: format
* remove console.log
* implement notifications
* prevent guest and member groups from being mentioned
* Update extensions/mentions/less/forum.less
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
* rename displayname to groupname
* Update extensions/mentions/src/Formatter/FormatGroupMentions.php
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
* remove redundant unparse
* simplify migrations
* add group deleted translation
* Apply fixes from StyleCI
* handle everything falsy
* Include icon in group mention preview
* remove box-shadow from autocomplete group results
* Add color to preview
* chore: format
* Remove box shadow from group autocomplete results
* Update extensions/mentions/migrations/2022_10_21_000000_create_post_mentions_groups_table.php
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
* remove unneeded migration
* prevent former group icon from beingdisplayed
* add group searcher with permissions
* Apply fixes from StyleCI
* Search groups based on canSearchGroups permission
* Don't include virtual groups in results
* Add search groups translation
* Revert "remove unneeded migration"
This reverts commit 9347665baa.
* Revert "Update extensions/mentions/migrations/2022_10_21_000000_create_post_mentions_groups_table.php"
This reverts commit 8406d51df2.
* add searchGroups permission to tests
* Apply fixes from StyleCI
* Add default searchGroups permission
* Apply fixes from StyleCI
* Update extensions/mentions/js/src/forum/addComposerAutocomplete.js
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
* Update extensions/mentions/migrations/2022_10_21_000000_create_post_mentions_groups_table.php
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
* remove unneeded migration, correct table table
* correct table name in down migration
* Remove group searcher
* Apply fixes from StyleCI
* Remove group searching from composer autocomplete
* Add mentionGroups permission
* Apply fixes from StyleCI
* prevent post preview from rendering a group mention when user does not have permission
* remove test changes
* wip: expose ServerRequestInterface to textformatter parse()
* Apply fixes from StyleCI
* Set post content properly
* php 7.x compatibility
* begin adding groupmention tests
* Apply fixes from StyleCI
* test virtual groups don't mention
* Apply fixes from StyleCI
* Update framework/core/tests/integration/api/groups/ListTest.php
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
* Update framework/core/tests/integration/api/groups/ListTest.php
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
* Update framework/core/tests/integration/api/groups/ListTest.php
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
* Update framework/core/tests/integration/api/groups/ListTest.php
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
* Update framework/core/tests/integration/api/groups/ListTest.php
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
* Update extensions/mentions/extend.php
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
* Update extensions/mentions/extend.php
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
* requested changes
* Update framework/core/tests/integration/api/groups/ListTest.php
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
* Update framework/core/tests/integration/api/groups/ListTest.php
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
* Update framework/core/src/Search/SearchServiceProvider.php
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
* Update framework/core/src/Extend/Formatter.php
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
* remove default permission migration
* try using datetime column instead of timestamp
* Apply fixes from StyleCI
* chore: remove commented code
* add tests
* Apply fixes from StyleCI
* Pass actor to parser instead of ServerRequest
* Allow for to be null
* Update framework/core/src/Extend/Formatter.php
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
* pass actor instead of request
* Apply fixes from StyleCI
* actor instead of request
* remove serverrequest
* Apply fixes from StyleCI
* remove dupe actor
* Update extensions/mentions/src/Formatter/CheckPermissions.php
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
* fix type in comment
* group does not have the relation, post does
* test: invalid, deleted, fresh data mentions
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* Apply fixes from StyleCI
* fix: group mentions don't work when editing posts
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
Co-authored-by: StyleCI Bot <bot@styleci.io>
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
We can't update to larastan v2 until we update to laravel v9 which has to wait for Flarum v2, so we need to stay on phpstan v1.8
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* feat: backend support for statistics custom date ranges
* feat: use seconds-based timestamps on backend instead
* feat: add frontend date selection option
* feat: add tests for lifetime and timed stats
* fix: add error alert when end date is after start date
* fix: wrong label
* fix: no data when start and end date are same day
* fix: use utc dayjs for formatting custom date range on widget
* chore: add dayjs as project dep
* fix: make end date inclusive
* feat: add integration test for custom date period
* fix: incorrect ts expect error comment
* fix: add missing type
* fix: typing errors
* fix(tests): remove type from class attribute definition
* fix: extract default values to function body
* fix: typo
* chore: use small modal
* fix: add missing `FormControl` class
* fix: cast url params to int to enforce type
* chore: `yarn format`
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
* Make it possible to extend Flarum\Testing\integration\Setup\SetupScript and added public methods to add settings or extensions to in initial installation pipeline
* Fix syntax error, unexpected 'static'
* Remove `addExtensions` method and document `addSettings`
In certain edge cases posts get approved through moderative action and
throws an error when the user has already been deleted.
Ref: DISCUSS-11K on sentry
* feat: increase margin between notifications list control icons
This feels cleaner, and reduces the chances of a misclick.
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
* chore: merge media queries
* chore: change discussion page skeleton to grid layout
* chore: use grid areas instead of order
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
* test: editing a post with deleted author and mentions
* fix(mentions): accessing `id` of null `user` relation
Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
Not a 100% perfect solution, however as us maintainers always push branches directly to the original repository and make PRs from those, this is plenty enough. Instead of having 300+ actions in each PR which takes time, we'll just have the normal 171 `push` actions.
This makes sure to still run `pull_request` actions from contributors as they'd be forking the repo.
Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
* chore: simplify added prefix tests to matrix without using exclusions
* test: recover 7.3 testing
* test: add mysql 8.0 to matrix
* test: exclude some PHP versions from running with MySQL 8.0 to reduce actions
Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
* fix(a11y): color preview fields have no aria label
* refactor: convert page components to TypeScript
Co-authored-by: David Wheatley <hi@davwheat.dev>
Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
* Add delete all notifications option
* chore: `DELETE /api/notifications` as per conventions
* test: can delete all notifications
Co-authored-by: Sami Mazouz <ilyasmazouz@gmail.com>
* Feature: Stackable modals
* Processed feedback
* fix: use position in modal stack rather than key for modal number
* fix: use correct base z-index
* chore: simplify `className` to `class`
* chore: add `key` attribute to ModalManager element
* fix: backdrop flashing as modals are stacked/unstacked
* chore: simplify modal close process
* docs: add TS overload to indicate deprecated modal opening syntax
Require explicit values for `attrs` and `stackModal` from Flarum 2.0, beginning deprecation from now.
* feat: use stackable modal for forgot password modal above sign in
* chore: explicitly check if modal is open before trying to focus trap
* fix(a11y): add missing `aria-hidden` on main content when modal open
* fix(a11y): add missing `aria-modal` on modal
* chore: remove test code
* chore: remove dead CSS
* chore: remove overload
* fix: lock page scrolling when modal is open
* fix: strange scrolling behaviour
* chore: convert to JSX
* fix: event listener memory leak
* chore: remove unneeded optional chaining
* fix: incorrect return types
* chore: rewrite backdrop system - use one backdrop for all modals
* docs: typos in comment block
* fix: show backdrop directly below top-most modal
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
* chore: format
* fix: use an invisible backdrop for each modal to exit
Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
* chore: remove debugging code
Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
* chore: remove forgotten debug code
Co-authored-by: David Wheatley <david@davwheat.dev>
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
* test: password tokens are generated and deleted on password change
* chore: delete all password tokens when the password is changed
* test: email tokens are generated and deleted on email change
* test: email tokens are deleted after password reset
* chore: delete email tokens after password change
* test: password tokens are deleted after email change
* chore: delete password tokens after email change
* chore: syntactic sugar
* chore: unify event listening
When I was reading README.md, I clicked the logo and I expected to go to the official website https://flarum.org/ but it didn't. So, the image is being linked to the official website in this commit.
Signed-off-by: Soobin Rho <soobinrho@gmail.com>
* perf: get notification counts through relation, not model filtering
* chore: rename `queryUnreadNotifications` to `unreadNotifications`
* fix: null coalesce to 0 for notif read time
* feat: Queue package manager commands
* adjust tests
* fix: force run whynot command synchronously
* chore: maximize command output box's height
* chore: more user instructions on background queue
* feat: track command peak memory usage
* feat: exit of CLI php version doesn't match web php version
* chore: install deps
* chore: format and typing workflow fix
Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
* test: list posts with mentions filter and `createdAt` sort
* fix: multiple `createdAt` columns in query causes conflicts
* chore: link to pull request for context
Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
* test: user should only be able to see related tags when allowed
* fix: restricted sibling tags appearing for unauthorized members on the sidebar
* fix: apply logic on tags with parents
* feature: adds advanced link handling in core
This PR adds rel and target to textformatter so that these can be easily extended and rendered into the source.
Without using the Extender the default values `ngc nofollow` are provided as a backward compatible way.
The new extender allows conditional overrides, a proof of concept extension is available at https://github.com/luceos/flarum-ext-dofollow; I will probably migrate this into the Blomstra namespace soon.
* Apply fixes from StyleCI
* fix typehints
* fix: mixed typehint is php 8+
Co-authored-by: StyleCI Bot <bot@styleci.io>
* chore: yarn workspaces means we only need a single `yarn.lock`
* fix: add a `cache_dependency_path` workflow input
* fix: re-introduce `env.cache_dependency_path`
`baseUrl` includes the path portion of the url, as does `basePath`, which is included in `app.route.x` function outputs. The `baseOrigin` (with no path component at all) should be used instead.
There is a check in the ExtensionManager::resolveExtensionOrder function that ignores optional dependencies on extensions that don't exist in the system. This is sufficient for resolution purposes.
The filter removed in this PR would ignore optional dependencies on non-enabled extensions, so when such an extension was enabled, dependency resolution would run incorrectly.
When app's PHP server's timezone is not set to UTC, which would normally be done by Flarum's bootstrapping process, this call to Carbon would return a different timestamp to other calls elsewhere in Flarum, causing issues with notifications seemingly being delivered too early/late rather than at the actual time they were triggered.
With all the commits below, we resolve all outstanding typing issues in the repo, and CI jobs run green.
* fix: Convert DashboardPage and DashboardWidget to TypeScript
* fix: fix type errors in package manager ext
* fix: Convert Post component to TypeScript
* fix: avatar typings should accept null user
* fix: convert Notification component to TypeScript
* fix: properly use `typeof` in ForumApplication
* feat: make Notification content attr generic
* chore: format Notification component
* fix: Convert DiscussionRenamedNotification to TypeScript
* fix(pusher) move shims to a location where they get applied
* fix(pusher): fix some typing errors
* fix(akismet): fix some typing issues
* chore: update core dist typings
* chore(pusher): format
* fix: anchorScroll should accept string selectors
* fix: more accurately represent ApiQueryParamsPlural
* fix: convert PostStreamState to TypeScript
* chore(core): rebuild typings
* feat: allow extending app.routes
* fix: more flexible typings for highlight.ts
* fix: use primitive `number` type for Discussion typings
* fix: convert DiscussionListItem to TypeScript
* chore: rebuild core typings
* fix: final pusher type fixes
* feat: start tags TypeScript conversion
* fix: require-dev tags in pusher for CI TypeScript purposes.
* chore(core): format
* chore(tags): build dist typings
* feat(pusher): use dist types from tags.
* feat: convert flags to TypeScript
* chore(flags): generate dist typings
* fix(akismet): last type errors
* chore: update .yarn-integrity
* chore: partially run flarum-cli audit infra --fix
The tsconfig changes from that command are ignored, since we don't yet support "replacable sections" that would let us add custom config.
* chore: use type imports
* fix: broader gitattributes
* chore: run flarum-cli audit infra --monorepo --fix
* feat: make `app.data` typings extensible
* chore(core): format
* chore: boost tags TypeScript coverage
* fix(tags): further increase type coverage.
Thanks for taking the time to fill out this feature request!
We primarily use GitHub as a bug tracker and issue tracker for items we are sure to tackle in the near future.
For feature requests, ideas and feedback please post in the Flarum Community.
Feature requests are added to GitHub only when they have been accepted by the development team and implementation details have been laid out.
- name:"🙋 Support Question"
url:https://discuss.flarum.org/t/support
about:|
We primarily use GitHub as a bug tracker and issue tracker for items we are sure to tackle in the near future; for usage and support questions, please check out these resources below. Thanks!
about: "I have a suggestion (and may want to implement it!)"
---
<!--
IMPORTANT: Feature requests on this GitHub issue tracker are only accepted in case they have been approved by a core developer or contain extensive argumentation and directions for implementation. For all other feature requests, ideas and feedback please post in the Flarum Community: https://discuss.flarum.org/t/feedback.
-->
## Feature Request
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. eg. I have an issue when [...]
**Describe the solution you'd like**
A detailed description of your proposed solution. Include:
- How the feature would work/behave
- Any potential drawbacks
- Maybe a screenshot, design, or example code
**Justify why this feature belongs in Flarum's core, rather than in a third-party extension**
Consider who this change will be useful to –most Flarum forums, or just a few?
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
description:The directory of the project where backend code is located. This should contain a `composer.json` file, and is generally the root directory of the repo.
type:string
required:false
default:'.'
php_versions:
description:Versions of PHP to test with. Should be array of strings encoded as JSON array
description:"Script to run for production build. Empty value to disable."
type:string
required:false
default:build
build_typings_script:
description:"Script to run for typings build. Empty value to disable."
type:string
required:false
default:build-typings
format_script:
description:"Script to run for code formatting. Empty value to disable."
type:string
required:false
default:format-check
check_typings_script:
description:"Script to run for tyiping check. Empty value to disable."
type:string
required:false
default:check-typings
type_coverage_script:
description:"Script to run for type coverage. Empty value to disable."
type:string
required:false
default:check-typings-coverage
test_script:
description:"Script to run for tests. Empty value to disable."
type:string
required:false
default:test
enable_bundlewatch:
description:"Enable Bundlewatch?"
type:boolean
default:false
required:false
enable_prettier:
description:"Enable Prettier?"
type:boolean
default:true
required:false
enable_typescript:
description:"Enable TypeScript?"
type:boolean
default:true
required:false
enable_tests:
description:"Enable Tests?"
type:boolean
default:false
required:false
backend_directory:
description:The directory of the project where backend code is located. This should contain a `composer.json` file, and is generally the root directory of the repo.
type:string
required:false
default:'.'
frontend_directory:
description:The directory of the project where frontend code is located. This should contain a `package.json` file.
type:string
required:false
default:'./js'
main_git_branch:
description:The main git branch to use for the workflow.
type:string
required:false
default:main
node_version:
description:The node version to use for the workflow.
type:number
required:false
default:20
js_package_manager:
description:"Enable TypeScript?"
type:string
default:yarn
required:false
cache_dependency_path:
description:"The path to the cache dependency file."
type:string
required:false
runner_type:
description:The type of runner to use for the jobs. This should be one of the types supported by the `runs-on` keyword.
type:string
required:false
default:'ubuntu-latest'
git_actor_name:
description:The name of the git actor to use for the bundled JS output.
type:string
required:false
git_actor_email:
description:The email of the git actor to use for the bundled JS output.
type:string
required:false
secrets:
bundlewatch_github_token:
description:The GitHub token to use for Bundlewatch.
required:false
composer_auth:
description:The Composer auth tokens to use for private packages.
required:false
git_actor_token:
description:The personal access token from the custom git actor.
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.