Skip to content

Commit

Permalink
Merge pull request #980 from adshares/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
m-pilarczyk authored Jan 26, 2023
2 parents 44ea7a9 + 7f64a29 commit f8e7fd8
Show file tree
Hide file tree
Showing 416 changed files with 11,356 additions and 15,125 deletions.
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
src/environments/*
!src/environments/environment.ts
!src/environments/environment.ts.template
110 changes: 110 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
{
"root": true,
"ignorePatterns": ["projects/**/*"],
"overrides": [
{
"files": ["*.ts"],
"parserOptions": {
"project": ["tsconfig.json", "e2e/tsconfig.json"],
"createDefaultProgram": true
},
"extends": [
"plugin:@angular-eslint/recommended",
"plugin:@angular-eslint/template/process-inline-templates",
"plugin:angular/johnpapa",
"plugin:prettier/recommended"
],
"rules": {
"angular/document-service": "off",
"angular/window-service": "off",
"angular/timeout-service": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
"@angular-eslint/no-output-rename": [1],
"@angular-eslint/component-class-suffix": [
"error",
{
"suffixes": ["Page", "Component"]
}
],
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": "app",
"style": "kebab-case"
}
],
"@angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
"prefix": "app",
"style": "camelCase"
}
],
"@typescript-eslint/member-ordering": 0,
"@typescript-eslint/naming-convention": 0,
"prettier/prettier" : [
"error",
{
"printWidth": 120,
"tabWidth": 2,
"useTabs": false,
"singleQuote": true,
"semi": true,
"bracketSpacing": true,
"arrowParens": "avoid",
"trailingComma": "es5",
"bracketSameLine": true,
"endOfLine": "lf"
}
]
}
},
{
"files": ["*.html"],
"extends": ["plugin:@angular-eslint/template/recommended", "plugin:prettier/recommended"],
"rules": {
"prettier/prettier" : [
"error",
{
"printWidth": 120,
"tabWidth": 2,
"useTabs": false,
"singleQuote": true,
"semi": true,
"bracketSpacing": true,
"arrowParens": "avoid",
"trailingComma": "es5",
"bracketSameLine": true,
"endOfLine": "lf"
}
]
}
},
{
"files": ["*.html"],
"excludedFiles": ["*inline-template-*.component.html"],
"extends": ["plugin:prettier/recommended"],
"rules": {
"prettier/prettier" : [
"error",
{
"parser": "angular",
"printWidth": 120,
"tabWidth": 2,
"useTabs": false,
"singleQuote": true,
"semi": true,
"bracketSpacing": true,
"arrowParens": "avoid",
"trailingComma": "es5",
"bracketSameLine": true,
"endOfLine": "lf"
}
]
}
}
]
}
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
build
coverage
e2e
node_modules
12 changes: 12 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"printWidth": 120,
"tabWidth": 2,
"useTabs": false,
"singleQuote": true,
"semi": true,
"bracketSpacing": true,
"arrowParens": "avoid",
"trailingComma": "es5",
"bracketSameLine": true,
"endOfLine": "lf"
}
16 changes: 15 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [2.3.0] - 2023-01-26
### Added
- Site's statuses (pending approval, rejected)
- Targeting chip representing domain routes to page on click
### Changed
- Load direct link ad content during campaign load
### Fixed
- Set chart's date filter
- Sites' order on dashboard after status change
- Set conversion's mutable value
- Handle HTTP 403 error
- Check user's role during impersonation

## [2.2.4] - 2022-12-29
### Fixed
- OAuth redirection during adserver initialization
Expand Down Expand Up @@ -511,7 +524,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Publisher features (Sites & AdUnits)


[Unreleased]: https://github.com/adshares/adpanel/compare/v2.2.4...develop
[Unreleased]: https://github.com/adshares/adpanel/compare/v2.3.0...develop
[2.3.0]: https://github.com/adshares/adpanel/compare/v2.2.4...v2.3.0
[2.2.4]: https://github.com/adshares/adpanel/compare/v2.2.3...v2.2.4
[2.2.3]: https://github.com/adshares/adpanel/compare/v2.2.2...v2.2.3
[2.2.2]: https://github.com/adshares/adpanel/compare/v2.2.1...v2.2.2
Expand Down
12 changes: 12 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,15 @@
"options": {
"browserTarget": "adshares:build"
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"src/**/*.ts",
"src/**/*.html"
]
}
}
}
}
Expand All @@ -124,5 +133,8 @@
"@schematics/angular:directive": {
"prefix": "app"
}
},
"cli": {
"defaultCollection": "@angular-eslint/schematics"
}
}
13 changes: 0 additions & 13 deletions docker-compose.override.yaml

This file was deleted.

15 changes: 0 additions & 15 deletions docker-compose.yaml

This file was deleted.

12 changes: 0 additions & 12 deletions dockerfile

This file was deleted.

21 changes: 19 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
{
"name": "adpanel",
"version": "2.2.4",
"version": "2.3.0",
"scripts": {
"ng": "ng",
"start": "ng serve adshares",
"build": "ng build",
"test": "ng test adshares",
"dev": "ng serve adshares --configuration=dev"
"dev": "ng serve adshares --configuration=dev",
"format": "ng lint --fix",
"lint": "ng lint"
},
"private": true,
"dependencies": {
Expand All @@ -26,6 +28,7 @@
"@angular/router": "^13.3.10",
"@fortawesome/angular-fontawesome": "~0.10.0",
"@fortawesome/fontawesome-svg-core": "^6.1.1",
"@fortawesome/free-regular-svg-icons": "^6.2.1",
"@fortawesome/free-solid-svg-icons": "^6.1.1",
"@ngrx/effects": "^13.0.0",
"@ngrx/store": "^13.0.0",
Expand All @@ -51,11 +54,25 @@
},
"devDependencies": {
"@angular-devkit/build-angular": "~13.3.7",
"@angular-eslint/builder": "13.5.0",
"@angular-eslint/eslint-plugin": "13.5.0",
"@angular-eslint/eslint-plugin-template": "13.5.0",
"@angular-eslint/schematics": "13.5.0",
"@angular-eslint/template-parser": "13.5.0",
"@angular/cli": "^13.3.7",
"@angular/compiler-cli": "^13.3.10",
"@angular/language-service": "^13.3.10",
"@ngrx/schematics": "^13.0.0",
"@types/node": "^12.12.6",
"@typescript-eslint/eslint-plugin": "5.27.1",
"@typescript-eslint/parser": "5.27.1",
"eslint": "8.22.0",
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-angular": "^4.1.0",
"eslint-plugin-prettier": "^4.2.1",
"prettier": "^2.8.2",
"prettier-eslint": "^15.0.1",
"tslint-config-prettier": "^1.18.0",
"typescript": "4.6.4"
}
}
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ sonar.host.url=https://sonarcloud.io
sonar.organization=adshares-github
sonar.projectKey=adshares-adpanel
sonar.projectName=Adshares AdPanel
sonar.projectVersion=2.2
sonar.projectVersion=2.3

# =====================================================
# Meta-data for the project
Expand Down
2 changes: 1 addition & 1 deletion src/app-settings/app-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ export const appSettings = {
// url validation regexp
TARGET_URL_REGEXP: `(?:(?:https?|ftp|http):\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9_]-*)*[a-z\u00a1-\uffff0-9_]+)(?:\\.(?:[a-z\u00a1-\uffff0-9_]-*)*[a-z\u00a1-\uffff0-9_]+)*(?:\\.(?:[a-z\u00a1-\uffff]{2,}))\\.?)(?::\\d{2,5})?(?:[\\/?#]\\S*)?`,
// user types available for admin filtering
USER_TYPES: ['Advertisers', 'Publishers', 'All']
USER_TYPES: ['Advertisers', 'Publishers', 'All'],
};
11 changes: 4 additions & 7 deletions src/app/admin/admin-guard.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,7 @@ import { SessionService } from 'app/session.service';

@Injectable()
export class AdminGuard implements CanActivate {

constructor(
private router: Router,
private session: SessionService,
) {
}
constructor(private router: Router, private session: SessionService) {}

canActivate(
_route: ActivatedRouteSnapshot,
Expand All @@ -21,7 +16,9 @@ export class AdminGuard implements CanActivate {
return true;
}

this.router.navigate(['/auth', 'login'], {queryParams: {redirectUrl: state.url}});
this.router.navigate(['/auth', 'login'], {
queryParams: { redirectUrl: state.url },
});

return false;
}
Expand Down
Loading

0 comments on commit f8e7fd8

Please sign in to comment.