mirror of
https://github.com/HangarMC/Hangar.git
synced 2025-01-18 14:14:50 +08:00
Bump prettier from 2.2.1 to 2.3.0 in /frontend (#453)
Bumps [prettier](https://github.com/prettier/prettier) from 2.2.1 to 2.3.0. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/2.2.1...2.3.0) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
parent
4c613fd28c
commit
d835e2f928
@ -143,8 +143,7 @@ const msgs: LocaleMessageObject = {
|
||||
new: {
|
||||
step1: {
|
||||
title: 'User Agreement',
|
||||
text:
|
||||
'A project contains your downloads and the documentation for your plugin.<br>Before continuing, please review the <a href="#">Hangar Submission Guidelines.</a>',
|
||||
text: 'A project contains your downloads and the documentation for your plugin.<br>Before continuing, please review the <a href="#">Hangar Submission Guidelines.</a>',
|
||||
continue: 'Agree',
|
||||
back: 'Abort',
|
||||
},
|
||||
@ -541,8 +540,7 @@ const msgs: LocaleMessageObject = {
|
||||
},
|
||||
visibility: {
|
||||
notice: {
|
||||
new:
|
||||
'This project is new, and will not be shown to others until a version has been uploaded. If a version is not uploaded over a longer time the project will be deleted.',
|
||||
new: 'This project is new, and will not be shown to others until a version has been uploaded. If a version is not uploaded over a longer time the project will be deleted.',
|
||||
needsChanges: 'This project requires changes',
|
||||
needsApproval: 'You have sent the project for review',
|
||||
softDelete: 'Project deleted by {0}',
|
||||
|
@ -52,7 +52,7 @@
|
||||
"fibers": "5.0.0",
|
||||
"husky": "6.0.0",
|
||||
"lint-staged": "11.0.0",
|
||||
"prettier": "2.2.1",
|
||||
"prettier": "2.3.0",
|
||||
"sass": "1.32.13",
|
||||
"sass-loader": "10.1.1",
|
||||
"typescript": "4.2.4",
|
||||
|
@ -312,11 +312,11 @@ export default class NewProjectPage extends HangarComponent {
|
||||
error = null as string | null;
|
||||
form: NewProjectForm = {
|
||||
category: ProjectCategory.ADMIN_TOOLS,
|
||||
settings: ({
|
||||
settings: {
|
||||
license: {} as ProjectSettingsForm['settings']['license'],
|
||||
donation: {} as ProjectSettingsForm['settings']['donation'],
|
||||
keywords: [],
|
||||
} as unknown) as ProjectSettingsForm['settings'],
|
||||
} as unknown as ProjectSettingsForm['settings'],
|
||||
} as NewProjectForm;
|
||||
|
||||
nameErrors: TranslateResult[] = [];
|
||||
|
@ -128,7 +128,7 @@ const createApi = ({ $axios, store, app: { $cookies } }: Context) => {
|
||||
if (headers['set-cookie']) {
|
||||
const statString = headers['set-cookie'].find((c: string) => c.startsWith('hangar_stats'));
|
||||
if (statString) {
|
||||
const statCookie: StatCookie = (Cookie.parse(statString) as unknown) as StatCookie;
|
||||
const statCookie: StatCookie = Cookie.parse(statString) as unknown as StatCookie;
|
||||
$cookies.set('hangar_stats', statCookie.hangar_stats, {
|
||||
path: statCookie.Path,
|
||||
expires: new Date(statCookie.Expires),
|
||||
|
@ -63,7 +63,7 @@ function collectErrors(exception: HangarApiException | MultiHangarApiException,
|
||||
const createUtil = ({ store, error, app: { i18n } }: Context) => {
|
||||
class Util {
|
||||
dummyUser(): HangarUser {
|
||||
return ({
|
||||
return {
|
||||
name: 'Dummy',
|
||||
id: 42,
|
||||
tagline: null,
|
||||
@ -77,11 +77,11 @@ const createUtil = ({ store, error, app: { i18n } }: Context) => {
|
||||
unresolvedFlags: 2,
|
||||
},
|
||||
joinDate: this.prettyDate(new Date()),
|
||||
} as unknown) as HangarUser;
|
||||
} as unknown as HangarUser;
|
||||
}
|
||||
|
||||
dummyProject(): HangarProject {
|
||||
return ({ namespace: { owner: 'test', slug: 'test2' }, visibility: Visibility.NEW } as unknown) as HangarProject;
|
||||
return { namespace: { owner: 'test', slug: 'test2' }, visibility: Visibility.NEW } as unknown as HangarProject;
|
||||
}
|
||||
|
||||
avatarUrl(name: string): string {
|
||||
@ -239,7 +239,10 @@ const createUtil = ({ store, error, app: { i18n } }: Context) => {
|
||||
}
|
||||
|
||||
$vc = {
|
||||
require: (name: TranslateResult = 'Field') => (v: string) => !!v || i18n.t('validation.required', [name]),
|
||||
require:
|
||||
(name: TranslateResult = 'Field') =>
|
||||
(v: string) =>
|
||||
!!v || i18n.t('validation.required', [name]),
|
||||
maxLength: (maxLength: number) => (v: string | any[]) => {
|
||||
return (
|
||||
((v === null || typeof v === 'undefined' || typeof v === 'string') && !v) ||
|
||||
@ -256,11 +259,16 @@ const createUtil = ({ store, error, app: { i18n } }: Context) => {
|
||||
i18n.t('validation.minLength', [minLength])
|
||||
);
|
||||
},
|
||||
requireNonEmptyArray: (name: TranslateResult = 'Field') => (v: any[]) => v.length > 0 || i18n.t('validation.required', [name]),
|
||||
requireNonEmptyArray:
|
||||
(name: TranslateResult = 'Field') =>
|
||||
(v: any[]) =>
|
||||
v.length > 0 || i18n.t('validation.required', [name]),
|
||||
url: (v: string) => !v || new RegExp((store.state as RootState).validations.urlRegex).test(v) || i18n.t('validation.invalidUrl'),
|
||||
regex: (name: TranslateResult = 'Field', regexp: string) => (v: string) => {
|
||||
return !v || new RegExp(regexp).test(v) || i18n.t('validation.invalidFormat', [name]);
|
||||
},
|
||||
regex:
|
||||
(name: TranslateResult = 'Field', regexp: string) =>
|
||||
(v: string) => {
|
||||
return !v || new RegExp(regexp).test(v) || i18n.t('validation.invalidFormat', [name]);
|
||||
},
|
||||
requireNumberArray: () => (v: string | any[]) => {
|
||||
return (
|
||||
((v === null || typeof v === 'undefined' || typeof v === 'string') && !v) ||
|
||||
|
@ -35,11 +35,11 @@ export interface RootState {
|
||||
}
|
||||
|
||||
export const state: () => RootState = () => ({
|
||||
projectCategories: (null as unknown) as Map<ProjectCategory, IProjectCategory>,
|
||||
permissions: (null as unknown) as Map<NamedPermission, IPermission>,
|
||||
platforms: (null as unknown) as Map<Platform, IPlatform>,
|
||||
validations: (null as unknown) as RootState['validations'],
|
||||
prompts: (null as unknown) as RootState['prompts'],
|
||||
projectCategories: null as unknown as Map<ProjectCategory, IProjectCategory>,
|
||||
permissions: null as unknown as Map<NamedPermission, IPermission>,
|
||||
platforms: null as unknown as Map<Platform, IPlatform>,
|
||||
validations: null as unknown as RootState['validations'],
|
||||
prompts: null as unknown as RootState['prompts'],
|
||||
});
|
||||
|
||||
export const mutations: MutationTree<RootState> = {
|
||||
@ -107,7 +107,7 @@ export const getters: GetterTree<RootState, RootState> = {
|
||||
function convertToMap<E, T>(values: T[], toStringFunc: (value: T) => string): Map<E, T> {
|
||||
const map = new Map<E, T>();
|
||||
for (const value of values) {
|
||||
const key: E = (toStringFunc(value) as unknown) as E;
|
||||
const key: E = toStringFunc(value) as unknown as E;
|
||||
if (key == null) {
|
||||
throw new Error('Could not find an enum for ' + value);
|
||||
}
|
||||
|
@ -3,14 +3,16 @@ import { PermissionCheck } from 'hangar-api';
|
||||
import { NamedPermission, PermissionType } from '~/types/enums';
|
||||
import { AuthState } from '~/store/auth';
|
||||
|
||||
const loggedInMiddleware = (code: number, msg?: string): Middleware => ({ store, error }: Context) => {
|
||||
if (!store.state.auth.authenticated) {
|
||||
error({
|
||||
message: msg,
|
||||
statusCode: code,
|
||||
});
|
||||
}
|
||||
};
|
||||
const loggedInMiddleware =
|
||||
(code: number, msg?: string): Middleware =>
|
||||
({ store, error }: Context) => {
|
||||
if (!store.state.auth.authenticated) {
|
||||
error({
|
||||
message: msg,
|
||||
statusCode: code,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
export function NotLoggedIn(constructor: Function) {
|
||||
addMiddleware(constructor, ({ store, redirect }) => {
|
||||
|
@ -8369,10 +8369,10 @@ prettier-linter-helpers@^1.0.0:
|
||||
dependencies:
|
||||
fast-diff "^1.1.2"
|
||||
|
||||
prettier@2.2.1:
|
||||
version "2.2.1"
|
||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.2.1.tgz#795a1a78dd52f073da0cd42b21f9c91381923ff5"
|
||||
integrity sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==
|
||||
prettier@2.3.0:
|
||||
version "2.3.0"
|
||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.0.tgz#b6a5bf1284026ae640f17f7ff5658a7567fc0d18"
|
||||
integrity sha512-kXtO4s0Lz/DW/IJ9QdWhAf7/NmPWQXkFr/r/WkR3vyI+0v8amTDxiaQSLzs8NBlytfLWX/7uQUMIW677yLKl4w==
|
||||
|
||||
prettier@^1.18.2:
|
||||
version "1.19.1"
|
||||
|
Loading…
Reference in New Issue
Block a user