Skip to content
This repository was archived by the owner on Mar 11, 2026. It is now read-only.

Commit 493d8f8

Browse files
authored
Merge pull request #320 from nzzdev/release-6.6.0-rc2
Release 6.6.0 rc2
2 parents 7f03f09 + 97907e1 commit 493d8f8

26 files changed

+439
-1130
lines changed

client/build/bundles.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const aureliaBundle = [
2727
"aurelia-binding",
2828
"aurelia-binding",
2929
"aurelia-bootstrapper",
30+
"aurelia-cookie",
3031
"aurelia-dependency-injection",
3132
"aurelia-dialog",
3233
"aurelia-event-aggregator",

client/build/export.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,18 @@
22
// need to be included when exporting the application
33
// for production.
44
module.exports = {
5-
'list': [
6-
'index.html',
7-
'livingdocs-component.html',
8-
'config.js',
9-
'../LICENSE',
10-
'jspm_packages/system.js',
11-
'jspm_packages/system-polyfills.js',
12-
'jspm_packages/system-csp-production.js',
5+
list: [
6+
"index.html",
7+
"config.js",
8+
"../LICENSE",
9+
"jspm_packages/system.js",
10+
"jspm_packages/system-polyfills.js",
11+
"jspm_packages/system-csp-production.js",
1312
],
1413
// this section lists any jspm packages that have
1514
// unbundled resources that need to be exported.
1615
// these files are in versioned folders and thus
1716
// must be 'normalized' by jspm to get the proper
1817
// path.
19-
'normalize': [
20-
]
18+
normalize: [],
2119
};

client/config.js

Lines changed: 2 additions & 918 deletions
Large diffs are not rendered by default.

client/livingdocs-component.html

Lines changed: 0 additions & 25 deletions
This file was deleted.

client/locales/de/translation.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,16 @@
2424
"changesSaved": "Die Änderungen wurden gespeichert.",
2525
"failedToSaveChanges": "Die Änderung konnten nicht gespeichert werden.",
2626
"loginFailed": "Ihr Benutzername oder Passwort ist unbekannt.",
27+
"loginFailedGeneric": "Anmeldung fehlgeschlagen.",
28+
"loginTechnicalIssues": "Gibt es technische Probleme?",
29+
"loginContactUsOnSlack": "Kontaktiert uns auf Slack.",
2730
"loginTimeout": "Server braucht zu lange um zu antworten. Wir arbeiten daran. Bitte versuch es später nochmals.",
2831
"genericServerError": "Es ist ein Problem auf dem Server aufgetreten. Wir arbeiten daran. Bitte versuch es später nochmals.",
2932
"serverConnectionFailed": "Die Verbindung zum Server ist fehlgeschlagen.",
3033
"articlesWithThisGraphic": "Artikel mit dieser Grafik",
31-
"loadMore": "Mehr laden"
34+
"loadMore": "Mehr laden",
35+
"mslogin": "Microsoft Login",
36+
"orContinueWith": "oder weiter mit"
3237
},
3338
"userConfig": {
3439
"initials": "Initialen",

client/locales/en/translation.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,17 @@
2424
"changesSaved": "Changes saved.",
2525
"failedToSaveChanges": "Failed to save changes.",
2626
"loginFailed": "Your username or password is not correct.",
27+
"loginFailedGeneric": "Failed to login.",
28+
"loginTechnicalIssues": "Are there technical issues?",
29+
"loginContactUsOnSlack": "Contact us on slack.",
30+
"loginFailedServer": "Failed to login.",
2731
"loginTimeout": "Server takes too long to reply. We're working on it. Please try again later.",
2832
"genericServerError": "A problem occured on the server. We're working on it. Please try again later",
2933
"serverConnectionFailed": "Failed to connect to server.",
3034
"articlesWithThisGraphic": "Articles with this graphic",
31-
"loadMore": "Load more"
35+
"loadMore": "Load more",
36+
"mslogin": "Microsoft Login",
37+
"orContinueWith": "or continue with"
3238
},
3339
"userConfig": {
3440
"initials": "initials",

client/locales/fr/translation.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,17 @@
2424
"changesSaved": "Changements sauvegardés.",
2525
"failedToSaveChanges": "Impossible de sauvegarder les changements.",
2626
"loginFailed": "Votre identifiant ou mot de passe est incorrect.",
27+
"loginFailedGeneric": "Échec de l'inscription.",
28+
"loginTechnicalIssues": "Des problèmes techniques?",
29+
"loginContactUsOnSlack": "Contacte-nous sur Slack.",
30+
"loginFailedServer": "Votre identifiant ou mot de passe est incorrect.",
2731
"loginTimeout": "Le serveur met trop de temps à répondre. Nous y travaillons. Veuillez réessayer plus tard.",
2832
"genericServerError": " Il y a un problème sur le serveur. Nous y travaillons. Veuillez réessayer plus tard.",
2933
"serverConnectionFailed": "Impossible de se connecter au serveur.",
3034
"articlesWithThisGraphic": "Articles avec ce graphique",
31-
"loadMore": "Charger plus"
35+
"loadMore": "Charger plus",
36+
"mslogin": "Microsoft Login",
37+
"orContinueWith": "ou continuer avec"
3238
},
3339
"userConfig": {
3440
"initials": "initiales",

client/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
"aurelia-authentication": "npm:aurelia-authentication@^3.8.3",
5252
"aurelia-binding": "npm:aurelia-binding@^2.3.1",
5353
"aurelia-bootstrapper": "npm:aurelia-bootstrapper@^2.3.3",
54+
"aurelia-cookie": "npm:aurelia-cookie@^1.0.10",
5455
"aurelia-dependency-injection": "npm:aurelia-dependency-injection@^1.4.2",
5556
"aurelia-dialog": "npm:aurelia-dialog@1",
5657
"aurelia-event-aggregator": "npm:aurelia-event-aggregator@^1.0.3",

client/src/app.js

Lines changed: 41 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import { inject } from "aurelia-framework";
22
import { Redirect, Router } from "aurelia-router";
3+
import { AureliaCookie } from "aurelia-cookie";
34
import User from "resources/User.js";
45
import QConfig from "resources/QConfig.js";
56
import qEnv from "resources/qEnv.js";
7+
import { SessionStorage } from "./session-storage";
68

79
@inject(QConfig, User, Router)
810
export class App {
@@ -34,7 +36,7 @@ export class App {
3436
route: ["login"],
3537
name: "login",
3638
moduleId: "pages/login",
37-
title: "Login"
39+
title: "Login",
3840
},
3941
{
4042
route: ["", "index"],
@@ -43,45 +45,51 @@ export class App {
4345
title: "Q",
4446
auth: true,
4547
desc: "Übersicht",
46-
iconName: "icon-logo"
48+
iconName: "icon-logo",
4749
},
4850
{
4951
route: ["item/:id"],
5052
name: "item",
5153
moduleId: "pages/item-overview",
52-
auth: true
54+
auth: true,
5355
},
5456
{
5557
route: ["editor/:tool/:id?"],
5658
name: "editor",
5759
moduleId: "pages/editor",
58-
auth: true
60+
auth: true,
5961
},
6062
{
6163
route: ["feed"],
6264
name: "feed",
6365
moduleId: "pages/feed",
64-
auth: true
66+
auth: true,
6567
},
6668
{
6769
route: ["tasks/:id?"],
6870
name: "tasks",
6971
moduleId: "pages/tasks",
70-
auth: true
72+
auth: true,
73+
},
74+
{
75+
route: ["q-item-picker"],
76+
name: "q-item-picker",
77+
moduleId: "pages/q-item-picker",
78+
auth: true,
7179
},
7280
{
7381
route: ["server-unavailable"],
7482
name: "server-unavailable",
7583
moduleId: "pages/server-unavailable",
76-
title: "Error"
77-
}
84+
title: "Error",
85+
},
7886
];
7987

8088
config.map(routerMap);
8189

8290
config.fallbackRoute("index");
8391

84-
return qEnv.pushState.then(pushState => {
92+
return qEnv.pushState.then((pushState) => {
8593
if (!pushState) {
8694
return;
8795
}
@@ -96,13 +104,13 @@ export class App {
96104
const stylesheets = await this.qConfig.get("stylesheets");
97105
if (stylesheets && stylesheets.length) {
98106
stylesheets
99-
.map(stylesheet => {
107+
.map((stylesheet) => {
100108
if (!stylesheet.url && stylesheet.path) {
101109
stylesheet.url = `${QServerBaseUrl}${stylesheet.path}`;
102110
}
103111
return stylesheet;
104112
})
105-
.map(stylesheet => {
113+
.map((stylesheet) => {
106114
if (stylesheet.url) {
107115
let link = document.createElement("link");
108116
link.type = "text/css";
@@ -123,19 +131,34 @@ export class App {
123131
}
124132
}
125133

126-
@inject(User, QConfig)
134+
@inject(User, QConfig, SessionStorage)
127135
class AuthorizeStep {
128-
constructor(user, qConfig) {
136+
constructor(user, qConfig, sessionStorage) {
129137
this.user = user;
130138
this.qConfig = qConfig;
139+
this.sessionStorage = sessionStorage;
131140
}
132141

133142
run(navigationInstruction, next) {
134143
// Check if the route has an "auth" key
135-
if (navigationInstruction.getAllInstructions().some(i => i.config.auth)) {
136-
return this.user.loaded
137-
.then(() => {
144+
if (navigationInstruction.getAllInstructions().some((i) => i.config.auth)) {
145+
const azureSession = AureliaCookie.get("azureSession");
146+
const headers = {
147+
Authorization: `Bearer ${azureSession}`,
148+
};
149+
150+
return this.user
151+
.loaded(headers)
152+
.then((resp) => {
138153
if (!this.user.isLoggedIn) {
154+
// Store the current route to redirect after login (for azure login)
155+
if (window.location.pathname !== "/") {
156+
this.sessionStorage.setItem(
157+
"redirectPathAfterLogin",
158+
window.location.href
159+
);
160+
}
161+
139162
this.redirectBackAfterLoginRoute = navigationInstruction.fragment;
140163
return next.cancel(new Redirect("login"));
141164
}
@@ -146,7 +169,7 @@ class AuthorizeStep {
146169
}
147170
return next();
148171
})
149-
.catch(e => {
172+
.catch((e) => {
150173
this.redirectBackAfterLoginRoute = navigationInstruction.fragment;
151174
return next.cancel(new Redirect("login"));
152175
});
@@ -166,7 +189,7 @@ class ConfigAvailableCheckStep {
166189
if (
167190
navigationInstruction
168191
.getAllInstructions()
169-
.some(i => i.config.name === "server-unavailable")
192+
.some((i) => i.config.name === "server-unavailable")
170193
) {
171194
try {
172195
await this.qConfig.configLoaded;

client/src/elements/schema-editor/schema-editor-files.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { Notification } from "aurelia-notification";
33
import { I18N } from "aurelia-i18n";
44
import qEnv from "resources/qEnv.js";
55
import { AuthService } from "aurelia-authentication";
6+
import { AureliaCookie } from "aurelia-cookie";
67
const log = LogManager.getLogger("Q");
78

89
@inject(Loader, AuthService, Notification, I18N)
@@ -84,18 +85,15 @@ export class SchemaEditorFiles {
8485
dictMaxFilesExceeded: this.i18n.tr("dropzone.dictMaxFilesExceeded"),
8586
};
8687

87-
const authorizationToken = [
88-
this.authService.config.authTokenType,
89-
this.authService.getAccessToken(),
90-
].join(" ");
88+
const azureSession = AureliaCookie.get("azureSession");
9189

9290
this.dropzoneOptions = Object.assign(
9391
{
9492
addRemoveLinks: true,
9593
url: `${QServerBaseUrl}/file`,
9694
withCredentials: true,
9795
headers: {
98-
Authorization: authorizationToken,
96+
Authorization: `Bearer ${azureSession}`,
9997
},
10098
thumbnailWidth: 120, // should keep aspect ratio,
10199
thumbnailHeight: null,
@@ -152,7 +150,7 @@ export class SchemaEditorFiles {
152150

153151
if (Array.isArray(this.data)) {
154152
// find the removed one in our data by
155-
dataArrayIndex = this.data.findIndex(data => data.url === file.name);
153+
dataArrayIndex = this.data.findIndex((data) => data.url === file.name);
156154
if (dataArrayIndex > -1) {
157155
this.data.splice(dataArrayIndex, 1);
158156
this.change();

0 commit comments

Comments
 (0)