Skip to content

Commit

Permalink
Add metadata comments and reformat various files
Browse files Browse the repository at this point in the history
- Added project metadata comments to multiple files for better documentation.
- Updated `.eslintrc.json` and `angular.json` to format arrays and objects with multi-line syntax for improved readability.
- Changed `request` type in `launch.json` from `launch` to `attach`.
- Incremented version in `package-lock.json` and `package.json` from `0.0.0` to `0.0.1`.
- Made `http` property readonly in `mls-data.service.ts`.
- Replaced `accountService.isLoggedIn()` with `accountService.getCurrentUser()` in `auth.guard.ts`.
- Adjusted margin in `admin-home.component.html` by removing `-m-24` class.
- Added CSS classes for better styling in `footer.component.scss` and `header.component.scss`.
- Added `Logout` button and additional styling to `admin-navbar.component.html`.
- Reformatted `motion-tailwind.css` for consistent indentation and line breaks.
- Improved formatting in `index.html`, `tsconfig.app.json`, `tsconfig.json`, and `tsconfig.spec.json`.
- Modified SVG content in `github-mark-white.svg` and `github-mark.svg` for better readability.
  • Loading branch information
phamtiendungcw committed Nov 8, 2024
1 parent 55f01ee commit e2b795e
Show file tree
Hide file tree
Showing 81 changed files with 1,358 additions and 238 deletions.
45 changes: 33 additions & 12 deletions src/MLS.MatLidStoreUI/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,41 @@
{
"ignorePatterns": ["projects/**/*"],
"ignorePatterns": [
"projects/**/*"
],
"root": true,
"plugins": ["unused-imports", "simple-import-sort"],
"plugins": [
"unused-imports",
"simple-import-sort"
],
"overrides": [
{
"files": ["*.ts"],
"files": [
"*.ts"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@angular-eslint/recommended",
"plugin:prettier/recommended"
],
"rules": {
"@angular-eslint/sort-ngmodule-metadata-arrays": ["error", {}],
"quotes": ["error", "single"],
"@angular-eslint/sort-ngmodule-metadata-arrays": [
"error",
{}
],
"quotes": [
"error",
"single"
],
"simple-import-sort/exports": "error",
"simple-import-sort/imports": "error",
"unused-imports/no-unused-imports": "error"
}
},
{
"files": ["*.html"],
"files": [
"*.html"
],
"extends": [
"plugin:@angular-eslint/template/recommended",
"plugin:@angular-eslint/template/accessibility",
Expand All @@ -32,12 +47,18 @@
{
"alphabetical": false,
"order": [
"STRUCTURAL_DIRECTIVE", // e.g. `*ngIf="true"`, `*ngFor="let item of items"`
"TEMPLATE_REFERENCE", // e.g. `<input #inputRef>`
"ATTRIBUTE_BINDING", // e.g. `<input required>`, `id="3"`
"INPUT_BINDING", // e.g. `[id]="3"`, `[attr.colspan]="colspan"`, [style.width.%]="100", [@triggerName]="expression", `bind-id="handleChange()"`
"TWO_WAY_BINDING", // e.g. `[(id)]="id"`, `bindon-id="id"
"OUTPUT_BINDING" // e.g. `(idChange)="handleChange()"`, `on-id="handleChange()"`
"STRUCTURAL_DIRECTIVE",
// e.g. `*ngIf="true"`, `*ngFor="let item of items"`
"TEMPLATE_REFERENCE",
// e.g. `<input #inputRef>`
"ATTRIBUTE_BINDING",
// e.g. `<input required>`, `id="3"`
"INPUT_BINDING",
// e.g. `[id]="3"`, `[attr.colspan]="colspan"`, [style.width.%]="100", [@triggerName]="expression", `bind-id="handleChange()"`
"TWO_WAY_BINDING",
// e.g. `[(id)]="id"`, `bindon-id="id"
"OUTPUT_BINDING"
// e.g. `(idChange)="handleChange()"`, `on-id="handleChange()"`
]
}
],
Expand Down
4 changes: 3 additions & 1 deletion src/MLS.MatLidStoreUI/.prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
"trailingComma": "es5",
"endOfLine": "auto",
"htmlWhitespaceSensitivity": "ignore",
"plugins": ["prettier-plugin-tailwindcss"],
"plugins": [
"prettier-plugin-tailwindcss"
],
"overrides": [
{
"files": "*.html",
Expand Down
4 changes: 2 additions & 2 deletions src/MLS.MatLidStoreUI/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
{
"name": "ng serve",
"type": "chrome",
"request": "launch",
"request": "attach",
"preLaunchTask": "npm: start",
"url": "http://localhost:4200/"
},
{
"name": "ng test",
"type": "chrome",
"request": "launch",
"request": "attach",
"preLaunchTask": "npm: test",
"url": "http://localhost:9876/debug.html"
}
Expand Down
37 changes: 29 additions & 8 deletions src/MLS.MatLidStoreUI/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,19 @@
"outputPath": "dist/matlidstore-ui",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": ["zone.js"],
"polyfills": [
"zone.js"
],
"tsConfig": "tsconfig.app.json",
"inlineStyleLanguage": "scss",
"assets": ["src/favicon.ico", "src/assets"],
"styles": ["src/styles.scss", "node_modules/ngx-toastr/toastr.css"],
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.scss",
"node_modules/ngx-toastr/toastr.css"
],
"scripts": []
},
"configurations": {
Expand Down Expand Up @@ -97,24 +105,37 @@
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"polyfills": ["zone.js", "zone.js/testing"],
"polyfills": [
"zone.js",
"zone.js/testing"
],
"tsConfig": "tsconfig.spec.json",
"inlineStyleLanguage": "scss",
"assets": ["src/favicon.ico", "src/assets"],
"styles": ["src/styles.scss"],
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.scss"
],
"scripts": []
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": ["src/**/*.ts", "src/**/*.html"]
"lintFilePatterns": [
"src/**/*.ts",
"src/**/*.html"
]
}
}
}
}
},
"cli": {
"schematicCollections": ["@angular-eslint/schematics"]
"schematicCollections": [
"@angular-eslint/schematics"
]
}
}
4 changes: 2 additions & 2 deletions src/MLS.MatLidStoreUI/package-lock.json

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

2 changes: 1 addition & 1 deletion src/MLS.MatLidStoreUI/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "matlidstore-ui",
"version": "0.0.0",
"version": "0.0.1",
"scripts": {
"ng": "ng",
"start": "ng serve",
Expand Down
15 changes: 15 additions & 0 deletions src/MLS.MatLidStoreUI/postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Project: MatLidStore(https://github.com/phamtiendungcw/matlidstore)
* File: postcss.config.js
* Author: phamtiendungcw(https://github.com/phamtiendungcw)
* Created on: 15:45, 07/11/2024
*
* Copyright (c) 2024 Pham Tien Dung. All rights reserved.
*
* Description:
* This file is part of the MLS.MatLidStoreUI project.
* Unauthorized copying or distribution of this file, via any medium, is strictly prohibited.
*
* License: Proprietary and confidential.
*/

module.exports = {
plugins: {
tailwindcss: {},
Expand Down
15 changes: 15 additions & 0 deletions src/MLS.MatLidStoreUI/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Project: MatLidStore(https://github.com/phamtiendungcw/matlidstore)
* File: app-routing.module.ts
* Author: phamtiendungcw(https://github.com/phamtiendungcw)
* Created on: 15:34, 07/11/2024
*
* Copyright (c) 2024 Pham Tien Dung. All rights reserved.
*
* Description:
* This file is part of the MLS.MatLidStoreUI project.
* Unauthorized copying or distribution of this file, via any medium, is strictly prohibited.
*
* License: Proprietary and confidential.
*/

import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';

Expand Down
15 changes: 15 additions & 0 deletions src/MLS.MatLidStoreUI/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Project: MatLidStore(https://github.com/phamtiendungcw/matlidstore)
* File: app.component.ts
* Author: phamtiendungcw(https://github.com/phamtiendungcw)
* Created on: 15:34, 07/11/2024
*
* Copyright (c) 2024 Pham Tien Dung. All rights reserved.
*
* Description:
* This file is part of the MLS.MatLidStoreUI project.
* Unauthorized copying or distribution of this file, via any medium, is strictly prohibited.
*
* License: Proprietary and confidential.
*/

import { Component } from '@angular/core';

@Component({
Expand Down
15 changes: 15 additions & 0 deletions src/MLS.MatLidStoreUI/src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Project: MatLidStore(https://github.com/phamtiendungcw/matlidstore)
* File: app.module.ts
* Author: phamtiendungcw(https://github.com/phamtiendungcw)
* Created on: 15:34, 07/11/2024
*
* Copyright (c) 2024 Pham Tien Dung. All rights reserved.
*
* Description:
* This file is part of the MLS.MatLidStoreUI project.
* Unauthorized copying or distribution of this file, via any medium, is strictly prohibited.
*
* License: Proprietary and confidential.
*/

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
Expand Down
17 changes: 16 additions & 1 deletion src/MLS.MatLidStoreUI/src/app/core/data/mls-data.service.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Project: MatLidStore(https://github.com/phamtiendungcw/matlidstore)
* File: mls-data.service.ts
* Author: phamtiendungcw(https://github.com/phamtiendungcw)
* Created on: 15:34, 07/11/2024
*
* Copyright (c) 2024 Pham Tien Dung. All rights reserved.
*
* Description:
* This file is part of the MLS.MatLidStoreUI project.
* Unauthorized copying or distribution of this file, via any medium, is strictly prohibited.
*
* License: Proprietary and confidential.
*/

//----------------------
// <auto-generated>
// Generated using the NSwag toolchain v14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org)
Expand Down Expand Up @@ -700,7 +715,7 @@ export interface IMatLidStoreAPIServices {
@Injectable()
export class MatLidStoreAPIServices implements IMatLidStoreAPIServices {
protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined;
private http: HttpClient;
private readonly http: HttpClient;
private readonly baseUrl: string;

constructor(@Inject(HttpClient) http: HttpClient, @Optional() @Inject(API_BASE_URL) baseUrl?: string) {
Expand Down
17 changes: 16 additions & 1 deletion src/MLS.MatLidStoreUI/src/app/core/guards/auth.guard.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Project: MatLidStore(https://github.com/phamtiendungcw/matlidstore)
* File: auth.guard.ts
* Author: phamtiendungcw(https://github.com/phamtiendungcw)
* Created on: 15:34, 07/11/2024
*
* Copyright (c) 2024 Pham Tien Dung. All rights reserved.
*
* Description:
* This file is part of the MLS.MatLidStoreUI project.
* Unauthorized copying or distribution of this file, via any medium, is strictly prohibited.
*
* License: Proprietary and confidential.
*/

import { inject } from '@angular/core';
import { CanActivateFn, Router } from '@angular/router';

Expand All @@ -7,7 +22,7 @@ export const authGuard: CanActivateFn = () => {
const router = inject(Router);
const accountService = inject(AccountService);

if (accountService.isLoggedIn()) {
if (accountService.getCurrentUser()) {
return true;
} else {
router.navigate(['/account/login']);
Expand Down
15 changes: 15 additions & 0 deletions src/MLS.MatLidStoreUI/src/app/core/services/account.service.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Project: MatLidStore(https://github.com/phamtiendungcw/matlidstore)
* File: account.service.ts
* Author: phamtiendungcw(https://github.com/phamtiendungcw)
* Created on: 15:34, 07/11/2024
*
* Copyright (c) 2024 Pham Tien Dung. All rights reserved.
*
* Description:
* This file is part of the MLS.MatLidStoreUI project.
* Unauthorized copying or distribution of this file, via any medium, is strictly prohibited.
*
* License: Proprietary and confidential.
*/

import { Injectable } from '@angular/core';
import jwtDecode from 'jwt-decode';
import { BehaviorSubject } from 'rxjs';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
<!--
~ Project: MatLidStore(https://github.com/phamtiendungcw/matlidstore)
~ File: admin-home.component.html
~ Author: phamtiendungcw(https://github.com/phamtiendungcw)
~ Created on: 15:38, 07/11/2024
~
~ Copyright (c) 2024 Pham Tien Dung. All rights reserved.
~
~ Description:
~ This file is part of the MLS.MatLidStoreUI project.
~ Unauthorized copying or distribution of this file, via any medium, is strictly prohibited.
~
~ License: Proprietary and confidential.
-->

<div>
<app-sidebar></app-sidebar>
<div class="bg-blueGray-100 relative md:ml-64">
<app-admin-navbar></app-admin-navbar>
<app-header></app-header>
<div class="-m-24 mx-auto w-full px-4 md:px-10">
<div class="mx-auto w-full px-4 md:px-10">
<router-outlet></router-outlet>
<app-footer></app-footer>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*!
* Project: MatLidStore(https://github.com/phamtiendungcw/matlidstore)
* File: admin-home.component.scss
* Author: phamtiendungcw(https://github.com/phamtiendungcw)
* Created on: 15:38, 07/11/2024
*
* Copyright (c) 2024 Pham Tien Dung. All rights reserved.
*
* Description:
* This file is part of the MLS.MatLidStoreUI project.
* Unauthorized copying or distribution of this file, via any medium, is strictly prohibited.
*
* License: Proprietary and confidential.
*/
Loading

0 comments on commit e2b795e

Please sign in to comment.