Skip to content

Commit

Permalink
Merge branch 'release/v1.24.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
appsol committed Nov 8, 2023
2 parents 6df07fe + 166ea4d commit eeee2f0
Show file tree
Hide file tree
Showing 271 changed files with 3,245 additions and 3,186 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ VUE_APP_BUGSNAG_API_KEY=
VUE_APP_CONTACT_EMAIL=
VUE_APP_CQC_LOCATION_ACTIVE=
VUE_APP_SERVICE_TAGS=
VUE_APP_HELP_SECTION=false
VUE_APP_S3D_REGION=eu-west-2
VUE_APP_S3D_BUCKET=
VUE_APP_S3D_ACL=private
Expand Down
8 changes: 4 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
module.exports = {
root: true,
env: {
node: true,
node: true
},
extends: ["plugin:vue/essential", "@vue/prettier"],
rules: {
"no-console": process.env.NODE_ENV === "production" ? "error" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "error" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "error" : "off"
},
parserOptions: {
parser: "babel-eslint",
},
parser: "babel-eslint"
}
};
8 changes: 4 additions & 4 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ module.exports = {
[
"@vue/app",
{
useBuiltIns: "entry",
},
],
],
useBuiltIns: "entry"
}
]
]
};
8 changes: 4 additions & 4 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ module.exports = {
"^.+\\.vue$": "vue-jest",
".+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2)$":
"jest-transform-stub",
"^.+\\.jsx?$": "babel-jest",
"^.+\\.jsx?$": "babel-jest"
},
moduleNameMapper: {
"^@/(.*)$": "<rootDir>/src/$1",
"^@/(.*)$": "<rootDir>/src/$1"
},
snapshotSerializers: ["jest-serializer-vue"],
testMatch: [
"**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)",
"**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)"
],
testURL: "http://localhost/",
testURL: "http://localhost/"
};
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
plugins: {
autoprefixer: {},
},
autoprefixer: {}
}
};
41 changes: 21 additions & 20 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,89 +37,90 @@ export default {
bodyClasses: ["js-enabled"],
mainClasses: [],
headerNav: [],
logoutInterval: null,
logoutInterval: null
};
},
computed: {
headAttributes() {
return {
"meta[name=theme-color]": {
content: this.themeColor,
content: this.themeColor
},
"meta[name=robots]": { content: "noindex" },
"meta[name=robots]": { content: "noindex" }
};
},
htmlAttributes() {
return {
body: {
class: [document.body.className, ...this.bodyClasses].join(" "),
},
class: [document.body.className, ...this.bodyClasses].join(" ")
}
};
},
loggedInItems() {
return [
{
text: "Services",
to: { name: "services-index" },
hide: !Auth.canView("services"),
hide: !Auth.canView("services")
},
{
text: "Locations",
to: { name: "locations-index" },
hide: !Auth.canView("locations"),
hide: !Auth.canView("locations")
},
{
text: "Referrals",
to: { name: "referrals-index" },
hide: !Auth.canView("referrals"),
hide: !Auth.canView("referrals")
},
{
text: "Organisations",
to: { name: "organisations-index" },
hide: !Auth.canView("organisations"),
hide: !Auth.canView("organisations")
},
{
text: "Events",
to: { name: "events-index" },
hide: !Auth.canView("events"),
hide: !Auth.canView("events")
},
{
text: "Pages",
to: { name: "pages-index" },
hide: !Auth.canView("pages"),
hide: !Auth.canView("pages")
},
{
text: "Users",
to: { name: "users-index" },
hide: !Auth.canView("users"),
hide: !Auth.canView("users")
},
{
text: "Reports",
to: { name: "reports-index" },
hide: !Auth.canView("reports"),
hide: !Auth.canView("reports")
},
{
text: "Admin",
to: { name: "admin-index" },
hide: !Auth.canView("admin"),
hide: !Auth.canView("admin")
},
{
text: "Update requests",
to: { name: "update-requests-index" },
hide: !Auth.canView("update requests"),
hide: !Auth.canView("update requests")
},
{
text: "Help",
to: { name: "help-index" },
},
hide: !this.appHelpSectionActive
}
];
},
loggedOutItems() {
return [
{ text: "Register", to: { name: "register-index" } },
{ text: "Login", href: Auth.authorizeUrl },
{ text: "Login", href: Auth.authorizeUrl }
];
},
}
},
methods: {
setHeaderItems() {
Expand Down Expand Up @@ -148,7 +149,7 @@ export default {
endAutoLogoutInterval() {
clearInterval(this.logoutInterval);
this.logoutInterval = null;
},
}
},
created() {
Expand All @@ -164,6 +165,6 @@ export default {
destroyed() {
this.endAutoLogoutInterval();
},
}
};
</script>
23 changes: 11 additions & 12 deletions src/classes/Auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Auth {
this.appUri = process.env.VUE_APP_URI;
this.appApiClientId = process.env.VUE_APP_API_CLIENT_ID;
this.http = axios.create({
baseURL: this.appApiUri,
baseURL: this.appApiUri
});
}

Expand All @@ -31,7 +31,7 @@ class Auth {
let e,
a = /\+/g, // Regex for replacing addition symbol with a space
r = /([^&;=]+)=?([^&;]*)/g,
d = function (s) {
d = function(s) {
return decodeURIComponent(s.replace(a, " "));
},
q = query,
Expand Down Expand Up @@ -64,7 +64,7 @@ class Auth {
"oauth",
JSON.stringify({
expires_at: expiresIn * 1000 + new Date().setHours(24, 0, 0, 0),
access_token: accessToken,
access_token: accessToken
})
);

Expand All @@ -80,8 +80,8 @@ class Auth {
params: { include: "user-roles" },
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${this.accessToken}`,
},
Authorization: `Bearer ${this.accessToken}`
}
});

localStorage.setItem("user", JSON.stringify(data.data));
Expand All @@ -105,8 +105,8 @@ class Auth {
await this.http.delete("/core/v1/users/user/sessions", {
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${this.accessToken}`,
},
Authorization: `Bearer ${this.accessToken}`
}
});
}

Expand Down Expand Up @@ -193,7 +193,7 @@ class Auth {
{ text: "Content admin", value: "Content Admin" },
{ text: "Organisation admin", value: "Organisation Admin" },
{ text: "Service admin", value: "Service Admin" },
{ text: "Service worker", value: "Service Worker" },
{ text: "Service worker", value: "Service Worker" }
];
}

Expand All @@ -209,7 +209,7 @@ class Auth {
}

return (
this.user.roles.find((role) => {
this.user.roles.find(role => {
if (role.role !== roleName) {
return false;
}
Expand Down Expand Up @@ -437,11 +437,10 @@ class Auth {
* @returns {string}
*/
displayHighestRole(userRoles) {
const roleNames = this.roles.map((role) => role.value);
const roleNames = this.roles.map(role => role.value);

const highestRole = roleNames.find(
(roleName) =>
userRoles.find((role) => role.role === roleName) !== undefined
roleName => userRoles.find(role => role.role === roleName) !== undefined
);

return highestRole || "None";
Expand Down
2 changes: 1 addition & 1 deletion src/classes/Errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export default class Errors {
record(errors) {
let keys = Object.keys(errors);

keys.forEach((key) => {
keys.forEach(key => {
if (key.includes(".")) {
let new_key = key.replace(/\./g, "_");
errors[new_key] = errors[key];
Expand Down
4 changes: 2 additions & 2 deletions src/classes/Form.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@ export default class Form {

return new Promise((resolve, reject) => {
this.$http[requestType](url, data, config)
.then((response) => {
.then(response => {
this.onSuccess(response.data);

resolve(response.data);
})
.catch((error) => {
.catch(error => {
if (error.response.hasOwnProperty("data")) {
this.onFail(error.response.data);
}
Expand Down
8 changes: 4 additions & 4 deletions src/classes/MarkdownConverter.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ class MarkdownConverter {
h2: "govuk-heading-l",
h3: "govuk-heading-m",
ul: "govuk-list govuk-list--bullet",
ol: "govuk-list govuk-list--number",
ol: "govuk-list govuk-list--number"
};
const bindings = Object.keys(classMap).map((key) => ({
const bindings = Object.keys(classMap).map(key => ({
type: "output",
regex: new RegExp(`<${key}>`, "g"),
replace: `<${key} class="${classMap[key]}">`,
replace: `<${key} class="${classMap[key]}">`
}));
this.showdownConverter = new Showdown.Converter({
extensions: [...bindings],
noHeaderId: true,
noHeaderId: true
});
}

Expand Down
18 changes: 9 additions & 9 deletions src/components/Ck/CkBannerInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ import CkImageInput from "./CkImageInput";
export default {
components: {
CkImageInput,
CkImageInput
},
model: {
prop: "banner",
event: "update",
event: "update"
},
props: {
Expand All @@ -75,20 +75,20 @@ export default {
title: "",
content: "",
button_text: "",
button_url: "",
button_url: ""
};
},
}
},
errors: {
type: Object,
default() {
return {};
},
}
},
showImageInput: {
type: Boolean,
default: false,
},
default: false
}
},
methods: {
Expand All @@ -99,8 +99,8 @@ export default {
this.$emit("update", banner);
this.$emit("clear", `banner.${field}`);
},
},
}
}
};
</script>

Expand Down
Loading

0 comments on commit eeee2f0

Please sign in to comment.