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 #11 from cabidop/main
Fixed deprecation warnings and bugs on page operations
- Loading branch information
Showing
26 changed files
with
3,361 additions
and
202 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,3 @@ | ||
{ | ||
"extends": "eslint-config-discourse" | ||
} |
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: Discourse Plugin | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
schedule: | ||
- cron: "0 0 * * *" | ||
|
||
jobs: | ||
ci: | ||
uses: discourse/.github/.github/workflows/discourse-plugin.yml@v1 |
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 +1,4 @@ | ||
gems | ||
.idea | ||
node_modules | ||
/gems | ||
/autogenerated |
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 @@ | ||
{} |
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,8 @@ | ||
# frozen_string_literal: true | ||
|
||
source "https://rubygems.org" | ||
|
||
group :development do | ||
gem "rubocop-discourse" | ||
gem "syntax_tree" | ||
end |
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,55 @@ | ||
GEM | ||
remote: https://rubygems.org/ | ||
specs: | ||
ast (2.4.2) | ||
base64 (0.1.1) | ||
json (2.6.3) | ||
language_server-protocol (3.17.0.3) | ||
parallel (1.23.0) | ||
parser (3.2.2.3) | ||
ast (~> 2.4.1) | ||
racc | ||
prettier_print (1.2.1) | ||
racc (1.7.1) | ||
rainbow (3.1.1) | ||
regexp_parser (2.8.1) | ||
rexml (3.2.6) | ||
rubocop (1.56.3) | ||
base64 (~> 0.1.1) | ||
json (~> 2.3) | ||
language_server-protocol (>= 3.17.0) | ||
parallel (~> 1.10) | ||
parser (>= 3.2.2.3) | ||
rainbow (>= 2.2.2, < 4.0) | ||
regexp_parser (>= 1.8, < 3.0) | ||
rexml (>= 3.2.5, < 4.0) | ||
rubocop-ast (>= 1.28.1, < 2.0) | ||
ruby-progressbar (~> 1.7) | ||
unicode-display_width (>= 2.4.0, < 3.0) | ||
rubocop-ast (1.29.0) | ||
parser (>= 3.2.1.0) | ||
rubocop-capybara (2.19.0) | ||
rubocop (~> 1.41) | ||
rubocop-discourse (3.4.0) | ||
rubocop (>= 1.1.0) | ||
rubocop-rspec (>= 2.0.0) | ||
rubocop-factory_bot (2.24.0) | ||
rubocop (~> 1.33) | ||
rubocop-rspec (2.24.0) | ||
rubocop (~> 1.33) | ||
rubocop-capybara (~> 2.17) | ||
rubocop-factory_bot (~> 2.22) | ||
ruby-progressbar (1.13.0) | ||
syntax_tree (6.1.1) | ||
prettier_print (>= 1.2.0) | ||
unicode-display_width (2.4.2) | ||
|
||
PLATFORMS | ||
x86_64-darwin-22 | ||
|
||
DEPENDENCIES | ||
rubocop-discourse | ||
syntax_tree | ||
|
||
BUNDLED WITH | ||
2.4.19 |
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
22 changes: 22 additions & 0 deletions
22
assets/javascripts/discourse/components/modal/import-pages.hbs
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,22 @@ | ||
<DModal | ||
class="upload-selector import-pages" | ||
@title={{i18n "admin.landing_pages.import.title"}} | ||
@closeModal={{@closeModal}} | ||
> | ||
<:body> | ||
<div class="inputs"> | ||
<input onchange={{action "uploadFile"}} type="file" id="file-input" accept=".zip,application/zip"><br> | ||
<span class="description">{{i18n "admin.landing_pages.import.file_tip"}}</span> | ||
</div> | ||
</:body> | ||
|
||
<:footer> | ||
<DButton | ||
@action={{this.importPage}} | ||
@disabled={{this.importDisabled}} | ||
class="btn btn-primary" | ||
@label="admin.landing_pages.import.button" | ||
/> | ||
<DModalCancel @close={{@closeModal}} /> | ||
</:footer> | ||
</DModal> |
33 changes: 33 additions & 0 deletions
33
assets/javascripts/discourse/components/modal/import-pages.js.es6
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,33 @@ | ||
import Component from "@ember/component"; | ||
import LandingPage from "../../models/landing-page"; | ||
import { popupAjaxError } from "discourse/lib/ajax-error"; | ||
import { action } from "@ember/object"; | ||
import bootbox from "bootbox"; | ||
|
||
export default Component.extend({ | ||
|
||
@action | ||
uploadFile() { | ||
this.set("pageFile", $("#file-input")[0].files[0]); | ||
}, | ||
|
||
@action | ||
importPage() { | ||
let data = new FormData(); | ||
data.append("page", this.pageFile); | ||
|
||
this.set("loading", true); | ||
LandingPage.import(data) | ||
.then((result) => { | ||
this.closeModal(result); | ||
}) | ||
.catch(function (e) { | ||
if (typeof e === "string") { | ||
bootbox.alert(e); | ||
} else { | ||
popupAjaxError(e); | ||
} | ||
}) | ||
.finally(() => this.set("loading", false)); | ||
}, | ||
}); |
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
33 changes: 0 additions & 33 deletions
33
assets/javascripts/discourse/controllers/import-pages.js.es6
This file was deleted.
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
Oops, something went wrong.