Skip to content
This repository was archived by the owner on Dec 18, 2025. It is now read-only.

Commit 45ed791

Browse files
kcinay055679njaeggimtnstarVakmeth
authored
Remove deprecations, upgrade node to 16.x, replace markdown lib, remove jquery stuff, fixes #719
--------- Co-authored-by: Yanick Minder <[email protected]> Co-authored-by: Niklas Jäggi <[email protected]> Co-authored-by: Mountain Star <[email protected]> Co-authored-by: megli2 <[email protected]>
1 parent b5e695f commit 45ed791

File tree

19 files changed

+1534
-773
lines changed

19 files changed

+1534
-773
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
- name: Use Node.js
5353
uses: actions/setup-node@v1
5454
with:
55-
node-version: '14.18.0'
55+
node-version: '16.16.0'
5656

5757
# Npm global packages caching
5858
- name: Cache global npm modules
@@ -82,6 +82,9 @@ jobs:
8282
- name: Install bundler
8383
run: gem install bundler:2.3.13
8484

85+
- name: Set node_options
86+
run: export NODE_OPTIONS=--openssl-legacy-provider
87+
8588
- name: Create database
8689
run: bundle exec rails db:setup
8790

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[Changelog](frontend/markdown/CHANGELOG.md)
1+
public/CHANGELOG.md

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ARG BUNDLE_WITHOUT='development:test'
1010
ARG BUNDLER_VERSION=2.3.13
1111

1212
# install nodejs
13-
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -
13+
RUN curl -sL https://deb.nodesource.com/setup_16.x | bash -
1414
RUN apt-get install -y nodejs
1515

1616
# yarn sources

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.2
1+
5.0

config/docker/development/Ember.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM danlynn/ember-cli:3.28.2-node_14.18
1+
FROM danlynn/ember-cli:4.5.0-node_16.16
22

33
RUN chown 1000:1000 /myapp
44

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
11
import Component from "@glimmer/component";
2+
import { tracked } from "@glimmer/tracking";
23

3-
export default class Changelog extends Component {}
4+
export default class Changelog extends Component {
5+
@tracked content = "";
6+
7+
constructor() {
8+
super(...arguments);
9+
this.loadMarkdown();
10+
}
11+
12+
async loadMarkdown() {
13+
const response = await fetch("./CHANGELOG.md");
14+
this.content = await response.text();
15+
}
16+
}

frontend/app/components/folder/show.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,15 @@ export default class ShowComponent extends Component {
5858
scrollToFolder() {
5959
if (!this.isSelectedFolder) return;
6060

61-
const SPEED = 700;
6261
const FOLDER_ID = this.args.folder.id;
63-
const OFFSET = $(`#folder-header-${FOLDER_ID}`).offset().top - 15;
62+
const element = document.querySelector(`#folder-header-${FOLDER_ID}`);
63+
const rect = element.getBoundingClientRect();
64+
const OFFSET = rect.top + document.body.getBoundingClientRect().top - 15;
6465

65-
$("html, body").animate(
66-
{
67-
scrollTop: OFFSET
68-
},
69-
SPEED
70-
);
66+
window.scrollTo({
67+
top: OFFSET,
68+
behavior: "smooth" // Enable smooth scrolling behavior
69+
});
7170
}
7271

7372
get isExpanded() {

frontend/app/components/password-strength-meter.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
import { inject as service } from "@ember/service";
21
import Component from "@ember/component";
32
import { tracked } from "@glimmer/tracking";
43
import { isPresent } from "@ember/utils";
4+
import zxcvbn from "zxcvbn";
55

66
export default class PasswordStrengthMeterComponent extends Component {
7-
@service passwordStrength;
8-
97
@tracked barWidth = 0;
108
@tracked score = 0;
119

1210
constructor() {
1311
super(...arguments);
12+
}
13+
14+
get passwordStrengthScore() {
15+
const { score } = zxcvbn(this.password);
1416

15-
this.passwordStrength.load();
17+
return score;
1618
}
1719

1820
didReceiveAttrs() {
1921
super.didReceiveAttrs();
2022
if (isPresent(this.password) && this.password !== "") {
21-
this.passwordStrength.strength(this.password).then((strength) => {
22-
this.score = strength.score;
23-
if (this.score === 0) this.score = 1;
24-
this.barWidth = this.score * 25;
25-
});
23+
this.score = this.passwordStrengthScore;
24+
if (this.score === 0) this.score = 1;
25+
this.barWidth = this.score * 25;
2626
} else {
2727
this.score = 0;
2828
this.barWidth = 0;

frontend/app/components/side-nav-bar.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,15 @@ export default class SideNavBar extends Component {
2222

2323
setupModal(element) {
2424
/* eslint-disable no-undef */
25-
$(element).on("show.bs.collapse", ".collapse", function () {
26-
$(element).find(".collapse.in").collapse("hide");
25+
// Attach the event handler to the element
26+
element.addEventListener("show.bs.collapse", function () {
27+
// Find visible collapse elements within the parent container
28+
const visibleCollapses = element.querySelectorAll(".collapse.in");
29+
30+
// Hide the visible collapse elements
31+
visibleCollapses.forEach(function (collapse) {
32+
collapse.classList.remove("in");
33+
});
2734
});
2835
/* eslint-enable no-undef */
2936
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { helper } from "@ember/component/helper";
2+
import MarkdownIt from "markdown-it";
3+
4+
export default helper(function markdownToHtml([markdown]) {
5+
const md = new MarkdownIt();
6+
return md.render(markdown);
7+
});

0 commit comments

Comments
 (0)