Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Frontend #789

Merged
merged 75 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
c02fc84
update @babel
kcinay055679 Jun 11, 2024
f3203ba
remove zero-md
kcinay055679 Jun 11, 2024
1c63934
update ember test helper
kcinay055679 Jun 11, 2024
124633c
update ember source to latest lts
kcinay055679 Jun 13, 2024
4e49c8c
update ember data
kcinay055679 Jun 13, 2024
e8d4a6b
update minors
kcinay055679 Jun 13, 2024
1def3df
update ember cli
kcinay055679 Jun 13, 2024
433eae4
update node version in pipeline
kcinay055679 Jun 13, 2024
8dfd474
update ember-cli babel
kcinay055679 Jun 13, 2024
79c241f
revert to old ember-data version
kcinay055679 Jun 13, 2024
c24be61
fix encryptable-file
kcinay055679 Jun 13, 2024
b53485f
mit de Em songs zum Debugkönig
kcinay055679 Jun 14, 2024
c3f3d8b
fix delete uesr form
kcinay055679 Jun 17, 2024
87649fb
fix file upload
kcinay055679 Jun 17, 2024
8ec3266
add new auto prepare assets file fix tests
kcinay055679 Jun 18, 2024
1f6b43a
Improve script
kcinay055679 Jun 18, 2024
fe869c4
Fix file upload test
kcinay055679 Jun 18, 2024
ebe1a5a
cleanup
kcinay055679 Jun 18, 2024
1c2037b
fix settings test
kcinay055679 Jun 18, 2024
1aae8bf
clean up
kcinay055679 Jun 18, 2024
c9e9764
Use modern syntax for adapter
kcinay055679 Jun 18, 2024
4e5641e
Fix type in version declaration in package.json
kcinay055679 Jun 21, 2024
c894a5d
update ember bootstrap
kcinay055679 Jun 21, 2024
762d9b9
update ember tests framework
kcinay055679 Jun 21, 2024
e1faba0
add .npmcheckrc file and update package.json
kcinay055679 Jun 21, 2024
bb48793
remove webpack
kcinay055679 Jun 21, 2024
c3032f7
readd webpacker
kcinay055679 Jun 21, 2024
bf790d7
add ember-toggle to .npmcheckrc
kcinay055679 Jun 21, 2024
0745e76
remove ember loading
kcinay055679 Jun 21, 2024
eef69e4
remove cli-cli-sass
kcinay055679 Jun 21, 2024
68ce9ff
update checkrc
kcinay055679 Jun 21, 2024
24e38b5
readd ember-cli-sass
kcinay055679 Jun 24, 2024
388aec4
update npmcheckrf
kcinay055679 Jun 24, 2024
7e32577
refresh yarn.lock
kcinay055679 Jun 24, 2024
75d895a
remove ember-cli-dependecy-checker
kcinay055679 Jun 24, 2024
4c79fab
remove ember-cli-clipboard
kcinay055679 Jun 24, 2024
995a8d8
make nullsafe
kcinay055679 Jun 25, 2024
d39538f
updte npmcheckrc
kcinay055679 Jun 25, 2024
7b4c278
remove loading service
kcinay055679 Jun 25, 2024
cda38a1
add new linter and fix encryptable form test
kcinay055679 Jun 25, 2024
58afb54
update eslintconfig
kcinay055679 Jun 25, 2024
7360342
update .npmcheckrc
kcinay055679 Jun 25, 2024
2e58066
update .npmcheckrc
kcinay055679 Jun 25, 2024
8d995de
remove ember autofocus
kcinay055679 Jun 25, 2024
bfa86ad
update .npmcheckrc
kcinay055679 Jun 25, 2024
669c087
remove babel-eslint
kcinay055679 Jun 25, 2024
74e6e86
remove popperjs
kcinay055679 Jun 25, 2024
dded231
remove messageformat parser
kcinay055679 Jun 25, 2024
f23c93d
remove ember render modifier
kcinay055679 Jun 25, 2024
94aeb94
update .npmcheckrc
kcinay055679 Jun 25, 2024
f64616a
update ember-auto-import
kcinay055679 Jun 25, 2024
5b6a1d3
update ember power select
kcinay055679 Jun 25, 2024
1e670eb
update eslint dependencies
kcinay055679 Jun 25, 2024
4f8c640
update .npmcheckrc
kcinay055679 Jun 25, 2024
2f27115
update ember-resolver
kcinay055679 Jun 25, 2024
7aa5e1a
update ember-file-upload
kcinay055679 Jun 25, 2024
8864f87
update ember-cli-app-versin
kcinay055679 Jun 25, 2024
91e1d02
update ember template lint
kcinay055679 Jun 25, 2024
6042848
update markdown-it
kcinay055679 Jun 25, 2024
e7bcc63
update sentry
kcinay055679 Jun 25, 2024
73490b6
update puzzle shell
kcinay055679 Jun 25, 2024
b0e1aea
exclude failing backend tests
kcinay055679 Jun 25, 2024
58b7234
revert puzzle shell
kcinay055679 Jun 25, 2024
09ec9d9
Inclue failing tests
kcinay055679 Jun 25, 2024
3388528
set current folder in navservice
kcinay055679 Jun 24, 2024
1f4178f
add tests for preset and update changelog
kcinay055679 Jun 24, 2024
a3a16ac
Update CHANGELOG.md
mtnstar Jun 24, 2024
c1417dd
Update ember dev dockerfile
mtnstar Jun 25, 2024
b080735
Update changelog/version
mtnstar Jun 25, 2024
05be4a4
add chromium to dockerfile and expect ember bootstrap wormhole
kcinay055679 Jun 25, 2024
6f8b6ef
Merge branch 'feature/768-update-frontend-dependencies' of github.com…
kcinay055679 Jun 25, 2024
b875cce
fix settings system spec
kcinay055679 Jun 25, 2024
62fb5a8
add wormhole for ember-basic-dropdown
kcinay055679 Jun 25, 2024
d73ea8d
exclude chrome from dockerfile
kcinay055679 Jun 25, 2024
bef38a4
Comment out failing and not required anymore db migration
mtnstar Jun 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '18.17.0'
node-version: '20.14.0'

# Npm global packages caching
- name: Cache global npm modules
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.3.5
5.4
26 changes: 26 additions & 0 deletions bin/watch-assets.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

filename="frontend/dist/assets/frontend.js"

watchFile() {
local filename="$1"
local m1=$(md5sum "$filename")

while true; do
sleep 10
local m2=$(md5sum "$filename")
echo ""
echo "$m1"
echo "$m2"
if [ "$m1" != "$m2" ] ; then
m1=$m2
rm -f public/frontend-index-test.html
cp -rf frontend/dist/* public/
cp public/{index,frontend-index-test}.html
cp public/{index,frontend-index-development}.html
echo "Refreshed frontend"
fi
done
}

watchFile "$filename"
2 changes: 1 addition & 1 deletion config/docker/development/Ember.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM danlynn/ember-cli:5.2.1-node_18.17
FROM danlynn/ember-cli:5.9.0

RUN chown 1000:1000 /myapp

Expand Down
36 changes: 18 additions & 18 deletions db/migrate/002_group_and_team_changes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ def up
rename_column :teams, :groupname, :name
add_column :teams, :visible, :boolean, default: true, null: false
add_column :teams, :private, :boolean, default: false, null: false
Team.find_each do |team|
teammember = Teammember.first(conditions: ["user_id = ? and team_id = ?", team.user_id, team.id])
teammember.team_admin = true
teammember.save
end
#Team.find_each do |team|
#teammember = Teammember.first(conditions: ["user_id = ? and team_id = ?", team.user_id, team.id])
#teammember.team_admin = true
#teammember.save
#end
remove_column :teams, :user_id

# Add the new admin flag to the users table
Expand All @@ -33,19 +33,19 @@ def up
end

# create a default group for every team with accounts
Team.find_each do |team|
group = Group.new()
group.name = "Default"
group.description = "Default group, created for migration"
group.team_id = team.id
group.save
#Team.find_each do |team|
#group = Group.new()
#group.name = "Default"
#group.description = "Default group, created for migration"
#group.team_id = team.id
#group.save

# Accounts are now linked to their groups and not directly to the team
Account.where("group_id = ?", team.id).find_each do |account|
account.group_id = group.id
account.save
end
end
## Accounts are now linked to their groups and not directly to the team
#Account.where("group_id = ?", team.id).find_each do |account|
#account.group_id = group.id
#account.save
#end
#end

end

Expand Down Expand Up @@ -81,4 +81,4 @@ def down
remove_column :grouppasswords, :team_admin

end
end
end
10 changes: 5 additions & 5 deletions db/migrate/004_add_no_root_flag_to_teams.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ class AddNoRootFlagToTeams < ActiveRecord::Migration[4.2]
def change
add_column :teams, :noroot, :boolean, default: 0, null: false

Team.reset_column_information
Team.find_each do |team|
team.noroot = false
team.save
end
#Team.reset_column_information
#Team.find_each do |team|
#team.noroot = false
#team.save
#end
end
end
12 changes: 6 additions & 6 deletions db/migrate/20190604054153_sqlite_boolean_values.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ class SqliteBooleanValues < ActiveRecord::Migration[5.2]
def up
return unless sqlite?

User.where("locked = 't'").update_all(locked: 1)
User.where("locked = 'f'").update_all(locked: 0)
#User.where("locked = 't'").update_all(locked: 1)
#User.where("locked = 'f'").update_all(locked: 0)

Team.where("visible = 't'").update_all(visible: 1)
Team.where("visible = 'f'").update_all(visible: 0)
#Team.where("visible = 't'").update_all(visible: 1)
#Team.where("visible = 'f'").update_all(visible: 0)

Team.where("private = 't'").update_all(private: 1)
Team.where("private = 'f'").update_all(private: 0)
#Team.where("private = 't'").update_all(private: 1)
#Team.where("private = 'f'").update_all(private: 0)
end

private
Expand Down
4 changes: 2 additions & 2 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.0].define(version: 2022_07_19_120958) do
ActiveRecord::Schema[7.1].define(version: 2022_07_19_120958) do
create_table "encryptables", force: :cascade do |t|
t.string "name", limit: 255, default: "", null: false
t.string "name", limit: 255
t.integer "folder_id"
t.text "description"
t.datetime "created_at", precision: nil, null: false
Expand Down
8 changes: 3 additions & 5 deletions frontend/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
module.exports = {
root: true,
parser: "babel-eslint",
parser: "@babel/eslint-parser",
parserOptions: {
ecmaVersion: 2018,
ecmaVersion: 2023,
sourceType: "module",
ecmaFeatures: {
legacyDecorators: true
}
requireConfigFile: false
},
plugins: ["ember"],
extends: [
Expand Down
54 changes: 54 additions & 0 deletions frontend/.npmcheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"depcheck": {
"ignoreMatches": [
"frontend",
"tracked-built-ins",
"sass",
"loader.js",

"eslint-plugin-ember",
"eslint-plugin-prettier",
"eslint-plugin-ember",

"@ember/optional-features",
"webpack",
"bootstrap",
"text-security",
"minimist",
"@babel/runtime",

"@ember/application",
"@ember/service",
"@ember/utils",
"@ember/routing",
"@ember/array",
"@ember/object",
"@ember/component",
"@ember/controller",

"ember-toggle",
"ember-moment",
"ember-in-viewport",
"ember-file-upload",
"ember-fetch",
"ember-cli-terser",
"ember-basic-dropdown",
"ember-cli-sass",
"ember-cli-app-version",
"ember-auto-import",
"ember-cli-app-version",
"ember-auto-import",
"ember-power-select-with-create",
"ember-cli-string-helpers",
"ember-cli-moment-shim",
"ember-cli-inject-live-reload",
"ember-bootstrap-power-select",
"ember-cli-babel",

"@ember-data/serializer",
"@ember-data/model",
"@ember-data/adapter",
"ember-inflector"
]
}
}
15 changes: 6 additions & 9 deletions frontend/app/adapters/application.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
import JSONAPIAdapter from "@ember-data/adapter/json-api";
import { computed } from "@ember/object";
import { pluralize } from "ember-inflector";
import { underscore } from "@ember/string";
import ENV from "../config/environment";

export default JSONAPIAdapter.extend({
namespace: "api",
export default class ApplicationAdapter extends JSONAPIAdapter {
namespace = "api";

pathForType(type) {
return pluralize(underscore(type));
},
}

headers: computed(function () {
/* eslint-disable no-undef */
get headers() {
return {
"X-CSRF-Token": ENV.CSRFToken,
"content-type": "application/json"
};
/* eslint-enable no-undef */
})
});
}
}
4 changes: 2 additions & 2 deletions frontend/app/adapters/encryptable-credential.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import ApplicationAdapter from "./application";

export default ApplicationAdapter.extend({
export default class EncryptableCredentialAdapter extends ApplicationAdapter{
pathForType() {
return "encryptables";
}
});
};
4 changes: 2 additions & 2 deletions frontend/app/adapters/encryptable-file.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import ApplicationAdapter from "./application";

export default ApplicationAdapter.extend({
export default class EncryptableFileAdapter extends ApplicationAdapter{
pathForType() {
return "encryptables";
}
});
};
18 changes: 9 additions & 9 deletions frontend/app/adapters/folder.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import ApplicationAdapter from "./application";

export default ApplicationAdapter.extend({
namespace: "api/teams",
export default class FolderAdapter extends ApplicationAdapter {
namespace = "api/teams";

urlForQuery(query, modelName) {
if (query.teamId) {
Expand All @@ -11,7 +11,7 @@ export default ApplicationAdapter.extend({
return url;
}
return super.urlForQuery(query, modelName);
},
}

urlForQueryRecord(query, modelName) {
if (query.teamId) {
Expand All @@ -22,27 +22,27 @@ export default ApplicationAdapter.extend({
return url;
}
return super.urlForQueryRecord(query, modelName);
},
}

urlForCreateRecord(modelName, snapshot) {
return `/${this.namespace}/${snapshot.belongsTo("team", {
id: true
})}/${this.pathForType()}`;
},
}

urlForUpdateRecord(id, modelName, snapshot) {
return `/${this.namespace}/${snapshot.belongsTo("team", {
id: true
})}/${this.pathForType()}/${id}`;
},
}

urlForDeleteRecord(id, modelName, snapshot) {
return `/${this.namespace}/${snapshot.belongsTo("team", {
id: true
})}/${this.pathForType()}/${id}`;
},
}

pathForType: function () {
pathForType() {
return "folders";
}
});
}
6 changes: 3 additions & 3 deletions frontend/app/adapters/team-api-user.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import ApplicationAdapter from "./application";
import { pluralize } from "ember-inflector";

export default ApplicationAdapter.extend({
export default class TeamApiUserAdapter extends ApplicationAdapter {
pathForType(modelName) {
let snakeCased = modelName.replace("-", "_");
return pluralize(snakeCased);
},
}

urlForQuery(query, modelName) {
let teamId = query.teamId;
Expand All @@ -15,4 +15,4 @@ export default ApplicationAdapter.extend({
}
return super.urlForQuery(query, modelName);
}
});
}
12 changes: 6 additions & 6 deletions frontend/app/adapters/teammember.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import ApplicationAdapter from "./application";

export default ApplicationAdapter.extend({
namespace: "api/teams",
export default class TeammemberAdapter extends ApplicationAdapter {
namespace = "api/teams";

urlForQuery(query, modelName) {
if (query.teamId) {
Expand All @@ -18,21 +18,21 @@ export default ApplicationAdapter.extend({
return url;
}
return super.urlForQuery(query, modelName);
},
}

pathForType() {
return "members";
},
}

urlForCreateRecord(modelName, snapshot) {
return `/${this.namespace}/${snapshot.belongsTo("team", {
id: true
})}/${this.pathForType()}`;
},
}

urlForDeleteRecord(id, modelName, snapshot) {
return `/${this.namespace}/${snapshot.belongsTo("team", {
id: true
})}/${this.pathForType()}/${id}`;
}
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default class SettingMultiselectWithCreateComponent extends Component {
if (!this.args.selectedOptions) {
this.store.findAll(this.args.settingModel).then((settings) => {
const setting = settings.firstObject;
if (this.args.options && this.args.options.length) {
if (this.args.options && this.args.options?.length) {
this.selectedOptions = this.args.options.filter((option) => {
return setting.value.includes(option.value);
});
Expand Down
Loading
Loading