-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from datlechin/main
Add workflows and run yarn format
- Loading branch information
Showing
13 changed files
with
1,624 additions
and
1,592 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
|
||
name: Popular Tags PHP | ||
|
||
on: [workflow_dispatch, push, pull_request] | ||
|
||
jobs: | ||
run: | ||
uses: flarum/framework/.github/workflows/REUSABLE_backend.yml@main | ||
with: | ||
enable_backend_testing: false | ||
|
||
backend_directory: . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Popular Tags JS | ||
|
||
on: [workflow_dispatch, push, pull_request] | ||
|
||
jobs: | ||
run: | ||
uses: flarum/framework/.github/workflows/REUSABLE_frontend.yml@main | ||
with: | ||
enable_bundlewatch: false | ||
enable_prettier: true | ||
enable_typescript: false | ||
|
||
frontend_directory: ./js | ||
backend_directory: . | ||
js_package_manager: yarn | ||
main_git_branch: main | ||
|
||
secrets: | ||
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }} |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,13 @@ | ||
import app from 'flarum/admin/app'; | ||
import registerWidget from "../common/registerWidget"; | ||
import registerWidget from '../common/registerWidget'; | ||
|
||
app.initializers.add('justoverclock/popular-tags', () => { | ||
registerWidget(app) | ||
app.extensionData | ||
.for('justoverclock-popular-tags') | ||
.registerSetting({ | ||
setting: 'justoverclock-popular-tags.numberOfTags', | ||
name: 'justoverclock-popular-tags.numberOfTags', | ||
type: 'number', | ||
label: app.translator.trans('justoverclock-popular-tags.admin.limit'), | ||
help: app.translator.trans('justoverclock-popular-tags.admin.limit-help'), | ||
}) | ||
registerWidget(app); | ||
app.extensionData.for('justoverclock-popular-tags').registerSetting({ | ||
setting: 'justoverclock-popular-tags.numberOfTags', | ||
name: 'justoverclock-popular-tags.numberOfTags', | ||
type: 'number', | ||
label: app.translator.trans('justoverclock-popular-tags.admin.limit'), | ||
help: app.translator.trans('justoverclock-popular-tags.admin.limit-help'), | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
export default async function getTags(url) { | ||
const response = await fetch(url) | ||
const data = await response.json() | ||
const response = await fetch(url); | ||
const data = await response.json(); | ||
return data.data.sort((a, b) => { | ||
if (a.number === b.number) { | ||
return b.attributes.discussionCount - a.attributes.discussionCount; | ||
} else { | ||
return b.number - a.number; | ||
} | ||
}) | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.