1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/discourse_ynh.git synced 2024-09-03 18:26:18 +02:00

Fix patches for v3

This commit is contained in:
Salamandar 2024-07-26 14:21:38 +02:00 committed by Félix Piédallu
parent 1c68c4a6e0
commit 3b82840d88
3 changed files with 69 additions and 32 deletions

View file

@ -1,14 +1,26 @@
From 0d5cfdaf5d1b65cff5b2c1bde026dbb9b3351d4f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= <felix@piedallu.me>
Date: Fri, 26 Jul 2024 14:15:56 +0200
Subject: [PATCH 1/3] Use latest uglify-js
---
lib/tasks/assets.rake | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lib/tasks/assets.rake b/lib/tasks/assets.rake
index 4a02d5f1b1..7b47f21658 100644
index 96082977..ce59ce85 100644
--- a/lib/tasks/assets.rake
+++ b/lib/tasks/assets.rake
@@ -126,6 +126,9 @@
data = File.read("#{assets_path}/#{from}")
@@ -181,6 +181,9 @@ def compress_ruby(from, to)
uglified, map =
Uglifier.new(
comments: :none,
+ harmony: true,
+ mangle: false,
+ compress: false,
source_map: {
filename: File.basename(from),
output_filename: File.basename(to),
--
2.45.2
uglified, map = Uglifier.new(comments: :none,
+ harmony: true,
+ mangle: false,
+ compress: false,
source_map: {
filename: File.basename(from),
output_filename: File.basename(to)

View file

@ -1,22 +1,35 @@
From 2319de5a4759f17c11a6000779d1c8840c342771 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= <felix@piedallu.me>
Date: Fri, 26 Jul 2024 14:19:22 +0200
Subject: [PATCH 2/3] Fix missing git commands in repository
---
lib/discourse.rb | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/discourse.rb b/lib/discourse.rb
index 2b53a91eb3..eec55647d5 100644
index 1af04378..6207c8f5 100644
--- a/lib/discourse.rb
+++ b/lib/discourse.rb
@@ -439,7 +439,7 @@ module Discourse
def self.full_version
@full_version ||= begin
git_cmd = 'git describe --dirty --match "v[0-9]*" 2> /dev/null'
- self.try_git(git_cmd, 'unknown')
+ self.try_git(git_cmd, Discourse::VERSION::STRING)
end
@@ -842,7 +842,7 @@ module Discourse
@full_version ||=
begin
git_cmd = 'git describe --dirty --match "v[0-9]*" 2> /dev/null'
- self.try_git(git_cmd, "unknown")
+ self.try_git(git_cmd, Discourse::VERSION::STRING)
end
end
@@ -448,7 +448,7 @@ module Discourse
def self.last_commit_date
@last_commit_date ||= begin
git_cmd = 'git log -1 --format="%ct"'
- seconds = self.try_git(git_cmd, nil)
+ seconds = '1563199245' # Note(decentral1se): Output from actual command in the v2.3.2 branch
seconds.nil? ? nil : DateTime.strptime(seconds, '%s')
end
@@ -850,7 +850,8 @@ module Discourse
@last_commit_date ||=
begin
git_cmd = 'git log -1 --format="%ct"'
- seconds = self.try_git(git_cmd, nil)
+ # Note(decentral1se): Output from actual command in the v3.2.4 branch
+ seconds = self.try_git(git_cmd, '1721046633')
seconds.nil? ? nil : DateTime.strptime(seconds, "%s")
end
end
--
2.45.2

View file

@ -1,13 +1,25 @@
From e515c68e1011d42f5fd817a799f4694fb469eea2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= <felix@piedallu.me>
Date: Fri, 26 Jul 2024 14:20:17 +0200
Subject: [PATCH 3/3] Fix download calendar
---
app/assets/javascripts/discourse/app/lib/download-calendar.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/assets/javascripts/discourse/app/lib/download-calendar.js b/app/assets/javascripts/discourse/app/lib/download-calendar.js
index 2b53a91eb3..eec55647d5 100644
index 238a8cf0..541b6b1b 100644
--- a/app/assets/javascripts/discourse/app/lib/download-calendar.js
+++ b/app/assets/javascripts/discourse/app/lib/download-calendar.js
@@ -22,7 +22,7 @@
@@ -23,7 +23,7 @@ export function downloadCalendar(title, dates, recurrenceRule = null) {
}
export function downloadIcs(title, dates) {
export function downloadIcs(title, dates, recurrenceRule) {
- const REMOVE_FILE_AFTER = 20_000;
+ const REMOVE_FILE_AFTER = 20000;
const file = new File([generateIcsData(title, dates)], {
const file = new File([generateIcsData(title, dates, recurrenceRule)], {
type: "text/plain",
});
--
2.45.2