mirror of
https://github.com/umami-software/umami.git
synced 2026-02-13 09:05:36 +01:00
Merge branch 'dev' of https://github.com/umami-software/umami into dev
This commit is contained in:
commit
3d6cdddd38
12 changed files with 772 additions and 25 deletions
1
.github/workflows/cd.yml
vendored
1
.github/workflows/cd.yml
vendored
|
|
@ -10,7 +10,6 @@ env:
|
||||||
org.opencontainers.image.vendor=${{github.repository_owner}},
|
org.opencontainers.image.vendor=${{github.repository_owner}},
|
||||||
org.opencontainers.image.licenses="MIT",
|
org.opencontainers.image.licenses="MIT",
|
||||||
org.opencontainers.image.version=${{github.ref_name}},
|
org.opencontainers.image.version=${{github.ref_name}},
|
||||||
org.opencontainers.image.created=${{ env.NOW }},
|
|
||||||
org.opencontainers.image.source=${{github.server_url}}/${{github.repository}},
|
org.opencontainers.image.source=${{github.server_url}}/${{github.repository}},
|
||||||
org.opencontainers.image.revision=${{github.sha}},
|
org.opencontainers.image.revision=${{github.sha}},
|
||||||
org.opencontainers.image.url="https://umami.is/",
|
org.opencontainers.image.url="https://umami.is/",
|
||||||
|
|
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -35,6 +35,7 @@ yarn-error.log*
|
||||||
# local env files
|
# local env files
|
||||||
.env
|
.env
|
||||||
.env.*
|
.env.*
|
||||||
|
*.env.*
|
||||||
|
|
||||||
*.dev.yml
|
*.dev.yml
|
||||||
|
|
||||||
|
|
|
||||||
7
cypress.config.ts
Normal file
7
cypress.config.ts
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
import { defineConfig } from 'cypress';
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
e2e: {
|
||||||
|
baseUrl: 'http://localhost:3000',
|
||||||
|
},
|
||||||
|
});
|
||||||
12
cypress/e2e/login.cy.ts
Normal file
12
cypress/e2e/login.cy.ts
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
describe('Login test', () => {
|
||||||
|
it('logs user in with correct credentials and logs user out', () => {
|
||||||
|
cy.visit('/login');
|
||||||
|
cy.dataCy('input-username').type(Cypress.env('umami_user'));
|
||||||
|
cy.dataCy('input-password').type(Cypress.env('umami_password'));
|
||||||
|
cy.dataCy('button-submit').click();
|
||||||
|
cy.url().should('eq', Cypress.config().baseUrl + '/dashboard');
|
||||||
|
cy.dataCy('button-profile').click();
|
||||||
|
cy.dataCy('item-logout').click();
|
||||||
|
cy.url().should('eq', Cypress.config().baseUrl + '/login');
|
||||||
|
});
|
||||||
|
});
|
||||||
5
cypress/support/e2e.ts
Normal file
5
cypress/support/e2e.ts
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
|
||||||
|
Cypress.Commands.add('dataCy', value => {
|
||||||
|
return cy.get(`[data-cy=${value}]`);
|
||||||
|
});
|
||||||
11
cypress/support/index.d.ts
vendored
Normal file
11
cypress/support/index.d.ts
vendored
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
|
||||||
|
declare namespace Cypress {
|
||||||
|
interface Chainable {
|
||||||
|
/**
|
||||||
|
* Custom command to select DOM element by data-cy attribute.
|
||||||
|
* @example cy.dataCy('greeting')
|
||||||
|
*/
|
||||||
|
dataCy(value: string): Chainable<JQuery<HTMLElement>>;
|
||||||
|
}
|
||||||
|
}
|
||||||
8
cypress/tsconfig.json
Normal file
8
cypress/tsconfig.json
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "es5",
|
||||||
|
"lib": ["es5", "dom"],
|
||||||
|
"types": ["cypress", "node"]
|
||||||
|
},
|
||||||
|
"include": ["**/*.ts"]
|
||||||
|
}
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "umami",
|
"name": "umami",
|
||||||
"version": "2.10.0",
|
"version": "2.11.0",
|
||||||
"description": "A simple, fast, privacy-focused alternative to Google Analytics.",
|
"description": "A simple, fast, privacy-focused alternative to Google Analytics.",
|
||||||
"author": "Mike Cao <mike@mikecao.com>",
|
"author": "Mike Cao <mike@mikecao.com>",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|
@ -42,7 +42,8 @@
|
||||||
"change-password": "node scripts/change-password.js",
|
"change-password": "node scripts/change-password.js",
|
||||||
"lint": "next lint --quiet",
|
"lint": "next lint --quiet",
|
||||||
"prepare": "node -e \"if (process.env.NODE_ENV !== 'production'){process.exit(1)} \" || husky install",
|
"prepare": "node -e \"if (process.env.NODE_ENV !== 'production'){process.exit(1)} \" || husky install",
|
||||||
"postbuild": "node scripts/postbuild.js"
|
"postbuild": "node scripts/postbuild.js",
|
||||||
|
"cypress-open": "cypress open"
|
||||||
},
|
},
|
||||||
"lint-staged": {
|
"lint-staged": {
|
||||||
"**/*.{js,jsx,ts,tsx}": [
|
"**/*.{js,jsx,ts,tsx}": [
|
||||||
|
|
@ -133,6 +134,7 @@
|
||||||
"@typescript-eslint/eslint-plugin": "^6.7.3",
|
"@typescript-eslint/eslint-plugin": "^6.7.3",
|
||||||
"@typescript-eslint/parser": "^6.7.3",
|
"@typescript-eslint/parser": "^6.7.3",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
|
"cypress": "^13.6.6",
|
||||||
"esbuild": "^0.17.17",
|
"esbuild": "^0.17.17",
|
||||||
"eslint": "^8.33.0",
|
"eslint": "^8.33.0",
|
||||||
"eslint-config-next": "^14.0.4",
|
"eslint-config-next": "^14.0.4",
|
||||||
|
|
|
||||||
|
|
@ -42,17 +42,30 @@ export function LoginForm() {
|
||||||
<div className={styles.title}>umami</div>
|
<div className={styles.title}>umami</div>
|
||||||
<Form className={styles.form} onSubmit={handleSubmit} error={getMessage(error)}>
|
<Form className={styles.form} onSubmit={handleSubmit} error={getMessage(error)}>
|
||||||
<FormRow label={formatMessage(labels.username)}>
|
<FormRow label={formatMessage(labels.username)}>
|
||||||
<FormInput name="username" rules={{ required: formatMessage(labels.required) }}>
|
<FormInput
|
||||||
|
data-cy="input-username"
|
||||||
|
name="username"
|
||||||
|
rules={{ required: formatMessage(labels.required) }}
|
||||||
|
>
|
||||||
<TextField autoComplete="off" />
|
<TextField autoComplete="off" />
|
||||||
</FormInput>
|
</FormInput>
|
||||||
</FormRow>
|
</FormRow>
|
||||||
<FormRow label={formatMessage(labels.password)}>
|
<FormRow label={formatMessage(labels.password)}>
|
||||||
<FormInput name="password" rules={{ required: formatMessage(labels.required) }}>
|
<FormInput
|
||||||
|
data-cy="input-password"
|
||||||
|
name="password"
|
||||||
|
rules={{ required: formatMessage(labels.required) }}
|
||||||
|
>
|
||||||
<PasswordField />
|
<PasswordField />
|
||||||
</FormInput>
|
</FormInput>
|
||||||
</FormRow>
|
</FormRow>
|
||||||
<FormButtons>
|
<FormButtons>
|
||||||
<SubmitButton className={styles.button} variant="primary" disabled={isPending}>
|
<SubmitButton
|
||||||
|
data-cy="button-submit"
|
||||||
|
className={styles.button}
|
||||||
|
variant="primary"
|
||||||
|
disabled={isPending}
|
||||||
|
>
|
||||||
{formatMessage(labels.login)}
|
{formatMessage(labels.login)}
|
||||||
</SubmitButton>
|
</SubmitButton>
|
||||||
</FormButtons>
|
</FormButtons>
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ export function ProfileButton() {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PopupTrigger>
|
<PopupTrigger>
|
||||||
<Button variant="quiet">
|
<Button data-cy="button-profile" variant="quiet">
|
||||||
<Icon>
|
<Icon>
|
||||||
<Icons.Profile />
|
<Icons.Profile />
|
||||||
</Icon>
|
</Icon>
|
||||||
|
|
@ -41,7 +41,7 @@ export function ProfileButton() {
|
||||||
<Text>{formatMessage(labels.profile)}</Text>
|
<Text>{formatMessage(labels.profile)}</Text>
|
||||||
</Item>
|
</Item>
|
||||||
{!cloudMode && (
|
{!cloudMode && (
|
||||||
<Item key="logout" className={styles.item}>
|
<Item data-cy="item-logout" key="logout" className={styles.item}>
|
||||||
<Icon>
|
<Icon>
|
||||||
<Icons.Logout />
|
<Icons.Logout />
|
||||||
</Icon>
|
</Icon>
|
||||||
|
|
|
||||||
|
|
@ -56,10 +56,10 @@ const schema = {
|
||||||
hostname: yup.string().matches(HOSTNAME_REGEX).max(100),
|
hostname: yup.string().matches(HOSTNAME_REGEX).max(100),
|
||||||
ip: yup.string().matches(IP_REGEX),
|
ip: yup.string().matches(IP_REGEX),
|
||||||
language: yup.string().max(35),
|
language: yup.string().max(35),
|
||||||
referrer: yup.string().max(500),
|
referrer: yup.string(),
|
||||||
screen: yup.string().max(11),
|
screen: yup.string().max(11),
|
||||||
title: yup.string().max(500),
|
title: yup.string(),
|
||||||
url: yup.string().max(500),
|
url: yup.string(),
|
||||||
website: yup.string().uuid().required(),
|
website: yup.string().uuid().required(),
|
||||||
name: yup.string().max(50),
|
name: yup.string().max(50),
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue