diff --git a/.eslintrc.json b/.eslintrc.json index 9d48db47..df34fa70 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,6 +1,11 @@ { "root": true, - "ignorePatterns": ["projects/**/*"], + "ignorePatterns": ["projects/**/*", "functions/**/**"], + "extends": ["plugin:@typescript-eslint/recommended", "prettier"], + "rules": { + "object-curly-spacing": ["error", "always"], // Ensure no space around `{` + "quotes": ["error", "double"] // Example ESLint rule for quotes, adjust as needed + }, "overrides": [ { "files": ["*.ts"], diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 623309d5..308b46b4 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,5 +1,18 @@ { - "recommendations": [ - "ionic.ionic" - ] + "recommendations": [ + "ionic.ionic", + "donjayamanne.githistory", + "streetsidesoftware.code-spell-checker", + "dbaeumer.vscode-eslint", + "toba.vsfire", + "eamodio.gitlens", + "yzhang.markdown-all-in-one", + "pkief.material-icon-theme", + "pilaton.vscode-npm-lens", + "esbenp.prettier-vscode", + "stylelint.vscode-stylelint", + "wayou.vscode-todo-highlight", + "johnpapa.angular2", + "angular.ng-template" + ] } diff --git a/.vscode/settings.json b/.vscode/settings.json index 77dbcda9..ee889b91 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,7 +1,7 @@ { "editor.defaultFormatter": "vscode.html-language-features", - "cSpell.words": ["arize", "Drucker", "etags", "maxlength"], -"editor.formatOnSave": true, + "cSpell.words": ["arize", "Drucker", "etags", "maxlength", "subdir"], + "editor.formatOnSave": true, "prettier.htmlWhitespaceSensitivity": "ignore", "[github-actions-workflow]": { "editor.defaultFormatter": "esbenp.prettier-vscode" diff --git a/angular.json b/angular.json index fc3cf121..aaf896c7 100644 --- a/angular.json +++ b/angular.json @@ -34,13 +34,8 @@ "src/robots.txt", "src/sitemap.xml" ], - "allowedCommonJsDependencies": [ - "file-saver" - ], - "styles": [ - "src/theme/variables.scss", - "src/global.scss" - ], + "allowedCommonJsDependencies": ["file-saver"], + "styles": ["src/theme/variables.scss", "src/global.scss"], "scripts": [], "serviceWorker": true, "ngswConfigPath": "ngsw-config.json" @@ -123,10 +118,7 @@ }, "src/manifest.webmanifest" ], - "styles": [ - "src/theme/variables.scss", - "src/global.scss" - ], + "styles": ["src/theme/variables.scss", "src/global.scss"], "scripts": [] }, "configurations": { @@ -139,10 +131,7 @@ "lint": { "builder": "@angular-eslint/builder:lint", "options": { - "lintFilePatterns": [ - "src/**/*.ts", - "src/**/*.html" - ] + "lintFilePatterns": ["src/**/*.ts", "src/**/*.html"] } }, "deploy": { @@ -159,9 +148,7 @@ } }, "cli": { - "schematicCollections": [ - "@ionic/angular-toolkit" - ] + "schematicCollections": ["@ionic/angular-toolkit"] }, "schematics": { "@ionic/angular-toolkit:component": { @@ -171,4 +158,4 @@ "styleext": "scss" } } -} \ No newline at end of file +} diff --git a/capacitor.config.ts b/capacitor.config.ts index 3a943df0..5ab66cf9 100644 --- a/capacitor.config.ts +++ b/capacitor.config.ts @@ -1,10 +1,10 @@ -import { CapacitorConfig } from '@capacitor/cli'; +import { CapacitorConfig } from "@capacitor/cli"; const config: CapacitorConfig = { - appId: 'io.ionic.starter', - appName: 'summarize', - webDir: 'www', - bundledWebRuntime: false + appId: "app.web.summarize-ng", + appName: "summarize", + webDir: "www", + bundledWebRuntime: false, }; export default config; diff --git a/documentation/Osmosys Rules.json b/documentation/Osmosys Rules.json new file mode 100644 index 00000000..007cf975 --- /dev/null +++ b/documentation/Osmosys Rules.json @@ -0,0 +1,405 @@ +{ + "env": { + "es6": true, + "browser": true, + "node": true + }, + "extends": ["plugin:@angular-eslint/recommended", "plugin:prettier/recommended"], + "rules": { + "@typescript-eslint/restrict-plus-operands": "error", + "prettier/prettier": "error" + }, + // Eslint for HTML files + "overrides": [ + { + "files": ["*.html", "*.component.html"], + // We set parserOptions.project for the project to allow TypeScript to create the type-checker behind the scenes when we run linting + "parserOptions": { + "project": ["tsconfig.(app|spec).json"] + }, + "extends": [ + "plugin:@angular-eslint/template/recommended" + // "plugin:@angular-eslint/template/accessibility" //TODO: Look for a possible solution to add this option. + ], + "rules": { + "max-len": ["warn", { "code": 100 }] + } + }, + // Custom rules for TypeScript + { + "files": ["*.ts"], + "extends": [ + // Added base + "airbnb-base", + "airbnb-typescript/base", + // Added modern prettier + "prettier" + ], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "parser": "@typescript-eslint/parser", + "ecmaVersion": "latest", + "project": ["./tsconfig.eslint.json", "./tsconfig.json"] + }, + "rules": { + // Custom rules for typescript by Osmosys + "@typescript-eslint/no-explicit-any": "error", + "padding-line-between-statements": [ + "error", + { "blankLine": "always", "prev": "*", "next": "function" }, + { "blankLine": "always", "prev": "function", "next": "*" }, + { "blankLine": "always", "prev": "*", "next": "if" }, + { "blankLine": "always", "prev": "if", "next": "*" }, + { "blankLine": "always", "prev": "*", "next": "for" }, + { "blankLine": "always", "prev": "for", "next": "*" }, + { "blankLine": "always", "prev": "*", "next": "while" }, + { "blankLine": "always", "prev": "while", "next": "*" } + ], + "arrow-body-style": [ + "error", + "as-needed", + { + "requireReturnForObjectLiteral": false + } + ], + "@typescript-eslint/prefer-function-type": "error", + "@typescript-eslint/naming-convention": "error", + "capitalized-comments": [ + "off", + "never", + { + "line": { + "ignorePattern": ".*", + "ignoreInlineComments": true, + "ignoreConsecutiveComments": true + }, + "block": { + "ignorePattern": ".*", + "ignoreInlineComments": true, + "ignoreConsecutiveComments": true + } + } + ], + "spaced-comment": [ + "error", + "always", + { + "line": { + "exceptions": ["-", "+"], + "markers": ["=", "!", "/"] + }, + "block": { + "exceptions": ["-", "+"], + "markers": ["=", "!", ":", "::"], + "balanced": true + } + } + ], + "eol-last": ["error", "always"], + "guard-for-in": "error", + "no-restricted-imports": [ + "off", + { + "paths": [], + "patterns": [] + } + ], + "indent": [ + "error", + 2, + { + "SwitchCase": 1, + "VariableDeclarator": 1, + "outerIIFEBody": 1, + "FunctionDeclaration": { + "parameters": 1, + "body": 1 + }, + "FunctionExpression": { + "parameters": 1, + "body": 1 + }, + "CallExpression": { + "arguments": 1 + }, + "ArrayExpression": 1, + "ObjectExpression": 1, + "ImportDeclaration": 1, + "flatTernaryExpressions": false, + "ignoredNodes": [ + "JSXElement", + "JSXElement > *", + "JSXAttribute", + "JSXIdentifier", + "JSXNamespacedName", + "JSXMemberExpression", + "JSXSpreadAttribute", + "JSXExpressionContainer", + "JSXOpeningElement", + "JSXClosingElement", + "JSXFragment", + "JSXOpeningFragment", + "JSXClosingFragment", + "JSXText", + "JSXEmptyExpression", + "JSXSpreadChild" + ], + "ignoreComments": false + } + ], + "@typescript-eslint/consistent-type-definitions": "error", + "@typescript-eslint/explicit-member-accessibility": "off", + "@typescript-eslint/member-ordering": [ + "error", + { + "default": ["static-field", "instance-field", "static-method", "instance-method"] + } + ], + "no-empty-function": [ + "error", + { + "allow": ["arrowFunctions", "functions", "methods", "constructors"] + } + ], + "no-bitwise": "error", + "no-new-wrappers": "error", + "no-debugger": "error", + "constructor-super": "error", + "no-empty": "error", + "@typescript-eslint/no-empty-interface": "error", + "no-eval": "error", + "@typescript-eslint/no-inferrable-types": "error", + "@typescript-eslint/no-misused-new": "error", + "@typescript-eslint/no-non-null-assertion": "error", + "no-shadow": "off", + "@typescript-eslint/no-shadow": ["error"], + "dot-notation": [ + "error", + { + "allowKeywords": true + } + ], + "no-throw-literal": "error", + "no-fallthrough": "error", + "no-trailing-spaces": [ + "error", + { + "skipBlankLines": false, + "ignoreComments": false + } + ], + "no-undef-init": "error", + "no-unused-expressions": [ + "error", + { + "allowShortCircuit": false, + "allowTernary": false, + "allowTaggedTemplates": false + } + ], + "no-var": "error", + "sort-keys": [ + "off", + "asc", + { + "caseSensitive": false, + "natural": true + } + ], + "brace-style": [ + "error", + "1tbs", + { + "allowSingleLine": true + } + ], + "prefer-const": [ + "error", + { + "destructuring": "any", + "ignoreReadBeforeAssign": true + } + ], + "quotes": [ + "error", + "single", + { + "avoidEscape": true + } + ], + "radix": "error", + "eqeqeq": [ + "error", + "always", + { + "null": "ignore" + } + ], + "@typescript-eslint/type-annotation-spacing": "error", + "@typescript-eslint/unified-signatures": "error", + "no-multi-spaces": [ + "error", + { + "ignoreEOLComments": false + } + ], + "@angular-eslint/no-output-on-prefix": "error", + "@angular-eslint/no-inputs-metadata-property": "error", + "@angular-eslint/no-outputs-metadata-property": "error", + "@angular-eslint/no-host-metadata-property": "error", + "@angular-eslint/use-lifecycle-interface": "error", + "@angular-eslint/use-pipe-transform-interface": "error", + "@angular-eslint/component-class-suffix": "error", + "@angular-eslint/directive-class-suffix": "error", + "import/no-extraneous-dependencies": [ + "error", + { + "devDependencies": false, + "optionalDependencies": false, + "peerDependencies": false + } + ], + + // Additional Custom Rules + + "camelcase": [ + "error", + { + "properties": "never", + "ignoreDestructuring": false + } + ], + "comma-dangle": [ + "error", + { + "arrays": "always-multiline", + "objects": "always-multiline", + "imports": "always-multiline", + "exports": "always-multiline", + "functions": "always-multiline" + } + ], + "comma-spacing": [ + "error", + { + "before": false, + "after": true + } + ], + "default-param-last": "error", + + "func-call-spacing": ["error", "never"], + + "keyword-spacing": [ + "error", + { + "before": true, + "after": true, + "overrides": { + "return": { + "after": true + }, + "throw": { + "after": true + }, + "case": { + "after": true + } + } + } + ], + "lines-between-class-members": [ + "error", + "always", + { + "exceptAfterSingleLine": false + } + ], + "no-array-constructor": "error", + "no-dupe-class-members": "error", + + "no-extra-parens": [ + "off", + "all", + { + "conditionalAssign": true, + "nestedBinaryExpressions": false, + "returnAssign": false, + "ignoreJSX": "all", // delegate to eslint-plugin-react + "enforceForArrowConditionals": false + } + ], + "no-extra-semi": "error", + "no-implied-eval": "error", + "no-new-func": "error", + "no-loss-of-precision": "error", + "no-loop-func": "error", + "no-magic-numbers": [ + "off", + { + "ignore": [], + "ignoreArrayIndexes": true, + "enforceConst": true, + "detectObjects": false + } + ], + "no-redeclare": "error", + "space-before-blocks": "error", + + "no-unused-vars": [ + "error", + { + "vars": "all", + "args": "after-used", + "ignoreRestSiblings": true + } + ], + "no-use-before-define": [ + "error", + { + "functions": true, + "classes": true, + "variables": true + } + ], + "no-useless-constructor": "off", + "@typescript-eslint/no-useless-constructor": "error", + "semi": ["error", "always"], + "space-before-function-paren": [ + "error", + { + "anonymous": "always", + "named": "never", + "asyncArrow": "always" + } + ], + "require-await": "off", + "no-return-await": "error", + "space-infix-ops": "error", + "object-curly-spacing": ["error", "always"], + "import/prefer-default-export": "off" + } + }, + // Configuration for unit and e2e spec files + { + "files": ["*.spec.ts"], + "rules": { + "@typescript-eslint/no-unused-vars": "off" + } + }, + /** + * This extra piece of configuration is only necessary if you make use of inline + * templates within Component metadata, e.g.: + */ + { + "files": ["*.component.ts"], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaVersion": 2020, + "sourceType": "module" + }, + "plugins": ["@angular-eslint/template", "prettier"], + "processor": "@angular-eslint/template/extract-inline-html" + } + ] +} diff --git a/firebase.json b/firebase.json index f338071d..e0f4e518 100644 --- a/firebase.json +++ b/firebase.json @@ -7,12 +7,7 @@ { "source": "functions", "codebase": "default", - "ignore": [ - "node_modules", - ".git", - "firebase-debug.log", - "firebase-debug.*.log" - ], + "ignore": ["node_modules", ".git", "firebase-debug.log", "firebase-debug.*.log"], "predeploy": [ "npm --prefix \"$RESOURCE_DIR\" run lint", "npm --prefix \"$RESOURCE_DIR\" run build" @@ -21,11 +16,7 @@ ], "hosting": { "public": "www", - "ignore": [ - "firebase.json", - "**/.*", - "**/node_modules/**" - ], + "ignore": ["firebase.json", "**/.*", "**/node_modules/**"], "rewrites": [ { "source": "**", diff --git a/functions/.eslintrc.js b/functions/.eslintrc.js index ff21277a..fb2451ae 100644 --- a/functions/.eslintrc.js +++ b/functions/.eslintrc.js @@ -20,12 +20,9 @@ module.exports = { ignorePatterns: [ "/lib/**/*", // Ignore built files. ], - plugins: [ - "@typescript-eslint", - "import", - ], + plugins: ["@typescript-eslint", "import"], rules: { - "quotes": ["error", "double"], + quotes: ["error", "double"], "import/no-unresolved": 0, }, }; diff --git a/functions/src/index.ts b/functions/src/index.ts index 59fb6f9f..3f246b73 100644 --- a/functions/src/index.ts +++ b/functions/src/index.ts @@ -4,6 +4,6 @@ import * as functions from "firebase-functions"; // https://firebase.google.com/docs/functions/typescript // export const helloWorld = functions.https.onRequest((request, response) => { - functions.logger.info("Hello logs!", {structuredData: true}); + functions.logger.info("Hello logs!", { structuredData: true }); response.send("Hello from Firebase!"); }); diff --git a/functions/tsconfig.dev.json b/functions/tsconfig.dev.json index 7560eed4..c0f990d7 100644 --- a/functions/tsconfig.dev.json +++ b/functions/tsconfig.dev.json @@ -1,5 +1,3 @@ { - "include": [ - ".eslintrc.js" - ] + "include": [".eslintrc.js"] } diff --git a/functions/tsconfig.json b/functions/tsconfig.json index 7ce05d03..a9ed863a 100644 --- a/functions/tsconfig.json +++ b/functions/tsconfig.json @@ -9,7 +9,5 @@ "target": "es2017" }, "compileOnSave": true, - "include": [ - "src" - ] + "include": ["src"] } diff --git a/gulpfile.js b/gulpfile.js index 381e6812..5116415b 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,8 +1,6 @@ -var gulp = require('gulp'); -var gzip = require('gulp-gzip'); +var gulp = require("gulp"); +var gzip = require("gulp-gzip"); -gulp.task('compress', function() { - return gulp.src(['./www/**/*.*']) - .pipe(gzip()) - .pipe(gulp.dest('./www')); +gulp.task("compress", function () { + return gulp.src(["./www/**/*.*"]).pipe(gzip()).pipe(gulp.dest("./www")); }); diff --git a/karma.conf.js b/karma.conf.js index 611c27fb..9a55d417 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -3,14 +3,14 @@ module.exports = function (config) { config.set({ - basePath: '', - frameworks: ['jasmine', '@angular-devkit/build-angular'], + basePath: "", + frameworks: ["jasmine", "@angular-devkit/build-angular"], plugins: [ - require('karma-jasmine'), - require('karma-chrome-launcher'), - require('karma-jasmine-html-reporter'), - require('karma-coverage'), - require('@angular-devkit/build-angular/plugins/karma') + require("karma-jasmine"), + require("karma-chrome-launcher"), + require("karma-jasmine-html-reporter"), + require("karma-coverage"), + require("@angular-devkit/build-angular/plugins/karma"), ], client: { jasmine: { @@ -19,26 +19,23 @@ module.exports = function (config) { // for example, you can disable the random execution with `random: false` // or set a specific seed with `seed: 4321` }, - clearContext: false // leave Jasmine Spec Runner output visible in browser + clearContext: false, // leave Jasmine Spec Runner output visible in browser }, jasmineHtmlReporter: { - suppressAll: true // removes the duplicated traces + suppressAll: true, // removes the duplicated traces }, coverageReporter: { - dir: require('path').join(__dirname, './coverage/app'), - subdir: '.', - reporters: [ - { type: 'html' }, - { type: 'text-summary' } - ] + dir: require("path").join(__dirname, "./coverage/app"), + subdir: ".", + reporters: [{ type: "html" }, { type: "text-summary" }], }, - reporters: ['progress', 'kjhtml'], + reporters: ["progress", "kjhtml"], port: 9876, colors: true, logLevel: config.LOG_INFO, autoWatch: true, - browsers: ['Chrome'], + browsers: ["Chrome"], singleRun: false, - restartOnFileChange: true + restartOnFileChange: true, }); }; diff --git a/ngsw-config.json b/ngsw-config.json index 788b26b7..4cb051ac 100644 --- a/ngsw-config.json +++ b/ngsw-config.json @@ -6,13 +6,7 @@ "name": "app", "installMode": "prefetch", "resources": { - "files": [ - "/favicon.ico", - "/index.html", - "/manifest.webmanifest", - "/*.css", - "/*.js" - ] + "files": ["/favicon.ico", "/index.html", "/manifest.webmanifest", "/*.css", "/*.js"] } }, { @@ -20,10 +14,7 @@ "installMode": "prefetch", "updateMode": "prefetch", "resources": { - "files": [ - "/assets/**", - "/*.(svg|cur|jpg|jpeg|png|apng|webp|avif|gif|otf|ttf|woff|woff2)" - ] + "files": ["/assets/**", "/*.(svg|cur|jpg|jpeg|png|apng|webp|avif|gif|otf|ttf|woff|woff2)"] } } ] diff --git a/src/app/admin/admin-routing.module.ts b/src/app/admin/admin-routing.module.ts index b95ac3c5..948ae518 100644 --- a/src/app/admin/admin-routing.module.ts +++ b/src/app/admin/admin-routing.module.ts @@ -1,13 +1,13 @@ -import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; +import { NgModule } from "@angular/core"; +import { Routes, RouterModule } from "@angular/router"; -import { AdminPage } from './admin.page'; +import { AdminPage } from "./admin.page"; const routes: Routes = [ { - path: '', - component: AdminPage - } + path: "", + component: AdminPage, + }, ]; @NgModule({ diff --git a/src/app/admin/admin.module.ts b/src/app/admin/admin.module.ts index c8ac08fd..e0c6b8a3 100644 --- a/src/app/admin/admin.module.ts +++ b/src/app/admin/admin.module.ts @@ -1,21 +1,15 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { FormsModule, ReactiveFormsModule } from "@angular/forms"; -import { IonicModule } from '@ionic/angular'; +import { IonicModule } from "@ionic/angular"; -import { AdminPageRoutingModule } from './admin-routing.module'; +import { AdminPageRoutingModule } from "./admin-routing.module"; -import { AdminPage } from './admin.page'; +import { AdminPage } from "./admin.page"; @NgModule({ - imports: [ - CommonModule, - FormsModule, - IonicModule, - AdminPageRoutingModule, - ReactiveFormsModule - ], - declarations: [AdminPage] + imports: [CommonModule, FormsModule, IonicModule, AdminPageRoutingModule, ReactiveFormsModule], + declarations: [AdminPage], }) export class AdminPageModule {} diff --git a/src/app/admin/admin.page.html b/src/app/admin/admin.page.html index b160e7c1..33eb9e24 100644 --- a/src/app/admin/admin.page.html +++ b/src/app/admin/admin.page.html @@ -5,62 +5,126 @@ -
+

Set Resource

- +
- +
- +
- - +
- +
- +
- +
- - +
- +
- +
- Submit + + Submit + Reset
-
- diff --git a/src/app/admin/admin.page.spec.ts b/src/app/admin/admin.page.spec.ts index e7a088b0..78f9237e 100644 --- a/src/app/admin/admin.page.spec.ts +++ b/src/app/admin/admin.page.spec.ts @@ -1,16 +1,16 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { IonicModule } from '@ionic/angular'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { IonicModule } from "@ionic/angular"; -import { AdminPage } from './admin.page'; +import { AdminPage } from "./admin.page"; -describe('AdminPage', () => { +describe("AdminPage", () => { let component: AdminPage; let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ AdminPage ], - imports: [IonicModule.forRoot()] + declarations: [AdminPage], + imports: [IonicModule.forRoot()], }).compileComponents(); fixture = TestBed.createComponent(AdminPage); @@ -18,7 +18,7 @@ describe('AdminPage', () => { fixture.detectChanges(); })); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/admin/admin.page.ts b/src/app/admin/admin.page.ts index ded82109..046bc601 100644 --- a/src/app/admin/admin.page.ts +++ b/src/app/admin/admin.page.ts @@ -1,57 +1,59 @@ -import { DatePipe } from '@angular/common'; -import { Component, OnInit } from '@angular/core'; -import { serverTimestamp } from '@angular/fire/firestore'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { Router } from '@angular/router'; -import { CustomDate } from '../models/class/date/custom-date'; -import { SeoTags } from '../models/class/seoTags/seo'; -import { AlertService } from '../services/alert/alert.service'; -import { SeoService } from '../services/seo/seo.service'; -import { ResourceService } from '../services/resource/resource.service'; +import { DatePipe } from "@angular/common"; +import { Component, OnInit } from "@angular/core"; +import { serverTimestamp } from "@angular/fire/firestore"; +import { FormBuilder, FormGroup, Validators } from "@angular/forms"; +import { Router } from "@angular/router"; +import { CustomDate } from "../models/class/date/custom-date"; +import { SeoTags } from "../models/class/seoTags/seo"; +import { AlertService } from "../services/alert/alert.service"; +import { SeoService } from "../services/seo/seo.service"; +import { ResourceService } from "../services/resource/resource.service"; @Component({ - selector: 'app-admin', - templateUrl: './admin.page.html', - styleUrls: ['./admin.page.scss'], + selector: "app-admin", + templateUrl: "./admin.page.html", + styleUrls: ["./admin.page.scss"], }) export class AdminPage implements OnInit { - - - pageTitle = "Resource" - title = SeoTags.pageTitle.resourcePage - pageMetaTags = SeoTags.helpPageTags + pageTitle = "Resource"; + title = SeoTags.pageTitle.resourcePage; + pageMetaTags = SeoTags.helpPageTags; constructor( private seoService: SeoService, private fb: FormBuilder, private resourceService: ResourceService, private alertService: AlertService, private datePipe: DatePipe, - private router: Router) { } - dateToday: string | null = this.datePipe.transform(new Date(), 'yyyy-MM-dd'); + private router: Router, + ) {} + dateToday: string | null = this.datePipe.transform(new Date(), "yyyy-MM-dd"); resourceForm: FormGroup = this.fb.group({ createdAt: [serverTimestamp()], - date: [this.dateToday, [Validators.required, Validators.pattern('^[a-zA-Z 0-9 .,-]*$')]], - progress: [0, [Validators.required, Validators.pattern('^[0-9]*$'), Validators.max(100), Validators.min(0)]], - gTerm: ['Daily', [Validators.required, Validators.pattern('^[a-zA-Z0-9 ]*$')]], - type: ['Studies', [Validators.required, Validators.pattern('^[a-zA-Z0-9 ]*$')]], - title: ['', [Validators.required, Validators.pattern('^[a-zA-Z0-9, -.]*$')]], - reward: ['', [Validators.required, Validators.pattern('^[a-zA-Z0-9\n, -.]*$')]], - resource: ['', [Validators.required, Validators.pattern('^[a-zA-Z0-9\n, -.]*$')]], - description: ['', [Validators.required, Validators.pattern('^[a-zA-Z0-9\n, -.]*$')]], - actionSteps: ['', [Validators.required, Validators.pattern('^[a-zA-Z0-9\n, -.]*$')]], - penalty: ['', [Validators.required, Validators.pattern('^[a-zA-Z0-9\n, -.]*$')]], - updatedAt: [serverTimestamp()] - }) - resourceData:any; + date: [this.dateToday, [Validators.required, Validators.pattern("^[a-zA-Z 0-9 .,-]*$")]], + progress: [ + 0, + [Validators.required, Validators.pattern("^[0-9]*$"), Validators.max(100), Validators.min(0)], + ], + gTerm: ["Daily", [Validators.required, Validators.pattern("^[a-zA-Z0-9 ]*$")]], + type: ["Studies", [Validators.required, Validators.pattern("^[a-zA-Z0-9 ]*$")]], + title: ["", [Validators.required, Validators.pattern("^[a-zA-Z0-9, -.]*$")]], + reward: ["", [Validators.required, Validators.pattern("^[a-zA-Z0-9\n, -.]*$")]], + resource: ["", [Validators.required, Validators.pattern("^[a-zA-Z0-9\n, -.]*$")]], + description: ["", [Validators.required, Validators.pattern("^[a-zA-Z0-9\n, -.]*$")]], + actionSteps: ["", [Validators.required, Validators.pattern("^[a-zA-Z0-9\n, -.]*$")]], + penalty: ["", [Validators.required, Validators.pattern("^[a-zA-Z0-9\n, -.]*$")]], + updatedAt: [serverTimestamp()], + }); + resourceData: any; ngOnInit() { - this.seoService.seo(this.title, this.pageMetaTags) + this.seoService.seo(this.title, this.pageMetaTags); // this.resourceService.getResource().subscribe((res:any)=>{ // console.log(res); // this.resourceData=res // }) } - rewardError = "Only alphabets and numbers allowed" + rewardError = "Only alphabets and numbers allowed"; addResource() { // this.resourceService.addResource(this.resourceForm.value); @@ -60,23 +62,23 @@ export class AdminPage implements OnInit { let targetDate = this.dateToday; switch (this.resourceForm.value.gTerm) { case "Daily": - targetDate = this.dateToday + targetDate = this.dateToday; break; case "Tomorrow": - targetDate = new CustomDate().getDateTomorrow() ; + targetDate = new CustomDate().getDateTomorrow(); break; case "Short Term": - targetDate = "" + targetDate = ""; break; case "Long Term": - targetDate = "" + targetDate = ""; break; default: break; } this.resourceForm.patchValue({ - date: targetDate - }) + date: targetDate, + }); } } diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index d7bd7a30..8db849e6 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -1,72 +1,74 @@ -import { NgModule } from '@angular/core'; -import { PreloadAllModules, RouterModule, Routes } from '@angular/router'; +import { NgModule } from "@angular/core"; +import { PreloadAllModules, RouterModule, Routes } from "@angular/router"; -import { redirectUnauthorizedTo, redirectLoggedInTo, canActivate } from '@angular/fire/auth-guard'; +import { redirectUnauthorizedTo, redirectLoggedInTo, canActivate } from "@angular/fire/auth-guard"; -const redirectUnauthorizedToLogin = () => redirectUnauthorizedTo(['login']); -const redirectLoggedInToHome = () => redirectLoggedInTo(['home']); +const redirectUnauthorizedToLogin = () => redirectUnauthorizedTo(["login"]); +const redirectLoggedInToHome = () => redirectLoggedInTo(["home"]); const routes: Routes = [ { - path: '', - redirectTo: 'home', - pathMatch: 'full' + path: "", + redirectTo: "home", + pathMatch: "full", }, { - path: 'login', - loadChildren: () => import('./auth/pages/login/login.module').then(m => m.LoginPageModule), - ...canActivate(redirectLoggedInToHome) + path: "login", + loadChildren: () => import("./auth/pages/login/login.module").then((m) => m.LoginPageModule), + ...canActivate(redirectLoggedInToHome), }, { - path: 'home', - loadChildren: () => import('./pages/home/home.module').then(m => m.HomePageModule) + path: "home", + loadChildren: () => import("./pages/home/home.module").then((m) => m.HomePageModule), }, { - path: 'help', - loadChildren: () => import('./pages/help/help.module').then(m => m.HelpPageModule) + path: "help", + loadChildren: () => import("./pages/help/help.module").then((m) => m.HelpPageModule), }, { - path: 'about', - loadChildren: () => import('./pages/about/about.module').then(m => m.AboutPageModule) + path: "about", + loadChildren: () => import("./pages/about/about.module").then((m) => m.AboutPageModule), }, { - path: 'expenses', - loadChildren: () => import('./pages/expense/expenses.module').then(m => m.ExpensesPageModule), - ...canActivate(redirectUnauthorizedToLogin) + path: "expenses", + loadChildren: () => import("./pages/expense/expenses.module").then((m) => m.ExpensesPageModule), + ...canActivate(redirectUnauthorizedToLogin), }, { - path: 'profile', - loadChildren: () => import('./pages/profile/profile.module').then(m => m.ProfilePageModule), - ...canActivate(redirectUnauthorizedToLogin) + path: "profile", + loadChildren: () => import("./pages/profile/profile.module").then((m) => m.ProfilePageModule), + ...canActivate(redirectUnauthorizedToLogin), }, { - path: 'studies', - loadChildren: () => import('./pages/studies/studies.module').then(m => m.StudiesPageModule), - ...canActivate(redirectUnauthorizedToLogin) + path: "studies", + loadChildren: () => import("./pages/studies/studies.module").then((m) => m.StudiesPageModule), + ...canActivate(redirectUnauthorizedToLogin), }, { - path: 'achievement', - loadChildren: () => import('./pages/achievement/achievement.module').then(m => m.AchievementPageModule), - ...canActivate(redirectUnauthorizedToLogin) + path: "achievement", + loadChildren: () => + import("./pages/achievement/achievement.module").then((m) => m.AchievementPageModule), + ...canActivate(redirectUnauthorizedToLogin), }, { - path: 'time', - loadChildren: () => import('./pages/time/time.module').then(m => m.TimePageModule), - ...canActivate(redirectUnauthorizedToLogin) + path: "time", + loadChildren: () => import("./pages/time/time.module").then((m) => m.TimePageModule), + ...canActivate(redirectUnauthorizedToLogin), }, { - path: 'goal', - loadChildren: () => import('./pages/goal/goal.module').then(m => m.GoalPageModule), - ...canActivate(redirectUnauthorizedToLogin) + path: "goal", + loadChildren: () => import("./pages/goal/goal.module").then((m) => m.GoalPageModule), + ...canActivate(redirectUnauthorizedToLogin), }, { - path: 'goal', - loadChildren: () => import('./pages/goal/goal.module').then( m => m.GoalPageModule), - ...canActivate(redirectUnauthorizedToLogin) + path: "goal", + loadChildren: () => import("./pages/goal/goal.module").then((m) => m.GoalPageModule), + ...canActivate(redirectUnauthorizedToLogin), }, { - path: 'privacy-policy', - loadChildren: () => import('./pages/privacy-policy/privacy-policy.module').then( m => m.PrivacyPolicyPageModule) + path: "privacy-policy", + loadChildren: () => + import("./pages/privacy-policy/privacy-policy.module").then((m) => m.PrivacyPolicyPageModule), }, // { // path: 'admin', @@ -94,16 +96,14 @@ const routes: Routes = [ // ...canActivate(redirectUnauthorizedToLogin) // }, { - path: '**', - redirectTo: 'home', - pathMatch: 'full' - } + path: "**", + redirectTo: "home", + pathMatch: "full", + }, ]; @NgModule({ - imports: [ - RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules }) - ], - exports: [RouterModule] + imports: [RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })], + exports: [RouterModule], }) -export class AppRoutingModule { } +export class AppRoutingModule {} diff --git a/src/app/app.component.html b/src/app/app.component.html index e9553a8c..7db69b85 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -3,20 +3,40 @@ - - Summarize - Summarize helps you Rise + + Summarize + Summarize helps you Rise - - + + {{ p.title }} - - + + Logout diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts index 454694e6..8ce757d1 100644 --- a/src/app/app.component.spec.ts +++ b/src/app/app.component.spec.ts @@ -1,15 +1,12 @@ -import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; -import { TestBed } from '@angular/core/testing'; +import { CUSTOM_ELEMENTS_SCHEMA } from "@angular/core"; +import { TestBed } from "@angular/core/testing"; -import { RouterTestingModule } from '@angular/router/testing'; - -import { AppComponent } from './app.component'; - -describe('AppComponent', () => { +import { RouterTestingModule } from "@angular/router/testing"; +import { AppComponent } from "./app.component"; +describe("AppComponent", () => { beforeEach(async () => { - await TestBed.configureTestingModule({ declarations: [AppComponent], schemas: [CUSTOM_ELEMENTS_SCHEMA], @@ -17,30 +14,29 @@ describe('AppComponent', () => { }).compileComponents(); }); - it('should create the app', async () => { + it("should create the app", async () => { const fixture = TestBed.createComponent(AppComponent); const app = fixture.componentInstance; expect(app).toBeTruthy(); }); - it('should have menu labels', async () => { + it("should have menu labels", async () => { const fixture = TestBed.createComponent(AppComponent); fixture.detectChanges(); const app = fixture.nativeElement; - const menuItems = app.querySelectorAll('ion-label'); + const menuItems = app.querySelectorAll("ion-label"); expect(menuItems.length).toEqual(12); - expect(menuItems[0].textContent).toContain('Inbox'); - expect(menuItems[1].textContent).toContain('Outbox'); + expect(menuItems[0].textContent).toContain("Inbox"); + expect(menuItems[1].textContent).toContain("Outbox"); }); - it('should have urls', async () => { + it("should have urls", async () => { const fixture = TestBed.createComponent(AppComponent); fixture.detectChanges(); const app = fixture.nativeElement; - const menuItems = app.querySelectorAll('ion-item'); + const menuItems = app.querySelectorAll("ion-item"); expect(menuItems.length).toEqual(12); - expect(menuItems[0].getAttribute('ng-reflect-router-link')).toEqual('/folder/Inbox'); - expect(menuItems[1].getAttribute('ng-reflect-router-link')).toEqual('/folder/Outbox'); + expect(menuItems[0].getAttribute("ng-reflect-router-link")).toEqual("/folder/Inbox"); + expect(menuItems[1].getAttribute("ng-reflect-router-link")).toEqual("/folder/Outbox"); }); - }); diff --git a/src/app/app.component.ts b/src/app/app.component.ts index dfd7209a..809abc86 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,21 +1,21 @@ -import { Component, OnInit } from '@angular/core'; -import { NavigationEnd, Router } from '@angular/router'; -import { AuthService } from './auth/service/auth.service'; -import { StatusBar, Style } from '@capacitor/status-bar'; -import { isPlatform } from '@ionic/angular'; -import { GoogleTagManagerService } from 'angular-google-tag-manager'; -import { FirebaseService } from './services/firebase/firebase.service'; -import { ProfileService } from './services/profile/profile.service'; -import { SidenavService } from './services/sidenav/sidenav.service'; -import { Subscription } from 'rxjs'; +import { Component, OnInit } from "@angular/core"; +import { NavigationEnd, Router } from "@angular/router"; +import { AuthService } from "./auth/service/auth.service"; +import { StatusBar, Style } from "@capacitor/status-bar"; +import { isPlatform } from "@ionic/angular"; +import { GoogleTagManagerService } from "angular-google-tag-manager"; +import { FirebaseService } from "./services/firebase/firebase.service"; +import { ProfileService } from "./services/profile/profile.service"; +import { SidenavService } from "./services/sidenav/sidenav.service"; +import { Subscription } from "rxjs"; @Component({ - selector: 'app-root', - templateUrl: 'app.component.html', - styleUrls: ['app.component.scss'], + selector: "app-root", + templateUrl: "app.component.html", + styleUrls: ["app.component.scss"], }) export class AppComponent implements OnInit { isLoggedIn: any = false; - public appPages: any = [] + public appPages: any = []; public labels: any = []; versionNumber: number = 2.0; private loginStateSubscription: Subscription; @@ -23,45 +23,43 @@ export class AppComponent implements OnInit { private authService: AuthService, private router: Router, private gtmService: GoogleTagManagerService, - private profileService:ProfileService, - private sidenavService:SidenavService, - private firebaseService: FirebaseService - + private profileService: ProfileService, + private sidenavService: SidenavService, + private firebaseService: FirebaseService, ) { this.initGoogleTagManager(); - this.loginStateSubscription = this.authService.isLoggedIn$.subscribe(isLoggedIn => { + this.loginStateSubscription = this.authService.isLoggedIn$.subscribe((isLoggedIn) => { this.isLoggedIn = isLoggedIn; if (isLoggedIn) { - this.appPages= sidenavService.loggedInPages; + this.appPages = sidenavService.loggedInPages; this.sidenavService.setLoggedInPages(); // Update appPages with logged-in pages } else { - this.appPages=sidenavService.defaultPages; + this.appPages = sidenavService.defaultPages; this.sidenavService.setDefaultPages(); // Update appPages with default pages } }); } ngOnInit() { - if (isPlatform('mobile')) { - StatusBar.setBackgroundColor({ color: '#3880ff' }).catch(() => {}); + if (isPlatform("mobile")) { + StatusBar.setBackgroundColor({ color: "#3880ff" }).catch(() => {}); } this.firebaseService.getUserProfile(); this.getUser(); } - private initGoogleTagManager(): void { this.router.events.subscribe((event) => { try { if (event instanceof NavigationEnd) { const gtmTag = { - event: 'page', - pageName: event.urlAfterRedirects + event: "page", + pageName: event.urlAfterRedirects, }; this.gtmService.pushTag(gtmTag); } } catch (error) { - console.error('Error occurred in Google Tag Manager:', error); + console.error("Error occurred in Google Tag Manager:", error); } }); } @@ -70,10 +68,10 @@ export class AppComponent implements OnInit { let userProfile; try { userProfile = await this.firebaseService.getUserProfile(); - this.profileService.userData = userProfile + this.profileService.userData = userProfile; // console.log(userProfile); } catch (error) { - console.error('Error fetching user profile:', error); + console.error("Error fetching user profile:", error); } if (userProfile?.uid) { @@ -91,7 +89,7 @@ export class AppComponent implements OnInit { async logout() { await this.authService.logout(); this.appPages = this.sidenavService.defaultPages; - this.isLoggedIn=false; - this.router.navigateByUrl('login', { replaceUrl: true }); + this.isLoggedIn = false; + this.router.navigateByUrl("login", { replaceUrl: true }); } } diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 78c0e85f..c8afbf85 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -1,21 +1,21 @@ -import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; -import { BrowserModule } from '@angular/platform-browser'; -import { RouteReuseStrategy } from '@angular/router'; +import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from "@angular/core"; +import { BrowserModule } from "@angular/platform-browser"; +import { RouteReuseStrategy } from "@angular/router"; -import { IonicModule, IonicRouteStrategy } from '@ionic/angular'; +import { IonicModule, IonicRouteStrategy } from "@ionic/angular"; -import { AppComponent } from './app.component'; -import { AppRoutingModule } from './app-routing.module'; -import { ServiceWorkerModule } from '@angular/service-worker'; -import { environment } from '../environments/environment'; -import { provideAuth,getAuth } from '@angular/fire/auth'; -import { provideStorage,getStorage } from '@angular/fire/storage'; -import { initializeApp,provideFirebaseApp } from '@angular/fire/app'; -import { provideFirestore,getFirestore } from '@angular/fire/firestore'; -import { getDatabase, provideDatabase } from '@angular/fire/database'; -import { FIREBASE_OPTIONS } from '@angular/fire/compat'; -import { GoogleTagManagerModule } from 'angular-google-tag-manager'; -import { DatePipe } from '@angular/common'; +import { AppComponent } from "./app.component"; +import { AppRoutingModule } from "./app-routing.module"; +import { ServiceWorkerModule } from "@angular/service-worker"; +import { environment } from "../environments/environment"; +import { provideAuth, getAuth } from "@angular/fire/auth"; +import { provideStorage, getStorage } from "@angular/fire/storage"; +import { initializeApp, provideFirebaseApp } from "@angular/fire/app"; +import { provideFirestore, getFirestore } from "@angular/fire/firestore"; +import { getDatabase, provideDatabase } from "@angular/fire/database"; +import { FIREBASE_OPTIONS } from "@angular/fire/compat"; +import { GoogleTagManagerModule } from "angular-google-tag-manager"; +import { DatePipe } from "@angular/common"; @NgModule({ declarations: [AppComponent], @@ -23,11 +23,11 @@ import { DatePipe } from '@angular/common'; BrowserModule, IonicModule.forRoot(), AppRoutingModule, - ServiceWorkerModule.register('ngsw-worker.js', { + ServiceWorkerModule.register("ngsw-worker.js", { enabled: environment.production, // Register the ServiceWorker as soon as the application is stable // or after 30 seconds (whichever comes first). - registrationStrategy: 'registerWhenStable:30000' + registrationStrategy: "registerWhenStable:30000", }), provideFirebaseApp(() => initializeApp(environment.firebase)), provideAuth(() => getAuth()), @@ -36,14 +36,14 @@ import { DatePipe } from '@angular/common'; provideDatabase(() => getDatabase()), GoogleTagManagerModule.forRoot({ id: environment.GTM_ID, - }) + }), ], providers: [ { provide: RouteReuseStrategy, useClass: IonicRouteStrategy }, { provide: FIREBASE_OPTIONS, useValue: environment.firebase }, - DatePipe + DatePipe, ], - schemas:[CUSTOM_ELEMENTS_SCHEMA], + schemas: [CUSTOM_ELEMENTS_SCHEMA], bootstrap: [AppComponent], }) -export class AppModule { } +export class AppModule {} diff --git a/src/app/auth/guards/auth.guard.spec.ts b/src/app/auth/guards/auth.guard.spec.ts index 68889d22..30d30efe 100644 --- a/src/app/auth/guards/auth.guard.spec.ts +++ b/src/app/auth/guards/auth.guard.spec.ts @@ -1,8 +1,8 @@ -import { TestBed } from '@angular/core/testing'; +import { TestBed } from "@angular/core/testing"; -import { AuthGuard } from './auth.guard'; +import { AuthGuard } from "./auth.guard"; -describe('AuthGuard', () => { +describe("AuthGuard", () => { let guard: AuthGuard; beforeEach(() => { @@ -10,7 +10,7 @@ describe('AuthGuard', () => { guard = TestBed.inject(AuthGuard); }); - it('should be created', () => { + it("should be created", () => { expect(guard).toBeTruthy(); }); }); diff --git a/src/app/auth/guards/auth.guard.ts b/src/app/auth/guards/auth.guard.ts index c6a02d19..8fb9e3c7 100644 --- a/src/app/auth/guards/auth.guard.ts +++ b/src/app/auth/guards/auth.guard.ts @@ -1,43 +1,58 @@ -import { Injectable } from '@angular/core'; -import { ActivatedRouteSnapshot, Route, Router, RouterStateSnapshot, UrlSegment, UrlTree } from '@angular/router'; -import { Observable } from 'rxjs'; -import { AuthService } from '../service/auth.service'; +import { Injectable } from "@angular/core"; +import { + ActivatedRouteSnapshot, + Route, + Router, + RouterStateSnapshot, + UrlSegment, + UrlTree, +} from "@angular/router"; +import { Observable } from "rxjs"; +import { AuthService } from "../service/auth.service"; @Injectable({ - providedIn: 'root' + providedIn: "root", }) -export class AuthGuard { - constructor(private auth:AuthService, private router:Router){} +export class AuthGuard { + constructor( + private auth: AuthService, + private router: Router, + ) {} canActivate( route: ActivatedRouteSnapshot, - state: RouterStateSnapshot): Observable | Promise | boolean | UrlTree { - if (this.auth.isLogin) { - return true - } - else{ - this.router.navigate(['login']) - return false; - } + state: RouterStateSnapshot, + ): Observable | Promise | boolean | UrlTree { + if (this.auth.isLogin) { + return true; + } else { + this.router.navigate(["login"]); + return false; + } } canActivateChild( childRoute: ActivatedRouteSnapshot, - state: RouterStateSnapshot): Observable | Promise | boolean | UrlTree { + state: RouterStateSnapshot, + ): Observable | Promise | boolean | UrlTree { return true; } canDeactivate( component: unknown, currentRoute: ActivatedRouteSnapshot, currentState: RouterStateSnapshot, - nextState?: RouterStateSnapshot): Observable | Promise | boolean | UrlTree { + nextState?: RouterStateSnapshot, + ): Observable | Promise | boolean | UrlTree { return true; } canMatch( route: Route, - segments: UrlSegment[]): Observable | Promise | boolean | UrlTree { + segments: UrlSegment[], + ): Observable | Promise | boolean | UrlTree { return true; - }canLoad( + } + canLoad( route: Route, - segments: UrlSegment[]): Observable | Promise | boolean | UrlTree { + segments: UrlSegment[], + ): Observable | Promise | boolean | UrlTree { return true; } } diff --git a/src/app/auth/pages/login/login-routing.module.ts b/src/app/auth/pages/login/login-routing.module.ts index c7cbaaed..4e08283c 100644 --- a/src/app/auth/pages/login/login-routing.module.ts +++ b/src/app/auth/pages/login/login-routing.module.ts @@ -1,18 +1,18 @@ -import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; +import { NgModule } from "@angular/core"; +import { Routes, RouterModule } from "@angular/router"; -import { LoginPage } from './login.page'; -import { ResetPasswordComponent } from '../reset-password/reset-password.component'; +import { LoginPage } from "./login.page"; +import { ResetPasswordComponent } from "../reset-password/reset-password.component"; const routes: Routes = [ { - path: '', - component: LoginPage + path: "", + component: LoginPage, }, { - path: 'reset-password', - component: ResetPasswordComponent - } + path: "reset-password", + component: ResetPasswordComponent, + }, ]; @NgModule({ diff --git a/src/app/auth/pages/login/login.module.ts b/src/app/auth/pages/login/login.module.ts index 71bf48b6..77e80dd3 100644 --- a/src/app/auth/pages/login/login.module.ts +++ b/src/app/auth/pages/login/login.module.ts @@ -1,22 +1,16 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { FormsModule, ReactiveFormsModule } from "@angular/forms"; -import { IonicModule } from '@ionic/angular'; +import { IonicModule } from "@ionic/angular"; -import { LoginPageRoutingModule } from './login-routing.module'; +import { LoginPageRoutingModule } from "./login-routing.module"; -import { LoginPage } from './login.page'; -import { ResetPasswordComponent } from '../reset-password/reset-password.component'; +import { LoginPage } from "./login.page"; +import { ResetPasswordComponent } from "../reset-password/reset-password.component"; @NgModule({ - imports: [ - CommonModule, - FormsModule, - IonicModule, - ReactiveFormsModule, - LoginPageRoutingModule - ], - declarations: [LoginPage,ResetPasswordComponent] + imports: [CommonModule, FormsModule, IonicModule, ReactiveFormsModule, LoginPageRoutingModule], + declarations: [LoginPage, ResetPasswordComponent], }) export class LoginPageModule {} diff --git a/src/app/auth/pages/login/login.page.html b/src/app/auth/pages/login/login.page.html index 64cc9325..b97b4152 100644 --- a/src/app/auth/pages/login/login.page.html +++ b/src/app/auth/pages/login/login.page.html @@ -14,19 +14,28 @@
-

Welcome to Summarize!
- *Please Install before login. For installation guide (check here) +

+ Welcome to Summarize! +
+ + *Please Install before login. For installation guide ( + check here + ) +

Login with Google (Recommended)

- Login with Google - + + Login with Google +
-
-

Why use Google Login?

  1. More Secure
  2. @@ -79,13 +98,18 @@

    Error on Login / Sign Up?If there is no specific reason to use email, Try Login with Google.
  3. For Email based, if you already have an account, Create account will not work.
  4. If you don't have an account, Login will not work for you. Create an account first.
  5. -
  6. Verification of email is required in next step. Please use valid email, else account will be deleted in next 7 days.
  7. +
  8. + Verification of email is required in next step. Please use valid email, else account will be + deleted in next 7 days. +
-

Have doubts / questions about Summarize?

+

+ Have doubts / questions about Summarize? +

  1. How to install Summarize? : Visit our Help page.
  2. -
  3. Why should I use Summarize? : Visit About page
  4. +
  5. Why should I use Summarize? : Visit About page
  6. What is the purpose of this tool? : Check our pages and for details read About Page.
-
\ No newline at end of file + diff --git a/src/app/auth/pages/login/login.page.spec.ts b/src/app/auth/pages/login/login.page.spec.ts index e6f9aac0..3151bd4a 100644 --- a/src/app/auth/pages/login/login.page.spec.ts +++ b/src/app/auth/pages/login/login.page.spec.ts @@ -1,16 +1,16 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { IonicModule } from '@ionic/angular'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { IonicModule } from "@ionic/angular"; -import { LoginPage } from './login.page'; +import { LoginPage } from "./login.page"; -describe('LoginPage', () => { +describe("LoginPage", () => { let component: LoginPage; let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ LoginPage ], - imports: [IonicModule.forRoot()] + declarations: [LoginPage], + imports: [IonicModule.forRoot()], }).compileComponents(); fixture = TestBed.createComponent(LoginPage); @@ -18,7 +18,7 @@ describe('LoginPage', () => { fixture.detectChanges(); })); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/auth/pages/login/login.page.ts b/src/app/auth/pages/login/login.page.ts index af93af70..29bdffc3 100644 --- a/src/app/auth/pages/login/login.page.ts +++ b/src/app/auth/pages/login/login.page.ts @@ -1,21 +1,21 @@ -import { Component, OnInit } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { Router } from '@angular/router'; -import { AlertController, LoadingController } from '@ionic/angular'; -import { SeoTags } from 'src/app/models/class/seoTags/seo'; -import { SeoService } from 'src/app/services/seo/seo.service'; -import { AuthService } from '../../service/auth.service'; +import { Component, OnInit } from "@angular/core"; +import { FormBuilder, FormGroup, Validators } from "@angular/forms"; +import { Router } from "@angular/router"; +import { AlertController, LoadingController } from "@ionic/angular"; +import { SeoTags } from "src/app/models/class/seoTags/seo"; +import { SeoService } from "src/app/services/seo/seo.service"; +import { AuthService } from "../../service/auth.service"; @Component({ - selector: 'app-login', - templateUrl: './login.page.html', - styleUrls: ['./login.page.scss'] + selector: "app-login", + templateUrl: "./login.page.html", + styleUrls: ["./login.page.scss"], }) export class LoginPage implements OnInit { credentials!: FormGroup; pageTitle: string = "Login Page"; pageMetaTags = SeoTags.loginPageTags; - title = SeoTags.pageTitle.loginPage + title = SeoTags.pageTitle.loginPage; loginMode: boolean = true; // Indicates whether the user is in login or registration mode loginForm: FormGroup; registerForm: FormGroup; @@ -25,23 +25,23 @@ export class LoginPage implements OnInit { private alertController: AlertController, private authService: AuthService, private router: Router, - private seoService: SeoService - ) { } + private seoService: SeoService, + ) {} // Easy access for form fields get email() { - return this.credentials.get('email'); + return this.credentials.get("email"); } get password() { - return this.credentials.get('password'); + return this.credentials.get("password"); } get errorControl() { return this.credentials.controls; } ngOnInit() { - this.seoService.seo(this.title, this.pageMetaTags) + this.seoService.seo(this.title, this.pageMetaTags); // this.credentials = this.fb.group({ // email: ['', [Validators.required, Validators.email]], // password: ['', [Validators.required, Validators.minLength(6)]] @@ -50,14 +50,14 @@ export class LoginPage implements OnInit { } initForms() { this.loginForm = this.fb.group({ - email: ['', [Validators.required, Validators.email]], - password: ['', [Validators.required, Validators.minLength(6)]], + email: ["", [Validators.required, Validators.email]], + password: ["", [Validators.required, Validators.minLength(6)]], }); this.registerForm = this.fb.group({ - email: ['', [Validators.required, Validators.email]], - password: ['', [Validators.required, Validators.minLength(6)]], - verifyPassword: ['', Validators.required], + email: ["", [Validators.required, Validators.email]], + password: ["", [Validators.required, Validators.minLength(6)]], + verifyPassword: ["", Validators.required], }); } toggleMode() { @@ -71,8 +71,8 @@ export class LoginPage implements OnInit { } passwordsMatch(): boolean { - const password = this.registerForm.get('password').value; - const verifyPassword = this.registerForm.get('verifyPassword').value; + const password = this.registerForm.get("password").value; + const verifyPassword = this.registerForm.get("verifyPassword").value; return password === verifyPassword; } forgotPassword() { @@ -82,13 +82,16 @@ export class LoginPage implements OnInit { const loading = await this.loadingController.create(); await loading.present(); - const user = await this.authService.register(this.credentials.value.email, this.credentials.value.password); + const user = await this.authService.register( + this.credentials.value.email, + this.credentials.value.password, + ); await loading.dismiss(); if (user) { - this.router.navigateByUrl('/home', { replaceUrl: true }); + this.router.navigateByUrl("/home", { replaceUrl: true }); } else { - this.showAlert('Registration failed', 'Please try again!'); + this.showAlert("Registration failed", "Please try again!"); } } @@ -96,22 +99,28 @@ export class LoginPage implements OnInit { const loading = await this.loadingController.create(); await loading.present(); - const user = await this.authService.login(this.loginForm.value.email, this.loginForm.value.password); + const user = await this.authService.login( + this.loginForm.value.email, + this.loginForm.value.password, + ); await loading.dismiss(); if (user) { - this.router.navigateByUrl('/home', { replaceUrl: true }); + this.router.navigateByUrl("/home", { replaceUrl: true }); } else { - this.showAlert('Login failed', 'Please try again!'); + this.showAlert("Login failed", "Please try again!"); } } async loginWithGoogle() { - let user = await this.authService.googleSignin() + let user = await this.authService.googleSignin(); if (user !== (null || undefined)) { - this.showAlert('Login Success', 'Welcome to Summarize...\nNavigate Manually in case of delay.'); - this.router.navigateByUrl('/home', { replaceUrl: true }); + this.showAlert( + "Login Success", + "Welcome to Summarize...\nNavigate Manually in case of delay.", + ); + this.router.navigateByUrl("/home", { replaceUrl: true }); } else { - this.showAlert('Login failed', 'Please try again!'); + this.showAlert("Login failed", "Please try again!"); } } @@ -119,7 +128,7 @@ export class LoginPage implements OnInit { const alert = await this.alertController.create({ header, message, - buttons: ['OK'] + buttons: ["OK"], }); await alert.present(); } diff --git a/src/app/auth/pages/reset-password/reset-password.component.html b/src/app/auth/pages/reset-password/reset-password.component.html index 9bd384d5..e9c6559a 100644 --- a/src/app/auth/pages/reset-password/reset-password.component.html +++ b/src/app/auth/pages/reset-password/reset-password.component.html @@ -18,18 +18,28 @@
- + Reset Password

- Email will be sent only if provided email is valid and associated with any account on Summarize. + + Email will be sent only if provided email is valid and associated with any account on + Summarize. +

- In case of difficulty contact support team from Help & support page. + + In case of difficulty contact support team from + Help & support + page. +

- -
-
\ No newline at end of file + diff --git a/src/app/auth/pages/reset-password/reset-password.component.spec.ts b/src/app/auth/pages/reset-password/reset-password.component.spec.ts index 0d4b6dee..6663b158 100644 --- a/src/app/auth/pages/reset-password/reset-password.component.spec.ts +++ b/src/app/auth/pages/reset-password/reset-password.component.spec.ts @@ -1,16 +1,16 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { IonicModule } from '@ionic/angular'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { IonicModule } from "@ionic/angular"; -import { ResetPasswordComponent } from './reset-password.component'; +import { ResetPasswordComponent } from "./reset-password.component"; -describe('ResetPasswordComponent', () => { +describe("ResetPasswordComponent", () => { let component: ResetPasswordComponent; let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ ResetPasswordComponent ], - imports: [IonicModule.forRoot()] + declarations: [ResetPasswordComponent], + imports: [IonicModule.forRoot()], }).compileComponents(); fixture = TestBed.createComponent(ResetPasswordComponent); @@ -18,7 +18,7 @@ describe('ResetPasswordComponent', () => { fixture.detectChanges(); })); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/auth/pages/reset-password/reset-password.component.ts b/src/app/auth/pages/reset-password/reset-password.component.ts index b7889922..52ea20fb 100644 --- a/src/app/auth/pages/reset-password/reset-password.component.ts +++ b/src/app/auth/pages/reset-password/reset-password.component.ts @@ -1,35 +1,33 @@ -import { Component, OnInit } from '@angular/core'; -import { AuthService } from '../../service/auth.service'; -import { ToasterService } from 'src/app/services/toaster/toaster.service'; +import { Component, OnInit } from "@angular/core"; +import { AuthService } from "../../service/auth.service"; +import { ToasterService } from "src/app/services/toaster/toaster.service"; @Component({ - selector: 'app-reset-password', - templateUrl: './reset-password.component.html', - styleUrls: ['./reset-password.component.scss'], + selector: "app-reset-password", + templateUrl: "./reset-password.component.html", + styleUrls: ["./reset-password.component.scss"], }) export class ResetPasswordComponent { - pageTitle = 'Reset password'; - email:string; + pageTitle = "Reset password"; + email: string; constructor( private authService: AuthService, - private toaster: ToasterService + private toaster: ToasterService, ) {} - async resetPassword() { try { await this.authService.resetPassword(this.email); - this.toaster.showToast('Password reset email sent!',"success"); + this.toaster.showToast("Password reset email sent!", "success"); } catch (error) { console.log(error); - - if (error.code === 'auth/user-not-found') { - this.toaster.showToast('No user found with this email.', "warning"); + + if (error.code === "auth/user-not-found") { + this.toaster.showToast("No user found with this email.", "warning"); } else { - this.toaster.showToast('Error resetting password. Please try again.', "warning"); + this.toaster.showToast("Error resetting password. Please try again.", "warning"); } } } - } diff --git a/src/app/auth/service/auth.service.spec.ts b/src/app/auth/service/auth.service.spec.ts index f1251cac..0a6cb89e 100644 --- a/src/app/auth/service/auth.service.spec.ts +++ b/src/app/auth/service/auth.service.spec.ts @@ -1,8 +1,8 @@ -import { TestBed } from '@angular/core/testing'; +import { TestBed } from "@angular/core/testing"; -import { AuthService } from './auth.service'; +import { AuthService } from "./auth.service"; -describe('AuthService', () => { +describe("AuthService", () => { let service: AuthService; beforeEach(() => { @@ -10,7 +10,7 @@ describe('AuthService', () => { service = TestBed.inject(AuthService); }); - it('should be created', () => { + it("should be created", () => { expect(service).toBeTruthy(); }); }); diff --git a/src/app/auth/service/auth.service.ts b/src/app/auth/service/auth.service.ts index a1d408bc..c68b0663 100644 --- a/src/app/auth/service/auth.service.ts +++ b/src/app/auth/service/auth.service.ts @@ -1,26 +1,26 @@ -import { Injectable } from '@angular/core'; +import { Injectable } from "@angular/core"; import { Auth, signInWithEmailAndPassword, createUserWithEmailAndPassword, signOut, GoogleAuthProvider, -} from '@angular/fire/auth'; -import { AngularFireAuth } from '@angular/fire/compat/auth'; +} from "@angular/fire/auth"; +import { AngularFireAuth } from "@angular/fire/compat/auth"; import { AngularFirestore, AngularFirestoreCollection, AngularFirestoreDocument, -} from '@angular/fire/compat/firestore'; -import { Router } from '@angular/router'; -import { error } from 'console'; -import firebase from 'firebase/compat/app'; -import { Observable, map } from 'rxjs'; -import { User } from 'src/app/models/interface/user.model'; -import { ToasterService } from 'src/app/services/toaster/toaster.service'; +} from "@angular/fire/compat/firestore"; +import { Router } from "@angular/router"; +import { error } from "console"; +import firebase from "firebase/compat/app"; +import { Observable, map } from "rxjs"; +import { User } from "src/app/models/interface/user.model"; +import { ToasterService } from "src/app/services/toaster/toaster.service"; @Injectable({ - providedIn: 'root', + providedIn: "root", }) export class AuthService { isLogin: boolean = true; @@ -33,21 +33,17 @@ export class AuthService { private afs: AngularFirestore, private afAuth: AngularFireAuth, private router: Router, - private toaster:ToasterService + private toaster: ToasterService, ) { // Subscribe to authentication state changes this.isLoggedIn$ = this.afAuth.authState.pipe( - map((user) => !!user) // Convert user object to boolean (true if logged in, false if not) + map((user) => !!user), // Convert user object to boolean (true if logged in, false if not) ); } async register(email: any, password: any) { try { - const user = await createUserWithEmailAndPassword( - this.auth, - email, - password - ); + const user = await createUserWithEmailAndPassword(this.auth, email, password); this.updateUserData(user.user); return user; } catch (e) { @@ -57,40 +53,36 @@ export class AuthService { async login(email: string, password: string) { try { - const userCredential = await signInWithEmailAndPassword( - this.auth, - email, - password - ); + const userCredential = await signInWithEmailAndPassword(this.auth, email, password); const user = userCredential.user; await this.getEmailBasedUser(user); - localStorage.setItem('user', JSON.stringify(user)); + localStorage.setItem("user", JSON.stringify(user)); this.isLogin = true; - this.toaster.showToast("Login Success!","success") + this.toaster.showToast("Login Success!", "success"); return user; } catch (error) { const errorCode = error.code; - let errorMessage = 'An error occurred. Please try again.'; + let errorMessage = "An error occurred. Please try again."; switch (errorCode) { case "auth/invalid-login-credentials": - errorMessage = "Invalid credentials" + errorMessage = "Invalid credentials"; break; - case 'auth/user-not-found': - errorMessage = 'User not found. Please check your email.'; + case "auth/user-not-found": + errorMessage = "User not found. Please check your email."; break; - case 'auth/wrong-password': - errorMessage = 'Invalid password. Please try again.'; + case "auth/wrong-password": + errorMessage = "Invalid password. Please try again."; break; - case 'auth/invalid-email': - errorMessage = 'Invalid email address. Please enter a valid email.'; + case "auth/invalid-email": + errorMessage = "Invalid email address. Please enter a valid email."; break; default: - errorMessage =" Unknown error occurred" + errorMessage = " Unknown error occurred"; break; } - this.toaster.showToast(errorMessage,"danger") + this.toaster.showToast(errorMessage, "danger"); return null; } } @@ -137,7 +129,7 @@ export class AuthService { const data = JSON.parse(JSON.stringify(user)); userRef.set(data, { merge: true }); } - localStorage.setItem('UserData', JSON.stringify(user)); + localStorage.setItem("UserData", JSON.stringify(user)); }); } else if (userRef.get() === undefined) { userRef.set(user, { merge: true }); @@ -156,8 +148,8 @@ export class AuthService { const data = JSON.parse(JSON.stringify(user)); userRef.set(data, { merge: true }); } - localStorage.setItem('UserData', JSON.stringify(user)); - this.router.navigateByUrl('/home', { replaceUrl: true }); + localStorage.setItem("UserData", JSON.stringify(user)); + this.router.navigateByUrl("/home", { replaceUrl: true }); }); } else { userRef.set(data, { merge: true }); diff --git a/src/app/folder/folder-routing.module.ts b/src/app/folder/folder-routing.module.ts index 200d4407..98af6fa8 100644 --- a/src/app/folder/folder-routing.module.ts +++ b/src/app/folder/folder-routing.module.ts @@ -1,13 +1,13 @@ -import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; +import { NgModule } from "@angular/core"; +import { Routes, RouterModule } from "@angular/router"; -import { FolderPage } from './folder.page'; +import { FolderPage } from "./folder.page"; const routes: Routes = [ { - path: '', - component: FolderPage - } + path: "", + component: FolderPage, + }, ]; @NgModule({ diff --git a/src/app/folder/folder.module.ts b/src/app/folder/folder.module.ts index 172c9f81..742f3e35 100644 --- a/src/app/folder/folder.module.ts +++ b/src/app/folder/folder.module.ts @@ -1,20 +1,15 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { FormsModule } from '@angular/forms'; +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { FormsModule } from "@angular/forms"; -import { IonicModule } from '@ionic/angular'; +import { IonicModule } from "@ionic/angular"; -import { FolderPageRoutingModule } from './folder-routing.module'; +import { FolderPageRoutingModule } from "./folder-routing.module"; -import { FolderPage } from './folder.page'; +import { FolderPage } from "./folder.page"; @NgModule({ - imports: [ - CommonModule, - FormsModule, - IonicModule, - FolderPageRoutingModule - ], - declarations: [FolderPage] + imports: [CommonModule, FormsModule, IonicModule, FolderPageRoutingModule], + declarations: [FolderPage], }) export class FolderPageModule {} diff --git a/src/app/folder/folder.page.html b/src/app/folder/folder.page.html index 39aaa6a0..1228537f 100644 --- a/src/app/folder/folder.page.html +++ b/src/app/folder/folder.page.html @@ -16,6 +16,15 @@
{{ folder }} -

Explore UI Components

+

+ Explore + + UI Components + +

diff --git a/src/app/folder/folder.page.spec.ts b/src/app/folder/folder.page.spec.ts index 898ea87f..4af9106d 100644 --- a/src/app/folder/folder.page.spec.ts +++ b/src/app/folder/folder.page.spec.ts @@ -1,17 +1,17 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { RouterModule } from '@angular/router'; -import { IonicModule } from '@ionic/angular'; +import { ComponentFixture, TestBed } from "@angular/core/testing"; +import { RouterModule } from "@angular/router"; +import { IonicModule } from "@ionic/angular"; -import { FolderPage } from './folder.page'; +import { FolderPage } from "./folder.page"; -describe('FolderPage', () => { +describe("FolderPage", () => { let component: FolderPage; let fixture: ComponentFixture; beforeEach(async () => { await TestBed.configureTestingModule({ declarations: [FolderPage], - imports: [IonicModule.forRoot(), RouterModule.forRoot([])] + imports: [IonicModule.forRoot(), RouterModule.forRoot([])], }).compileComponents(); fixture = TestBed.createComponent(FolderPage); @@ -19,7 +19,7 @@ describe('FolderPage', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/folder/folder.page.ts b/src/app/folder/folder.page.ts index 0cbdba64..279865b5 100644 --- a/src/app/folder/folder.page.ts +++ b/src/app/folder/folder.page.ts @@ -1,18 +1,17 @@ -import { Component, OnInit } from '@angular/core'; -import { ActivatedRoute } from '@angular/router'; +import { Component, OnInit } from "@angular/core"; +import { ActivatedRoute } from "@angular/router"; @Component({ - selector: 'app-folder', - templateUrl: './folder.page.html', - styleUrls: ['./folder.page.scss'], + selector: "app-folder", + templateUrl: "./folder.page.html", + styleUrls: ["./folder.page.scss"], }) export class FolderPage implements OnInit { - public folder:any; + public folder: any; - constructor(private activatedRoute: ActivatedRoute) { } + constructor(private activatedRoute: ActivatedRoute) {} ngOnInit() { - this.folder = this.activatedRoute.snapshot.paramMap.get('id'); + this.folder = this.activatedRoute.snapshot.paramMap.get("id"); } - } diff --git a/src/app/models/class/date/custom-date.spec.ts b/src/app/models/class/date/custom-date.spec.ts index cef58de4..8ce3f2c4 100644 --- a/src/app/models/class/date/custom-date.spec.ts +++ b/src/app/models/class/date/custom-date.spec.ts @@ -1,7 +1,7 @@ -import { CustomDate } from './custom-date'; +import { CustomDate } from "./custom-date"; -describe('CustomDate', () => { - it('should create an instance', () => { +describe("CustomDate", () => { + it("should create an instance", () => { expect(new CustomDate()).toBeTruthy(); }); }); diff --git a/src/app/models/class/date/custom-date.ts b/src/app/models/class/date/custom-date.ts index 30d6afcf..2bc31642 100644 --- a/src/app/models/class/date/custom-date.ts +++ b/src/app/models/class/date/custom-date.ts @@ -1,71 +1,67 @@ export class CustomDate { - constructor() { } - public dateToday: any = this.getDateToday() + constructor() {} + public dateToday: any = this.getDateToday(); getDateToday() { - const year = new Date().getFullYear() - const date = new Date().getDate() + const year = new Date().getFullYear(); + const date = new Date().getDate(); let month = new Date().getMonth() + 1; - let value = "" + let value = ""; if (month < 10) { - value = year + "-0" + month + "-" + date + value = year + "-0" + month + "-" + date; + } else { + value = year + "-" + month + "-" + date; } - else { - value = year + "-" + month + "-" + date - } - return value + return value; } getWeekBackDate() { var date = new Date(); - var last = new Date(date.getTime() - (7 * 24 * 60 * 60 * 1000)); - return last + var last = new Date(date.getTime() - 7 * 24 * 60 * 60 * 1000); + return last; } getLastMonthDate() { var date = new Date(); - var last = new Date(date.getTime() - (30 * 24 * 60 * 60 * 1000)); - return last + var last = new Date(date.getTime() - 30 * 24 * 60 * 60 * 1000); + return last; } getLastYearDate() { var date = new Date(); - var last = new Date(date.getTime() - (365 * 24 * 60 * 60 * 1000)); - return last + var last = new Date(date.getTime() - 365 * 24 * 60 * 60 * 1000); + return last; } - getThisYear(){ - return new Date().getFullYear() + "-01" + "-01" + getThisYear() { + return new Date().getFullYear() + "-01" + "-01"; } - getThisMonth(){ - const year = new Date().getFullYear() + getThisMonth() { + const year = new Date().getFullYear(); let month = new Date().getMonth() + 1; - let value = "" + let value = ""; if (month < 10) { - value = year + "-0" + month + "-01" - } - else { - value = year + "-" + month + "-01" + value = year + "-0" + month + "-01"; + } else { + value = year + "-" + month + "-01"; } - return value + return value; } - getCurrentMonth(){ - const year = new Date().getFullYear() + getCurrentMonth() { + const year = new Date().getFullYear(); let month = new Date().getMonth() + 1; - let value = "" + let value = ""; if (month < 10) { value = year + "-0" + month; - } - else { + } else { value = year + "-" + month; } - return value + return value; } - getDateTomorrow(){ + getDateTomorrow() { const tomorrow = new Date(); tomorrow.setDate(tomorrow.getDate() + 1); - const dd = String(tomorrow.getDate()).padStart(2, '0'); - const mm = String(tomorrow.getMonth() + 1).padStart(2, '0'); + const dd = String(tomorrow.getDate()).padStart(2, "0"); + const mm = String(tomorrow.getMonth() + 1).padStart(2, "0"); const yyyy = tomorrow.getFullYear(); const tomorrowDate = `${yyyy}-${mm}-${dd}`; return tomorrowDate; } - } diff --git a/src/app/models/class/masterData/master-data.spec.ts b/src/app/models/class/masterData/master-data.spec.ts index a4ca5e9f..ea4d7779 100644 --- a/src/app/models/class/masterData/master-data.spec.ts +++ b/src/app/models/class/masterData/master-data.spec.ts @@ -1,7 +1,7 @@ -import { MasterData } from './master-data'; +import { MasterData } from "./master-data"; -describe('MasterData', () => { - it('should create an instance', () => { +describe("MasterData", () => { + it("should create an instance", () => { expect(new MasterData()).toBeTruthy(); }); }); diff --git a/src/app/models/class/masterData/master-data.ts b/src/app/models/class/masterData/master-data.ts index 2a83994a..da92eca4 100644 --- a/src/app/models/class/masterData/master-data.ts +++ b/src/app/models/class/masterData/master-data.ts @@ -1,36 +1,36 @@ import { Features } from "../../interface/masterData.model"; export class MasterData { - public static features:Features[] =[ + public static features: Features[] = [ { - title:"Expenses", - icon:"cash", - color:"success", - path:"expenses" + title: "Expenses", + icon: "cash", + color: "success", + path: "expenses", }, { - title:"Goal", - icon:"bulb", - color:"secondary", - path:"goal" + title: "Goal", + icon: "bulb", + color: "secondary", + path: "goal", }, { - title:"Studies", - icon:"book", - color:"tertiary", - path:"studies" + title: "Studies", + icon: "book", + color: "tertiary", + path: "studies", }, { - title:"Time", - icon:"hourglass", - color:"danger", - path:"time" + title: "Time", + icon: "hourglass", + color: "danger", + path: "time", }, { - title:"Achievements", - icon:"trophy", - color:"warning", - path:"achievement" - } - ] + title: "Achievements", + icon: "trophy", + color: "warning", + path: "achievement", + }, + ]; } diff --git a/src/app/models/class/seoTags/seo.spec.ts b/src/app/models/class/seoTags/seo.spec.ts index 2a711416..081aefb4 100644 --- a/src/app/models/class/seoTags/seo.spec.ts +++ b/src/app/models/class/seoTags/seo.spec.ts @@ -1,7 +1,7 @@ -import { SeoTags } from './seo'; +import { SeoTags } from "./seo"; -describe('Seo', () => { - it('should create an instance', () => { +describe("Seo", () => { + it("should create an instance", () => { expect(new SeoTags()).toBeTruthy(); }); }); diff --git a/src/app/models/class/seoTags/seo.ts b/src/app/models/class/seoTags/seo.ts index bf912750..0f156c42 100644 --- a/src/app/models/class/seoTags/seo.ts +++ b/src/app/models/class/seoTags/seo.ts @@ -1,75 +1,86 @@ import { seoMetaTag } from "../../interface/masterData.model"; export class SeoTags { - public static pageTitle:any={ - homePage:"Summarize : Record, Analyze and Rise | Dashboard", - loginPage:"Login | Sign up now and stay organized with Summarize", - aboutPage:"About Summarize : What it is? Why and How to use?", - helpPage:"Need Help to install Summarize | Reach out to us | FAQ", - goalPage:"Create Goals, manage and achieve them with consistency", - studiesPage:"", - timePage:"Log, Analyze and Manage your time effectively" - } + public static pageTitle: any = { + homePage: "Summarize : Record, Analyze and Rise | Dashboard", + loginPage: "Login | Sign up now and stay organized with Summarize", + aboutPage: "About Summarize : What it is? Why and How to use?", + helpPage: "Need Help to install Summarize | Reach out to us | FAQ", + goalPage: "Create Goals, manage and achieve them with consistency", + studiesPage: "", + timePage: "Log, Analyze and Manage your time effectively", + }; public static homePageTags: seoMetaTag[] = [ { - name:'description', - content:"Summarize (summarize-ng web app) help users manage their achievements, money, time, and studies effectively. Install on any device and boost your productivity." + name: "description", + content: + "Summarize (summarize-ng web app) help users manage their achievements, money, time, and studies effectively. Install on any device and boost your productivity.", }, { - name:'keywords', - content:'Summarize, summarize-ng, Money management, Budgeting, Financial goals, Expense tracking, Time management, Study management, Productivity, Goal setting, Organizational tools, Personal finance, Study planner, Study materials, Study schedule, Study progress, Study tracker, Study management app' - } + name: "keywords", + content: + "Summarize, summarize-ng, Money management, Budgeting, Financial goals, Expense tracking, Time management, Study management, Productivity, Goal setting, Organizational tools, Personal finance, Study planner, Study materials, Study schedule, Study progress, Study tracker, Study management app", + }, ]; public static aboutPageTags: seoMetaTag[] = [ { - name:'description', - content:"Tempting advertisement and deals makes you to spend more money and time to purchase and use their product/service. Summarize helps you in managing achievement, studies, expenses, time and spend only on needs for better savings." + name: "description", + content: + "Tempting advertisement and deals makes you to spend more money and time to purchase and use their product/service. Summarize helps you in managing achievement, studies, expenses, time and spend only on needs for better savings.", }, { - name:'keywords', - content:'Summarize, summarize-ng, Money management, Budgeting, Financial goals, Expense tracking, Time management, Study management, Productivity, Goal setting, Organizational tools, Personal finance, Study planner, Study materials, Study schedule, Study progress, Study notes, Study reminders, Study rewards, Study reports, Study tracker, Study management app' - } + name: "keywords", + content: + "Summarize, summarize-ng, Money management, Budgeting, Financial goals, Expense tracking, Time management, Study management, Productivity, Goal setting, Organizational tools, Personal finance, Study planner, Study materials, Study schedule, Study progress, Study notes, Study reminders, Study rewards, Study reports, Study tracker, Study management app", + }, ]; public static helpPageTags: seoMetaTag[] = [ { - name:'description', - content:"Need help to install Summarize (summarize-ng.web.app) on PC ( Windows / MAC / Linux all-distro ),Install on Android, Install on IOS, Update Summarize." + name: "description", + content: + "Need help to install Summarize (summarize-ng.web.app) on PC ( Windows / MAC / Linux all-distro ),Install on Android, Install on IOS, Update Summarize.", }, { - name:'keywords', - content:'Summarize, summarize-ng , time management, money management, expense management, study assistant , digital dairy,iam5k, IAM5K, Sandeep Kumar' - } + name: "keywords", + content: + "Summarize, summarize-ng , time management, money management, expense management, study assistant , digital dairy,iam5k, IAM5K, Sandeep Kumar", + }, ]; public static loginPageTags: seoMetaTag[] = [ { - name:'description', - content:"Login or Sign up now to Summarize (summarize-ng.web.app) now. With its user-friendly interface and secure login, Simplify time, money, achievement, and study management. Easily track progress, set goals, and stay organized. " + name: "description", + content: + "Login or Sign up now to Summarize (summarize-ng.web.app) now. With its user-friendly interface and secure login, Simplify time, money, achievement, and study management. Easily track progress, set goals, and stay organized. ", }, { - name:'keywords', - content:'Summarize, Summarize, arise, arize, money management, expense management, cost analysis,summarize-ng, summarize-ng, digital dairy, expense analysis' - } + name: "keywords", + content: + "Summarize, Summarize, arise, arize, money management, expense management, cost analysis,summarize-ng, summarize-ng, digital dairy, expense analysis", + }, ]; public static studiesPageTags: seoMetaTag[] = [ { - name: 'description', - content: "Summarize (summarize-ng web app) helps users manage their studies efficiently. Stay organized, track progress, and boost productivity with our study management tools." + name: "description", + content: + "Summarize (summarize-ng web app) helps users manage their studies efficiently. Stay organized, track progress, and boost productivity with our study management tools.", }, { - name: 'keywords', - content: 'Summarize, summarize-ng, Study management, Study planner, Study materials, Study schedule, Study progress, Study tracker, Productivity, Educational tools, Time management, Organization, Learning app' - } + name: "keywords", + content: + "Summarize, summarize-ng, Study management, Study planner, Study materials, Study schedule, Study progress, Study tracker, Productivity, Educational tools, Time management, Organization, Learning app", + }, ]; - + public static timePageTags: seoMetaTag[] = [ { - name: 'description', - content: "Efficient time management is crucial for success. With Summarize (summarize-ng web app), prioritize tasks, track time usage, and enhance productivity across all your endeavors." + name: "description", + content: + "Efficient time management is crucial for success. With Summarize (summarize-ng web app), prioritize tasks, track time usage, and enhance productivity across all your endeavors.", }, { - name: 'keywords', - content: 'Summarize, summarize-ng, Time management, Task prioritization, Productivity tools, Time tracking, Schedule optimization, Efficiency, Organizational tools, Goal setting, Study management, Study planner, Study progress' - } + name: "keywords", + content: + "Summarize, summarize-ng, Time management, Task prioritization, Productivity tools, Time tracking, Schedule optimization, Efficiency, Organizational tools, Goal setting, Study management, Study planner, Study progress", + }, ]; - } diff --git a/src/app/models/class/static/goal.spec.ts b/src/app/models/class/static/goal.spec.ts index 9722f3b1..2b11c4c7 100644 --- a/src/app/models/class/static/goal.spec.ts +++ b/src/app/models/class/static/goal.spec.ts @@ -1,7 +1,7 @@ -import { GoalData } from './goal'; +import { GoalData } from "./goal"; -describe('Goal', () => { - it('should create an instance', () => { +describe("Goal", () => { + it("should create an instance", () => { expect(new GoalData()).toBeTruthy(); }); }); diff --git a/src/app/models/class/static/goal.ts b/src/app/models/class/static/goal.ts index 7a98aec1..d7794eec 100644 --- a/src/app/models/class/static/goal.ts +++ b/src/app/models/class/static/goal.ts @@ -1,203 +1,238 @@ import { DataDescription, Options } from "../../interface/masterData.model"; export class GoalData { - public static goalType:Options[]=[ + public static goalType: Options[] = [ { - title:'Daily', - value:'Daily' + title: "Daily", + value: "Daily", }, { - title:'Tomorrow', - value:'Tomorrow' + title: "Tomorrow", + value: "Tomorrow", }, { - title:'Short Term', - value:'Short Term' + title: "Short Term", + value: "Short Term", }, { - title:'Long Term', - value:'Long Term' - } - ] + title: "Long Term", + value: "Long Term", + }, + ]; - public static goalFor:Options[]=[ - { title: 'Adventure', value: 'Adventure' }, - { title: 'Business', value: 'Business' }, - { title: 'Career', value: 'Career' }, - { title: 'Contribution', value: 'Contribution' }, - { title: 'Creativity', value: 'Creativity' }, - { title: 'Discipline', value: 'Discipline' }, - { title: 'Donation', value: 'Donation' }, - { title: 'Education', value: 'Education' }, - { title: 'Emotional Well-being', value: 'Emotional Well-being' }, - { title: 'Environment', value: 'Environment' }, - { title: 'Finance', value: 'Finance' }, - { title: 'Health', value: 'Health' }, - { title: 'Home', value: 'Home' }, - { title: 'Language Learning', value: 'Language Learning' }, - { title: 'Organization', value: 'Organization' }, - { title: 'Personal Development', value: 'Personal Development' }, - { title: 'Productivity', value: 'Productivity' }, - { title: 'Relationship', value: 'Relationship' }, - { title: 'Social Connections', value: 'Social Connections' }, - { title: 'Skills Development', value: 'Skills Development' }, - { title: 'Spirituality', value: 'Spirituality' }, - { title: 'Sport', value: 'Sport' }, - { title: 'Studies', value: 'Studies' }, - { title: 'Time Management', value: 'Time Management' }, - { title: 'Travel', value: 'Travel' }, - { title: 'Well-being', value: 'Well-being' }, - { title: 'Work', value: 'Work' } - ] + public static goalFor: Options[] = [ + { title: "Adventure", value: "Adventure" }, + { title: "Business", value: "Business" }, + { title: "Career", value: "Career" }, + { title: "Contribution", value: "Contribution" }, + { title: "Creativity", value: "Creativity" }, + { title: "Discipline", value: "Discipline" }, + { title: "Donation", value: "Donation" }, + { title: "Education", value: "Education" }, + { title: "Emotional Well-being", value: "Emotional Well-being" }, + { title: "Environment", value: "Environment" }, + { title: "Finance", value: "Finance" }, + { title: "Health", value: "Health" }, + { title: "Home", value: "Home" }, + { title: "Language Learning", value: "Language Learning" }, + { title: "Organization", value: "Organization" }, + { title: "Personal Development", value: "Personal Development" }, + { title: "Productivity", value: "Productivity" }, + { title: "Relationship", value: "Relationship" }, + { title: "Social Connections", value: "Social Connections" }, + { title: "Skills Development", value: "Skills Development" }, + { title: "Spirituality", value: "Spirituality" }, + { title: "Sport", value: "Sport" }, + { title: "Studies", value: "Studies" }, + { title: "Time Management", value: "Time Management" }, + { title: "Travel", value: "Travel" }, + { title: "Well-being", value: "Well-being" }, + { title: "Work", value: "Work" }, + ]; - public static goalDetails:DataDescription[]=[ + public static goalDetails: DataDescription[] = [ { - title: 'Adventure', - description: 'Embrace exciting and daring experiences, explore the unknown, and seek thrilling journeys that push your boundaries.' + title: "Adventure", + description: + "Embrace exciting and daring experiences, explore the unknown, and seek thrilling journeys that push your boundaries.", }, { - title: 'Business', - description: 'Focus on entrepreneurial endeavors, managing and growing enterprises, and creating value in the corporate world.' + title: "Business", + description: + "Focus on entrepreneurial endeavors, managing and growing enterprises, and creating value in the corporate world.", }, { - title: 'Career', - description: 'Set goals and work towards advancing your profession, achieving success, and finding fulfillment in your chosen vocation.' + title: "Career", + description: + "Set goals and work towards advancing your profession, achieving success, and finding fulfillment in your chosen vocation.", }, { - title: 'Contribution', - description: 'Make a positive impact by actively giving back to society, volunteering, and supporting meaningful causes.' + title: "Contribution", + description: + "Make a positive impact by actively giving back to society, volunteering, and supporting meaningful causes.", }, { - title: 'Creativity', - description: 'Express your imagination and originality through various artistic forms, unleashing your innovative and inventive potential.' + title: "Creativity", + description: + "Express your imagination and originality through various artistic forms, unleashing your innovative and inventive potential.", }, { - title: 'Discipline', - description: 'Cultivate self-control, adhere to structured routines, and stay committed to achieving your goals through focused effort.' + title: "Discipline", + description: + "Cultivate self-control, adhere to structured routines, and stay committed to achieving your goals through focused effort.", }, { - title: 'Donation', - description: 'Generously give resources, money, or time to support charitable organizations and make a difference in the lives of others.' + title: "Donation", + description: + "Generously give resources, money, or time to support charitable organizations and make a difference in the lives of others.", }, { - title: 'Education', - description: 'Pursue knowledge and intellectual growth through formal learning, gaining expertise, and expanding your understanding.' + title: "Education", + description: + "Pursue knowledge and intellectual growth through formal learning, gaining expertise, and expanding your understanding.", }, { - title: 'Emotional Well-being', - description: 'Nurture your emotional health by cultivating self-awareness, managing stress, and fostering positive emotions and relationships.' + title: "Emotional Well-being", + description: + "Nurture your emotional health by cultivating self-awareness, managing stress, and fostering positive emotions and relationships.", }, { - title: 'Environment', - description: 'Promote sustainability, protect nature, and actively engage in preserving and conserving the environment for future generations.' + title: "Environment", + description: + "Promote sustainability, protect nature, and actively engage in preserving and conserving the environment for future generations.", }, { - title: 'Finance', - description: 'Manage and grow your financial resources, make sound investment decisions, and attain long-term financial stability.' + title: "Finance", + description: + "Manage and grow your financial resources, make sound investment decisions, and attain long-term financial stability.", }, { - title: 'Health', - description: 'Prioritize your physical well-being by adopting a balanced lifestyle, exercising regularly, and maintaining good health habits.' + title: "Health", + description: + "Prioritize your physical well-being by adopting a balanced lifestyle, exercising regularly, and maintaining good health habits.", }, { - title: 'Home', - description: 'Create a comfortable, harmonious living space that reflects your personal style and provides a sanctuary for relaxation and joy.' + title: "Home", + description: + "Create a comfortable, harmonious living space that reflects your personal style and provides a sanctuary for relaxation and joy.", }, { - title: 'Language Learning', - description: 'Expand your horizons by acquiring proficiency in a new language, embracing cultural diversity, and enhancing communication skills.' + title: "Language Learning", + description: + "Expand your horizons by acquiring proficiency in a new language, embracing cultural diversity, and enhancing communication skills.", }, { - title: 'Organization', - description: 'Bring order and structure to your life, de-clutter your surroundings, and develop efficient systems for increased productivity.' + title: "Organization", + description: + "Bring order and structure to your life, de-clutter your surroundings, and develop efficient systems for increased productivity.", }, { - title: 'Personal Development', - description: 'Continuously grow and improve as an individual, explore self-discovery, and unleash your full potential for personal fulfillment.' + title: "Personal Development", + description: + "Continuously grow and improve as an individual, explore self-discovery, and unleash your full potential for personal fulfillment.", }, { - title: 'Productivity', - description: 'Optimize your efficiency, manage time effectively, and achieve more by focusing on high-value tasks and eliminating distractions.' + title: "Productivity", + description: + "Optimize your efficiency, manage time effectively, and achieve more by focusing on high-value tasks and eliminating distractions.", }, { - title: 'Relationship', - description: 'Cultivate meaningful connections, build trust, and foster healthy interactions with others based on mutual respect and understanding. Nurture and strengthen bonds with family, friends, and loved ones through open communication, empathy, and quality time together' + title: "Relationship", + description: + "Cultivate meaningful connections, build trust, and foster healthy interactions with others based on mutual respect and understanding. Nurture and strengthen bonds with family, friends, and loved ones through open communication, empathy, and quality time together", }, { - title: 'Social Connections', - description: 'Build and foster a network of diverse social connections, engage in meaningful interactions, and create a sense of belonging.' + title: "Social Connections", + description: + "Build and foster a network of diverse social connections, engage in meaningful interactions, and create a sense of belonging.", }, { - title: 'Skills Development', - description: 'Enhance your abilities and acquire new skills through continuous learning, practice, and seeking opportunities for personal growth.' + title: "Skills Development", + description: + "Enhance your abilities and acquire new skills through continuous learning, practice, and seeking opportunities for personal growth.", }, { - title: 'Spirituality', - description: 'Explore and connect with your inner self, seek meaning and purpose, and develop a deeper connection with the divine or higher power.' + title: "Spirituality", + description: + "Explore and connect with your inner self, seek meaning and purpose, and develop a deeper connection with the divine or higher power.", }, { - title: 'Sport', - description: 'Engage in physical activities, sports, and exercises that promote fitness, competition, teamwork, and personal well-being.' + title: "Sport", + description: + "Engage in physical activities, sports, and exercises that promote fitness, competition, teamwork, and personal well-being.", }, { - title: 'Time Management', - description: 'Effectively utilize and manage your time, prioritize tasks, and make the most of each day for increased productivity and fulfillment.' + title: "Time Management", + description: + "Effectively utilize and manage your time, prioritize tasks, and make the most of each day for increased productivity and fulfillment.", }, { - title: 'Travel', - description: 'Embark on new adventures, explore different cultures and destinations, and broaden your horizons through enriching travel experiences.' + title: "Travel", + description: + "Embark on new adventures, explore different cultures and destinations, and broaden your horizons through enriching travel experiences.", }, { - title: 'Well-being', - description: 'Take care of your overall well-being, focusing on physical, mental, and emotional health, and nurturing a balanced lifestyle.' - } - ] + title: "Well-being", + description: + "Take care of your overall well-being, focusing on physical, mental, and emotional health, and nurturing a balanced lifestyle.", + }, + ]; - public static goalSetting:DataDescription[] =[ + public static goalSetting: DataDescription[] = [ { - title: 'Goal Term', - description: 'Select goal term or target duration, like daily goal, tomorrow, short term or long term.Set a target date accordingly.' + title: "Goal Term", + description: + "Select goal term or target duration, like daily goal, tomorrow, short term or long term.Set a target date accordingly.", }, { - title: 'Goal Category', - description: 'Select a category or domain for your goal, such as personal development, career, health, relationships, etc.' + title: "Goal Category", + description: + "Select a category or domain for your goal, such as personal development, career, health, relationships, etc.", }, { - title: 'Goal Description', - description: 'Describe your goal in detail, including what you want to achieve and why it is important to you.' + title: "Goal Description", + description: + "Describe your goal in detail, including what you want to achieve and why it is important to you.", }, { - title: 'Specificity', - description: 'Make your goal more specific by defining measurable outcomes, setting deadlines, or identifying key milestones.' + title: "Specificity", + description: + "Make your goal more specific by defining measurable outcomes, setting deadlines, or identifying key milestones.", }, { - title: 'Action Steps', - description: 'Outline the specific action steps or tasks you need to take to work towards your goal.' + title: "Action Steps", + description: + "Outline the specific action steps or tasks you need to take to work towards your goal.", }, { - title: 'Resources Needed', - description: 'Identify any resources you require to achieve your goal, such as time, money, tools, or support from others.' + title: "Resources Needed", + description: + "Identify any resources you require to achieve your goal, such as time, money, tools, or support from others.", }, { - title: 'Potential Obstacles', - description: 'Anticipate potential obstacles or challenges you might face while pursuing your goal.' + title: "Potential Obstacles", + description: + "Anticipate potential obstacles or challenges you might face while pursuing your goal.", }, { - title: 'Strategies and Solutions', - description: 'Brainstorm and document strategies you can employ to overcome obstacles and find solutions to challenges.' + title: "Strategies and Solutions", + description: + "Brainstorm and document strategies you can employ to overcome obstacles and find solutions to challenges.", }, { - title: 'Timeline', - description: 'Set a timeline or target date for achieving your goal, establishing a sense of urgency and accountability.' + title: "Timeline", + description: + "Set a timeline or target date for achieving your goal, establishing a sense of urgency and accountability.", }, { - title: 'Progress Tracking', - description: 'Track your progress towards your goal using a checklist, milestones, or a progress bar.' + title: "Progress Tracking", + description: + "Track your progress towards your goal using a checklist, milestones, or a progress bar.", }, { - title: 'Motivation and Rewards', - description: 'Identify your motivation for achieving the goal and determine any rewards or incentives you can give yourself upon successful completion.' - } - ] - + title: "Motivation and Rewards", + description: + "Identify your motivation for achieving the goal and determine any rewards or incentives you can give yourself upon successful completion.", + }, + ]; } diff --git a/src/app/models/data/classTweleveSyllabus.data.ts b/src/app/models/data/classTweleveSyllabus.data.ts index 78bed88b..ddfd869e 100644 --- a/src/app/models/data/classTweleveSyllabus.data.ts +++ b/src/app/models/data/classTweleveSyllabus.data.ts @@ -1,520 +1,475 @@ -import { Syllabus } from '../interface/masterData.model'; +import { Syllabus } from "../interface/masterData.model"; export class ClassTwelveSyllabusData { public static biologyUnits: Syllabus[] = [ { unit_id: 1, - unit_name: 'Diversity in Living World', + unit_name: "Diversity in Living World", topics: [ - { name: 'Diversity of Living Organisms' }, + { name: "Diversity of Living Organisms" }, { - name: 'Classification of Living Organisms', + name: "Classification of Living Organisms", sub_topics: [ - 'Five Kingdom Classification', - 'Major Groups and Principles of Classification within Each Kingdom', + "Five Kingdom Classification", + "Major Groups and Principles of Classification within Each Kingdom", ], }, - { name: 'systematics and Binomial System of Nomenclature' }, + { name: "systematics and Binomial System of Nomenclature" }, { - name: 'salient Features of Animal Classification', - sub_topics: [ - 'Non-chordates up to Phylum Level', - 'Chordates up to Class Level', - ], + name: "salient Features of Animal Classification", + sub_topics: ["Non-chordates up to Phylum Level", "Chordates up to Class Level"], }, { - name: 'salient Features of Plant Classification', - sub_topics: ['Major Groups', 'Angiosperms up to Subclass'], + name: "salient Features of Plant Classification", + sub_topics: ["Major Groups", "Angiosperms up to Subclass"], }, - { name: 'Botanical Gardens, Herbaria, Zoological Parks, and Museums' }, + { name: "Botanical Gardens, Herbaria, Zoological Parks, and Museums" }, { - name: 'Practicals', + name: "Practicals", sub_topics: [ - 'study the Large Variation of Living Organisms in the Neighborhood', - 'Note Their Behavior and Characteristics', - 'Categorize Them into Groups Based on Common Features', - 'study Preserved Specimens to Understand Systematic Correlations', - 'Learn to Collect, Press, Dry, and Prepare Plant Specimens for the Herbarium/Museum', + "study the Large Variation of Living Organisms in the Neighborhood", + "Note Their Behavior and Characteristics", + "Categorize Them into Groups Based on Common Features", + "study Preserved Specimens to Understand Systematic Correlations", + "Learn to Collect, Press, Dry, and Prepare Plant Specimens for the Herbarium/Museum", ], }, ], }, { unit_id: 2, - unit_name: 'structural Organization in Animals and Plants', + unit_name: "structural Organization in Animals and Plants", topics: [ - { name: 'Tissues in Animals and Plants' }, + { name: "Tissues in Animals and Plants" }, { - name: 'Morphology, Anatomy, and Functions of Flowering Plants', - sub_topics: [ - 'Root', - 'stem', - 'Leaf', - 'Inflorescence', - 'Flower', - 'Fruit', - 'seed', - ], + name: "Morphology, Anatomy, and Functions of Flowering Plants", + sub_topics: ["Root", "stem", "Leaf", "Inflorescence", "Flower", "Fruit", "seed"], }, { - name: 'Morphology, Anatomy, and Functions of Different Systems', - sub_topics: [ - 'Annelid (Earthworm)', - 'Insect (Cockroach)', - 'Amphibian (Frog)', - ], + name: "Morphology, Anatomy, and Functions of Different Systems", + sub_topics: ["Annelid (Earthworm)", "Insect (Cockroach)", "Amphibian (Frog)"], }, - { name: 'Practicals' }, + { name: "Practicals" }, { - name: 'study of Tissues in Plants and Animals', + name: "study of Tissues in Plants and Animals", sub_topics: [ - 'Temporary Preparations', - 'Permanent Slides', - 'Transverse Section of Roots and Stems', - 'Identification of Different Tissues', + "Temporary Preparations", + "Permanent Slides", + "Transverse Section of Roots and Stems", + "Identification of Different Tissues", ], }, { - name: 'study of Local Plants and Animals', + name: "study of Local Plants and Animals", sub_topics: [ - 'External Morphology', - 'Description of Three Common Flowering Plants (Solanaceae, Fabaceae, Liliaceae)', - 'Grouping Based on Flower Characteristics', + "External Morphology", + "Description of Three Common Flowering Plants (Solanaceae, Fabaceae, Liliaceae)", + "Grouping Based on Flower Characteristics", ], }, { - name: 'study of Anatomy', - sub_topics: [ - 'Roots', - 'stems (Hand Sections)', - 'Leaves (Permanent Slides)', - ], + name: "study of Anatomy", + sub_topics: ["Roots", "stems (Hand Sections)", "Leaves (Permanent Slides)"], }, { - name: 'study of Vertebrate and Invertebrate Morphology and Internal Organization', - sub_topics: [ - 'One Vertebrate', - 'One Invertebrate (Charts and Models)', - ], + name: "study of Vertebrate and Invertebrate Morphology and Internal Organization", + sub_topics: ["One Vertebrate", "One Invertebrate (Charts and Models)"], }, ], }, { unit_id: 3, - unit_name: 'Cell: Structure and Function', + unit_name: "Cell: Structure and Function", topics: [ { - name: 'Cell Components', - sub_topics: [ - 'Cell Wall', - 'Cell Membrane', - 'Cell Organelles', - 'Nuclear Organization', - ], + name: "Cell Components", + sub_topics: ["Cell Wall", "Cell Membrane", "Cell Organelles", "Nuclear Organization"], }, { - name: 'Cell Division', - sub_topics: ['Mitosis', 'Meiosis', 'Cell Cycle'], + name: "Cell Division", + sub_topics: ["Mitosis", "Meiosis", "Cell Cycle"], }, { - name: 'Basic Chemical Constituents of Living Bodies', - sub_topics: ['Carbohydrates', 'Proteins', 'Lipids', 'Nucleic Acids'], + name: "Basic Chemical Constituents of Living Bodies", + sub_topics: ["Carbohydrates", "Proteins", "Lipids", "Nucleic Acids"], }, { - name: 'Enzymes', - sub_topics: ['Types', 'Properties', 'Function'], + name: "Enzymes", + sub_topics: ["Types", "Properties", "Function"], }, { - name: 'Practicals', + name: "Practicals", sub_topics: [ - 'Observation of Animal and Plant Cells (Sections and Smears)', - 'study of Mitosis in Onion Root Tip and Animal Cells (Permanent Slides)', - 'Carbohydrate, Protein, and Fat Testing in Plant and Animal Materials', - 'study of Enzyme Activity (Amylase, Trypsin, Papain) Using Milk Powder as Substrate', + "Observation of Animal and Plant Cells (Sections and Smears)", + "study of Mitosis in Onion Root Tip and Animal Cells (Permanent Slides)", + "Carbohydrate, Protein, and Fat Testing in Plant and Animal Materials", + "study of Enzyme Activity (Amylase, Trypsin, Papain) Using Milk Powder as Substrate", ], }, ], }, { unit_id: 4, - unit_name: 'Plant Physiology', + unit_name: "Plant Physiology", topics: [ - { name: 'Movement of Water, Food, Nutrients, and Gases' }, - { name: 'Plants and Water' }, - { name: 'Mineral Nutrition' }, - { name: 'Respiration' }, - { name: 'Photosynthesis' }, - { name: 'Plant Growth and Development' }, + { name: "Movement of Water, Food, Nutrients, and Gases" }, + { name: "Plants and Water" }, + { name: "Mineral Nutrition" }, + { name: "Respiration" }, + { name: "Photosynthesis" }, + { name: "Plant Growth and Development" }, { - name: 'Practicals', + name: "Practicals", sub_topics: [ - 'Demonstration of the Requirement of Chlorophyll and Light for Photosynthesis', - 'separation of Plant Pigments Using Paper Chromatography', - 'study of Respiration Rate in Different Plant Materials', - 'Demonstration of Anaerobic Respiration', - 'study of Transpiration in Plants Using Cobalt Chloride Method', - 'study of Imbibition of Water by Seeds', + "Demonstration of the Requirement of Chlorophyll and Light for Photosynthesis", + "separation of Plant Pigments Using Paper Chromatography", + "study of Respiration Rate in Different Plant Materials", + "Demonstration of Anaerobic Respiration", + "study of Transpiration in Plants Using Cobalt Chloride Method", + "study of Imbibition of Water by Seeds", ], }, ], }, { unit_id: 5, - unit_name: 'Human Physiology', + unit_name: "Human Physiology", topics: [ { - name: 'Digestion and Absorption', + name: "Digestion and Absorption", sub_topics: [ - 'Food breakdown and enzymatic digestion', - 'Nutrient absorption in the alimentary canal', + "Food breakdown and enzymatic digestion", + "Nutrient absorption in the alimentary canal", ], }, { - name: 'Breathing and Respiration', - sub_topics: [ - 'Exchange of gases at multiple levels', - 'Oxidation of sugars in cells', - ], + name: "Breathing and Respiration", + sub_topics: ["Exchange of gases at multiple levels", "Oxidation of sugars in cells"], }, { - name: 'Body Fluids and Circulation', + name: "Body Fluids and Circulation", sub_topics: [ - 'Transport of gases, nutrients, and waste products through the vascular system', + "Transport of gases, nutrients, and waste products through the vascular system", ], }, { - name: 'Excretory Products and Elimination', + name: "Excretory Products and Elimination", sub_topics: [ - 'Role of kidneys in osmoregulation', - 'Elimination of metabolic wastes by the excretory system', + "Role of kidneys in osmoregulation", + "Elimination of metabolic wastes by the excretory system", ], }, { - name: 'Locomotion and Movement', + name: "Locomotion and Movement", sub_topics: [ - 'Interaction of the skeletal and muscular system', - 'Protection of body parts by the skeleton', + "Interaction of the skeletal and muscular system", + "Protection of body parts by the skeleton", ], }, { - name: 'Control and Coordination', + name: "Control and Coordination", sub_topics: [ - 'Integration of neural and endocrine systems for control and coordination', - 'specialization of sense organs in stimulus reception and transmission to the brain', + "Integration of neural and endocrine systems for control and coordination", + "specialization of sense organs in stimulus reception and transmission to the brain", ], }, { - name: 'Practicals', + name: "Practicals", sub_topics: [ - 'study diversity of food habits in different parts of the country', - 'Discussion on the sources of carbohydrates, proteins, fats, and other nutrients', - 'Testing different food items for macro-nutrients', - 'Effect of temperature and pH on the activity of salivary amylase', - 'study of permanent slides of human blood cells', - 'Testing urine for urea and sugar', - 'study of the human skeleton and types of joints', + "study diversity of food habits in different parts of the country", + "Discussion on the sources of carbohydrates, proteins, fats, and other nutrients", + "Testing different food items for macro-nutrients", + "Effect of temperature and pH on the activity of salivary amylase", + "study of permanent slides of human blood cells", + "Testing urine for urea and sugar", + "study of the human skeleton and types of joints", ], }, ], }, { unit_id: 6, - unit_name: 'sexual Reproduction', + unit_name: "sexual Reproduction", topics: [ { - name: 'Pollination and Fertilization in Flowering Plants', + name: "Pollination and Fertilization in Flowering Plants", sub_topics: [ - 'Reproductive methods in plants', - 'Types of reproduction: vegetative, asexual, and sexual', - 'Flowers as reproductive organs', - 'Types of flowers: unisexual and bisexual', - 'Mechanisms of pollination', - 'Barriers to successful pollination', - 'The fertilization process in flowering plants', + "Reproductive methods in plants", + "Types of reproduction: vegetative, asexual, and sexual", + "Flowers as reproductive organs", + "Types of flowers: unisexual and bisexual", + "Mechanisms of pollination", + "Barriers to successful pollination", + "The fertilization process in flowering plants", ], }, { - name: 'Development of Seeds and Fruits', + name: "Development of Seeds and Fruits", sub_topics: [ - 'Transformation of ovules into seeds', - 'Conversion of ovaries into fruits after fertilization', + "Transformation of ovules into seeds", + "Conversion of ovaries into fruits after fertilization", ], }, { - name: 'Human Reproduction', + name: "Human Reproduction", sub_topics: [ - 'Reproductive systems in males and females', - 'Menstrual cycle in females', - 'Gamete production in males and females', - 'Fertilization process', - 'Implantation of the embryo', - 'Embryo development', - 'Pregnancy and parturition in humans', + "Reproductive systems in males and females", + "Menstrual cycle in females", + "Gamete production in males and females", + "Fertilization process", + "Implantation of the embryo", + "Embryo development", + "Pregnancy and parturition in humans", ], }, { - name: 'Reproductive Health', + name: "Reproductive Health", sub_topics: [ - 'Methods of birth control and contraception', - 'Prevention of sexually transmitted diseases (STDs)', - 'In vitro fertilization (IVF) and its procedure', - 'Legal aspects of abortion', - 'Prenatal sex determination and its legal status', + "Methods of birth control and contraception", + "Prevention of sexually transmitted diseases (STDs)", + "In vitro fertilization (IVF) and its procedure", + "Legal aspects of abortion", + "Prenatal sex determination and its legal status", ], }, { - name: 'Practicals', + name: "Practicals", sub_topics: [ - 'study of flowers adapted to different pollination agencies', - 'Examination of reproductive parts in various flower types', - 'Observation of pollen germination and pollen tube growth', - 'Microscopic study of mammalian testis and ovary tissue sections', - 'study of fruits and seeds at different developmental stages', + "study of flowers adapted to different pollination agencies", + "Examination of reproductive parts in various flower types", + "Observation of pollen germination and pollen tube growth", + "Microscopic study of mammalian testis and ovary tissue sections", + "study of fruits and seeds at different developmental stages", ], }, ], }, { unit_id: 7, - unit_name: 'Genetics and Evolution', + unit_name: "Genetics and Evolution", topics: [ { - name: 'Mendelian Inheritance', + name: "Mendelian Inheritance", sub_topics: [ - 'Mendelian inheritance in plants', - 'Mendelian inheritance in animals', - 'Cytoplasmic inheritance', + "Mendelian inheritance in plants", + "Mendelian inheritance in animals", + "Cytoplasmic inheritance", ], }, { - name: 'Chromosome Theory of Inheritance', - sub_topics: ['Deviations from Mendelian ratio', 'Gene interactions'], + name: "Chromosome Theory of Inheritance", + sub_topics: ["Deviations from Mendelian ratio", "Gene interactions"], }, { - name: 'Gene Interactions', + name: "Gene Interactions", sub_topics: [ - 'Incomplete dominance', - 'Co-dominance', - 'Complementary genes', - 'Multiple alleles', + "Incomplete dominance", + "Co-dominance", + "Complementary genes", + "Multiple alleles", ], }, { - name: 'sex Determination in Human Beings', - sub_topics: ['XX, XY determination'], + name: "sex Determination in Human Beings", + sub_topics: ["XX, XY determination"], }, { - name: 'Linkage and Crossing Over', - sub_topics: [ - 'Genes on the same chromosome', - 'Inheritance with crossing over', - ], + name: "Linkage and Crossing Over", + sub_topics: ["Genes on the same chromosome", "Inheritance with crossing over"], }, { - name: 'Inheritance Pattern of Haemophilia and Blood Groups in Human Beings', - sub_topics: [ - 'Patterns of inheritance for haemophilia and blood groups', - ], + name: "Inheritance Pattern of Haemophilia and Blood Groups in Human Beings", + sub_topics: ["Patterns of inheritance for haemophilia and blood groups"], }, { - name: 'DNA: Replication, Transcription, Translation', + name: "DNA: Replication, Transcription, Translation", sub_topics: [ - 'Processes of DNA replication', - 'Transcription of DNA into RNA', - 'Translation of RNA into proteins', + "Processes of DNA replication", + "Transcription of DNA into RNA", + "Translation of RNA into proteins", ], }, { - name: 'Gene Expression and Regulation', - sub_topics: ['Regulation of gene expression'], + name: "Gene Expression and Regulation", + sub_topics: ["Regulation of gene expression"], }, { - name: 'Genome and Human Genome Project', - sub_topics: ['The Human Genome Project and its significance'], + name: "Genome and Human Genome Project", + sub_topics: ["The Human Genome Project and its significance"], }, { - name: 'DNA Fingerprinting', - sub_topics: ['Applications of DNA fingerprinting'], + name: "DNA Fingerprinting", + sub_topics: ["Applications of DNA fingerprinting"], }, { - name: 'Evolution: Theories and Evidences', + name: "Evolution: Theories and Evidences", sub_topics: [ - 'Theories of evolution (Lamarckism, Darwinism, Neo-Darwinism)', - 'Evidences supporting evolution', + "Theories of evolution (Lamarckism, Darwinism, Neo-Darwinism)", + "Evidences supporting evolution", ], }, { - name: 'Practicals', + name: "Practicals", sub_topics: [ - 'study of mitosis in onion root tips and animal cells (grasshopper)', - 'study of meiosis in onion buds and grasshopper testis', - 'staining tissue section for nucleic acids (aceto carmine stain)', - 'study of Mendelian inheritance using seeds of different traits', - 'Preparation of pedigree charts for genetic traits', - 'Comparison of analogous and homologous organs in various plants and animals', + "study of mitosis in onion root tips and animal cells (grasshopper)", + "study of meiosis in onion buds and grasshopper testis", + "staining tissue section for nucleic acids (aceto carmine stain)", + "study of Mendelian inheritance using seeds of different traits", + "Preparation of pedigree charts for genetic traits", + "Comparison of analogous and homologous organs in various plants and animals", ], }, ], }, { unit_id: 8, - unit_name: 'Biology and Human Welfare', + unit_name: "Biology and Human Welfare", topics: [ { - name: 'Animal Husbandry', + name: "Animal Husbandry", sub_topics: [ - 'Traditional Breeding', - 'Productivity Improvement', - 'Disease and Pest Resistance', + "Traditional Breeding", + "Productivity Improvement", + "Disease and Pest Resistance", ], }, { - name: 'Immunology and Vaccines', + name: "Immunology and Vaccines", sub_topics: [ - 'Human Defense Mechanism', - 'Antibody Production', - 'Vaccination and Acquired Immunity', - 'Genetic Engineering for Vaccine Production', + "Human Defense Mechanism", + "Antibody Production", + "Vaccination and Acquired Immunity", + "Genetic Engineering for Vaccine Production", ], }, { - name: 'Pathogens and Parasites', + name: "Pathogens and Parasites", sub_topics: [ - 'Infectious Agents', - 'specific Organisms and Diseases', - 'Preventive Measures and Hygiene', + "Infectious Agents", + "specific Organisms and Diseases", + "Preventive Measures and Hygiene", ], }, { - name: 'Plant Breeding and Tissue Culture', + name: "Plant Breeding and Tissue Culture", sub_topics: [ - 'Traditional Breeding Methods', - 'Modern Techniques and Crop Improvement', - 'Horticulture and Pest Resistance', + "Traditional Breeding Methods", + "Modern Techniques and Crop Improvement", + "Horticulture and Pest Resistance", ], }, { - name: 'Microbes in Various Applications', + name: "Microbes in Various Applications", sub_topics: [ - 'Household Food Processing', - 'Industrial Production', - 'sewage Treatment', - 'Energy Generation', - 'Bioreactors for Pharmaceuticals', - 'Microbes in Environmental Applications', + "Household Food Processing", + "Industrial Production", + "sewage Treatment", + "Energy Generation", + "Bioreactors for Pharmaceuticals", + "Microbes in Environmental Applications", ], }, { - name: 'Cancer and AIDS', - sub_topics: [ - 'Understanding the Diseases', - 'Preventive and Control Measures', - ], + name: "Cancer and AIDS", + sub_topics: ["Understanding the Diseases", "Preventive and Control Measures"], }, { - name: 'Adolescence and Substance Abuse', + name: "Adolescence and Substance Abuse", sub_topics: [ - 'Emotional Stress and Coping', - 'Risks and Consequences of Substance Abuse', - 'Prevention and Support Systems', + "Emotional Stress and Coping", + "Risks and Consequences of Substance Abuse", + "Prevention and Support Systems", ], }, ], }, { unit_id: 9, - unit_name: 'Biotechnology and its Applications', + unit_name: "Biotechnology and its Applications", topics: [ { - name: 'Recombinant DNA Technology', + name: "Recombinant DNA Technology", sub_topics: [ - 'Editing DNA Molecules', - 'Creation of Genetically Modified Organisms (GMOs)', - 'Applications in Medicine, Agriculture, and Industry', + "Editing DNA Molecules", + "Creation of Genetically Modified Organisms (GMOs)", + "Applications in Medicine, Agriculture, and Industry", ], }, { - name: 'Genetically Modified Organisms (GMOs)', + name: "Genetically Modified Organisms (GMOs)", sub_topics: [ - 'Advantages of GM Foods and Crops', - 'Biosafety Concerns', - 'Classical Breeding with rDNA Technology', - 'Cloning in Plants and Animals', + "Advantages of GM Foods and Crops", + "Biosafety Concerns", + "Classical Breeding with rDNA Technology", + "Cloning in Plants and Animals", ], }, { - name: 'Gene Therapy', + name: "Gene Therapy", sub_topics: [ - 'Remedies for Genetic Disorders', - 'Bioreactors for Vaccine and Drug Production', + "Remedies for Genetic Disorders", + "Bioreactors for Vaccine and Drug Production", ], }, { - name: 'Practicals', + name: "Practicals", sub_topics: [ - 'staining Tissue Sections for Nucleic Acids', - 'Model of DNA Construction', - 'Quality and Shelf Life Assessment of Market Fruits/Seeds', + "staining Tissue Sections for Nucleic Acids", + "Model of DNA Construction", + "Quality and Shelf Life Assessment of Market Fruits/Seeds", ], }, ], }, { unit_id: 10, - unit_name: 'Ecology and Environment', + unit_name: "Ecology and Environment", topics: [ { - name: 'Ecosystems', + name: "Ecosystems", sub_topics: [ - 'Components and Structure', - 'Types and Classification', - 'Energy Flow in Ecosystems', + "Components and Structure", + "Types and Classification", + "Energy Flow in Ecosystems", ], }, { - name: 'Populations and Communities', - sub_topics: [ - 'species', - 'Population Dynamics', - 'Community Interactions', - ], + name: "Populations and Communities", + sub_topics: ["species", "Population Dynamics", "Community Interactions"], }, { - name: 'Ecological Adaptations', - sub_topics: [ - 'Adaptations in Plants and Animals', - 'Habitat-specific Adaptations', - ], + name: "Ecological Adaptations", + sub_topics: ["Adaptations in Plants and Animals", "Habitat-specific Adaptations"], }, { - name: 'Biodiversity Conservation', + name: "Biodiversity Conservation", sub_topics: [ - 'Centres of Diversity', - 'Conservation Strategies', - 'In-situ and Ex-situ Conservation', - 'Role of Women in Conservation', - 'silent Valley Case Study', - 'Intellectual Property Rights (IPR)', + "Centres of Diversity", + "Conservation Strategies", + "In-situ and Ex-situ Conservation", + "Role of Women in Conservation", + "silent Valley Case Study", + "Intellectual Property Rights (IPR)", ], }, { - name: 'Environmental Issues', + name: "Environmental Issues", sub_topics: [ - 'Pollution', - 'Deforestation', - 'Global Warming', - 'Ozone Layer Depletion', - 'Groundwater Depletion', - 'Threats to Biodiversity', + "Pollution", + "Deforestation", + "Global Warming", + "Ozone Layer Depletion", + "Groundwater Depletion", + "Threats to Biodiversity", ], }, { - name: 'Practicals', + name: "Practicals", sub_topics: [ - 'soil Analysis for Texture, Moisture, and pH', - 'study of Plants and Animals in Different Habitats', - 'Water Analysis for pH, Clarity, and Organisms', - 'Measurement of Suspended Particulate Matter (SPM) in Air', + "soil Analysis for Texture, Moisture, and pH", + "study of Plants and Animals in Different Habitats", + "Water Analysis for pH, Clarity, and Organisms", + "Measurement of Suspended Particulate Matter (SPM) in Air", ], }, ], @@ -524,345 +479,328 @@ export class ClassTwelveSyllabusData { public static physicsUnits: Syllabus[] = [ { unit_id: 1, - unit_name: 'Electrostatics', + unit_name: "Electrostatics", topics: [ { - name: 'Electric Charges and Conservation', + name: "Electric Charges and Conservation", }, { name: "Coulomb's Law", - sub_topics: [ - 'Force Between Two Point Charges', - 'Forces Between Multiple Charges', - ], + sub_topics: ["Force Between Two Point Charges", "Forces Between Multiple Charges"], }, { - name: 'superposition Principle and Continuous Charge Distribution', + name: "superposition Principle and Continuous Charge Distribution", }, { - name: 'Electric Field', - sub_topics: [ - 'Electric Field Due to a Point Charge', - 'Electric Field Lines', - ], + name: "Electric Field", + sub_topics: ["Electric Field Due to a Point Charge", "Electric Field Lines"], }, { - name: 'Electric Dipole', + name: "Electric Dipole", sub_topics: [ - 'Electric Field Due to a Dipole', - 'Torque on a Dipole in a Uniform Electric Field', + "Electric Field Due to a Dipole", + "Torque on a Dipole in a Uniform Electric Field", ], }, { - name: 'Electric Flux', + name: "Electric Flux", sub_topics: [ "statement of Gauss's Theorem", - 'Applications to Find Field Due to Infinitely Long Straight Wire', - 'Applications to Find Field Due to Uniformly Charged Infinite Plane Sheet', - 'Applications to Find Field Due to Uniformly Charged Thin Spherical Shell (Field Inside and Outside)', + "Applications to Find Field Due to Infinitely Long Straight Wire", + "Applications to Find Field Due to Uniformly Charged Infinite Plane Sheet", + "Applications to Find Field Due to Uniformly Charged Thin Spherical Shell (Field Inside and Outside)", ], }, { - name: 'Electric Potential', + name: "Electric Potential", sub_topics: [ - 'Potential Difference', - 'Electric Potential Due to a Point Charge', - 'Electric Potential Due to a Dipole', - 'Electric Potential Due to a System of Charges', - 'Equipotential Surfaces', - 'Electrical Potential Energy of a System of Two Point Charges', - 'Electrical Potential Energy of Electric Dipoles in an Electrostatic Field', + "Potential Difference", + "Electric Potential Due to a Point Charge", + "Electric Potential Due to a Dipole", + "Electric Potential Due to a System of Charges", + "Equipotential Surfaces", + "Electrical Potential Energy of a System of Two Point Charges", + "Electrical Potential Energy of Electric Dipoles in an Electrostatic Field", ], }, { - name: 'Conductors and Insulators', - sub_topics: ['Free Charges and Bound Charges Inside a Conductor'], + name: "Conductors and Insulators", + sub_topics: ["Free Charges and Bound Charges Inside a Conductor"], }, { - name: 'Dielectrics and Electric Polarisation', + name: "Dielectrics and Electric Polarisation", sub_topics: [ - 'Capacitors and Capacitance', - 'Combination of Capacitors in Series and in Parallel', - 'Capacitance of a Parallel Plate Capacitor with and Without Dielectric Medium Between the Plates', - 'Energy Stored in a Capacitor', - 'Van de Graaff Generator', + "Capacitors and Capacitance", + "Combination of Capacitors in Series and in Parallel", + "Capacitance of a Parallel Plate Capacitor with and Without Dielectric Medium Between the Plates", + "Energy Stored in a Capacitor", + "Van de Graaff Generator", ], }, ], }, { unit_id: 2, - unit_name: 'Current Electricity', + unit_name: "Current Electricity", topics: [ { - name: 'Electric Current', + name: "Electric Current", sub_topics: [ - 'Flow of Electric Charges in a Metallic Conductor', - 'Drift Velocity and Mobility, and Their Relation with Electric Current', + "Flow of Electric Charges in a Metallic Conductor", + "Drift Velocity and Mobility, and Their Relation with Electric Current", ], }, { name: "Ohm's Law", sub_topics: [ - 'Electrical Resistance', - 'V-I Characteristics (Linear and Non-linear)', - 'Electrical Energy and Power', - 'Electrical Resistivity and Conductivity', + "Electrical Resistance", + "V-I Characteristics (Linear and Non-linear)", + "Electrical Energy and Power", + "Electrical Resistivity and Conductivity", ], }, { - name: 'Carbon Resistors', - sub_topics: ['Colour Code for Carbon Resistors'], + name: "Carbon Resistors", + sub_topics: ["Colour Code for Carbon Resistors"], }, { - name: 'series and Parallel Combinations of Resistors', + name: "series and Parallel Combinations of Resistors", }, { - name: 'Temperature Dependence of Resistance', + name: "Temperature Dependence of Resistance", }, { - name: 'Internal Resistance of a Cell', + name: "Internal Resistance of a Cell", sub_topics: [ - 'Potential Difference and EMF of a Cell', - 'Combination of Cells in Series and in Parallel', + "Potential Difference and EMF of a Cell", + "Combination of Cells in Series and in Parallel", ], }, { name: "Kirchhoff's Laws", - sub_topics: ['simple Applications'], + sub_topics: ["simple Applications"], }, { - name: 'Wheatstone Bridge', + name: "Wheatstone Bridge", }, { - name: 'Metre Bridge', + name: "Metre Bridge", }, { - name: 'Potentiometer', + name: "Potentiometer", sub_topics: [ - 'Principle', - 'Applications to Measure Potential Difference', - 'Applications for Comparing EMF of Two Cells', - 'Measurement of Internal Resistance of a Cell', + "Principle", + "Applications to Measure Potential Difference", + "Applications for Comparing EMF of Two Cells", + "Measurement of Internal Resistance of a Cell", ], }, ], }, { unit_id: 3, - unit_name: 'Magnetic Effects of Current and Magnetism', + unit_name: "Magnetic Effects of Current and Magnetism", topics: [ { - name: 'Concept of Magnetic Field', + name: "Concept of Magnetic Field", sub_topics: ["Oersted's Experiment"], }, { - name: 'Biot-Savart Law', - sub_topics: ['Application to Current Carrying Circular Loop'], + name: "Biot-Savart Law", + sub_topics: ["Application to Current Carrying Circular Loop"], }, { name: "Ampere's Law", sub_topics: [ - 'Applications to Infinitely Long Straight Wire', - 'straight and Toroidal Solenoids', + "Applications to Infinitely Long Straight Wire", + "straight and Toroidal Solenoids", ], }, { - name: 'Force on a Moving Charge', - sub_topics: ['In Uniform Magnetic and Electric Fields', 'Cyclotron'], + name: "Force on a Moving Charge", + sub_topics: ["In Uniform Magnetic and Electric Fields", "Cyclotron"], }, { - name: 'Force on a Current-Carrying Conductor', + name: "Force on a Current-Carrying Conductor", sub_topics: [ - 'In a Uniform Magnetic Field', - 'Between Two Parallel Current-Carrying Conductors (Definition of Ampere)', + "In a Uniform Magnetic Field", + "Between Two Parallel Current-Carrying Conductors (Definition of Ampere)", ], }, { - name: 'Torque Experienced by a Current Loop in a Magnetic Field', + name: "Torque Experienced by a Current Loop in a Magnetic Field", sub_topics: [ - 'Moving Coil Galvanometer (Current Sensitivity)', - 'Conversion to Ammeter and Voltmeter', + "Moving Coil Galvanometer (Current Sensitivity)", + "Conversion to Ammeter and Voltmeter", ], }, { - name: 'Current Loop as a Magnetic Dipole', - sub_topics: ['Magnetic Dipole Moment'], + name: "Current Loop as a Magnetic Dipole", + sub_topics: ["Magnetic Dipole Moment"], }, { - name: 'Magnetic Dipole Moment of a Revolving Electron', + name: "Magnetic Dipole Moment of a Revolving Electron", }, { - name: 'Magnetic Field Intensity due to a Magnetic Dipole (Bar Magnet)', - sub_topics: ['Along Its Axis', 'Perpendicular to Its Axis'], + name: "Magnetic Field Intensity due to a Magnetic Dipole (Bar Magnet)", + sub_topics: ["Along Its Axis", "Perpendicular to Its Axis"], }, { - name: 'Torque on a Magnetic Dipole (Bar Magnet) in a Uniform Magnetic Field', - sub_topics: [ - 'Bar Magnet as an Equivalent Solenoid', - 'Magnetic Field Lines', - ], + name: "Torque on a Magnetic Dipole (Bar Magnet) in a Uniform Magnetic Field", + sub_topics: ["Bar Magnet as an Equivalent Solenoid", "Magnetic Field Lines"], }, { name: "Earth's Magnetic Field and Magnetic Elements", }, { - name: 'Para-, Dia-, and Ferro-magnetic Substances', - sub_topics: ['With Examples'], + name: "Para-, Dia-, and Ferro-magnetic Substances", + sub_topics: ["With Examples"], }, { - name: 'Electromagnets', - sub_topics: ['Factors Affecting Their Strengths'], + name: "Electromagnets", + sub_topics: ["Factors Affecting Their Strengths"], }, { - name: 'Permanent Magnets', + name: "Permanent Magnets", }, ], }, { unit_id: 4, - unit_name: 'Electromagnetic Induction and Alternating Currents', + unit_name: "Electromagnetic Induction and Alternating Currents", topics: [ { - name: 'Electromagnetic Induction', - sub_topics: [ - "Faraday's Law", - 'Induced emf and Current', - "Lenz's Law", - 'Eddy Currents', - ], + name: "Electromagnetic Induction", + sub_topics: ["Faraday's Law", "Induced emf and Current", "Lenz's Law", "Eddy Currents"], }, { - name: 'self and Mutual Inductance', + name: "self and Mutual Inductance", }, { - name: 'Need for Displacement Current', + name: "Need for Displacement Current", }, { - name: 'Alternating Currents', + name: "Alternating Currents", sub_topics: [ - 'Peak and RMS Value of Alternating Current/Voltage', - 'Reactance and Impedance', - 'LC Oscillations (Qualitative Treatment Only)', - 'LCR Series Circuit', - 'Resonance', - 'Power in AC Circuits', - 'Wattless Current', + "Peak and RMS Value of Alternating Current/Voltage", + "Reactance and Impedance", + "LC Oscillations (Qualitative Treatment Only)", + "LCR Series Circuit", + "Resonance", + "Power in AC Circuits", + "Wattless Current", ], }, { - name: 'AC Generator and Transformer', + name: "AC Generator and Transformer", }, ], }, { unit_id: 5, - unit_name: 'Electromagnetic Waves', + unit_name: "Electromagnetic Waves", topics: [ { - name: 'Electromagnetic Waves and Their Characteristics', - sub_topics: [ - 'Qualitative Ideas Only', - 'Transverse Nature of Electromagnetic Waves', - ], + name: "Electromagnetic Waves and Their Characteristics", + sub_topics: ["Qualitative Ideas Only", "Transverse Nature of Electromagnetic Waves"], }, { - name: 'Electromagnetic Spectrum', + name: "Electromagnetic Spectrum", sub_topics: [ - 'Radio Waves', - 'Microwaves', - 'Infrared', - 'Visible Light', - 'Ultraviolet', - 'X-rays', - 'Gamma Rays', - 'Elementary Facts About Their Uses', + "Radio Waves", + "Microwaves", + "Infrared", + "Visible Light", + "Ultraviolet", + "X-rays", + "Gamma Rays", + "Elementary Facts About Their Uses", ], }, ], }, { unit_id: 6, - unit_name: 'Optics', + unit_name: "Optics", topics: [ { - name: 'Reflection of Light', - sub_topics: ['spherical Mirrors', 'Mirror Formula'], + name: "Reflection of Light", + sub_topics: ["spherical Mirrors", "Mirror Formula"], }, { - name: 'Refraction of Light', + name: "Refraction of Light", sub_topics: [ - 'Total Internal Reflection and Its Applications', - 'Optical Fibres', - 'Refraction at Spherical Surfaces', - 'Lenses', - 'Thin Lens Formula', + "Total Internal Reflection and Its Applications", + "Optical Fibres", + "Refraction at Spherical Surfaces", + "Lenses", + "Thin Lens Formula", "Lensmaker's Formula", ], }, { - name: 'Magnification and Power of Lenses', - sub_topics: ['Combination of Thin Lenses in Contact'], + name: "Magnification and Power of Lenses", + sub_topics: ["Combination of Thin Lenses in Contact"], }, { - name: 'Refraction and Dispersion of Light Through a Prism', + name: "Refraction and Dispersion of Light Through a Prism", sub_topics: [ - 'scattering of Light', - 'Blue Color of the Sky', - 'Reddish Appearance of the Sun at Sunrise and Sunset', + "scattering of Light", + "Blue Color of the Sky", + "Reddish Appearance of the Sun at Sunrise and Sunset", ], }, { - name: 'Optical Instruments', + name: "Optical Instruments", sub_topics: [ - 'Human Eye', - 'Image Formation and Accommodation', - 'Correction of Myopia Using Lenses', - 'Correction of Hypermetropia Using Lenses', - 'Correction of Presbyopia Using Lenses', - 'Correction of Astigmatism Using Lenses', - 'Microscopes', - 'Astronomical Telescopes (Reflecting and Refracting)', - 'Magnifying Powers', + "Human Eye", + "Image Formation and Accommodation", + "Correction of Myopia Using Lenses", + "Correction of Hypermetropia Using Lenses", + "Correction of Presbyopia Using Lenses", + "Correction of Astigmatism Using Lenses", + "Microscopes", + "Astronomical Telescopes (Reflecting and Refracting)", + "Magnifying Powers", ], }, { - name: 'Wave Optics', + name: "Wave Optics", sub_topics: [ "Wavefront and Huygens' Principle", - 'Reflection and Refraction of Plane Wave at a Plane Surface Using Wavefronts', + "Reflection and Refraction of Plane Wave at a Plane Surface Using Wavefronts", "Proof of Laws of Reflection and Refraction Using Huygens' Principle", - 'Interference', + "Interference", "Young's Double Slit Experiment and Expression for Fringe Width", - 'Coherent Sources and Sustained Interference of Light', - 'Diffraction Due to a Single Slit', - 'Width of Central Maximum', - 'Resolving Power of Microscopes and Astronomical Telescopes', - 'Polarisation', - 'Plane Polarised Light', + "Coherent Sources and Sustained Interference of Light", + "Diffraction Due to a Single Slit", + "Width of Central Maximum", + "Resolving Power of Microscopes and Astronomical Telescopes", + "Polarisation", + "Plane Polarised Light", "Brewster's Law", - 'Uses of Plane Polarised Light and Polaroids', + "Uses of Plane Polarised Light and Polaroids", ], }, ], }, { unit_id: 7, - unit_name: 'Dual Nature of Matter and Radiation', + unit_name: "Dual Nature of Matter and Radiation", topics: [ { - name: 'Photoelectric Effect', + name: "Photoelectric Effect", sub_topics: [ "Hertz and Lenard's Observations", "Einstein's Photoelectric Equation - Particle Nature of Light", ], }, { - name: 'Matter Waves', + name: "Matter Waves", sub_topics: [ - 'Wave Nature of Particles', - 'de Broglie Relation', - 'Davisson-Germer Experiment', + "Wave Nature of Particles", + "de Broglie Relation", + "Davisson-Germer Experiment", ], }, ], @@ -870,109 +808,102 @@ export class ClassTwelveSyllabusData { { unit_id: 8, - unit_name: 'Atoms and Nuclei', + unit_name: "Atoms and Nuclei", topics: [ { - name: 'Alpha-Particle Scattering Experiment', + name: "Alpha-Particle Scattering Experiment", }, { name: "Rutherford's Model of Atom", }, { - name: 'Bohr Model', - sub_topics: ['Energy Levels', 'Hydrogen Spectrum'], + name: "Bohr Model", + sub_topics: ["Energy Levels", "Hydrogen Spectrum"], }, { - name: 'Composition and Size of Nucleus', + name: "Composition and Size of Nucleus", }, { - name: 'Atomic Masses', + name: "Atomic Masses", }, { - name: 'Isotopes, Isobars, Isotones', + name: "Isotopes, Isobars, Isotones", }, { - name: 'Radioactivity', + name: "Radioactivity", sub_topics: [ - 'Alpha, Beta, and Gamma Particles/Rays and Their Properties', - 'Radioactive Decay Law', + "Alpha, Beta, and Gamma Particles/Rays and Their Properties", + "Radioactive Decay Law", ], }, { - name: 'Mass-Energy Relation', + name: "Mass-Energy Relation", sub_topics: [ - 'Mass Defect', - 'Binding Energy per Nucleon and Its Variation with Mass Number', + "Mass Defect", + "Binding Energy per Nucleon and Its Variation with Mass Number", ], }, { - name: 'Nuclear Fission and Fusion', + name: "Nuclear Fission and Fusion", }, ], }, { unit_id: 9, - unit_name: 'Electronic Devices', + unit_name: "Electronic Devices", topics: [ { - name: 'semiconductors', + name: "semiconductors", }, { - name: 'semiconductor Diode', - sub_topics: [ - 'I-V Characteristics in Forward and Reverse Bias', - 'Diode as a Rectifier', - ], + name: "semiconductor Diode", + sub_topics: ["I-V Characteristics in Forward and Reverse Bias", "Diode as a Rectifier"], }, { - name: 'I-V Characteristics of LED, Photodiode, Solar Cell, and Zener Diode', - sub_topics: ['Zener Diode as a Voltage Regulator'], + name: "I-V Characteristics of LED, Photodiode, Solar Cell, and Zener Diode", + sub_topics: ["Zener Diode as a Voltage Regulator"], }, { - name: 'Junction Transistor', - sub_topics: ['Transistor Action', 'Characteristics of a Transistor'], + name: "Junction Transistor", + sub_topics: ["Transistor Action", "Characteristics of a Transistor"], }, { - name: 'Transistor as an Amplifier', - sub_topics: ['Common Emitter Configuration', 'Oscillator'], + name: "Transistor as an Amplifier", + sub_topics: ["Common Emitter Configuration", "Oscillator"], }, { - name: 'Logic Gates', - sub_topics: ['OR', 'AND', 'NOT', 'NAND', 'NOR'], + name: "Logic Gates", + sub_topics: ["OR", "AND", "NOT", "NAND", "NOR"], }, { - name: 'Transistor as a Switch', + name: "Transistor as a Switch", }, ], }, { unit_id: 10, - unit_name: 'Communication Systems', + unit_name: "Communication Systems", topics: [ { - name: 'Elements of a Communication System', - sub_topics: ['Block Diagram Only'], + name: "Elements of a Communication System", + sub_topics: ["Block Diagram Only"], }, { - name: 'Bandwidth of Signals', - sub_topics: ['speech', 'TV', 'Digital Data'], + name: "Bandwidth of Signals", + sub_topics: ["speech", "TV", "Digital Data"], }, { - name: 'Bandwidth of Transmission Medium', + name: "Bandwidth of Transmission Medium", }, { - name: 'Propagation of Electromagnetic Waves', - sub_topics: [ - 'In the Atmosphere', - 'sky Wave Propagation', - 'space Wave Propagation', - ], + name: "Propagation of Electromagnetic Waves", + sub_topics: ["In the Atmosphere", "sky Wave Propagation", "space Wave Propagation"], }, { - name: 'Need for Modulation', + name: "Need for Modulation", }, { - name: 'Production and Detection of an Amplitude-Modulated Wave', + name: "Production and Detection of an Amplitude-Modulated Wave", }, ], }, @@ -980,590 +911,565 @@ export class ClassTwelveSyllabusData { public static chemistryUnits: Syllabus[] = [ { unit_id: 1, - unit_name: 'solid State', + unit_name: "solid State", topics: [ { - name: 'Classification of Solids Based on Different Binding Forces', - sub_topics: [ - 'Molecular Solids', - 'Ionic Solids', - 'Covalent Solids', - 'Metallic Solids', - ], + name: "Classification of Solids Based on Different Binding Forces", + sub_topics: ["Molecular Solids", "Ionic Solids", "Covalent Solids", "Metallic Solids"], }, { - name: 'Amorphous and Crystalline Solids (Elementary Idea)', + name: "Amorphous and Crystalline Solids (Elementary Idea)", }, { - name: 'Unit Cell in Two-Dimensional and Three-Dimensional Lattices', + name: "Unit Cell in Two-Dimensional and Three-Dimensional Lattices", }, { - name: 'Calculation of Density of Unit Cell', + name: "Calculation of Density of Unit Cell", }, { - name: 'Packing in Solids', + name: "Packing in Solids", }, { - name: 'Voids', + name: "Voids", }, { - name: 'Number of Atoms per Unit Cell in a Cubic Unit Cell', + name: "Number of Atoms per Unit Cell in a Cubic Unit Cell", }, { - name: 'Point Defects', + name: "Point Defects", }, { - name: 'Electrical and Magnetic Properties', + name: "Electrical and Magnetic Properties", }, ], }, { unit_id: 2, - unit_name: 'solutions', + unit_name: "solutions", topics: [ { - name: 'Types of Solutions', + name: "Types of Solutions", }, { - name: 'Expression of Concentration of Solutions of Solids in Liquids', + name: "Expression of Concentration of Solutions of Solids in Liquids", }, { - name: 'solubility of Gases in Liquids', + name: "solubility of Gases in Liquids", }, { - name: 'solid Solutions', + name: "solid Solutions", }, { - name: 'Colligative Properties', + name: "Colligative Properties", sub_topics: [ - 'Relative Lowering of Vapour Pressure', - 'Elevation of Boiling Point', - 'Depression of Freezing Point', - 'Osmotic Pressure', - 'Determination of Molecular Masses Using Colligative Properties', - 'Abnormal Molecular Mass', + "Relative Lowering of Vapour Pressure", + "Elevation of Boiling Point", + "Depression of Freezing Point", + "Osmotic Pressure", + "Determination of Molecular Masses Using Colligative Properties", + "Abnormal Molecular Mass", ], }, ], }, { unit_id: 3, - unit_name: 'Electrochemistry', + unit_name: "Electrochemistry", topics: [ { - name: 'Redox reactions', + name: "Redox reactions", }, { - name: 'Conductance in electrolytic solutions', + name: "Conductance in electrolytic solutions", }, { - name: 'specific and Molar Conductivity', - sub_topics: [ - 'Variations of conductivity with concentration', - 'Kohlrausch’s Law', - ], + name: "specific and Molar Conductivity", + sub_topics: ["Variations of conductivity with concentration", "Kohlrausch’s Law"], }, { - name: 'Electrolysis and Laws of Electrolysis', - sub_topics: ['Elementary idea'], + name: "Electrolysis and Laws of Electrolysis", + sub_topics: ["Elementary idea"], }, { - name: 'Electrochemical Cells', + name: "Electrochemical Cells", sub_topics: [ - 'Dry cell', - 'Electrolytic cells', - 'Galvanic cells', - 'Lead accumulator', - 'EMF of a cell', - 'standard electrode potential', - 'Nernst equation and its application to chemical cells', - 'Fuel cells', + "Dry cell", + "Electrolytic cells", + "Galvanic cells", + "Lead accumulator", + "EMF of a cell", + "standard electrode potential", + "Nernst equation and its application to chemical cells", + "Fuel cells", ], }, { - name: 'Corrosion', + name: "Corrosion", }, ], }, { unit_id: 4, - unit_name: 'Chemical Kinetics', + unit_name: "Chemical Kinetics", topics: [ { - name: 'Rate of a Reaction', - sub_topics: ['Average and instantaneous'], + name: "Rate of a Reaction", + sub_topics: ["Average and instantaneous"], }, { - name: 'Factors Affecting Rates of Reaction', - sub_topics: ['Concentration', 'Temperature', 'Catalyst'], + name: "Factors Affecting Rates of Reaction", + sub_topics: ["Concentration", "Temperature", "Catalyst"], }, { - name: 'Order and Molecularity of a Reaction', + name: "Order and Molecularity of a Reaction", }, { - name: 'Rate Law and Specific Rate Constant', + name: "Rate Law and Specific Rate Constant", }, { - name: 'Integrated Rate Equations and Half-Life', - sub_topics: ['Only for zero and first-order reactions'], + name: "Integrated Rate Equations and Half-Life", + sub_topics: ["Only for zero and first-order reactions"], }, { - name: 'Concept of Collision Theory', - sub_topics: ['Elementary idea, no mathematical treatment'], + name: "Concept of Collision Theory", + sub_topics: ["Elementary idea, no mathematical treatment"], }, ], }, { unit_id: 5, - unit_name: 'surface Chemistry', + unit_name: "surface Chemistry", topics: [ { - name: 'Adsorption', - sub_topics: ['Physisorption and chemisorption'], + name: "Adsorption", + sub_topics: ["Physisorption and chemisorption"], }, { - name: 'Factors Affecting Adsorption of Gases on Solids', + name: "Factors Affecting Adsorption of Gases on Solids", }, { - name: 'Catalysis', - sub_topics: ['Homogeneous and heterogeneous'], + name: "Catalysis", + sub_topics: ["Homogeneous and heterogeneous"], }, { - name: 'Activity and Selectivity', - sub_topics: ['Enzyme catalysis'], + name: "Activity and Selectivity", + sub_topics: ["Enzyme catalysis"], }, { - name: 'Colloidal State', - sub_topics: [ - 'Distinction between true solutions, colloids, and suspensions', - ], + name: "Colloidal State", + sub_topics: ["Distinction between true solutions, colloids, and suspensions"], }, { - name: 'Lyophilic and Lyophobic Multimolecular and Macromolecular Colloids', + name: "Lyophilic and Lyophobic Multimolecular and Macromolecular Colloids", }, { - name: 'Properties of Colloids', - sub_topics: [ - 'Tyndall effect', - 'Brownian movement', - 'Electrophoresis', - 'Coagulation', - ], + name: "Properties of Colloids", + sub_topics: ["Tyndall effect", "Brownian movement", "Electrophoresis", "Coagulation"], }, { - name: 'Emulsions', - sub_topics: ['Types of emulsions'], + name: "Emulsions", + sub_topics: ["Types of emulsions"], }, ], }, { unit_id: 6, - unit_name: 'General Principles and Processes of Isolation of Elements', + unit_name: "General Principles and Processes of Isolation of Elements", topics: [ { - name: 'Principles and Methods of Extraction', + name: "Principles and Methods of Extraction", sub_topics: [ - 'Concentration', - 'Oxidation', - 'Reduction', - 'Electrolytic Method', - 'Refining', + "Concentration", + "Oxidation", + "Reduction", + "Electrolytic Method", + "Refining", ], }, { - name: 'Occurrence and Principles of Extraction', - sub_topics: ['Aluminium', 'Copper', 'Zinc', 'Iron'], + name: "Occurrence and Principles of Extraction", + sub_topics: ["Aluminium", "Copper", "Zinc", "Iron"], }, ], }, { unit_id: 7, - unit_name: 'p-Block Elements', + unit_name: "p-Block Elements", topics: [ { - name: 'Group 15 Elements', + name: "Group 15 Elements", sub_topics: [ - 'General Introduction', - 'Electronic Configuration', - 'Occurrence', - 'Oxidation States', - 'Trends in Physical and Chemical Properties', + "General Introduction", + "Electronic Configuration", + "Occurrence", + "Oxidation States", + "Trends in Physical and Chemical Properties", ], }, { - name: 'Nitrogen', + name: "Nitrogen", sub_topics: [ - 'Preparation, Properties, and Uses', - 'Compounds of Nitrogen: Preparation and Properties of Ammonia and Nitric Acid', - 'Oxides of Nitrogen (Structure Only)', + "Preparation, Properties, and Uses", + "Compounds of Nitrogen: Preparation and Properties of Ammonia and Nitric Acid", + "Oxides of Nitrogen (Structure Only)", ], }, { - name: 'Phosphorus', + name: "Phosphorus", sub_topics: [ - 'Allotropic Forms', - 'Compounds of Phosphorus: Preparation and Properties of Phosphine', - 'Halides (PCl3, PCl5) and Oxoacids (Elementary Idea Only)', + "Allotropic Forms", + "Compounds of Phosphorus: Preparation and Properties of Phosphine", + "Halides (PCl3, PCl5) and Oxoacids (Elementary Idea Only)", ], }, { - name: 'Group 16 Elements', + name: "Group 16 Elements", sub_topics: [ - 'General Introduction', - 'Electronic Configuration', - 'Oxidation States', - 'Occurrence', - 'Trends in Physical and Chemical Properties', + "General Introduction", + "Electronic Configuration", + "Oxidation States", + "Occurrence", + "Trends in Physical and Chemical Properties", ], }, { - name: 'Dioxygen', - sub_topics: [ - 'Preparation, Properties, and Uses', - 'simple Oxides', - 'Ozone', - ], + name: "Dioxygen", + sub_topics: ["Preparation, Properties, and Uses", "simple Oxides", "Ozone"], }, { - name: 'sulfur', + name: "sulfur", sub_topics: [ - 'Allotropic Forms', - 'Compounds of Sulfur: Preparation, Properties, and Uses of Sulfur Dioxide', - 'sulfuric Acid: Industrial Process of Manufacture, Properties, and Uses', - 'Oxoacids of Sulfur (Structures Only)', + "Allotropic Forms", + "Compounds of Sulfur: Preparation, Properties, and Uses of Sulfur Dioxide", + "sulfuric Acid: Industrial Process of Manufacture, Properties, and Uses", + "Oxoacids of Sulfur (Structures Only)", ], }, { - name: 'Group 17 Elements', + name: "Group 17 Elements", sub_topics: [ - 'General Introduction', - 'Electronic Configuration', - 'Oxidation States', - 'Occurrence', - 'Trends in Physical and Chemical Properties', + "General Introduction", + "Electronic Configuration", + "Oxidation States", + "Occurrence", + "Trends in Physical and Chemical Properties", ], }, { - name: 'Compounds of Halogens', + name: "Compounds of Halogens", sub_topics: [ - 'Preparation, Properties, and Uses of Chlorine and Hydrochloric Acid', - 'Interhalogen Compounds', - 'Oxoacids of Halogens (Structures Only)', + "Preparation, Properties, and Uses of Chlorine and Hydrochloric Acid", + "Interhalogen Compounds", + "Oxoacids of Halogens (Structures Only)", ], }, { - name: 'Group 18 Elements', + name: "Group 18 Elements", sub_topics: [ - 'General Introduction', - 'Electronic Configuration', - 'Occurrence', - 'Trends in Physical and Chemical Properties', - 'Uses', + "General Introduction", + "Electronic Configuration", + "Occurrence", + "Trends in Physical and Chemical Properties", + "Uses", ], }, ], }, { unit_id: 8, - unit_name: 'd and f Block Elements', + unit_name: "d and f Block Elements", topics: [ { - name: 'General Introduction', + name: "General Introduction", }, { - name: 'Electronic Configuration', + name: "Electronic Configuration", }, { - name: 'Occurrence and Characteristics of Transition Metals', + name: "Occurrence and Characteristics of Transition Metals", }, { - name: 'General Trends in Properties of the First Row Transition Metals', + name: "General Trends in Properties of the First Row Transition Metals", sub_topics: [ - 'Metallic Character', - 'Ionization Enthalpy', - 'Oxidation States', - 'Ionic Radii', - 'Colour', - 'Catalytic Property', - 'Magnetic Properties', - 'Interstitial Compounds', - 'Alloy Formation', + "Metallic Character", + "Ionization Enthalpy", + "Oxidation States", + "Ionic Radii", + "Colour", + "Catalytic Property", + "Magnetic Properties", + "Interstitial Compounds", + "Alloy Formation", ], }, { - name: 'Preparation and Properties of K2Cr2O7 and KMnO4', + name: "Preparation and Properties of K2Cr2O7 and KMnO4", }, { - name: 'Lanthanoids', + name: "Lanthanoids", sub_topics: [ - 'Electronic Configuration', - 'Oxidation States', - 'Chemical Reactivity', - 'Lanthanoid Contraction', + "Electronic Configuration", + "Oxidation States", + "Chemical Reactivity", + "Lanthanoid Contraction", ], }, { - name: 'Actinoids', - sub_topics: ['Electronic Configuration', 'Oxidation States'], + name: "Actinoids", + sub_topics: ["Electronic Configuration", "Oxidation States"], }, ], }, { unit_id: 9, - unit_name: 'Coordination Compounds', + unit_name: "Coordination Compounds", topics: [ { - name: 'Introduction', + name: "Introduction", }, { - name: 'Ligands', + name: "Ligands", }, { - name: 'Coordination Number', + name: "Coordination Number", }, { - name: 'Colour', + name: "Colour", }, { - name: 'Magnetic Properties', + name: "Magnetic Properties", }, { - name: 'shapes', + name: "shapes", }, { - name: 'IUPAC Nomenclature of Mononuclear Coordination Compounds', + name: "IUPAC Nomenclature of Mononuclear Coordination Compounds", }, { - name: 'Bonding', + name: "Bonding", }, { - name: 'Isomerism', + name: "Isomerism", }, { - name: 'Importance of Coordination Compounds', + name: "Importance of Coordination Compounds", sub_topics: [ - 'In Qualitative Analysis', - 'In Extraction of Metals', - 'In Biological Systems', + "In Qualitative Analysis", + "In Extraction of Metals", + "In Biological Systems", ], }, ], }, { unit_id: 10, - unit_name: 'Haloalkanes and Haloarenes', + unit_name: "Haloalkanes and Haloarenes", topics: [ { - name: 'Haloalkanes', + name: "Haloalkanes", sub_topics: [ - 'Nomenclature', - 'Nature of C-X Bond', - 'Physical and Chemical Properties', - 'Mechanism of Substitution Reactions', + "Nomenclature", + "Nature of C-X Bond", + "Physical and Chemical Properties", + "Mechanism of Substitution Reactions", ], }, { - name: 'Haloarenes', + name: "Haloarenes", sub_topics: [ - 'Nature of C-X Bond', - 'substitution Reactions (Directive Influence of Halogen for Mono substituted Compounds Only)', + "Nature of C-X Bond", + "substitution Reactions (Directive Influence of Halogen for Mono substituted Compounds Only)", ], }, { - name: 'Uses and Environmental Effects', + name: "Uses and Environmental Effects", sub_topics: [ - 'Dichloromethane', - 'Trichloromethane', - 'Tetrochloromethane', - 'Iodoform', - 'Freons', - 'DDT', + "Dichloromethane", + "Trichloromethane", + "Tetrochloromethane", + "Iodoform", + "Freons", + "DDT", ], }, ], }, { unit_id: 11, - unit_name: 'Alcohols, Phenols, and Ethers', + unit_name: "Alcohols, Phenols, and Ethers", topics: [ { - name: 'Alcohols', + name: "Alcohols", sub_topics: [ - 'Nomenclature', - 'Methods of Preparation', - 'Physical and Chemical Properties (of Primary Alcohols Only)', - 'Identification of Primary, Secondary, and Tertiary Alcohols', - 'Mechanism of Dehydration', - 'Uses', - 'some Important Compounds', + "Nomenclature", + "Methods of Preparation", + "Physical and Chemical Properties (of Primary Alcohols Only)", + "Identification of Primary, Secondary, and Tertiary Alcohols", + "Mechanism of Dehydration", + "Uses", + "some Important Compounds", ], }, { - name: 'Phenols', + name: "Phenols", sub_topics: [ - 'Nomenclature', - 'Methods of Preparation', - 'Physical and Chemical Properties', - 'Acidic Nature of Phenol', - 'Electrophilic Substitution Reactions', - 'Uses', + "Nomenclature", + "Methods of Preparation", + "Physical and Chemical Properties", + "Acidic Nature of Phenol", + "Electrophilic Substitution Reactions", + "Uses", ], }, { - name: 'Ethers', + name: "Ethers", sub_topics: [ - 'Nomenclature', - 'Methods of Preparation', - 'Physical and Chemical Properties', - 'Uses', + "Nomenclature", + "Methods of Preparation", + "Physical and Chemical Properties", + "Uses", ], }, ], }, { unit_id: 12, - unit_name: 'Aldehydes, Ketones, and Carboxylic Acids', + unit_name: "Aldehydes, Ketones, and Carboxylic Acids", topics: [ { - name: 'Aldehydes and Ketones', + name: "Aldehydes and Ketones", sub_topics: [ - 'Nomenclature', - 'Nature of Carbonyl Group', - 'Methods of Preparation', - 'Physical and Chemical Properties', - 'Mechanism of Nucleophilic Addition', - 'Reactivity of Alpha Hydrogen in Aldehydes', - 'Uses', + "Nomenclature", + "Nature of Carbonyl Group", + "Methods of Preparation", + "Physical and Chemical Properties", + "Mechanism of Nucleophilic Addition", + "Reactivity of Alpha Hydrogen in Aldehydes", + "Uses", ], }, { - name: 'Carboxylic Acids', + name: "Carboxylic Acids", sub_topics: [ - 'Nomenclature', - 'Acidic Nature', - 'Methods of Preparation', - 'Physical and Chemical Properties', - 'Uses', + "Nomenclature", + "Acidic Nature", + "Methods of Preparation", + "Physical and Chemical Properties", + "Uses", ], }, ], }, { unit_id: 13, - unit_name: 'Organic Compounds Containing Nitrogen', + unit_name: "Organic Compounds Containing Nitrogen", topics: [ { - name: 'Amines', + name: "Amines", sub_topics: [ - 'Nomenclature', - 'Classification', - 'structure', - 'Methods of Preparation', - 'Physical and Chemical Properties', - 'Uses', - 'Identification of Primary, Secondary, and Tertiary Amines', + "Nomenclature", + "Classification", + "structure", + "Methods of Preparation", + "Physical and Chemical Properties", + "Uses", + "Identification of Primary, Secondary, and Tertiary Amines", ], }, { - name: 'Cyanides and Isocyanides', + name: "Cyanides and Isocyanides", }, { - name: 'Diazonium Salts', + name: "Diazonium Salts", sub_topics: [ - 'Preparation', - 'Chemical Reactions', - 'Importance in Synthetic Organic Chemistry', + "Preparation", + "Chemical Reactions", + "Importance in Synthetic Organic Chemistry", ], }, ], }, { unit_id: 14, - unit_name: 'Biomolecules', + unit_name: "Biomolecules", topics: [ { - name: 'Carbohydrates', + name: "Carbohydrates", sub_topics: [ - 'Classification (Aldoses and Ketoses)', - 'Monosaccharides (Glucose and Fructose)', - 'Oligosaccharides (Sucrose, Lactose, Maltose)', - 'Polysaccharides (Starch, Cellulose, Glycogen)', - 'Importance', + "Classification (Aldoses and Ketoses)", + "Monosaccharides (Glucose and Fructose)", + "Oligosaccharides (Sucrose, Lactose, Maltose)", + "Polysaccharides (Starch, Cellulose, Glycogen)", + "Importance", ], }, { - name: 'Proteins', + name: "Proteins", sub_topics: [ - 'Elementary Idea of α-Amino Acids', - 'Peptide Bond', - 'Polypeptides', - 'Proteins', - 'Primary Structure', - 'secondary Structure', - 'Tertiary Structure and Quaternary Structure (Qualitative Idea Only)', - 'Denaturation of Proteins', - 'Enzymes', + "Elementary Idea of α-Amino Acids", + "Peptide Bond", + "Polypeptides", + "Proteins", + "Primary Structure", + "secondary Structure", + "Tertiary Structure and Quaternary Structure (Qualitative Idea Only)", + "Denaturation of Proteins", + "Enzymes", ], }, { - name: 'Vitamins', - sub_topics: ['Classification and Functions'], + name: "Vitamins", + sub_topics: ["Classification and Functions"], }, { - name: 'Nucleic Acids', - sub_topics: ['DNA and RNA'], + name: "Nucleic Acids", + sub_topics: ["DNA and RNA"], }, ], }, { unit_id: 15, - unit_name: 'Polymers', + unit_name: "Polymers", topics: [ { - name: 'Classification', + name: "Classification", sub_topics: [ - 'Natural and Synthetic', - 'Methods of Polymerization (Addition and Condensation)', - 'Copolymerization', + "Natural and Synthetic", + "Methods of Polymerization (Addition and Condensation)", + "Copolymerization", ], }, { - name: 'Important Polymers', - sub_topics: [ - 'Polythene', - 'Nylon', - 'Polyesters', - 'Bakelite', - 'Rubber', - ], + name: "Important Polymers", + sub_topics: ["Polythene", "Nylon", "Polyesters", "Bakelite", "Rubber"], }, ], }, { unit_id: 16, - unit_name: 'Chemistry in Everyday Life', + unit_name: "Chemistry in Everyday Life", topics: [ { - name: 'Chemicals in Medicines', + name: "Chemicals in Medicines", sub_topics: [ - 'Analgesics', - 'Tranquilizers', - 'Antiseptics', - 'Disinfectants', - 'Antimicrobials', - 'Antifertility Drugs', - 'Antibiotics', - 'Antacids', - 'Antihistamines', + "Analgesics", + "Tranquilizers", + "Antiseptics", + "Disinfectants", + "Antimicrobials", + "Antifertility Drugs", + "Antibiotics", + "Antacids", + "Antihistamines", ], }, { - name: 'Chemicals in Food', - sub_topics: ['Preservatives', 'Artificial Sweetening Agents'], + name: "Chemicals in Food", + sub_topics: ["Preservatives", "Artificial Sweetening Agents"], }, { - name: 'Cleansing Agents', - sub_topics: ['soaps and Detergents', 'Cleansing Action'], + name: "Cleansing Agents", + sub_topics: ["soaps and Detergents", "Cleansing Action"], }, ], }, diff --git a/src/app/models/data/studyOptions.data.ts b/src/app/models/data/studyOptions.data.ts index 3aba64f9..fd7c8109 100644 --- a/src/app/models/data/studyOptions.data.ts +++ b/src/app/models/data/studyOptions.data.ts @@ -1,37 +1,37 @@ -import { EducationLevel, Options } from '../interface/masterData.model'; +import { EducationLevel, Options } from "../interface/masterData.model"; export class StudyOptionsData { public static matriculationSubjects = [ - 'Physics', - 'Chemistry', - 'Mathematics', - 'Biology', - 'English', - 'Computer', - 'Hindi', - 'Sanskrit', - 'Telugu', - 'Malayalam', + "Physics", + "Chemistry", + "Mathematics", + "Biology", + "English", + "Computer", + "Hindi", + "Sanskrit", + "Telugu", + "Malayalam", ]; public static intermediateSubjects = [ - 'Physics', - 'Chemistry', - 'Mathematics', - 'Biology', - 'English', - 'Computer', - 'Hindi', - 'Sanskrit', - 'Telugu', - 'Malayalam', + "Physics", + "Chemistry", + "Mathematics", + "Biology", + "English", + "Computer", + "Hindi", + "Sanskrit", + "Telugu", + "Malayalam", ]; public static educationLevel: EducationLevel[] = [ { - level: 'Matriculation', + level: "Matriculation", subjects: this.matriculationSubjects, }, { - level: 'Intermediate', + level: "Intermediate", subjects: this.intermediateSubjects, }, ]; @@ -42,12 +42,12 @@ export class StudyOptionsData { { title: "Practice", value: "practice" }, { title: "Read", value: "read" }, { title: "Write", value: "write" }, - { title: "Test", value: "test" } + { title: "Test", value: "test" }, ]; public static studyMode: Options[] = [ { title: "Self", value: "self" }, { title: "Group", value: "group" }, { title: "Teacher", value: "teacher" }, - { title: "Online", value: "online" } + { title: "Online", value: "online" }, ]; } diff --git a/src/app/models/functions/time.function.ts b/src/app/models/functions/time.function.ts index adf6c787..330d470c 100644 --- a/src/app/models/functions/time.function.ts +++ b/src/app/models/functions/time.function.ts @@ -1,26 +1,26 @@ export class TimeFunctions { - calculateTotalHours(workLogs) { - const totalHoursPerDay = {}; - workLogs.forEach((workLog) => { - const startTime = workLog.startTime; - const endTime = workLog.endTime; - const startParts = startTime.split(':'); - const endParts = endTime.split(':'); - const startMinutes = parseInt(startParts[0]) * 60 + parseInt(startParts[1]); - const endMinutes = parseInt(endParts[0]) * 60 + parseInt(endParts[1]); - const durationMinutes = endMinutes - startMinutes; - const durationHours = durationMinutes / 60; - const logDate = new Date(workLog.date).toDateString(); - if (totalHoursPerDay[logDate]) { - totalHoursPerDay[logDate] += durationHours; - } else { - totalHoursPerDay[logDate] = durationHours; - } - }); - let output = ''; - for (const date in totalHoursPerDay) { - output += `${date}: ${totalHoursPerDay[date]} hours\n`; - } - return output; + calculateTotalHours(workLogs) { + const totalHoursPerDay = {}; + workLogs.forEach((workLog) => { + const startTime = workLog.startTime; + const endTime = workLog.endTime; + const startParts = startTime.split(":"); + const endParts = endTime.split(":"); + const startMinutes = parseInt(startParts[0]) * 60 + parseInt(startParts[1]); + const endMinutes = parseInt(endParts[0]) * 60 + parseInt(endParts[1]); + const durationMinutes = endMinutes - startMinutes; + const durationHours = durationMinutes / 60; + const logDate = new Date(workLog.date).toDateString(); + if (totalHoursPerDay[logDate]) { + totalHoursPerDay[logDate] += durationHours; + } else { + totalHoursPerDay[logDate] = durationHours; } -} \ No newline at end of file + }); + let output = ""; + for (const date in totalHoursPerDay) { + output += `${date}: ${totalHoursPerDay[date]} hours\n`; + } + return output; + } +} diff --git a/src/app/models/interface/masterData.model.ts b/src/app/models/interface/masterData.model.ts index 940ef5b0..4c36cbd8 100644 --- a/src/app/models/interface/masterData.model.ts +++ b/src/app/models/interface/masterData.model.ts @@ -1,43 +1,42 @@ export interface Features { - title: string, - icon: string, - color: string, - path: string + title: string; + icon: string; + color: string; + path: string; } export interface seoMetaTag { -name:string, -content:string + name: string; + content: string; } -export interface Expense { -} +export interface Expense {} export interface Options { - title:string, - value:string| Date|null + title: string; + value: string | Date | null; } export interface DataDescription { - title:string, - description:string + title: string; + description: string; } export interface Goal { - title?:string, - description?:string + title?: string; + description?: string; } -export interface Syllabus{ - unit_id:number, - unit_name:string, - topics?:topic[], - sub_topics?: string[], - practicals?:string[] +export interface Syllabus { + unit_id: number; + unit_name: string; + topics?: topic[]; + sub_topics?: string[]; + practicals?: string[]; } interface topic { - name:string, - sub_topics?: string[] + name: string; + sub_topics?: string[]; +} +export interface EducationLevel { + level: string; + subjects: string[]; } -export interface EducationLevel{ - level:string, - subjects:string[] -} \ No newline at end of file diff --git a/src/app/models/interface/profile.interface.ts b/src/app/models/interface/profile.interface.ts index 0f866d0e..9503460c 100644 --- a/src/app/models/interface/profile.interface.ts +++ b/src/app/models/interface/profile.interface.ts @@ -1,10 +1,10 @@ export interface ProfileData { - educationDetails?:string[], - projects?:Project[] + educationDetails?: string[]; + projects?: Project[]; } export interface Project { - name:string, - isActive?:boolean, - idField?:string -} \ No newline at end of file + name: string; + isActive?: boolean; + idField?: string; +} diff --git a/src/app/models/interface/user.model.ts b/src/app/models/interface/user.model.ts index 65868f49..2af4e572 100644 --- a/src/app/models/interface/user.model.ts +++ b/src/app/models/interface/user.model.ts @@ -1,7 +1,7 @@ -export interface User{ - uid:string; - email:string; - displayName?:string; +export interface User { + uid: string; + email: string; + displayName?: string; role?: string; permissions?: string[]; -} \ No newline at end of file +} diff --git a/src/app/models/interface/userProfile.interface.ts b/src/app/models/interface/userProfile.interface.ts index 46c1946c..db17f063 100644 --- a/src/app/models/interface/userProfile.interface.ts +++ b/src/app/models/interface/userProfile.interface.ts @@ -1,30 +1,29 @@ export interface UserProfile { - uid: string; - email: string; - emailVerified: boolean; - displayName: string; - isAnonymous: boolean; - photoURL: string; - providerData: ProviderData[]; - stsTokenManager: TokenManager; - createdAt: string; - lastLoginAt: string; - apiKey: string; - appName: string; - } - - interface ProviderData { - providerId: string; - uid: string; - displayName: string; - email: string; - phoneNumber: string | null; - photoURL: string; - } - - interface TokenManager { - refreshToken: string; - accessToken: string; - expirationTime: number; - } - \ No newline at end of file + uid: string; + email: string; + emailVerified: boolean; + displayName: string; + isAnonymous: boolean; + photoURL: string; + providerData: ProviderData[]; + stsTokenManager: TokenManager; + createdAt: string; + lastLoginAt: string; + apiKey: string; + appName: string; +} + +interface ProviderData { + providerId: string; + uid: string; + displayName: string; + email: string; + phoneNumber: string | null; + photoURL: string; +} + +interface TokenManager { + refreshToken: string; + accessToken: string; + expirationTime: number; +} diff --git a/src/app/models/interface/work.interface.ts b/src/app/models/interface/work.interface.ts index 2061ed57..d9b826a2 100644 --- a/src/app/models/interface/work.interface.ts +++ b/src/app/models/interface/work.interface.ts @@ -1,11 +1,11 @@ export interface WorkInterface { - createdAt:string, - date:string, - startTime:string, - endTime:string, - project:string, - type:string, - description:string, - updatedAt:string, - idField?:string -} \ No newline at end of file + createdAt: string; + date: string; + startTime: string; + endTime: string; + project: string; + type: string; + description: string; + updatedAt: string; + idField?: string; +} diff --git a/src/app/models/pipe/time/twelve-hour-format.module.ts b/src/app/models/pipe/time/twelve-hour-format.module.ts index f9364787..63fd4517 100644 --- a/src/app/models/pipe/time/twelve-hour-format.module.ts +++ b/src/app/models/pipe/time/twelve-hour-format.module.ts @@ -1,8 +1,8 @@ -import { NgModule } from '@angular/core'; -import { TwelveHourFormatPipe } from './twelve-hour-format.pipe'; +import { NgModule } from "@angular/core"; +import { TwelveHourFormatPipe } from "./twelve-hour-format.pipe"; @NgModule({ declarations: [TwelveHourFormatPipe], - exports: [TwelveHourFormatPipe] + exports: [TwelveHourFormatPipe], }) -export class TwelveHourFormatPipeModule { } +export class TwelveHourFormatPipeModule {} diff --git a/src/app/models/pipe/time/twelve-hour-format.pipe.spec.ts b/src/app/models/pipe/time/twelve-hour-format.pipe.spec.ts index 004454ee..149d5c21 100644 --- a/src/app/models/pipe/time/twelve-hour-format.pipe.spec.ts +++ b/src/app/models/pipe/time/twelve-hour-format.pipe.spec.ts @@ -1,7 +1,7 @@ -import { TwelveHourFormatPipe } from './twelve-hour-format.pipe'; +import { TwelveHourFormatPipe } from "./twelve-hour-format.pipe"; -describe('TwelveHourFormatPipe', () => { - it('create an instance', () => { +describe("TwelveHourFormatPipe", () => { + it("create an instance", () => { const pipe = new TwelveHourFormatPipe(); expect(pipe).toBeTruthy(); }); diff --git a/src/app/models/pipe/time/twelve-hour-format.pipe.ts b/src/app/models/pipe/time/twelve-hour-format.pipe.ts index 8b0bc66e..e41fa9da 100644 --- a/src/app/models/pipe/time/twelve-hour-format.pipe.ts +++ b/src/app/models/pipe/time/twelve-hour-format.pipe.ts @@ -1,21 +1,20 @@ -import { Pipe, PipeTransform } from '@angular/core'; +import { Pipe, PipeTransform } from "@angular/core"; @Pipe({ - name: 'twelveHourFormat' + name: "twelveHourFormat", }) export class TwelveHourFormatPipe implements PipeTransform { - transform(value: string): string { // Extract the hours and minutes from the input value - const [hours, minutes] = value.split(':').map(Number); + const [hours, minutes] = value.split(":").map(Number); // Determine if the time is AM or PM - const amPm = hours >= 12 ? 'PM' : 'AM'; + const amPm = hours >= 12 ? "PM" : "AM"; // Convert hours to 12-hour format let formattedHours = hours % 12 || 12; // Return the formatted time string - return `${formattedHours}:${minutes.toString().padStart(2, '0')} ${amPm}`; + return `${formattedHours}:${minutes.toString().padStart(2, "0")} ${amPm}`; } } diff --git a/src/app/pages/about/about-routing.module.ts b/src/app/pages/about/about-routing.module.ts index 3d41bc68..9cb9feb3 100644 --- a/src/app/pages/about/about-routing.module.ts +++ b/src/app/pages/about/about-routing.module.ts @@ -1,27 +1,27 @@ -import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; +import { NgModule } from "@angular/core"; +import { Routes, RouterModule } from "@angular/router"; -import { AboutPage } from './about.page'; -import { HofComponent } from './components/hof/hof.component'; -import { HowtoComponent } from './components/howto/howto.component'; -import { UpdateComponent } from './components/update/update.component'; +import { AboutPage } from "./about.page"; +import { HofComponent } from "./components/hof/hof.component"; +import { HowtoComponent } from "./components/howto/howto.component"; +import { UpdateComponent } from "./components/update/update.component"; const routes: Routes = [ { - path: '', - component: AboutPage + path: "", + component: AboutPage, }, { - path: 'howto', - component: HowtoComponent + path: "howto", + component: HowtoComponent, }, { - path: 'hof', - component: HofComponent + path: "hof", + component: HofComponent, }, { - path: 'update', - component: UpdateComponent + path: "update", + component: UpdateComponent, }, ]; diff --git a/src/app/pages/about/about.module.ts b/src/app/pages/about/about.module.ts index 6800168f..987a9e25 100644 --- a/src/app/pages/about/about.module.ts +++ b/src/app/pages/about/about.module.ts @@ -1,28 +1,18 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { FormsModule } from '@angular/forms'; +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { FormsModule } from "@angular/forms"; -import { IonicModule } from '@ionic/angular'; +import { IonicModule } from "@ionic/angular"; -import { AboutPageRoutingModule } from './about-routing.module'; +import { AboutPageRoutingModule } from "./about-routing.module"; -import { AboutPage } from './about.page'; -import { HowtoComponent } from './components/howto/howto.component'; -import { UpdateComponent } from './components/update/update.component'; -import { HofComponent } from './components/hof/hof.component'; +import { AboutPage } from "./about.page"; +import { HowtoComponent } from "./components/howto/howto.component"; +import { UpdateComponent } from "./components/update/update.component"; +import { HofComponent } from "./components/hof/hof.component"; @NgModule({ - imports: [ - CommonModule, - FormsModule, - IonicModule, - AboutPageRoutingModule - ], - declarations: [ - AboutPage, - HowtoComponent, - UpdateComponent, - HofComponent - ] + imports: [CommonModule, FormsModule, IonicModule, AboutPageRoutingModule], + declarations: [AboutPage, HowtoComponent, UpdateComponent, HofComponent], }) export class AboutPageModule {} diff --git a/src/app/pages/about/about.page.html b/src/app/pages/about/about.page.html index 20966399..a291031f 100644 --- a/src/app/pages/about/about.page.html +++ b/src/app/pages/about/about.page.html @@ -25,7 +25,7 @@

Check for Update

- {{item.type}} : + {{item.type}} : {{item.date}} : {{item.version}} @@ -33,27 +33,37 @@

Check for Update

- Check for update - - - Update Details - + Check for update + + + + Update Details +

- Last update check : {{lastUpdateOn }} + + Last update check : {{lastUpdateOn }} +

{{infoNote}}

Thanks Awesome Users

- Top Contributors in reporting bugs and suggestions : + + Top Contributors in reporting bugs and suggestions : +
    -
  1. Vinayak ( 10+ Contributions )
  2. +
  3. + Vinayak + ( 10+ Contributions ) +
  4. Charan
  5. Sofia
  6. Sanayam
- ** Hall of frame will be availabe soon. Please keep contributing. + + ** Hall of frame will be availabe soon. Please keep contributing. + - - - - - - - - + + + + + + + @@ -113,7 +180,6 @@

Expense logged for {{expenseOf}}

{{expense.description}} : {{expense.amount}}

-->
-
@@ -125,14 +191,30 @@

My Expenses

- + Duration Spent On Type - + {{item.title }} @@ -144,27 +226,35 @@

My Expenses

- {{item.title}} + + {{item.title}} +
- - {{ item.title - }} + + + {{ item.title }} +
-
-

{{expenseMessage}} {{expenseCurrency}} {{totalExpense}}

+

{{expenseMessage}} {{expenseCurrency}} {{totalExpense}}

-
@@ -187,10 +277,18 @@

My Expenses

{{ expense?.spendedOn | titlecase}} - + - + @@ -199,10 +297,10 @@

My Expenses

- Analyze Expenses + + Analyze Expenses Export Data -
@@ -210,26 +308,64 @@

My Expenses

Record and Analyze Expense

My budget list

-

* Note : To use upcoming Analyze feature it is required to - provide your income / budget ( planned / alloted amount to be spent ) for the specific month

+

+ * Note : To use upcoming Analyze feature it is required to provide your income / budget ( + planned / alloted amount to be spent ) for the specific month +

- +
- +
- Add Budget - Update - Get My - Budget - Go to Add - Budget + + Add Budget + + + Update + + + Get My Budget + + + Go to Add Budget +
@@ -240,11 +376,11 @@

My budget list

{{ item.month | date:'MMM y' }} - : {{expenseCurrency}} {{item.amount}} + : {{expenseCurrency}} {{item.amount}}
- \ No newline at end of file + diff --git a/src/app/pages/expense/expenses.page.spec.ts b/src/app/pages/expense/expenses.page.spec.ts index ef22aab5..321fa021 100644 --- a/src/app/pages/expense/expenses.page.spec.ts +++ b/src/app/pages/expense/expenses.page.spec.ts @@ -1,16 +1,16 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { IonicModule } from '@ionic/angular'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { IonicModule } from "@ionic/angular"; -import { ExpensesPage } from './expenses.page'; +import { ExpensesPage } from "./expenses.page"; -describe('ExpensesPage', () => { +describe("ExpensesPage", () => { let component: ExpensesPage; let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ ExpensesPage ], - imports: [IonicModule.forRoot()] + declarations: [ExpensesPage], + imports: [IonicModule.forRoot()], }).compileComponents(); fixture = TestBed.createComponent(ExpensesPage); @@ -18,7 +18,7 @@ describe('ExpensesPage', () => { fixture.detectChanges(); })); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/pages/expense/expenses.page.ts b/src/app/pages/expense/expenses.page.ts index 166808e7..87aa8b98 100644 --- a/src/app/pages/expense/expenses.page.ts +++ b/src/app/pages/expense/expenses.page.ts @@ -1,40 +1,42 @@ -import { Component, EventEmitter, OnInit, Output } from '@angular/core'; -import { CustomDate } from 'src/app/models/class/date/custom-date'; -import { serverTimestamp } from '@angular/fire/firestore'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { ExpenseService } from 'src/app/services/expense/expense.service'; -import { SeoService } from 'src/app/services/seo/seo.service'; -import { Options } from 'src/app/models/interface/masterData.model'; -import { AlertService } from 'src/app/services/alert/alert.service'; -import { DatePipe } from '@angular/common'; -import { Router } from '@angular/router'; -import * as XLSX from 'xlsx'; -import * as FileSaver from 'file-saver'; -import { Analyze } from './modules/analyze'; -import { PopoverController } from '@ionic/angular'; +import { Component, EventEmitter, OnInit, Output } from "@angular/core"; +import { CustomDate } from "src/app/models/class/date/custom-date"; +import { serverTimestamp } from "@angular/fire/firestore"; +import { FormBuilder, FormGroup, Validators } from "@angular/forms"; +import { ExpenseService } from "src/app/services/expense/expense.service"; +import { SeoService } from "src/app/services/seo/seo.service"; +import { Options } from "src/app/models/interface/masterData.model"; +import { AlertService } from "src/app/services/alert/alert.service"; +import { DatePipe } from "@angular/common"; +import { Router } from "@angular/router"; +import * as XLSX from "xlsx"; +import * as FileSaver from "file-saver"; +import { Analyze } from "./modules/analyze"; +import { PopoverController } from "@ionic/angular"; @Component({ - selector: 'app-expenses', - templateUrl: './expenses.page.html', - styleUrls: ['./expenses.page.scss'], + selector: "app-expenses", + templateUrl: "./expenses.page.html", + styleUrls: ["./expenses.page.scss"], }) export class ExpensesPage implements OnInit { @Output() expenseData = new EventEmitter(); - pageTitle = "Expenses" + pageTitle = "Expenses"; pageMetaTags = [ { - name: 'description', - content: "Summarize all your expenses here. Summarize will help you to check them down in the list immediately and later Analyze them to have an understanding about where you can spend wisely and how to manage your expenses in better way. Soon we will also give finance tips that will help you better." + name: "description", + content: + "Summarize all your expenses here. Summarize will help you to check them down in the list immediately and later Analyze them to have an understanding about where you can spend wisely and how to manage your expenses in better way. Soon we will also give finance tips that will help you better.", }, { - name: 'keyword', - content: 'Summarize, Summarize, arise, arize, money management, expense management, cost analysis,summarize-ng, summarize-ng, digital dairy, expense analysis' - } + name: "keyword", + content: + "Summarize, Summarize, arise, arize, money management, expense management, cost analysis,summarize-ng, summarize-ng, digital dairy, expense analysis", + }, ]; - editMode:boolean = false; - updateSubmitted= false; - editExpenseData:any; - dateToday: string | null = this.datePipe.transform(new Date(), 'yyyy-MM-dd'); - expenseOf:string = this.dateToday; + editMode: boolean = false; + updateSubmitted = false; + editExpenseData: any; + dateToday: string | null = this.datePipe.transform(new Date(), "yyyy-MM-dd"); + expenseOf: string = this.dateToday; expenseByDate: any; constructor( private fb: FormBuilder, @@ -43,9 +45,8 @@ export class ExpensesPage implements OnInit { private alertService: AlertService, private datePipe: DatePipe, public popoverController: PopoverController, - private router: Router - ) { - } + private router: Router, + ) {} Expenses: any = []; Budget: any = []; budgetExists = false; @@ -53,7 +54,10 @@ export class ExpensesPage implements OnInit { expensesCount: number = 0; totalExpense = 0; dataSize = 5; - weekBackDate: string | null = this.datePipe.transform(new CustomDate().getWeekBackDate(), 'yyyy-MM-dd'); + weekBackDate: string | null = this.datePipe.transform( + new CustomDate().getWeekBackDate(), + "yyyy-MM-dd", + ); expenseTypes = [ { title: "Bills", value: "bill" }, { title: "Emi", value: "emi" }, @@ -73,45 +77,54 @@ export class ExpensesPage implements OnInit { { title: "Transportation", value: "transportation" }, { title: "Travel", value: "travel" }, { title: "Donate", value: "donated" }, - { title: "Miscellaneous", value: "miscellaneous" } - ] + { title: "Miscellaneous", value: "miscellaneous" }, + ]; spentOn = [ { value: "self", title: "Self" }, { value: "group", title: "Group" }, - { value: "family", title: "Family" } - ] - filterType: string = "duration" - filterParams: any = "" - filterDuration: any = this.weekBackDate + { value: "family", title: "Family" }, + ]; + filterType: string = "duration"; + filterParams: any = ""; + filterDuration: any = this.weekBackDate; durationFilter: Options[] = [ // { title: "5 Recent", value: "recent" }, { title: "Today", value: this.dateToday }, { title: "7 Days", value: this.weekBackDate }, - { title: "30 Days", value: this.datePipe.transform(new CustomDate().getLastMonthDate(), 'yyyy-MM-dd') }, - { title: "365 Days", value: this.datePipe.transform(new CustomDate().getLastYearDate(), 'yyyy-MM-dd') }, + { + title: "30 Days", + value: this.datePipe.transform(new CustomDate().getLastMonthDate(), "yyyy-MM-dd"), + }, + { + title: "365 Days", + value: this.datePipe.transform(new CustomDate().getLastYearDate(), "yyyy-MM-dd"), + }, { title: "This Month", value: new CustomDate().getThisMonth() }, - { title: "This Year", value: new CustomDate().getThisYear() } - ] - expenseMessage: string = "Getting Last 5 Expenses :" - expenseCurrency: string = "₹" + { title: "This Year", value: new CustomDate().getThisYear() }, + ]; + expenseMessage: string = "Getting Last 5 Expenses :"; + expenseCurrency: string = "₹"; showFilter: boolean = false; - handlerMessage = ''; - roleMessage = ''; + handlerMessage = ""; + roleMessage = ""; expenseForm: FormGroup = this.fb.group({ createdAt: [serverTimestamp()], - date: [this.dateToday, [Validators.required, Validators.pattern('^[a-zA-Z 0-9 .,-]*$')]], - amount: ['', [Validators.required, Validators.pattern('^[0-9]*$')]], - type: ['', [Validators.required, Validators.pattern('^[a-zA-Z0-9 ]*$')]], - description: ['', [Validators.required, Validators.pattern('^[a-zA-Z0-9\n, -.]*$')]], - spendedOn: ['self', [Validators.required, Validators.pattern('^[a-zA-Z 0-9 .,-]*$')]], - updatedAt: [serverTimestamp()] - }) + date: [this.dateToday, [Validators.required, Validators.pattern("^[a-zA-Z 0-9 .,-]*$")]], + amount: ["", [Validators.required, Validators.pattern("^[0-9]*$")]], + type: ["", [Validators.required, Validators.pattern("^[a-zA-Z0-9 ]*$")]], + description: ["", [Validators.required, Validators.pattern("^[a-zA-Z0-9\n, -.]*$")]], + spendedOn: ["self", [Validators.required, Validators.pattern("^[a-zA-Z 0-9 .,-]*$")]], + updatedAt: [serverTimestamp()], + }); budgetForm: FormGroup = this.fb.group({ createdAt: [serverTimestamp()], - month: [new CustomDate().getCurrentMonth(), [Validators.required, Validators.pattern('^[0-9-]*$')]], - amount: ['', [Validators.required, Validators.pattern('^[0-9]*$')]], - updatedAt: [serverTimestamp()] - }) + month: [ + new CustomDate().getCurrentMonth(), + [Validators.required, Validators.pattern("^[0-9-]*$")], + ], + amount: ["", [Validators.required, Validators.pattern("^[0-9]*$")]], + updatedAt: [serverTimestamp()], + }); ngOnInit() { this.seoService.seo(this.pageTitle, this.pageMetaTags); @@ -122,109 +135,110 @@ export class ExpensesPage implements OnInit { await this.expenseService.getExpenses(this.dataSize).subscribe((res: any) => { this.Expenses = res; this.expensesCount = this.Expenses.length; - this.getTotalExpense() - }) - this.expenseMessage = "Total of last 5 Expenses : " - this.expenseSize = "week" + this.getTotalExpense(); + }); + this.expenseMessage = "Total of last 5 Expenses : "; + this.expenseSize = "week"; } async getAllExpenses() { await this.expenseService.getExpenses().subscribe((res: any) => { this.Expenses = res; this.expensesCount = this.Expenses.length; - sessionStorage.setItem("total_expense", JSON.stringify(this.Expenses)) - }) - this.expenseSize = "all" - + sessionStorage.setItem("total_expense", JSON.stringify(this.Expenses)); + }); + this.expenseSize = "all"; } addExpense() { this.expenseService.addExpense(this.expenseForm.value); this.expenseForm.patchValue({ - amount: '', - description: '' + amount: "", + description: "", }); this.seoService.eventTrigger("form", this.pageTitle); } - editExpense(expense){ + editExpense(expense) { this.editExpenseData = expense; this.expenseForm.patchValue({ - createdAt : expense.createdAt, + createdAt: expense.createdAt, date: expense.date, amount: expense.amount, type: expense.type, description: expense.description, - spendedOn: expense.spendedOn - }) + spendedOn: expense.spendedOn, + }); } - async updateExpense(){ + async updateExpense() { this.updateSubmitted = true; - const response = await this.expenseService.updateExpense(this.expenseForm.value, this.editExpenseData.idField); + const response = await this.expenseService.updateExpense( + this.expenseForm.value, + this.editExpenseData.idField, + ); if (response) { this.cancelUpdate(); - } - else{ + } else { this.updateSubmitted = false; } } - cancelUpdate(){ - this.editMode=false; + cancelUpdate() { + this.editMode = false; this.expenseForm.markAsUntouched(); this.updateSubmitted = false; setTimeout(() => { - this.backToDefault(); + this.backToDefault(); }, 100); } - async backToDefault(){ + async backToDefault() { this.expenseForm.reset({ createdAt: serverTimestamp(), date: this.dateToday.toString(), spendedOn: "self", - amount:0, - type:"", - description:"", - }) + amount: 0, + type: "", + description: "", + }); } async deleteExpense(idField: string) { - const response = await this.alertService.deleteAlert() + const response = await this.alertService.deleteAlert(); if (response === "confirm") { this.expenseService.deleteExpense(idField); } } getTotalExpense() { - this.totalExpense = 0 + this.totalExpense = 0; this.Expenses.forEach((expense: any) => { - this.totalExpense += expense.amount + this.totalExpense += expense.amount; }); } async getAllExpenseOf() { if (this.expenseOf !== null) { - (await this.expenseService.getExpenseByDate(this.expenseOf)).subscribe((res:any) => { + (await this.expenseService.getExpenseByDate(this.expenseOf)).subscribe((res: any) => { this.expenseByDate = res; - }) + }); } } filterBy() { switch (this.filterType) { case "duration": - this.filterParams = this.weekBackDate + this.filterParams = this.weekBackDate; break; case "spentOn": - this.filterParams = "self" + this.filterParams = "self"; break; case "type": - this.filterParams = "food" + this.filterParams = "food"; break; default: - this.filterType = "duration" - this.filterParams = "week" + this.filterType = "duration"; + this.filterParams = "week"; break; } } @@ -234,22 +248,25 @@ export class ExpensesPage implements OnInit { this.expenseMessage = "Total Expenses since " + this.filterParams + " : "; break; case "spentOn": - this.expenseMessage = "Total Expenses on " + this.filterParams + " since " + this.filterDuration + " : "; + this.expenseMessage = + "Total Expenses on " + this.filterParams + " since " + this.filterDuration + " : "; break; case "type": - this.expenseMessage = "Total Expenses for " + this.filterParams + " since " + this.filterDuration + " : "; + this.expenseMessage = + "Total Expenses for " + this.filterParams + " since " + this.filterDuration + " : "; break; default: - this.expenseMessage = "No Expenses found for " + this.filterParams + " : " + this.expenseMessage = "No Expenses found for " + this.filterParams + " : "; break; } this.Expenses = []; - await this.expenseService.getCustomExpenses(this.filterType, this.filterParams, this.filterDuration).subscribe((res: any) => { - this.Expenses = res; - this.expensesCount = this.Expenses.length; - this.getTotalExpense(); - }) - + await this.expenseService + .getCustomExpenses(this.filterType, this.filterParams, this.filterDuration) + .subscribe((res: any) => { + this.Expenses = res; + this.expensesCount = this.Expenses.length; + this.getTotalExpense(); + }); } async getBudget() { @@ -258,85 +275,78 @@ export class ExpensesPage implements OnInit { if (this.Budget.length > 0) { this.budgetExists = true; } - sessionStorage.setItem("budget", JSON.stringify(this.Budget)) - }) - - + sessionStorage.setItem("budget", JSON.stringify(this.Budget)); + }); } async addBudget() { let month = this.budgetForm.value.month; let savedBudget: any; let monthExists: any; - await this.getBudget().then(res => { - let tempBudget = sessionStorage.getItem('budget') + await this.getBudget().then((res) => { + let tempBudget = sessionStorage.getItem("budget"); if (tempBudget) { - savedBudget = JSON.parse(tempBudget) + savedBudget = JSON.parse(tempBudget); + } else { + alert("There was some error in adding budget. Try later or report via help section."); } - else { - alert("There was some error in adding budget. Try later or report via help section.") - } - monthExists = savedBudget.find((item: any) => - item.month === month - ) - }) + monthExists = savedBudget.find((item: any) => item.month === month); + }); if (monthExists) { - alert("This month already exists.Please use update section to verify and update.") - } - else { + alert("This month already exists.Please use update section to verify and update."); + } else { await this.expenseService.addBudget(this.budgetForm.value); - sessionStorage.setItem("budget", JSON.stringify(this.Budget)) + sessionStorage.setItem("budget", JSON.stringify(this.Budget)); } - - } async updateBudget() { const month = this.budgetForm.value.month; - const updatedBudget = this.Budget.filter((item: any) => - item.month === this.budgetForm.value.month - ) + const updatedBudget = this.Budget.filter( + (item: any) => item.month === this.budgetForm.value.month, + ); if (updatedBudget !== undefined && updatedBudget.length > 0) { - const newBudget = updatedBudget[0] - newBudget.amount = this.budgetForm.value.amount - newBudget.updatedAt = serverTimestamp() - await this.expenseService.updateBudget(newBudget) + const newBudget = updatedBudget[0]; + newBudget.amount = this.budgetForm.value.amount; + newBudget.updatedAt = serverTimestamp(); + await this.expenseService.updateBudget(newBudget); } else { - const message = `Budget for ${month} does not exist. Please add first.` - this.expenseService.successAlert(message) + const message = `Budget for ${month} does not exist. Please add first.`; + this.expenseService.successAlert(message); } - sessionStorage.setItem("budget", JSON.stringify(this.Budget)) - + sessionStorage.setItem("budget", JSON.stringify(this.Budget)); } async analyzeExpense() { this.getAllExpenses(); await this.getBudget(); - this.router.navigateByUrl('expenses/analyze'); + this.router.navigateByUrl("expenses/analyze"); } // Export data async exportData() { - const data: any[] = this.Expenses.map((item:any) => ({ + const data: any[] = this.Expenses.map((item: any) => ({ Date: item.date, Cost: item.amount, - Description: item.description.replace(/\n/g, '\n '), - Type:item.type, - SpentOn: item.spendedOn + Description: item.description.replace(/\n/g, "\n "), + Type: item.type, + SpentOn: item.spendedOn, })); - let categoryWiseData = await new Analyze().getCategoryWiseData(this.Expenses); + let categoryWiseData = await new Analyze().getCategoryWiseData(this.Expenses); // console.log(categoryWiseData); - const filename= "ExpenseData"+ new Date().getTime() +".xlsx" + const filename = "ExpenseData" + new Date().getTime() + ".xlsx"; const worksheet: XLSX.WorkSheet = XLSX.utils.json_to_sheet(data); const categoryData: XLSX.WorkSheet = XLSX.utils.json_to_sheet(categoryWiseData); const workbook: XLSX.WorkBook = { Sheets: { - 'Expense Data': worksheet, - 'Category wise' : categoryData + "Expense Data": worksheet, + "Category wise": categoryData, }, - SheetNames: ['Expense Data', 'Category wise'] + SheetNames: ["Expense Data", "Category wise"], }; - const excelBuffer: any = XLSX.write(workbook, { bookType: 'xlsx', type: 'array' }); - const excelBlob: Blob = new Blob([excelBuffer], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' }); + const excelBuffer: any = XLSX.write(workbook, { bookType: "xlsx", type: "array" }); + const excelBlob: Blob = new Blob([excelBuffer], { + type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", + }); FileSaver.saveAs(excelBlob, filename); } } diff --git a/src/app/pages/expense/modules/analyze.spec.ts b/src/app/pages/expense/modules/analyze.spec.ts index ba56c043..a8ca7ce4 100644 --- a/src/app/pages/expense/modules/analyze.spec.ts +++ b/src/app/pages/expense/modules/analyze.spec.ts @@ -1,7 +1,7 @@ -import { Analyze } from './analyze'; +import { Analyze } from "./analyze"; -describe('Analyze', () => { - it('should create an instance', () => { +describe("Analyze", () => { + it("should create an instance", () => { expect(new Analyze()).toBeTruthy(); }); }); diff --git a/src/app/pages/expense/modules/budget.spec.ts b/src/app/pages/expense/modules/budget.spec.ts index 71961771..b95a192c 100644 --- a/src/app/pages/expense/modules/budget.spec.ts +++ b/src/app/pages/expense/modules/budget.spec.ts @@ -1,7 +1,7 @@ -import { Budget } from './budget'; +import { Budget } from "./budget"; -describe('Budget', () => { - it('should create an instance', () => { +describe("Budget", () => { + it("should create an instance", () => { expect(new Budget()).toBeTruthy(); }); }); diff --git a/src/app/pages/expense/modules/budget.ts b/src/app/pages/expense/modules/budget.ts index 72f58166..f0281917 100644 --- a/src/app/pages/expense/modules/budget.ts +++ b/src/app/pages/expense/modules/budget.ts @@ -1,31 +1,31 @@ export class Budget { - async getCurrentBudget(currentMonth:string) { - let retrievedBudget :any = 0 - retrievedBudget = await sessionStorage.getItem('budget'); + async getCurrentBudget(currentMonth: string) { + let retrievedBudget: any = 0; + retrievedBudget = await sessionStorage.getItem("budget"); let currentBudget: number = 0; if (retrievedBudget) { - let budget = JSON.parse(retrievedBudget) + let budget = JSON.parse(retrievedBudget); const budgetForThisMonth = budget.find((item: any) => item.month === currentMonth); // console.log(budgetForThisMonth); - if(budgetForThisMonth){ - currentBudget = budgetForThisMonth.amount + if (budgetForThisMonth) { + currentBudget = budgetForThisMonth.amount; + } else { + alert("Budget for the current month not found. Add budget first"); } - else{ - alert("Budget for the current month not found. Add budget first") - } - } - else{ - currentBudget=0; - alert("There was some error getting your budget. Make sure you have added budget for this month.") + } else { + currentBudget = 0; + alert( + "There was some error getting your budget. Make sure you have added budget for this month.", + ); } return currentBudget; } getTotalBudget(): number { - let retrievedBudget = sessionStorage.getItem('budget'); + let retrievedBudget = sessionStorage.getItem("budget"); let currentBudget: number = 0; if (retrievedBudget) { - let budget = JSON.parse(retrievedBudget) + let budget = JSON.parse(retrievedBudget); budget.forEach((item: any) => { currentBudget = currentBudget + item.amount; }); diff --git a/src/app/pages/expense/modules/daily-expense.spec.ts b/src/app/pages/expense/modules/daily-expense.spec.ts index 6eea0f20..91f82e07 100644 --- a/src/app/pages/expense/modules/daily-expense.spec.ts +++ b/src/app/pages/expense/modules/daily-expense.spec.ts @@ -1,7 +1,7 @@ -import { DailyExpense } from './daily-expense'; +import { DailyExpense } from "./daily-expense"; -describe('DailyExpense', () => { - it('should create an instance', () => { +describe("DailyExpense", () => { + it("should create an instance", () => { expect(new DailyExpense()).toBeTruthy(); }); }); diff --git a/src/app/pages/expense/modules/daily-expense.ts b/src/app/pages/expense/modules/daily-expense.ts index 966fa3c1..223c0b54 100644 --- a/src/app/pages/expense/modules/daily-expense.ts +++ b/src/app/pages/expense/modules/daily-expense.ts @@ -1,2 +1 @@ -export class DailyExpense { -} +export class DailyExpense {} diff --git a/src/app/pages/expense/modules/monthly-expense.spec.ts b/src/app/pages/expense/modules/monthly-expense.spec.ts index a66845f1..283d4492 100644 --- a/src/app/pages/expense/modules/monthly-expense.spec.ts +++ b/src/app/pages/expense/modules/monthly-expense.spec.ts @@ -1,7 +1,7 @@ -import { MonthlyExpense } from './monthly-expense'; +import { MonthlyExpense } from "./monthly-expense"; -describe('MonthlyExpense', () => { - it('should create an instance', () => { +describe("MonthlyExpense", () => { + it("should create an instance", () => { expect(new MonthlyExpense()).toBeTruthy(); }); }); diff --git a/src/app/pages/expense/modules/monthly-expense.ts b/src/app/pages/expense/modules/monthly-expense.ts index dc5af0de..c43a56c9 100644 --- a/src/app/pages/expense/modules/monthly-expense.ts +++ b/src/app/pages/expense/modules/monthly-expense.ts @@ -1,26 +1,24 @@ export class MonthlyExpense { - currentExpenseGraph() { - - } + currentExpenseGraph() {} getCurrentExpense(): number { - return 0 + return 0; } getExpensesAfterDate(expenses: any[], firstDateOfMonth: string) { - return expenses.filter(expense => expense.date >= firstDateOfMonth); + return expenses.filter((expense) => expense.date >= firstDateOfMonth); } - getMonthlyData(expense: any[], currentBudget:number) { + getMonthlyData(expense: any[], currentBudget: number) { let dates: any = []; let amount: any = []; let dailyAmount: any = []; - let incrementAmount: number = 0 - let budgetData:any = [] + let incrementAmount: number = 0; + let budgetData: any = []; expense.forEach((data: any, index: number) => { - dailyAmount.push(data.amount) + dailyAmount.push(data.amount); incrementAmount += data.amount; amount.push(incrementAmount); dates.push(data.date); - budgetData.push(currentBudget) + budgetData.push(currentBudget); }); - return { dates, dailyAmount, amount,budgetData,incrementAmount } + return { dates, dailyAmount, amount, budgetData, incrementAmount }; } } diff --git a/src/app/pages/expense/modules/total-expense.spec.ts b/src/app/pages/expense/modules/total-expense.spec.ts index 1c7edad2..f0732a2e 100644 --- a/src/app/pages/expense/modules/total-expense.spec.ts +++ b/src/app/pages/expense/modules/total-expense.spec.ts @@ -1,7 +1,7 @@ -import { TotalExpense } from './total-expense'; +import { TotalExpense } from "./total-expense"; -describe('TotalExpense', () => { - it('should create an instance', () => { +describe("TotalExpense", () => { + it("should create an instance", () => { expect(new TotalExpense()).toBeTruthy(); }); }); diff --git a/src/app/pages/expense/modules/total-expense.ts b/src/app/pages/expense/modules/total-expense.ts index f5b1c1ab..13fcc3c5 100644 --- a/src/app/pages/expense/modules/total-expense.ts +++ b/src/app/pages/expense/modules/total-expense.ts @@ -1,6 +1,6 @@ export class TotalExpense { - async incrementExpense(expenses:any[]){ - const dailyExpenses: any[] = []; + async incrementExpense(expenses: any[]) { + const dailyExpenses: any[] = []; // Get unique dates from expenses array const uniqueDates = [...new Set(expenses.map((e) => e.date))]; // Loop through unique dates and calculate daily expenses @@ -13,13 +13,22 @@ export class TotalExpense { return dailyExpenses; } - getIncrementalExpenses(month: string, totalExpenses: { date: string, amount: number }[]): { date: string, amount: number }[] { - const expenses:any[] = []; + getIncrementalExpenses( + month: string, + totalExpenses: { date: string; amount: number }[], + ): { date: string; amount: number }[] { + const expenses: any[] = []; const monthDate = new Date(month); // Loop through each day of the month - for (let i = 1; i <= new Date(monthDate.getFullYear(), monthDate.getMonth() + 1, 0).getDate(); i++) { - const date = new Date(monthDate.getFullYear(), monthDate.getMonth(), i).toISOString().substr(0, 10); + for ( + let i = 1; + i <= new Date(monthDate.getFullYear(), monthDate.getMonth() + 1, 0).getDate(); + i++ + ) { + const date = new Date(monthDate.getFullYear(), monthDate.getMonth(), i) + .toISOString() + .substr(0, 10); let total = 0; // Loop through total expenses and add up amount spent on this day @@ -39,6 +48,4 @@ export class TotalExpense { return expenses; } - - } diff --git a/src/app/pages/goal/components/goal-info/goal-info.component.html b/src/app/pages/goal/components/goal-info/goal-info.component.html index 739e8634..e2ef27fe 100644 --- a/src/app/pages/goal/components/goal-info/goal-info.component.html +++ b/src/app/pages/goal/components/goal-info/goal-info.component.html @@ -4,7 +4,12 @@ {{ title }} - + @@ -16,7 +21,8 @@

How to set Goal

  • - {{item.title}} : {{item.description}} + {{ item.title }} : + {{ item.description }}
@@ -24,7 +30,8 @@

How to set Goal

Goal Categories

  • - {{item.title}} : {{item.description}} + {{ item.title }} : + {{ item.description }}
diff --git a/src/app/pages/goal/components/goal-info/goal-info.component.spec.ts b/src/app/pages/goal/components/goal-info/goal-info.component.spec.ts index 373b46ab..0a3c7059 100644 --- a/src/app/pages/goal/components/goal-info/goal-info.component.spec.ts +++ b/src/app/pages/goal/components/goal-info/goal-info.component.spec.ts @@ -1,16 +1,16 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { IonicModule } from '@ionic/angular'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { IonicModule } from "@ionic/angular"; -import { GoalInfoComponent } from './goal-info.component'; +import { GoalInfoComponent } from "./goal-info.component"; -describe('GoalInfoComponent', () => { +describe("GoalInfoComponent", () => { let component: GoalInfoComponent; let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ GoalInfoComponent ], - imports: [IonicModule.forRoot()] + declarations: [GoalInfoComponent], + imports: [IonicModule.forRoot()], }).compileComponents(); fixture = TestBed.createComponent(GoalInfoComponent); @@ -18,7 +18,7 @@ describe('GoalInfoComponent', () => { fixture.detectChanges(); })); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/pages/goal/components/goal-info/goal-info.component.ts b/src/app/pages/goal/components/goal-info/goal-info.component.ts index 26128cc5..ffdff4d2 100644 --- a/src/app/pages/goal/components/goal-info/goal-info.component.ts +++ b/src/app/pages/goal/components/goal-info/goal-info.component.ts @@ -1,18 +1,16 @@ -import { Component, OnInit } from '@angular/core'; -import { GoalData } from 'src/app/models/class/static/goal'; -import { DataDescription } from 'src/app/models/interface/masterData.model'; +import { Component, OnInit } from "@angular/core"; +import { GoalData } from "src/app/models/class/static/goal"; +import { DataDescription } from "src/app/models/interface/masterData.model"; @Component({ - selector: 'app-goal-info', - templateUrl: './goal-info.component.html', - styleUrls: ['./goal-info.component.scss'], + selector: "app-goal-info", + templateUrl: "./goal-info.component.html", + styleUrls: ["./goal-info.component.scss"], }) export class GoalInfoComponent { - title:string = "Goal Setting"; - goalSetting:DataDescription[] = GoalData.goalSetting; - goalDetails:DataDescription[] = GoalData.goalDetails; - - constructor() { } - + title: string = "Goal Setting"; + goalSetting: DataDescription[] = GoalData.goalSetting; + goalDetails: DataDescription[] = GoalData.goalDetails; + constructor() {} } diff --git a/src/app/pages/goal/goal-routing.module.ts b/src/app/pages/goal/goal-routing.module.ts index e0f7ff85..e0962413 100644 --- a/src/app/pages/goal/goal-routing.module.ts +++ b/src/app/pages/goal/goal-routing.module.ts @@ -1,18 +1,18 @@ -import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; +import { NgModule } from "@angular/core"; +import { Routes, RouterModule } from "@angular/router"; -import { GoalPage } from './goal.page'; -import { GoalInfoComponent } from './components/goal-info/goal-info.component'; +import { GoalPage } from "./goal.page"; +import { GoalInfoComponent } from "./components/goal-info/goal-info.component"; const routes: Routes = [ { - path: '', - component: GoalPage + path: "", + component: GoalPage, }, { - path: 'info', - component: GoalInfoComponent - } + path: "info", + component: GoalInfoComponent, + }, ]; @NgModule({ diff --git a/src/app/pages/goal/goal.module.ts b/src/app/pages/goal/goal.module.ts index 0e0c09c6..5c737cc8 100644 --- a/src/app/pages/goal/goal.module.ts +++ b/src/app/pages/goal/goal.module.ts @@ -1,25 +1,16 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { FormsModule, ReactiveFormsModule } from "@angular/forms"; -import { IonicModule } from '@ionic/angular'; +import { IonicModule } from "@ionic/angular"; -import { GoalPageRoutingModule } from './goal-routing.module'; +import { GoalPageRoutingModule } from "./goal-routing.module"; -import { GoalPage } from './goal.page'; -import { GoalInfoComponent } from './components/goal-info/goal-info.component'; +import { GoalPage } from "./goal.page"; +import { GoalInfoComponent } from "./components/goal-info/goal-info.component"; @NgModule({ - imports: [ - CommonModule, - FormsModule, - IonicModule, - GoalPageRoutingModule, - ReactiveFormsModule - ], - declarations: [ - GoalPage, - GoalInfoComponent - ], + imports: [CommonModule, FormsModule, IonicModule, GoalPageRoutingModule, ReactiveFormsModule], + declarations: [GoalPage, GoalInfoComponent], }) export class GoalPageModule {} diff --git a/src/app/pages/goal/goal.page.html b/src/app/pages/goal/goal.page.html index eda591c1..41376763 100644 --- a/src/app/pages/goal/goal.page.html +++ b/src/app/pages/goal/goal.page.html @@ -14,72 +14,152 @@
-
+
- How to set Goal + + How to set Goal +
-
+

Set Goal

- - {{item.title}} + + + {{item.title}} +
- +
- - {{type.title}} + + + {{type.title}} +
- - +
- +
- +
- +
- - +
- +
- +
- Submit + + Submit + Reset
-
- -
- Note: This Feature is under development. Please give us some time to complete it. Till then feel free to add goals. Manage goals will be available soon. If you feel you have already waited for long, ping me on LinkedIn +
+ + Note: This Feature is under development. Please give us some time to complete it. Till then + feel free to add goals. Manage goals will be available soon. If you feel you have already + waited for long, ping me on + + LinkedIn + +
diff --git a/src/app/pages/goal/goal.page.spec.ts b/src/app/pages/goal/goal.page.spec.ts index f2f9b657..bdc61e1e 100644 --- a/src/app/pages/goal/goal.page.spec.ts +++ b/src/app/pages/goal/goal.page.spec.ts @@ -1,16 +1,16 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { IonicModule } from '@ionic/angular'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { IonicModule } from "@ionic/angular"; -import { GoalPage } from './goal.page'; +import { GoalPage } from "./goal.page"; -describe('GoalPage', () => { +describe("GoalPage", () => { let component: GoalPage; let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ GoalPage ], - imports: [IonicModule.forRoot()] + declarations: [GoalPage], + imports: [IonicModule.forRoot()], }).compileComponents(); fixture = TestBed.createComponent(GoalPage); @@ -18,7 +18,7 @@ describe('GoalPage', () => { fixture.detectChanges(); })); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/pages/goal/goal.page.ts b/src/app/pages/goal/goal.page.ts index 95b59bfa..8a5d6e55 100644 --- a/src/app/pages/goal/goal.page.ts +++ b/src/app/pages/goal/goal.page.ts @@ -1,81 +1,49 @@ -import { DatePipe } from '@angular/common'; -import { Component, OnInit } from '@angular/core'; -import { serverTimestamp } from '@angular/fire/firestore'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { CustomDate } from 'src/app/models/class/date/custom-date'; -import { SeoTags } from 'src/app/models/class/seoTags/seo'; -import { GoalData } from 'src/app/models/class/static/goal'; -import { GoalService } from 'src/app/services/goal/goal.service'; -import { SeoService } from 'src/app/services/seo/seo.service'; +import { DatePipe } from "@angular/common"; +import { Component, OnInit } from "@angular/core"; +import { serverTimestamp } from "@angular/fire/firestore"; +import { FormBuilder, FormGroup, Validators } from "@angular/forms"; +import { CustomDate } from "src/app/models/class/date/custom-date"; +import { SeoTags } from "src/app/models/class/seoTags/seo"; +import { GoalData } from "src/app/models/class/static/goal"; +import { GoalService } from "src/app/services/goal/goal.service"; +import { SeoService } from "src/app/services/seo/seo.service"; @Component({ - selector: 'app-goal', - templateUrl: './goal.page.html', - styleUrls: ['./goal.page.scss'], + selector: "app-goal", + templateUrl: "./goal.page.html", + styleUrls: ["./goal.page.scss"], }) export class GoalPage implements OnInit { - pageTitle = 'Goal'; + pageTitle = "Goal"; title = SeoTags.pageTitle.goalPage; pageMetaTags = SeoTags.helpPageTags; constructor( private seoService: SeoService, private fb: FormBuilder, private goalService: GoalService, - private datePipe: DatePipe + private datePipe: DatePipe, ) {} - dateToday: string | null = this.datePipe.transform(new Date(), 'yyyy-MM-dd'); + dateToday: string | null = this.datePipe.transform(new Date(), "yyyy-MM-dd"); goalType = GoalData.goalType; goalFor = GoalData.goalFor; goalForm: FormGroup = this.fb.group({ createdAt: [serverTimestamp()], - date: [ - this.dateToday, - [Validators.required, Validators.pattern('^[a-zA-Z 0-9 .,-]*$')], - ], + date: [this.dateToday, [Validators.required, Validators.pattern("^[a-zA-Z 0-9 .,-]*$")]], progress: [ 0, - [ - Validators.required, - Validators.pattern('^[0-9]*$'), - Validators.max(100), - Validators.min(0), - ], - ], - gTerm: [ - 'Tomorrow', - [Validators.required, Validators.pattern('^[a-zA-Z0-9 ]*$')], - ], - type: [ - 'Studies', - [Validators.required, Validators.pattern('^[a-zA-Z0-9 ]*$')], - ], - title: [ - '', - [Validators.required, Validators.pattern('^[a-zA-Z0-9, -.]*$')], - ], - reward: [ - '', - [Validators.required, Validators.pattern('^[a-zA-Z0-9\n, -.]*$')], - ], - resource: [ - '', - [Validators.required, Validators.pattern('^[a-zA-Z0-9\n, -.]*$')], - ], - description: [ - '', - [Validators.required, Validators.pattern('^[a-zA-Z0-9\n, -.]*$')], - ], - actionSteps: [ - '', - [Validators.required, Validators.pattern('^[a-zA-Z0-9\n, -.]*$')], - ], - penalty: [ - '', - [Validators.required, Validators.pattern('^[a-zA-Z0-9\n, -.]*$')], + [Validators.required, Validators.pattern("^[0-9]*$"), Validators.max(100), Validators.min(0)], ], + gTerm: ["Tomorrow", [Validators.required, Validators.pattern("^[a-zA-Z0-9 ]*$")]], + type: ["Studies", [Validators.required, Validators.pattern("^[a-zA-Z0-9 ]*$")]], + title: ["", [Validators.required, Validators.pattern("^[a-zA-Z0-9, -.]*$")]], + reward: ["", [Validators.required, Validators.pattern("^[a-zA-Z0-9\n, -.]*$")]], + resource: ["", [Validators.required, Validators.pattern("^[a-zA-Z0-9\n, -.]*$")]], + description: ["", [Validators.required, Validators.pattern("^[a-zA-Z0-9\n, -.]*$")]], + actionSteps: ["", [Validators.required, Validators.pattern("^[a-zA-Z0-9\n, -.]*$")]], + penalty: ["", [Validators.required, Validators.pattern("^[a-zA-Z0-9\n, -.]*$")]], updatedAt: [serverTimestamp()], }); - rewardError = 'Only alphabets and numbers allowed'; + rewardError = "Only alphabets and numbers allowed"; ngOnInit() { this.seoService.seo(this.title, this.pageMetaTags); } @@ -86,17 +54,17 @@ export class GoalPage implements OnInit { dateUpdate() { let targetDate = this.dateToday; switch (this.goalForm.value.gTerm) { - case 'Daily': + case "Daily": targetDate = this.dateToday; break; - case 'Tomorrow': + case "Tomorrow": targetDate = new CustomDate().getDateTomorrow(); break; - case 'Short Term': - targetDate = ''; + case "Short Term": + targetDate = ""; break; - case 'Long Term': - targetDate = ''; + case "Long Term": + targetDate = ""; break; default: break; diff --git a/src/app/pages/help/faq/faq.component.html b/src/app/pages/help/faq/faq.component.html index 6da672cd..ff482b91 100644 --- a/src/app/pages/help/faq/faq.component.html +++ b/src/app/pages/help/faq/faq.component.html @@ -4,13 +4,20 @@ {{ title }} - + + +
-
+

Reach out to us.

Share Feedback / Request Feature / Ask Quries.

@@ -20,9 +27,15 @@

Share Feedback / Request Feature / Ask Quries.

- Name is required. - Name should be min 4 characters long. - Name should have alphabets only. + + Name is required. + + + Name should be min 4 characters long. + + + Name should have alphabets only. +
@@ -31,8 +44,12 @@

Share Feedback / Request Feature / Ask Quries.

- Email is required. - Please provide valid email id. + + Email is required. + + + Please provide valid email id. +
@@ -54,15 +71,30 @@

Share Feedback / Request Feature / Ask Quries.

- Message is required. - Message should be min 5 characters long.
- Only Alphabets and Numbers are Allowed! + + Message is required. + + + Message should be min 5 characters long. +
+
+ + Only Alphabets and Numbers are Allowed! +
- Submit - Reset Form + + Submit + + + Reset Form +

Request Submitted Successfully!

diff --git a/src/app/pages/help/faq/faq.component.spec.ts b/src/app/pages/help/faq/faq.component.spec.ts index 43d2eeab..319007a2 100644 --- a/src/app/pages/help/faq/faq.component.spec.ts +++ b/src/app/pages/help/faq/faq.component.spec.ts @@ -1,16 +1,16 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { IonicModule } from '@ionic/angular'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { IonicModule } from "@ionic/angular"; -import { FaqComponent } from './faq.component'; +import { FaqComponent } from "./faq.component"; -describe('FaqComponent', () => { +describe("FaqComponent", () => { let component: FaqComponent; let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ FaqComponent ], - imports: [IonicModule.forRoot()] + declarations: [FaqComponent], + imports: [IonicModule.forRoot()], }).compileComponents(); fixture = TestBed.createComponent(FaqComponent); @@ -18,7 +18,7 @@ describe('FaqComponent', () => { fixture.detectChanges(); })); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/pages/help/faq/faq.component.ts b/src/app/pages/help/faq/faq.component.ts index 365b5703..4e6d607e 100644 --- a/src/app/pages/help/faq/faq.component.ts +++ b/src/app/pages/help/faq/faq.component.ts @@ -1,58 +1,70 @@ -import { Component, OnInit } from '@angular/core'; -import { AngularFirestoreCollection } from '@angular/fire/compat/firestore'; +import { Component, OnInit } from "@angular/core"; +import { AngularFirestoreCollection } from "@angular/fire/compat/firestore"; import { FormGroup, FormBuilder, Validators } from "@angular/forms"; -import { serverTimestamp } from '@angular/fire/firestore'; -import { SeoService } from 'src/app/services/seo/seo.service'; -import { SupportService } from 'src/app/services/support/support.service'; +import { serverTimestamp } from "@angular/fire/firestore"; +import { SeoService } from "src/app/services/seo/seo.service"; +import { SupportService } from "src/app/services/support/support.service"; @Component({ - selector: 'app-faq', - templateUrl: './faq.component.html', - styleUrls: ['./faq.component.scss'], + selector: "app-faq", + templateUrl: "./faq.component.html", + styleUrls: ["./faq.component.scss"], }) export class FaqComponent { title = "Contact"; - isSubmitted=false; + isSubmitted = false; constructor( private supportService: SupportService, - public formBuilder: FormBuilder) { } + public formBuilder: FormBuilder, + ) {} supportForm = this.formBuilder.group({ createdAt: [serverTimestamp()], - name: ['', [Validators.required, Validators.minLength(4), Validators.pattern('^[a-zA-Z ]*$')]], - email: ['', [Validators.required, Validators.pattern('[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,3}$')]], - sub: ['', [Validators.required, Validators.minLength(5), Validators.pattern('^[a-zA-Z 0-9 ]*$')]], - msg: ['', [Validators.required, Validators.minLength(5), Validators.pattern('^[a-zA-Z 0-9 ., \n]*$')]] - }) + name: ["", [Validators.required, Validators.minLength(4), Validators.pattern("^[a-zA-Z ]*$")]], + email: [ + "", + [Validators.required, Validators.pattern("[a-z0-9._%+-]+@[a-z0-9.-]+.[a-z]{2,3}$")], + ], + sub: [ + "", + [Validators.required, Validators.minLength(5), Validators.pattern("^[a-zA-Z 0-9 ]*$")], + ], + msg: [ + "", + [Validators.required, Validators.minLength(5), Validators.pattern("^[a-zA-Z 0-9 ., \n]*$")], + ], + }); - submitForm(){ - this.supportService.postSupport(this.supportForm.value).then(res=>{ - this.supportForm.reset( {} ) - this.isSubmitted=true - setTimeout(() => { - this.isSubmitted=false - }, 15000); - }).catch(err=>{ - // console.log(err); - }) + submitForm() { + this.supportService + .postSupport(this.supportForm.value) + .then((res) => { + this.supportForm.reset({}); + this.isSubmitted = true; + setTimeout(() => { + this.isSubmitted = false; + }, 15000); + }) + .catch((err) => { + // console.log(err); + }); } get errorControl() { return this.supportForm.controls; } get email() { - return this.supportForm.get('email') + return this.supportForm.get("email"); } get name() { - return this.supportForm.get('name') + return this.supportForm.get("name"); } get mobile() { - return this.supportForm.get('mobile') + return this.supportForm.get("mobile"); } get sub() { - return this.supportForm.get('sub') + return this.supportForm.get("sub"); } get msg() { - return this.supportForm.get('msg') + return this.supportForm.get("msg"); } - } diff --git a/src/app/pages/help/help-routing.module.ts b/src/app/pages/help/help-routing.module.ts index 63e7f009..edb3293d 100644 --- a/src/app/pages/help/help-routing.module.ts +++ b/src/app/pages/help/help-routing.module.ts @@ -1,18 +1,18 @@ -import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; -import { FaqComponent } from './faq/faq.component'; +import { NgModule } from "@angular/core"; +import { Routes, RouterModule } from "@angular/router"; +import { FaqComponent } from "./faq/faq.component"; -import { HelpPage } from './help.page'; +import { HelpPage } from "./help.page"; const routes: Routes = [ { - path: '', - component: HelpPage + path: "", + component: HelpPage, }, { - path: 'contact', - component: FaqComponent - } + path: "contact", + component: FaqComponent, + }, ]; @NgModule({ diff --git a/src/app/pages/help/help.module.ts b/src/app/pages/help/help.module.ts index 05b7ea8a..a61cf287 100644 --- a/src/app/pages/help/help.module.ts +++ b/src/app/pages/help/help.module.ts @@ -1,22 +1,16 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { FormsModule, ReactiveFormsModule } from "@angular/forms"; -import { IonicModule } from '@ionic/angular'; +import { IonicModule } from "@ionic/angular"; -import { HelpPageRoutingModule } from './help-routing.module'; +import { HelpPageRoutingModule } from "./help-routing.module"; -import { HelpPage } from './help.page'; -import { FaqComponent } from './faq/faq.component'; +import { HelpPage } from "./help.page"; +import { FaqComponent } from "./faq/faq.component"; @NgModule({ - imports: [ - CommonModule, - FormsModule, - IonicModule, - HelpPageRoutingModule, - ReactiveFormsModule, - ], - declarations: [HelpPage,FaqComponent] + imports: [CommonModule, FormsModule, IonicModule, HelpPageRoutingModule, ReactiveFormsModule], + declarations: [HelpPage, FaqComponent], }) export class HelpPageModule {} diff --git a/src/app/pages/help/help.page.html b/src/app/pages/help/help.page.html index 0d4bf2c1..fbcd12dd 100644 --- a/src/app/pages/help/help.page.html +++ b/src/app/pages/help/help.page.html @@ -17,22 +17,46 @@

Install on PC ( Windows / MAC / Linux all-dostro )

-

On your browser check the url bar. On right of it there is a - "Install" button. In case of no such icon, on your top left there is menu button that is generally used to navigate to settings. There you can find an option to Install Summarize. Click on it and the app will be installed on your pc. Now you can use it as a Native Software.

+

+ On your browser check the url bar. On right of it there is a + + "Install" button. In case of no such icon, on your top left there is menu button that is + generally used to navigate to settings. There you can find an option to Install Summarize. + Click on it and the app will be installed on your pc. Now you can use it as a Native + Software. +

Install on Android

-

After opening the portal you will receive a popup to install, click on install and it will get installed and ready to be used as Native application. In case of no such icon, click on menu button that is generally used to navigate to settings. There you can find an option to Install Summarize. Click on it and the app will be installed on your phone. Now you can use it as a Native Application.

+

+ After opening the portal you will receive a popup to install, click on install and it will + get installed and ready to be used as Native application. In case of no such icon, click on + menu button that is generally used to navigate to settings. There you can find an option to + Install Summarize. Click on it and the app will be installed on your phone. Now you can use + it as a Native Application. +

Install on IOS

-

In the share option on botton in center, you can find an option to add to home screen. This will add the app to your home screen and you will be able to use as normal application.

+

+ In the share option on botton in center, you can find an option to add to home screen. This + will add the app to your home screen and you will be able to use as normal application. +

How to get updates?

-

For updates go to About page and there you can find the version details and update button.Currently just navigate to About page and you will recieve update app popup, accept it and you will recieve updates. There are few active issues with the update of app so please be patient. We are working to get it fixed soon. +

+ For updates go to About page and there you can find the version details and update + button.Currently just navigate to About page and you will recieve update app popup, accept + it and you will recieve updates. There are few active issues with the update of app so + please be patient. We are working to get it fixed soon.

How to contact us?

-

Visit our Contact page and you can ask your Queries, Request a feature, give suggestions, Donate and support or give your feedback through it.

- Contact Us +

+ Visit our Contact page and you can ask your Queries, Request a feature, give suggestions, + Donate and support or give your feedback through it. +

+ + Contact Us +

How to get free courses?

@@ -43,7 +67,10 @@

How to get free courses?

  • Check if the current availabe course is helpful to you.
  • If yes, click on "Get Now".
  • - There are only limited number of enrolments for free. If maximum free enrolments are done you maynot get it for free. You can wait for the next free offer or pay if urgent. + + There are only limited number of enrolments for free. If maximum free enrolments are done + you maynot get it for free. You can wait for the next free offer or pay if urgent. +
    diff --git a/src/app/pages/help/help.page.spec.ts b/src/app/pages/help/help.page.spec.ts index 5fb370e6..d646e755 100644 --- a/src/app/pages/help/help.page.spec.ts +++ b/src/app/pages/help/help.page.spec.ts @@ -1,16 +1,16 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { IonicModule } from '@ionic/angular'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { IonicModule } from "@ionic/angular"; -import { HelpPage } from './help.page'; +import { HelpPage } from "./help.page"; -describe('HelpPage', () => { +describe("HelpPage", () => { let component: HelpPage; let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ HelpPage ], - imports: [IonicModule.forRoot()] + declarations: [HelpPage], + imports: [IonicModule.forRoot()], }).compileComponents(); fixture = TestBed.createComponent(HelpPage); @@ -18,7 +18,7 @@ describe('HelpPage', () => { fixture.detectChanges(); })); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/pages/help/help.page.ts b/src/app/pages/help/help.page.ts index bf9ec822..9b72b865 100644 --- a/src/app/pages/help/help.page.ts +++ b/src/app/pages/help/help.page.ts @@ -1,22 +1,20 @@ -import { Component, OnInit } from '@angular/core'; -import { SeoTags } from 'src/app/models/class/seoTags/seo'; -import { SeoService } from 'src/app/services/seo/seo.service'; +import { Component, OnInit } from "@angular/core"; +import { SeoTags } from "src/app/models/class/seoTags/seo"; +import { SeoService } from "src/app/services/seo/seo.service"; @Component({ - selector: 'app-help', - templateUrl: './help.page.html', - styleUrls: ['./help.page.scss'], + selector: "app-help", + templateUrl: "./help.page.html", + styleUrls: ["./help.page.scss"], }) export class HelpPage implements OnInit { - pageTitle="Help & Support" + pageTitle = "Help & Support"; - title= SeoTags.pageTitle.helpPage - pageMetaTags= SeoTags.helpPageTags - constructor( - private seoService: SeoService) { } + title = SeoTags.pageTitle.helpPage; + pageMetaTags = SeoTags.helpPageTags; + constructor(private seoService: SeoService) {} ngOnInit() { - this.seoService.seo(this.title,this.pageMetaTags) + this.seoService.seo(this.title, this.pageMetaTags); } - } diff --git a/src/app/pages/home/components/goal-on-dashboard/goal-on-dashboard.component.html b/src/app/pages/home/components/goal-on-dashboard/goal-on-dashboard.component.html index f0e78839..5a8a7bd5 100644 --- a/src/app/pages/home/components/goal-on-dashboard/goal-on-dashboard.component.html +++ b/src/app/pages/home/components/goal-on-dashboard/goal-on-dashboard.component.html @@ -1,44 +1,80 @@
    -

    Goals for {{dateToday}}

    - +

    Goals for {{ dateToday }}

    + - - {{item.title}} + + {{ item.title }} - - + + - +

    No goals found.

    - Add daily goal + + Add daily goal +

    Priority Goals

    - + - - {{item.title}} + + {{ item.title }} - - + + - +

    No goals found.

    Add Goals
    -
    \ No newline at end of file + diff --git a/src/app/pages/home/components/goal-on-dashboard/goal-on-dashboard.component.spec.ts b/src/app/pages/home/components/goal-on-dashboard/goal-on-dashboard.component.spec.ts index 3f99518c..5d86d747 100644 --- a/src/app/pages/home/components/goal-on-dashboard/goal-on-dashboard.component.spec.ts +++ b/src/app/pages/home/components/goal-on-dashboard/goal-on-dashboard.component.spec.ts @@ -1,16 +1,16 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { IonicModule } from '@ionic/angular'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { IonicModule } from "@ionic/angular"; -import { GoalOnDashboardComponent } from './goal-on-dashboard.component'; +import { GoalOnDashboardComponent } from "./goal-on-dashboard.component"; -describe('GoalOnDashboardComponent', () => { +describe("GoalOnDashboardComponent", () => { let component: GoalOnDashboardComponent; let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ GoalOnDashboardComponent ], - imports: [IonicModule.forRoot()] + declarations: [GoalOnDashboardComponent], + imports: [IonicModule.forRoot()], }).compileComponents(); fixture = TestBed.createComponent(GoalOnDashboardComponent); @@ -18,7 +18,7 @@ describe('GoalOnDashboardComponent', () => { fixture.detectChanges(); })); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/pages/home/components/goal-on-dashboard/goal-on-dashboard.component.ts b/src/app/pages/home/components/goal-on-dashboard/goal-on-dashboard.component.ts index fd43cef1..a4b2ea1b 100644 --- a/src/app/pages/home/components/goal-on-dashboard/goal-on-dashboard.component.ts +++ b/src/app/pages/home/components/goal-on-dashboard/goal-on-dashboard.component.ts @@ -1,29 +1,29 @@ -import { DatePipe } from '@angular/common'; -import { Component, OnInit } from '@angular/core'; -import { serverTimestamp } from '@angular/fire/firestore'; -import { FormBuilder, FormGroup } from '@angular/forms'; -import { GoalData } from 'src/app/models/interface/goals.interface'; -import { FirebaseService } from 'src/app/services/firebase/firebase.service'; -import { GoalService } from 'src/app/services/goal/goal.service'; -import { ToasterService } from 'src/app/services/toaster/toaster.service'; +import { DatePipe } from "@angular/common"; +import { Component, OnInit } from "@angular/core"; +import { serverTimestamp } from "@angular/fire/firestore"; +import { FormBuilder, FormGroup } from "@angular/forms"; +import { GoalData } from "src/app/models/interface/goals.interface"; +import { FirebaseService } from "src/app/services/firebase/firebase.service"; +import { GoalService } from "src/app/services/goal/goal.service"; +import { ToasterService } from "src/app/services/toaster/toaster.service"; @Component({ - selector: 'app-goal-on-dashboard', - templateUrl: './goal-on-dashboard.component.html', - styleUrls: ['./goal-on-dashboard.component.scss'], + selector: "app-goal-on-dashboard", + templateUrl: "./goal-on-dashboard.component.html", + styleUrls: ["./goal-on-dashboard.component.scss"], }) export class GoalOnDashboardComponent implements OnInit { dailyGoals: GoalData[]; priorityGoals: GoalData[]; - alertButtons = ['Close']; + alertButtons = ["Close"]; goalForm: FormGroup; - dateToday: string | null = this.datePipe.transform(new Date(), 'yyyy-MM-dd'); + dateToday: string | null = this.datePipe.transform(new Date(), "yyyy-MM-dd"); constructor( private firebaseService: FirebaseService, private fb: FormBuilder, private goalService: GoalService, - private toasterService:ToasterService, - private datePipe: DatePipe + private toasterService: ToasterService, + private datePipe: DatePipe, ) { this.goalForm = this.fb.group({ updatedAt: [serverTimestamp()], @@ -44,7 +44,7 @@ export class GoalOnDashboardComponent implements OnInit { this.priorityGoals = res; }); } else { - this.toasterService.showToast("No goals found : User not logged in.","warning") + this.toasterService.showToast("No goals found : User not logged in.", "warning"); } } diff --git a/src/app/pages/home/home-routing.module.ts b/src/app/pages/home/home-routing.module.ts index 720fb1c2..3ab86112 100644 --- a/src/app/pages/home/home-routing.module.ts +++ b/src/app/pages/home/home-routing.module.ts @@ -1,13 +1,13 @@ -import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; +import { NgModule } from "@angular/core"; +import { Routes, RouterModule } from "@angular/router"; -import { HomePage } from './home.page'; +import { HomePage } from "./home.page"; const routes: Routes = [ { - path: '', - component: HomePage - } + path: "", + component: HomePage, + }, ]; @NgModule({ diff --git a/src/app/pages/home/home.module.ts b/src/app/pages/home/home.module.ts index 61317184..128ea724 100644 --- a/src/app/pages/home/home.module.ts +++ b/src/app/pages/home/home.module.ts @@ -1,21 +1,16 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { FormsModule } from '@angular/forms'; +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { FormsModule } from "@angular/forms"; -import { IonicModule } from '@ionic/angular'; +import { IonicModule } from "@ionic/angular"; -import { HomePageRoutingModule } from './home-routing.module'; +import { HomePageRoutingModule } from "./home-routing.module"; -import { HomePage } from './home.page'; -import { GoalOnDashboardComponent } from './components/goal-on-dashboard/goal-on-dashboard.component'; +import { HomePage } from "./home.page"; +import { GoalOnDashboardComponent } from "./components/goal-on-dashboard/goal-on-dashboard.component"; @NgModule({ - imports: [ - CommonModule, - FormsModule, - IonicModule, - HomePageRoutingModule - ], - declarations: [HomePage, GoalOnDashboardComponent] + imports: [CommonModule, FormsModule, IonicModule, HomePageRoutingModule], + declarations: [HomePage, GoalOnDashboardComponent], }) export class HomePageModule {} diff --git a/src/app/pages/home/home.page.html b/src/app/pages/home/home.page.html index 8abb77f0..84ba5faa 100644 --- a/src/app/pages/home/home.page.html +++ b/src/app/pages/home/home.page.html @@ -15,32 +15,46 @@
    -

    What gets measured, Gets managed -
    - Peter F. Drucker +

    + What gets measured, Gets managed +
    + - Peter F. Drucker

    - - +
    -
    +

    Available Features

    -
    - +
    + {{f.title}}
    -

    About Summarize

    {{item}}

    -

    More Details in About Page (check here)

    - +

    + More Details in About Page ( + check here + ) +

    -

    Upcoming Features

    +

    Upcoming Features

    1. Analyze Studies
    2. Analyze Work
    3. diff --git a/src/app/pages/home/home.page.spec.ts b/src/app/pages/home/home.page.spec.ts index d628561e..a20435cc 100644 --- a/src/app/pages/home/home.page.spec.ts +++ b/src/app/pages/home/home.page.spec.ts @@ -1,16 +1,16 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { IonicModule } from '@ionic/angular'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { IonicModule } from "@ionic/angular"; -import { HomePage } from './home.page'; +import { HomePage } from "./home.page"; -describe('HomePage', () => { +describe("HomePage", () => { let component: HomePage; let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ HomePage ], - imports: [IonicModule.forRoot()] + declarations: [HomePage], + imports: [IonicModule.forRoot()], }).compileComponents(); fixture = TestBed.createComponent(HomePage); @@ -18,7 +18,7 @@ describe('HomePage', () => { fixture.detectChanges(); })); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/pages/home/home.page.ts b/src/app/pages/home/home.page.ts index 344d6ffd..3f1af8df 100644 --- a/src/app/pages/home/home.page.ts +++ b/src/app/pages/home/home.page.ts @@ -29,7 +29,7 @@ export class HomePage implements OnInit { homeData: any; constructor( private seoService: SeoService, - private rtdb: RealTimeDataBaseService + private rtdb: RealTimeDataBaseService, ) {} ngOnInit() { diff --git a/src/app/pages/office/office-routing.module.ts b/src/app/pages/office/office-routing.module.ts index 59837c85..ccc9015f 100644 --- a/src/app/pages/office/office-routing.module.ts +++ b/src/app/pages/office/office-routing.module.ts @@ -1,13 +1,13 @@ -import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; +import { NgModule } from "@angular/core"; +import { Routes, RouterModule } from "@angular/router"; -import { OfficePage } from './office.page'; +import { OfficePage } from "./office.page"; const routes: Routes = [ { - path: '', - component: OfficePage - } + path: "", + component: OfficePage, + }, ]; @NgModule({ diff --git a/src/app/pages/office/office.module.ts b/src/app/pages/office/office.module.ts index a181972e..20e3487b 100644 --- a/src/app/pages/office/office.module.ts +++ b/src/app/pages/office/office.module.ts @@ -1,21 +1,15 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { FormsModule, ReactiveFormsModule } from "@angular/forms"; -import { IonicModule } from '@ionic/angular'; +import { IonicModule } from "@ionic/angular"; -import { OfficePageRoutingModule } from './office-routing.module'; +import { OfficePageRoutingModule } from "./office-routing.module"; -import { OfficePage } from './office.page'; +import { OfficePage } from "./office.page"; @NgModule({ - imports: [ - CommonModule, - FormsModule, - IonicModule, - OfficePageRoutingModule, - ReactiveFormsModule - ], - declarations: [OfficePage] + imports: [CommonModule, FormsModule, IonicModule, OfficePageRoutingModule, ReactiveFormsModule], + declarations: [OfficePage], }) export class OfficePageModule {} diff --git a/src/app/pages/office/office.page.html b/src/app/pages/office/office.page.html index 8572bafa..6a38c738 100644 --- a/src/app/pages/office/office.page.html +++ b/src/app/pages/office/office.page.html @@ -15,8 +15,7 @@
      - -
      +

      Add Work

      @@ -42,8 +41,12 @@

      Add Work

      Description - +
      @@ -60,10 +63,11 @@

      Add Work

      - Submit + + Submit + Reset
      -
      @@ -72,8 +76,12 @@

      Add Work

      No Work found

      My Work

      - All Works - Latest Only + + All Works + + + Latest Only +
      @@ -93,10 +101,16 @@

      My Work

      {{ work?.startTime }} {{ work?.endTime }} {{ work?.type | titlecase }} - {{ work?.description | titlecase}} + + {{ work?.description | titlecase}} + - + @@ -105,7 +119,9 @@

      My Work

      - * Edit and copy features coming soon. + + * Edit and copy features coming soon. +
      diff --git a/src/app/pages/office/office.page.spec.ts b/src/app/pages/office/office.page.spec.ts index 5805cc62..b201edd2 100644 --- a/src/app/pages/office/office.page.spec.ts +++ b/src/app/pages/office/office.page.spec.ts @@ -1,16 +1,16 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { IonicModule } from '@ionic/angular'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { IonicModule } from "@ionic/angular"; -import { OfficePage } from './office.page'; +import { OfficePage } from "./office.page"; -describe('OfficePage', () => { +describe("OfficePage", () => { let component: OfficePage; let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ OfficePage ], - imports: [IonicModule.forRoot()] + declarations: [OfficePage], + imports: [IonicModule.forRoot()], }).compileComponents(); fixture = TestBed.createComponent(OfficePage); @@ -18,7 +18,7 @@ describe('OfficePage', () => { fixture.detectChanges(); })); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/pages/office/office.page.ts b/src/app/pages/office/office.page.ts index 473681a2..39224352 100644 --- a/src/app/pages/office/office.page.ts +++ b/src/app/pages/office/office.page.ts @@ -1,50 +1,53 @@ -import { Component, OnInit } from '@angular/core'; -import { Clipboard } from '@capacitor/clipboard'; -import { serverTimestamp } from '@angular/fire/firestore'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { OfficeService } from 'src/app/services/office/office.service'; -import { SeoService } from 'src/app/services/seo/seo.service'; +import { Component, OnInit } from "@angular/core"; +import { Clipboard } from "@capacitor/clipboard"; +import { serverTimestamp } from "@angular/fire/firestore"; +import { FormBuilder, FormGroup, Validators } from "@angular/forms"; +import { OfficeService } from "src/app/services/office/office.service"; +import { SeoService } from "src/app/services/seo/seo.service"; @Component({ - selector: 'app-office', - templateUrl: './office.page.html', - styleUrls: ['./office.page.scss'], + selector: "app-office", + templateUrl: "./office.page.html", + styleUrls: ["./office.page.scss"], }) export class OfficePage implements OnInit { pageTitle = "Office"; pageMetaTags = [ { - name: 'description', - content: "Summarize all your expenses here. Summarize will help you to check them down in the list immediately and later Analyze them to have an understanding about where you can spend wisely and how to manage your expenses in better way. Soon we will also give finance tips that will help you better." + name: "description", + content: + "Summarize all your expenses here. Summarize will help you to check them down in the list immediately and later Analyze them to have an understanding about where you can spend wisely and how to manage your expenses in better way. Soon we will also give finance tips that will help you better.", }, { - name: 'keyword', - content: 'Summarize, Summarize, arise, arize, money managemnet, expense management, cost analysis,summarize-ng, summarize-ng, digital dairy, expense analysis' + name: "keyword", + content: + "Summarize, Summarize, arise, arize, money managemnet, expense management, cost analysis,summarize-ng, summarize-ng, digital dairy, expense analysis", }, { - name: 'author', - content: 'Sandeep Kumar' - } + name: "author", + content: "Sandeep Kumar", + }, ]; Works: any = []; worksCount: number = 0; getCount: number = 0; - dateToday= (new Date().getFullYear()) + "-0" + (new Date().getMonth() + 1) + "-" + (new Date().getDate()); + dateToday = + new Date().getFullYear() + "-0" + (new Date().getMonth() + 1) + "-" + new Date().getDate(); constructor( private fb: FormBuilder, private seoService: SeoService, - private officeService: OfficeService - ) { } + private officeService: OfficeService, + ) {} workForm: FormGroup = this.fb.group({ createdAt: [serverTimestamp()], - date: [this.dateToday, [Validators.required, Validators.pattern('^[a-zA-Z 0-9 .,-]*$')]], - startTime: ['', [Validators.required, Validators.pattern('^[0-9:]*$')]], - endTime: ['', [Validators.required, Validators.pattern('^[0-9:]*$')]], - type: ['coding', [Validators.required, Validators.pattern('^[a-zA-Z 0-9 :/.,-]*$')]], - description: ['', [Validators.required, Validators.pattern('^[a-zA-Z 0-9 .,-]*$')]], + date: [this.dateToday, [Validators.required, Validators.pattern("^[a-zA-Z 0-9 .,-]*$")]], + startTime: ["", [Validators.required, Validators.pattern("^[0-9:]*$")]], + endTime: ["", [Validators.required, Validators.pattern("^[0-9:]*$")]], + type: ["coding", [Validators.required, Validators.pattern("^[a-zA-Z 0-9 :/.,-]*$")]], + description: ["", [Validators.required, Validators.pattern("^[a-zA-Z 0-9 .,-]*$")]], // spendedOn: ['self', [Validators.required, Validators.pattern('^[a-zA-Z 0-9 .,-]*$')]], - updatedAt: [serverTimestamp()] - }) + updatedAt: [serverTimestamp()], + }); ngOnInit() { this.getWork(); this.seoService.seo(this.pageTitle, this.pageMetaTags); @@ -52,31 +55,29 @@ export class OfficePage implements OnInit { async getWork() { this.getCount = 5; - await this.officeService.getWork(this.getCount).subscribe(res => { - this.Works = res - this.worksCount = this.Works.length - }) - + await this.officeService.getWork(this.getCount).subscribe((res) => { + this.Works = res; + this.worksCount = this.Works.length; + }); } async getAllWork() { this.getCount = 0; - await this.officeService.getWork(this.getCount).subscribe(res => { - this.Works = res - this.worksCount = this.Works.length - }) - + await this.officeService.getWork(this.getCount).subscribe((res) => { + this.Works = res; + this.worksCount = this.Works.length; + }); } addWork() { - this.officeService.addWork(this.workForm.value) + this.officeService.addWork(this.workForm.value); } deleteWork(idField: string) { - this.officeService.deleteWork(idField) + this.officeService.deleteWork(idField); } async copyToClipboard(work: any) { await Clipboard.write({ - string: `${work.description} : (${work.startTime} - ${work.endTime}) ` + string: `${work.description} : (${work.startTime} - ${work.endTime}) `, }); } } diff --git a/src/app/pages/privacy-policy/privacy-policy-routing.module.ts b/src/app/pages/privacy-policy/privacy-policy-routing.module.ts index c3750b0a..fba4eb5f 100644 --- a/src/app/pages/privacy-policy/privacy-policy-routing.module.ts +++ b/src/app/pages/privacy-policy/privacy-policy-routing.module.ts @@ -1,13 +1,13 @@ -import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; +import { NgModule } from "@angular/core"; +import { Routes, RouterModule } from "@angular/router"; -import { PrivacyPolicyPage } from './privacy-policy.page'; +import { PrivacyPolicyPage } from "./privacy-policy.page"; const routes: Routes = [ { - path: '', - component: PrivacyPolicyPage - } + path: "", + component: PrivacyPolicyPage, + }, ]; @NgModule({ diff --git a/src/app/pages/privacy-policy/privacy-policy.module.ts b/src/app/pages/privacy-policy/privacy-policy.module.ts index 4e58131c..16957cf3 100644 --- a/src/app/pages/privacy-policy/privacy-policy.module.ts +++ b/src/app/pages/privacy-policy/privacy-policy.module.ts @@ -1,20 +1,15 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { FormsModule } from '@angular/forms'; +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { FormsModule } from "@angular/forms"; -import { IonicModule } from '@ionic/angular'; +import { IonicModule } from "@ionic/angular"; -import { PrivacyPolicyPageRoutingModule } from './privacy-policy-routing.module'; +import { PrivacyPolicyPageRoutingModule } from "./privacy-policy-routing.module"; -import { PrivacyPolicyPage } from './privacy-policy.page'; +import { PrivacyPolicyPage } from "./privacy-policy.page"; @NgModule({ - imports: [ - CommonModule, - FormsModule, - IonicModule, - PrivacyPolicyPageRoutingModule - ], - declarations: [PrivacyPolicyPage] + imports: [CommonModule, FormsModule, IonicModule, PrivacyPolicyPageRoutingModule], + declarations: [PrivacyPolicyPage], }) export class PrivacyPolicyPageModule {} diff --git a/src/app/pages/privacy-policy/privacy-policy.page.html b/src/app/pages/privacy-policy/privacy-policy.page.html index 29d417b8..a3a6b2e3 100644 --- a/src/app/pages/privacy-policy/privacy-policy.page.html +++ b/src/app/pages/privacy-policy/privacy-policy.page.html @@ -14,33 +14,68 @@ +
      +

      Privacy Policy

      -
      -

      Privacy Policy

      - -
      -

      Thank you for choosing Summarize. We are committed to protecting your privacy. This Privacy Policy explains how we collect, use, disclose, and safeguard your information when you use our web application, accessible via mobile and PC devices.

      +
      +

      + Thank you for choosing Summarize. We are committed to protecting your privacy. This Privacy + Policy explains how we collect, use, disclose, and safeguard your information when you use + our web application, accessible via mobile and PC devices. +

      Information We Collect

      -

      We do not collect any personal information from you when you use Summarize. We do not require any permissions to access your device data. The only data we may collect is the information you voluntarily provide, while using the app or when contacting us for support or feedback.

      +

      + We do not collect any personal information from you when you use Summarize. We do not + require any permissions to access your device data. The only data we may collect is the + information you voluntarily provide, while using the app or when contacting us for support + or feedback. +

      How We Use Your Information

      -

      Any information you provide to us is solely used to address your inquiries, feedback, or support requests. We do not use your data for advertising purposes or share it with third parties.

      +

      + Any information you provide to us is solely used to address your inquiries, feedback, or + support requests. We do not use your data for advertising purposes or share it with third + parties. +

      Data Security

      -

      We prioritize the security of your information. We implement appropriate technical and organizational measures to protect against unauthorized access, alteration, disclosure, or destruction of your personal information.

      +

      + We prioritize the security of your information. We implement appropriate technical and + organizational measures to protect against unauthorized access, alteration, disclosure, or + destruction of your personal information. +

      Data Retention

      -

      We retain any information you provide to us only for as long as necessary to fulfill the purposes outlined in this Privacy Policy or as required by law.

      +

      + We retain any information you provide to us only for as long as necessary to fulfill the + purposes outlined in this Privacy Policy or as required by law. +

      Children's Privacy

      -

      Summarize is not intended for use by individuals under the age of 13. Although there is no harm or problem in app being used by children but we believe that it will not add much value to any children with less than 13 years of age. We do not knowingly collect personal information from children under 13. If you are a parent or guardian and believe your child has provided us with personal information, please contact us immediately, and we will promptly delete such information from our records.

      +

      + Summarize is not intended for use by individuals under the age of 13. Although there is no + harm or problem in app being used by children but we believe that it will not add much value + to any children with less than 13 years of age. We do not knowingly collect personal + information from children under 13. If you are a parent or guardian and believe your child + has provided us with personal information, please contact us immediately, and we will + promptly delete such information from our records. +

      Changes to This Privacy Policy

      -

      We reserve the right to update or change our Privacy Policy at any time. We will notify you of any changes by posting the new Privacy Policy on this page. You are advised to review this Privacy Policy periodically for any changes.

      +

      + We reserve the right to update or change our Privacy Policy at any time. We will notify you + of any changes by posting the new Privacy Policy on this page. You are advised to review + this Privacy Policy periodically for any changes. +

      Contact Us

      -

      If you have any questions or concerns about our Privacy Policy or our practices regarding your personal information, please contact us via the support page on our website.

      +

      + If you have any questions or concerns about our Privacy Policy or our practices regarding + your personal information, please + contact us + via the support page on our website. +

      +
      -
      diff --git a/src/app/pages/privacy-policy/privacy-policy.page.spec.ts b/src/app/pages/privacy-policy/privacy-policy.page.spec.ts index 756be9a7..c2728e3a 100644 --- a/src/app/pages/privacy-policy/privacy-policy.page.spec.ts +++ b/src/app/pages/privacy-policy/privacy-policy.page.spec.ts @@ -1,7 +1,7 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { PrivacyPolicyPage } from './privacy-policy.page'; +import { ComponentFixture, TestBed } from "@angular/core/testing"; +import { PrivacyPolicyPage } from "./privacy-policy.page"; -describe('PrivacyPolicyPage', () => { +describe("PrivacyPolicyPage", () => { let component: PrivacyPolicyPage; let fixture: ComponentFixture; @@ -11,7 +11,7 @@ describe('PrivacyPolicyPage', () => { fixture.detectChanges(); }); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/pages/privacy-policy/privacy-policy.page.ts b/src/app/pages/privacy-policy/privacy-policy.page.ts index 7f7f841d..0a47b6d0 100644 --- a/src/app/pages/privacy-policy/privacy-policy.page.ts +++ b/src/app/pages/privacy-policy/privacy-policy.page.ts @@ -1,13 +1,11 @@ -import { Component } from '@angular/core'; +import { Component } from "@angular/core"; @Component({ - selector: 'app-privacy-policy', - templateUrl: './privacy-policy.page.html', - styleUrls: ['./privacy-policy.page.scss'], + selector: "app-privacy-policy", + templateUrl: "./privacy-policy.page.html", + styleUrls: ["./privacy-policy.page.scss"], }) -export class PrivacyPolicyPage { - - pageTitle="Privacy Policy" - constructor() { } - +export class PrivacyPolicyPage { + pageTitle = "Privacy Policy"; + constructor() {} } diff --git a/src/app/pages/profile/profile-routing.module.ts b/src/app/pages/profile/profile-routing.module.ts index a7052f82..6a46cc09 100644 --- a/src/app/pages/profile/profile-routing.module.ts +++ b/src/app/pages/profile/profile-routing.module.ts @@ -1,13 +1,13 @@ -import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; +import { NgModule } from "@angular/core"; +import { Routes, RouterModule } from "@angular/router"; -import { ProfilePage } from './profile.page'; +import { ProfilePage } from "./profile.page"; const routes: Routes = [ { - path: '', - component: ProfilePage - } + path: "", + component: ProfilePage, + }, ]; @NgModule({ diff --git a/src/app/pages/profile/profile.module.ts b/src/app/pages/profile/profile.module.ts index ad4dc670..12f7fcf4 100644 --- a/src/app/pages/profile/profile.module.ts +++ b/src/app/pages/profile/profile.module.ts @@ -1,21 +1,15 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { FormsModule, ReactiveFormsModule } from "@angular/forms"; -import { IonicModule } from '@ionic/angular'; +import { IonicModule } from "@ionic/angular"; -import { ProfilePageRoutingModule } from './profile-routing.module'; +import { ProfilePageRoutingModule } from "./profile-routing.module"; -import { ProfilePage } from './profile.page'; +import { ProfilePage } from "./profile.page"; @NgModule({ - imports: [ - CommonModule, - FormsModule, - IonicModule, - ProfilePageRoutingModule, - ReactiveFormsModule - ], - declarations: [ProfilePage] + imports: [CommonModule, FormsModule, IonicModule, ProfilePageRoutingModule, ReactiveFormsModule], + declarations: [ProfilePage], }) export class ProfilePageModule {} diff --git a/src/app/pages/profile/profile.page.html b/src/app/pages/profile/profile.page.html index 2cc9ab50..a6c56782 100644 --- a/src/app/pages/profile/profile.page.html +++ b/src/app/pages/profile/profile.page.html @@ -17,26 +17,32 @@
      - +

      {{userProfile.displayName}}

      - Welcome to Summarize, Profile page is under development. It will be - available soon with some exciting features. + + Welcome to Summarize, Profile page is under development. It will be available soon with some + exciting features. +

      - Email : - - {{userProfile?.email | titlecase}} + Email : + {{userProfile?.email | titlecase}}

      - Email Verified : + Email Verified : - {{userProfile?.emailVerified.toString() | titlecase }} + {{userProfile?.emailVerified.toString() | titlecase }} +

      - Phone Number : - - {{userProfile.phoneNumber }} + Phone Number : + {{userProfile.phoneNumber }}

      @@ -50,19 +56,47 @@

      About Me

      - + Intermediate - + PCM PCB - Submit - Update + + Submit + + + Update +
      @@ -70,18 +104,25 @@

      About Me

      - Projects - - + + Projects + - +
      - + {{item.name}} @@ -90,10 +131,13 @@

      About Me

      Add project - -
      - -
      + +
      @@ -108,7 +152,12 @@

      About Me

      - {{item.name}} + + {{item.name}} + @@ -117,4 +166,4 @@

      About Me

      - \ No newline at end of file + diff --git a/src/app/pages/profile/profile.page.spec.ts b/src/app/pages/profile/profile.page.spec.ts index 8027310d..700862e5 100644 --- a/src/app/pages/profile/profile.page.spec.ts +++ b/src/app/pages/profile/profile.page.spec.ts @@ -1,16 +1,16 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { IonicModule } from '@ionic/angular'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { IonicModule } from "@ionic/angular"; -import { ProfilePage } from './profile.page'; +import { ProfilePage } from "./profile.page"; -describe('ProfilePage', () => { +describe("ProfilePage", () => { let component: ProfilePage; let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ ProfilePage ], - imports: [IonicModule.forRoot()] + declarations: [ProfilePage], + imports: [IonicModule.forRoot()], }).compileComponents(); fixture = TestBed.createComponent(ProfilePage); @@ -18,7 +18,7 @@ describe('ProfilePage', () => { fixture.detectChanges(); })); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/pages/profile/profile.page.ts b/src/app/pages/profile/profile.page.ts index 2e7296e1..44d83a11 100644 --- a/src/app/pages/profile/profile.page.ts +++ b/src/app/pages/profile/profile.page.ts @@ -1,48 +1,45 @@ -import { Component, OnInit } from '@angular/core'; -import { AlertController } from '@ionic/angular'; -import { - ProfileData, - Project, -} from 'src/app/models/interface/profile.interface'; -import { AlertService } from 'src/app/services/alert/alert.service'; -import { ProfileService } from 'src/app/services/profile/profile.service'; -import { SeoService } from 'src/app/services/seo/seo.service'; +import { Component, OnInit } from "@angular/core"; +import { AlertController } from "@ionic/angular"; +import { ProfileData, Project } from "src/app/models/interface/profile.interface"; +import { AlertService } from "src/app/services/alert/alert.service"; +import { ProfileService } from "src/app/services/profile/profile.service"; +import { SeoService } from "src/app/services/seo/seo.service"; @Component({ - selector: 'app-profile', - templateUrl: './profile.page.html', - styleUrls: ['./profile.page.scss'], + selector: "app-profile", + templateUrl: "./profile.page.html", + styleUrls: ["./profile.page.scss"], }) export class ProfilePage implements OnInit { - pageTitle = 'Profile'; + pageTitle = "Profile"; profileData: ProfileData; pageMetaTags = [ { - name: 'description', + name: "description", content: - 'Summarize all your expenses here. Summarize will help you to check them down in the list immediately and later Analyze them to have an understanding about where you can spend wisely and how to manage your expenses in better way. Soon we will also give finance tips that will help you better.', + "Summarize all your expenses here. Summarize will help you to check them down in the list immediately and later Analyze them to have an understanding about where you can spend wisely and how to manage your expenses in better way. Soon we will also give finance tips that will help you better.", }, { - name: 'keyword', + name: "keyword", content: - 'Summarize, Summarize, arise, arize, money management, expense management, cost analysis,summarize-ng, summarize-ng, digital dairy, expense analysis', + "Summarize, Summarize, arise, arize, money management, expense management, cost analysis,summarize-ng, summarize-ng, digital dairy, expense analysis", }, { - name: 'author', - content: 'Sandeep Kumar', + name: "author", + content: "Sandeep Kumar", }, ]; userProfile: any; educationDetails: string[] = []; - educationPhase: string = ''; + educationPhase: string = ""; projects: Project[] = []; friendsGroup = []; - subjects: string = ''; + subjects: string = ""; updateDisabled: boolean = true; public alertButtons = [ { - text: 'Submit', - role: 'confirm', + text: "Submit", + role: "confirm", handler: (value: object) => { this.addProjectDetail(value); }, @@ -50,7 +47,7 @@ export class ProfilePage implements OnInit { ]; public alertInputs = [ { - placeholder: 'Active project name', + placeholder: "Active project name", }, ]; @@ -118,18 +115,18 @@ export class ProfilePage implements OnInit { }; this.profileService.updateProjects(data, item.idField); } - async deleteProject(item:Project){ + async deleteProject(item: Project) { const response = await this.alertService.deleteAlert(); if (response === "confirm") { this.profileService.deleteProjects(item.idField); } - } async showProjectInfo() { const alert = await this.alertController.create({ - header: 'Projects List', - message: 'Here you can add, view and manage your projects. When a project is added it is considered as active, you can make it inactive by using the toggle and it will not be visible in Time section.', - buttons: ['OK'] + header: "Projects List", + message: + "Here you can add, view and manage your projects. When a project is added it is considered as active, you can make it inactive by using the toggle and it will not be visible in Time section.", + buttons: ["OK"], }); await alert.present(); diff --git a/src/app/pages/setup/setup-routing.module.ts b/src/app/pages/setup/setup-routing.module.ts index 17d9f0ef..309af084 100644 --- a/src/app/pages/setup/setup-routing.module.ts +++ b/src/app/pages/setup/setup-routing.module.ts @@ -1,13 +1,13 @@ -import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; +import { NgModule } from "@angular/core"; +import { Routes, RouterModule } from "@angular/router"; -import { SetupPage } from './setup.page'; +import { SetupPage } from "./setup.page"; const routes: Routes = [ { - path: '', - component: SetupPage - } + path: "", + component: SetupPage, + }, ]; @NgModule({ diff --git a/src/app/pages/setup/setup.module.ts b/src/app/pages/setup/setup.module.ts index 484e08c8..9183c73e 100644 --- a/src/app/pages/setup/setup.module.ts +++ b/src/app/pages/setup/setup.module.ts @@ -1,20 +1,15 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { FormsModule } from '@angular/forms'; +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { FormsModule } from "@angular/forms"; -import { IonicModule } from '@ionic/angular'; +import { IonicModule } from "@ionic/angular"; -import { SetupPageRoutingModule } from './setup-routing.module'; +import { SetupPageRoutingModule } from "./setup-routing.module"; -import { SetupPage } from './setup.page'; +import { SetupPage } from "./setup.page"; @NgModule({ - imports: [ - CommonModule, - FormsModule, - IonicModule, - SetupPageRoutingModule - ], - declarations: [SetupPage] + imports: [CommonModule, FormsModule, IonicModule, SetupPageRoutingModule], + declarations: [SetupPage], }) export class SetupPageModule {} diff --git a/src/app/pages/setup/setup.page.spec.ts b/src/app/pages/setup/setup.page.spec.ts index a28cefd9..d130bf67 100644 --- a/src/app/pages/setup/setup.page.spec.ts +++ b/src/app/pages/setup/setup.page.spec.ts @@ -1,16 +1,16 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { IonicModule } from '@ionic/angular'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { IonicModule } from "@ionic/angular"; -import { SetupPage } from './setup.page'; +import { SetupPage } from "./setup.page"; -describe('SetupPage', () => { +describe("SetupPage", () => { let component: SetupPage; let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ SetupPage ], - imports: [IonicModule.forRoot()] + declarations: [SetupPage], + imports: [IonicModule.forRoot()], }).compileComponents(); fixture = TestBed.createComponent(SetupPage); @@ -18,7 +18,7 @@ describe('SetupPage', () => { fixture.detectChanges(); })); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/pages/setup/setup.page.ts b/src/app/pages/setup/setup.page.ts index bd6faf68..ae27330a 100644 --- a/src/app/pages/setup/setup.page.ts +++ b/src/app/pages/setup/setup.page.ts @@ -1,14 +1,11 @@ -import { Component } from '@angular/core'; +import { Component } from "@angular/core"; @Component({ - selector: 'app-setup', - templateUrl: './setup.page.html', - styleUrls: ['./setup.page.scss'], + selector: "app-setup", + templateUrl: "./setup.page.html", + styleUrls: ["./setup.page.scss"], }) -export class SetupPage { - pageTitle = "Setup" - constructor() { } - - - +export class SetupPage { + pageTitle = "Setup"; + constructor() {} } diff --git a/src/app/pages/studies/components/advanced-studies/advanced-studies.component.html b/src/app/pages/studies/components/advanced-studies/advanced-studies.component.html index 31c69f2a..bc0dbd5e 100644 --- a/src/app/pages/studies/components/advanced-studies/advanced-studies.component.html +++ b/src/app/pages/studies/components/advanced-studies/advanced-studies.component.html @@ -1,6 +1,10 @@
      -

      Feature coming soon! -
      - Users will be able to log and track their studies based on their syllabus of either School, college or any competitive exam. +

      + Feature coming soon! +
      + + Users will be able to log and track their studies based on their syllabus of either School, + college or any competitive exam. +

      -
      \ No newline at end of file +
      diff --git a/src/app/pages/studies/components/advanced-studies/advanced-studies.component.spec.ts b/src/app/pages/studies/components/advanced-studies/advanced-studies.component.spec.ts index e1691b0e..dee8a5e4 100644 --- a/src/app/pages/studies/components/advanced-studies/advanced-studies.component.spec.ts +++ b/src/app/pages/studies/components/advanced-studies/advanced-studies.component.spec.ts @@ -1,16 +1,16 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { IonicModule } from '@ionic/angular'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { IonicModule } from "@ionic/angular"; -import { AdvancedStudiesComponent } from './advanced-studies.component'; +import { AdvancedStudiesComponent } from "./advanced-studies.component"; -describe('AdvancedStudiesComponent', () => { +describe("AdvancedStudiesComponent", () => { let component: AdvancedStudiesComponent; let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ AdvancedStudiesComponent ], - imports: [IonicModule.forRoot()] + declarations: [AdvancedStudiesComponent], + imports: [IonicModule.forRoot()], }).compileComponents(); fixture = TestBed.createComponent(AdvancedStudiesComponent); @@ -18,7 +18,7 @@ describe('AdvancedStudiesComponent', () => { fixture.detectChanges(); })); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/pages/studies/components/advanced-studies/advanced-studies.component.ts b/src/app/pages/studies/components/advanced-studies/advanced-studies.component.ts index a2df4660..bad533e6 100644 --- a/src/app/pages/studies/components/advanced-studies/advanced-studies.component.ts +++ b/src/app/pages/studies/components/advanced-studies/advanced-studies.component.ts @@ -1,14 +1,10 @@ -import { Component } from '@angular/core'; +import { Component } from "@angular/core"; @Component({ - selector: 'app-advanced-studies', - templateUrl: './advanced-studies.component.html', - styleUrls: ['./advanced-studies.component.scss'], + selector: "app-advanced-studies", + templateUrl: "./advanced-studies.component.html", + styleUrls: ["./advanced-studies.component.scss"], }) -export class AdvancedStudiesComponent { - - constructor() { } - - - +export class AdvancedStudiesComponent { + constructor() {} } diff --git a/src/app/pages/studies/components/edit-studies/edit-studies.component.html b/src/app/pages/studies/components/edit-studies/edit-studies.component.html index a2a88ff8..cb3ac24e 100644 --- a/src/app/pages/studies/components/edit-studies/edit-studies.component.html +++ b/src/app/pages/studies/components/edit-studies/edit-studies.component.html @@ -1,3 +1 @@ -

      - edit-studies works! -

      +

      edit-studies works!

      diff --git a/src/app/pages/studies/components/edit-studies/edit-studies.component.spec.ts b/src/app/pages/studies/components/edit-studies/edit-studies.component.spec.ts index 62fdd54a..86ea8812 100644 --- a/src/app/pages/studies/components/edit-studies/edit-studies.component.spec.ts +++ b/src/app/pages/studies/components/edit-studies/edit-studies.component.spec.ts @@ -1,16 +1,16 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { IonicModule } from '@ionic/angular'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { IonicModule } from "@ionic/angular"; -import { EditStudiesComponent } from './edit-studies.component'; +import { EditStudiesComponent } from "./edit-studies.component"; -describe('EditStudiesComponent', () => { +describe("EditStudiesComponent", () => { let component: EditStudiesComponent; let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ EditStudiesComponent ], - imports: [IonicModule.forRoot()] + declarations: [EditStudiesComponent], + imports: [IonicModule.forRoot()], }).compileComponents(); fixture = TestBed.createComponent(EditStudiesComponent); @@ -18,7 +18,7 @@ describe('EditStudiesComponent', () => { fixture.detectChanges(); })); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/pages/studies/components/edit-studies/edit-studies.component.ts b/src/app/pages/studies/components/edit-studies/edit-studies.component.ts index 28e19fa4..1cc2577b 100644 --- a/src/app/pages/studies/components/edit-studies/edit-studies.component.ts +++ b/src/app/pages/studies/components/edit-studies/edit-studies.component.ts @@ -1,14 +1,10 @@ -import { Component } from '@angular/core'; +import { Component } from "@angular/core"; @Component({ - selector: 'app-edit-studies', - templateUrl: './edit-studies.component.html', - styleUrls: ['./edit-studies.component.scss'], + selector: "app-edit-studies", + templateUrl: "./edit-studies.component.html", + styleUrls: ["./edit-studies.component.scss"], }) -export class EditStudiesComponent { - - constructor() { } - - - +export class EditStudiesComponent { + constructor() {} } diff --git a/src/app/pages/studies/components/free-resource/free-resource.component.html b/src/app/pages/studies/components/free-resource/free-resource.component.html index b32ab75d..8edb9e44 100644 --- a/src/app/pages/studies/components/free-resource/free-resource.component.html +++ b/src/app/pages/studies/components/free-resource/free-resource.component.html @@ -4,38 +4,56 @@ {{ title }} - + + +
      -

      Limited coupons only!

      - MongoDB, Express, React, Node, Angular (MEAN/MERN) - 5 in 1 + + MongoDB, Express, React, Node, Angular (MEAN/MERN) - 5 in 1 + Created by: Prince Patni

      What you'll learn

        -
      • MongoDB: It is a document-oriented No-SQL data store used to store back-end applications.
      • -
      • ExpressJS: It is a layered framework built on top of NodeJS that takes care of the website's back-end - functionality and structure.
      • -
      • ReactJS: It is a library that facilitates creating the user interface components of single-page web - applications.
      • +
      • + MongoDB: It is a document-oriented No-SQL data store used to store back-end + applications. +
      • +
      • + ExpressJS: It is a layered framework built on top of NodeJS that takes care of the + website's back-end functionality and structure. +
      • +
      • + ReactJS: It is a library that facilitates creating the user interface components of + single-page web applications. +
      • NodeJS: It is a runtime environment capable of running JavaScript on a machine
      • AngularJS: It is the front-end framework that runs the code in the browser.
      - Get Now + target="blank" + > + Get Now +
      diff --git a/src/app/pages/studies/components/free-resource/free-resource.component.spec.ts b/src/app/pages/studies/components/free-resource/free-resource.component.spec.ts index ae00bb32..f2a21e25 100644 --- a/src/app/pages/studies/components/free-resource/free-resource.component.spec.ts +++ b/src/app/pages/studies/components/free-resource/free-resource.component.spec.ts @@ -1,16 +1,16 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { IonicModule } from '@ionic/angular'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { IonicModule } from "@ionic/angular"; -import { FreeResourceComponent } from './free-resource.component'; +import { FreeResourceComponent } from "./free-resource.component"; -describe('FreeResourceComponent', () => { +describe("FreeResourceComponent", () => { let component: FreeResourceComponent; let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ FreeResourceComponent ], - imports: [IonicModule.forRoot()] + declarations: [FreeResourceComponent], + imports: [IonicModule.forRoot()], }).compileComponents(); fixture = TestBed.createComponent(FreeResourceComponent); @@ -18,7 +18,7 @@ describe('FreeResourceComponent', () => { fixture.detectChanges(); })); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/pages/studies/components/free-resource/free-resource.component.ts b/src/app/pages/studies/components/free-resource/free-resource.component.ts index d9e78471..9f0a97db 100644 --- a/src/app/pages/studies/components/free-resource/free-resource.component.ts +++ b/src/app/pages/studies/components/free-resource/free-resource.component.ts @@ -1,13 +1,11 @@ -import { Component } from '@angular/core'; +import { Component } from "@angular/core"; @Component({ - selector: 'app-free-resource', - templateUrl: './free-resource.component.html', - styleUrls: ['./free-resource.component.scss'], + selector: "app-free-resource", + templateUrl: "./free-resource.component.html", + styleUrls: ["./free-resource.component.scss"], }) export class FreeResourceComponent { - - constructor() { } - title = "Free Resource" - + constructor() {} + title = "Free Resource"; } diff --git a/src/app/pages/studies/studies-routing.module.ts b/src/app/pages/studies/studies-routing.module.ts index aa9d30ff..2b1f2426 100644 --- a/src/app/pages/studies/studies-routing.module.ts +++ b/src/app/pages/studies/studies-routing.module.ts @@ -1,28 +1,28 @@ -import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; +import { NgModule } from "@angular/core"; +import { Routes, RouterModule } from "@angular/router"; -import { StudiesPage } from './studies.page'; -import { EditStudiesComponent } from './components/edit-studies/edit-studies.component'; -import { FreeResourceComponent } from './components/free-resource/free-resource.component'; -import { AdvancedStudiesComponent } from './components/advanced-studies/advanced-studies.component'; +import { StudiesPage } from "./studies.page"; +import { EditStudiesComponent } from "./components/edit-studies/edit-studies.component"; +import { FreeResourceComponent } from "./components/free-resource/free-resource.component"; +import { AdvancedStudiesComponent } from "./components/advanced-studies/advanced-studies.component"; const routes: Routes = [ { - path: '', - component: StudiesPage + path: "", + component: StudiesPage, }, { - path:'edit-studies', - component:EditStudiesComponent + path: "edit-studies", + component: EditStudiesComponent, }, { - path:'free-resource', - component:FreeResourceComponent + path: "free-resource", + component: FreeResourceComponent, }, { - path:'advanced-studies', - component:AdvancedStudiesComponent - } + path: "advanced-studies", + component: AdvancedStudiesComponent, + }, ]; @NgModule({ diff --git a/src/app/pages/studies/studies.module.ts b/src/app/pages/studies/studies.module.ts index 36361b54..f7be50a1 100644 --- a/src/app/pages/studies/studies.module.ts +++ b/src/app/pages/studies/studies.module.ts @@ -1,13 +1,13 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { IonicModule } from '@ionic/angular'; -import { StudiesPageRoutingModule } from './studies-routing.module'; -import { StudiesPage } from './studies.page'; -import { TwelveHourFormatPipeModule } from 'src/app/models/pipe/time/twelve-hour-format.module'; -import { EditStudiesComponent } from './components/edit-studies/edit-studies.component'; -import { FreeResourceComponent } from './components/free-resource/free-resource.component'; -import { AdvancedStudiesComponent } from './components/advanced-studies/advanced-studies.component'; +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { FormsModule, ReactiveFormsModule } from "@angular/forms"; +import { IonicModule } from "@ionic/angular"; +import { StudiesPageRoutingModule } from "./studies-routing.module"; +import { StudiesPage } from "./studies.page"; +import { TwelveHourFormatPipeModule } from "src/app/models/pipe/time/twelve-hour-format.module"; +import { EditStudiesComponent } from "./components/edit-studies/edit-studies.component"; +import { FreeResourceComponent } from "./components/free-resource/free-resource.component"; +import { AdvancedStudiesComponent } from "./components/advanced-studies/advanced-studies.component"; @NgModule({ imports: [ @@ -16,13 +16,13 @@ import { AdvancedStudiesComponent } from './components/advanced-studies/advanced IonicModule, StudiesPageRoutingModule, ReactiveFormsModule, - TwelveHourFormatPipeModule + TwelveHourFormatPipeModule, ], declarations: [ StudiesPage, EditStudiesComponent, FreeResourceComponent, - AdvancedStudiesComponent - ] + AdvancedStudiesComponent, + ], }) export class StudiesPageModule {} diff --git a/src/app/pages/studies/studies.page.html b/src/app/pages/studies/studies.page.html index 5d7a6fd9..7471ebd1 100644 --- a/src/app/pages/studies/studies.page.html +++ b/src/app/pages/studies/studies.page.html @@ -17,20 +17,20 @@
      - - - - Normal Mode - - - - Advanced Mode - - - + + + + Normal Mode + + + + Advanced Mode + + +
      -
      +

      {{editMode?"Update":"Add"}} Studies

      @@ -56,42 +56,80 @@

      {{editMode?"Update":"Add"}} Studies

      Subject - +
      Topic - +
      Description - - +
      Type - - {{type.title}} + + + {{type.title}} +
      Study Mode - - {{item.title}} + + + {{item.title}} +
      - {{editMode?"Update":"Submit"}} - Reset - Cancel + + {{editMode?"Update":"Submit"}} + + + Reset + + + Cancel +
      @@ -108,9 +146,18 @@

      My Studies

      -

      Description: {{study?.description}}

      -

      Date: {{study?.startTime}}

      -

      Answered By at {{study?.endTime}}

      +

      + Description: + {{study?.description}} +

      +

      + Date: + {{study?.startTime}} +

      +

      + Answered By at + {{study?.endTime}} +

      @@ -122,13 +169,18 @@

      My Studies

      - Get Free Resource + + Get Free Resource +
      - - - \ No newline at end of file + + diff --git a/src/app/pages/studies/studies.page.spec.ts b/src/app/pages/studies/studies.page.spec.ts index dc0f0391..bc4c5ba5 100644 --- a/src/app/pages/studies/studies.page.spec.ts +++ b/src/app/pages/studies/studies.page.spec.ts @@ -1,16 +1,16 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { IonicModule } from '@ionic/angular'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { IonicModule } from "@ionic/angular"; -import { StudiesPage } from './studies.page'; +import { StudiesPage } from "./studies.page"; -describe('StudiesPage', () => { +describe("StudiesPage", () => { let component: StudiesPage; let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ StudiesPage ], - imports: [IonicModule.forRoot()] + declarations: [StudiesPage], + imports: [IonicModule.forRoot()], }).compileComponents(); fixture = TestBed.createComponent(StudiesPage); @@ -18,7 +18,7 @@ describe('StudiesPage', () => { fixture.detectChanges(); })); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/pages/studies/studies.page.ts b/src/app/pages/studies/studies.page.ts index d487d358..8ede89a3 100644 --- a/src/app/pages/studies/studies.page.ts +++ b/src/app/pages/studies/studies.page.ts @@ -1,18 +1,18 @@ -import { DatePipe, ViewportScroller } from '@angular/common'; -import { Component, OnInit } from '@angular/core'; -import { serverTimestamp } from '@angular/fire/firestore'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { SeoTags } from 'src/app/models/class/seoTags/seo'; -import { StudyOptionsData } from 'src/app/models/data/studyOptions.data'; -import { AlertService } from 'src/app/services/alert/alert.service'; -import { ProfileService } from 'src/app/services/profile/profile.service'; -import { SeoService } from 'src/app/services/seo/seo.service'; -import { StudiesService } from 'src/app/services/studies/studies.service'; +import { DatePipe, ViewportScroller } from "@angular/common"; +import { Component, OnInit } from "@angular/core"; +import { serverTimestamp } from "@angular/fire/firestore"; +import { FormBuilder, FormGroup, Validators } from "@angular/forms"; +import { SeoTags } from "src/app/models/class/seoTags/seo"; +import { StudyOptionsData } from "src/app/models/data/studyOptions.data"; +import { AlertService } from "src/app/services/alert/alert.service"; +import { ProfileService } from "src/app/services/profile/profile.service"; +import { SeoService } from "src/app/services/seo/seo.service"; +import { StudiesService } from "src/app/services/studies/studies.service"; @Component({ - selector: 'app-studies', - templateUrl: './studies.page.html', - styleUrls: ['./studies.page.scss'] + selector: "app-studies", + templateUrl: "./studies.page.html", + styleUrls: ["./studies.page.scss"], }) export class StudiesPage implements OnInit { constructor( @@ -22,115 +22,113 @@ export class StudiesPage implements OnInit { private alertService: AlertService, private datePipe: DatePipe, private viewportScroller: ViewportScroller, - private profileService: ProfileService - ) { } + private profileService: ProfileService, + ) {} pageTitle = "Studies"; - pageMetaTags = SeoTags.studiesPageTags - studyMode = StudyOptionsData.studyMode + pageMetaTags = SeoTags.studiesPageTags; + studyMode = StudyOptionsData.studyMode; Studies: any = []; studiesCount: number = 0; - currentTime = this.datePipe.transform(new Date(), 'hh:mm'); - advancedMode:boolean = false; - advancedModeAvailable:boolean = false; - editMode:boolean = false; - updateSubmitted:Boolean = false; - dateToday: string | null = this.datePipe.transform(new Date(), 'yyyy-MM-dd'); + currentTime = this.datePipe.transform(new Date(), "hh:mm"); + advancedMode: boolean = false; + advancedModeAvailable: boolean = false; + editMode: boolean = false; + updateSubmitted: Boolean = false; + dateToday: string | null = this.datePipe.transform(new Date(), "yyyy-MM-dd"); studiesForm: FormGroup = this.fb.group({ createdAt: [serverTimestamp()], - date: [this.dateToday, [Validators.required, Validators.pattern('^[a-zA-Z 0-9 .,-]*$')]], - startTime: ['', [Validators.required, Validators.pattern('^[0-9:]*$')]], - endTime: [this.currentTime, [Validators.required, Validators.pattern('^[0-9:]*$')]], - type: ['read', [Validators.required, Validators.pattern('^[a-z]*$')]], - subject: ['', [Validators.required, Validators.pattern('^[a-zA-Z 0-9 .,-]*$')]], - topic: ['', [Validators.required, Validators.pattern('^[a-zA-Z 0-9\n .,-]*$')]], - description: ['', [Validators.required, Validators.pattern('^[a-zA-Z 0-9\n .,-]*$')]], - studyMode: ['self', [Validators.required, Validators.pattern('^[a-zA-Z 0-9 .,-]*$')]], - updatedAt: [serverTimestamp()] - }) - studiesTypes = StudyOptionsData.studiesTypes - updateDataId:string =""; + date: [this.dateToday, [Validators.required, Validators.pattern("^[a-zA-Z 0-9 .,-]*$")]], + startTime: ["", [Validators.required, Validators.pattern("^[0-9:]*$")]], + endTime: [this.currentTime, [Validators.required, Validators.pattern("^[0-9:]*$")]], + type: ["read", [Validators.required, Validators.pattern("^[a-z]*$")]], + subject: ["", [Validators.required, Validators.pattern("^[a-zA-Z 0-9 .,-]*$")]], + topic: ["", [Validators.required, Validators.pattern("^[a-zA-Z 0-9\n .,-]*$")]], + description: ["", [Validators.required, Validators.pattern("^[a-zA-Z 0-9\n .,-]*$")]], + studyMode: ["self", [Validators.required, Validators.pattern("^[a-zA-Z 0-9 .,-]*$")]], + updatedAt: [serverTimestamp()], + }); + studiesTypes = StudyOptionsData.studiesTypes; + updateDataId: string = ""; ngOnInit() { - this.getStudies() + this.getStudies(); this.seoService.seo(this.pageTitle, this.pageMetaTags); this.activateAdvancedMode(); } async getStudies() { - await this.studiesService.getStudies().subscribe(res => { - this.Studies = res - this.studiesCount = this.Studies.length - }) - - + await this.studiesService.getStudies().subscribe((res) => { + this.Studies = res; + this.studiesCount = this.Studies.length; + }); } - manageStudies(idField?:string){ + manageStudies(idField?: string) { if (this.editMode) { - this.updateStudies(this.studiesForm.value) + this.updateStudies(this.studiesForm.value); } else { - this.addStudies(this.studiesForm.value) + this.addStudies(this.studiesForm.value); } - this.editMode = false - this.studiesForm.get('date')?.enable(); + this.editMode = false; + this.studiesForm.get("date")?.enable(); this.studiesForm.patchValue({ - subject: '', - topic: '', - description: '' - }) + subject: "", + topic: "", + description: "", + }); } - cancelUpdate(){ + cancelUpdate() { this.editMode = false; this.studiesForm.markAsUntouched(); - this.studiesForm.get('date')?.enable(); + this.studiesForm.get("date")?.enable(); this.studiesForm.reset({ date: this.dateToday, - subject: '', - topic: '', - description: '' - }) - this.updateSubmitted=false; + subject: "", + topic: "", + description: "", + }); + this.updateSubmitted = false; } addStudies(value: any) { - this.studiesService.addStudies(value) + this.studiesService.addStudies(value); } - updateStudies(value:any) { + updateStudies(value: any) { this.updateSubmitted = true; - this.studiesService.updateStudies(value,this.updateDataId) + this.studiesService.updateStudies(value, this.updateDataId); this.cancelUpdate(); } - async deleteStudies(idField:string){ - const response = await this.alertService.deleteAlert() + async deleteStudies(idField: string) { + const response = await this.alertService.deleteAlert(); if (response === "confirm") { - this.studiesService.deleteStudies(idField) + this.studiesService.deleteStudies(idField); } } - async editStudies(data:any){ + async editStudies(data: any) { this.studiesForm.patchValue({ - createdAt:data.createdAt, - date:data.date, - startTime:data.startTime, - endTime:data.endTime, - type:data.type, - subject:data.subject, - topic:data.topic, - description:data.description, - studyMode:data.studyMode, - updatedAt: serverTimestamp() - }) - this.updateDataId= data.idField; - this.studiesForm.get('date')?.disable(); + createdAt: data.createdAt, + date: data.date, + startTime: data.startTime, + endTime: data.endTime, + type: data.type, + subject: data.subject, + topic: data.topic, + description: data.description, + studyMode: data.studyMode, + updatedAt: serverTimestamp(), + }); + this.updateDataId = data.idField; + this.studiesForm.get("date")?.disable(); this.editMode = true; } - async activateAdvancedMode(){ + async activateAdvancedMode() { const profileData = await this.profileService.getProfileData(); - if(profileData.educationDetails){ - this.advancedModeAvailable = true - this.advancedMode = true; - } + if (profileData.educationDetails) { + this.advancedModeAvailable = true; + this.advancedMode = true; + } } } diff --git a/src/app/pages/support/support-routing.module.ts b/src/app/pages/support/support-routing.module.ts index 49e02fd8..1c266ee1 100644 --- a/src/app/pages/support/support-routing.module.ts +++ b/src/app/pages/support/support-routing.module.ts @@ -1,13 +1,13 @@ -import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; +import { NgModule } from "@angular/core"; +import { Routes, RouterModule } from "@angular/router"; -import { SupportPage } from './support.page'; +import { SupportPage } from "./support.page"; const routes: Routes = [ { - path: '', - component: SupportPage - } + path: "", + component: SupportPage, + }, ]; @NgModule({ diff --git a/src/app/pages/support/support.module.ts b/src/app/pages/support/support.module.ts index 7d5bbec0..c9d7c3d3 100644 --- a/src/app/pages/support/support.module.ts +++ b/src/app/pages/support/support.module.ts @@ -1,20 +1,15 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { FormsModule } from '@angular/forms'; +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { FormsModule } from "@angular/forms"; -import { IonicModule } from '@ionic/angular'; +import { IonicModule } from "@ionic/angular"; -import { SupportPageRoutingModule } from './support-routing.module'; +import { SupportPageRoutingModule } from "./support-routing.module"; -import { SupportPage } from './support.page'; +import { SupportPage } from "./support.page"; @NgModule({ - imports: [ - CommonModule, - FormsModule, - IonicModule, - SupportPageRoutingModule - ], - declarations: [SupportPage] + imports: [CommonModule, FormsModule, IonicModule, SupportPageRoutingModule], + declarations: [SupportPage], }) export class SupportPageModule {} diff --git a/src/app/pages/support/support.page.spec.ts b/src/app/pages/support/support.page.spec.ts index 69ce63a1..b8873699 100644 --- a/src/app/pages/support/support.page.spec.ts +++ b/src/app/pages/support/support.page.spec.ts @@ -1,16 +1,16 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { IonicModule } from '@ionic/angular'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { IonicModule } from "@ionic/angular"; -import { SupportPage } from './support.page'; +import { SupportPage } from "./support.page"; -describe('SupportPage', () => { +describe("SupportPage", () => { let component: SupportPage; let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ SupportPage ], - imports: [IonicModule.forRoot()] + declarations: [SupportPage], + imports: [IonicModule.forRoot()], }).compileComponents(); fixture = TestBed.createComponent(SupportPage); @@ -18,7 +18,7 @@ describe('SupportPage', () => { fixture.detectChanges(); })); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/pages/support/support.page.ts b/src/app/pages/support/support.page.ts index 54fa581b..ceab47ac 100644 --- a/src/app/pages/support/support.page.ts +++ b/src/app/pages/support/support.page.ts @@ -1,12 +1,11 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit } from "@angular/core"; @Component({ - selector: 'app-support', - templateUrl: './support.page.html', - styleUrls: ['./support.page.scss'], + selector: "app-support", + templateUrl: "./support.page.html", + styleUrls: ["./support.page.scss"], }) export class SupportPage { - pageTitle = "Support" - constructor() { } - + pageTitle = "Support"; + constructor() {} } diff --git a/src/app/pages/time/time-routing.module.ts b/src/app/pages/time/time-routing.module.ts index 7f0c07f0..2ad7e856 100644 --- a/src/app/pages/time/time-routing.module.ts +++ b/src/app/pages/time/time-routing.module.ts @@ -1,13 +1,13 @@ -import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; +import { NgModule } from "@angular/core"; +import { Routes, RouterModule } from "@angular/router"; -import { TimePage } from './time.page'; +import { TimePage } from "./time.page"; const routes: Routes = [ { - path: '', - component: TimePage - } + path: "", + component: TimePage, + }, ]; @NgModule({ diff --git a/src/app/pages/time/time.module.ts b/src/app/pages/time/time.module.ts index 57d2bfef..f49356a0 100644 --- a/src/app/pages/time/time.module.ts +++ b/src/app/pages/time/time.module.ts @@ -1,21 +1,15 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { NgModule } from "@angular/core"; +import { CommonModule } from "@angular/common"; +import { FormsModule, ReactiveFormsModule } from "@angular/forms"; -import { IonicModule } from '@ionic/angular'; +import { IonicModule } from "@ionic/angular"; -import { TimePageRoutingModule } from './time-routing.module'; +import { TimePageRoutingModule } from "./time-routing.module"; -import { TimePage } from './time.page'; +import { TimePage } from "./time.page"; @NgModule({ - imports: [ - CommonModule, - FormsModule, - IonicModule, - TimePageRoutingModule, - ReactiveFormsModule - ], - declarations: [TimePage] + imports: [CommonModule, FormsModule, IonicModule, TimePageRoutingModule, ReactiveFormsModule], + declarations: [TimePage], }) export class TimePageModule {} diff --git a/src/app/pages/time/time.page.html b/src/app/pages/time/time.page.html index b1aaced1..8ea32a93 100644 --- a/src/app/pages/time/time.page.html +++ b/src/app/pages/time/time.page.html @@ -15,35 +15,74 @@
      - -
      +

      {{editMode?"Update":"Add"}} Work

      - + - + - {{item.name}} + + {{item.name}} + - No project found. Please add active projects from Profile page. If already have please wait while we fetch. + + No project found. Please add active projects from + Profile page. + If already have please wait while we fetch. + - + - + - - + - + Break Bug Fixing Coding @@ -57,15 +96,25 @@

      {{editMode?"Update":"Add"}} Work

      - Submit + + Submit + Reset - Update - Cancel + + Update + + + Cancel +
      -
      @@ -75,9 +124,15 @@

      {{editMode?"Update":"Add"}} Work

      Get all for a day

      - + - +
      @@ -90,7 +145,7 @@

      Work logged on {{totalWorkingHours}}.

      {{work.startTime}} - {{work.endTime}} : {{work.description}}

      - Copy to clipboard + Copy to clipboard
      @@ -98,8 +153,12 @@

      Work logged on {{totalWorkingHours}}.

      No Work found

      My Work

      - All Works - Latest Only + + All Works + + + Latest Only +
      @@ -117,14 +176,19 @@

      My Work

      {{ work?.project }} {{ work?.date }} - {{ work?.startTime }} - {{ work?.endTime }} + {{ work?.startTime }} - {{ work?.endTime }} + {{ work?.type | titlecase }}
      {{ work?.description}}
      - + @@ -136,13 +200,10 @@

      My Work

      - * Edit and copy features coming - soon. + + * Edit and copy features coming soon. +
      - - - -
      - \ No newline at end of file + diff --git a/src/app/pages/time/time.page.spec.ts b/src/app/pages/time/time.page.spec.ts index b11e0cd0..fff85188 100644 --- a/src/app/pages/time/time.page.spec.ts +++ b/src/app/pages/time/time.page.spec.ts @@ -1,16 +1,16 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { IonicModule } from '@ionic/angular'; +import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; +import { IonicModule } from "@ionic/angular"; -import { TimePage } from './time.page'; +import { TimePage } from "./time.page"; -describe('TimePage', () => { +describe("TimePage", () => { let component: TimePage; let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ TimePage ], - imports: [IonicModule.forRoot()] + declarations: [TimePage], + imports: [IonicModule.forRoot()], }).compileComponents(); fixture = TestBed.createComponent(TimePage); @@ -18,7 +18,7 @@ describe('TimePage', () => { fixture.detectChanges(); })); - it('should create', () => { + it("should create", () => { expect(component).toBeTruthy(); }); }); diff --git a/src/app/services/achievements/achievements.service.spec.ts b/src/app/services/achievements/achievements.service.spec.ts index d50563f1..17c541e1 100644 --- a/src/app/services/achievements/achievements.service.spec.ts +++ b/src/app/services/achievements/achievements.service.spec.ts @@ -1,8 +1,8 @@ -import { TestBed } from '@angular/core/testing'; +import { TestBed } from "@angular/core/testing"; -import { AchievementsService } from './achievements.service'; +import { AchievementsService } from "./achievements.service"; -describe('AchievementsService', () => { +describe("AchievementsService", () => { let service: AchievementsService; beforeEach(() => { @@ -10,7 +10,7 @@ describe('AchievementsService', () => { service = TestBed.inject(AchievementsService); }); - it('should be created', () => { + it("should be created", () => { expect(service).toBeTruthy(); }); }); diff --git a/src/app/services/achievements/achievements.service.ts b/src/app/services/achievements/achievements.service.ts index 0582003a..4e63f3bb 100644 --- a/src/app/services/achievements/achievements.service.ts +++ b/src/app/services/achievements/achievements.service.ts @@ -1,58 +1,72 @@ -import { Injectable } from '@angular/core'; +import { Injectable } from "@angular/core"; import { AngularFirestore } from "@angular/fire/compat/firestore"; -import { AlertController } from '@ionic/angular'; -import { ProfileService } from '../profile/profile.service'; +import { AlertController } from "@ionic/angular"; +import { ProfileService } from "../profile/profile.service"; @Injectable({ - providedIn: 'root' + providedIn: "root", }) export class AchievementsService { - constructor( private afs: AngularFirestore, private alertCtrl: AlertController, - private profileService: ProfileService - ) { } - userId = this.profileService.getUserProfile()?.uid - successMessage = "Achievement Added Successfully!" - deletedMessage = "Achievement Deleted Successfully!" - achievementCollection = this.afs.collection('userData') + private profileService: ProfileService, + ) {} + userId = this.profileService.getUserProfile()?.uid; + successMessage = "Achievement Added Successfully!"; + deletedMessage = "Achievement Deleted Successfully!"; + achievementCollection = this.afs.collection("userData"); addAchievement(data: any) { - this.achievementCollection.doc(this.userId).collection('myAchievement').add(data).then(res => { - this.successAlert(this.successMessage); - }).catch(err => { - alert("There was an error in posting. \n Please try again later. Check console for detail."); - console.warn(err); - }) + this.achievementCollection + .doc(this.userId) + .collection("myAchievement") + .add(data) + .then((res) => { + this.successAlert(this.successMessage); + }) + .catch((err) => { + alert( + "There was an error in posting. \n Please try again later. Check console for detail.", + ); + console.warn(err); + }); } getAchievement(count: number) { if (count > 4) { - return this.achievementCollection.doc(this.userId).collection('myAchievement', ref => ref.orderBy('achievedOn', 'desc').limit(count)).valueChanges({ idField: 'idField' }) - } - else { - return this.achievementCollection.doc(this.userId).collection('myAchievement', ref => ref.orderBy('achievedOn', 'desc')).valueChanges({ idField: 'idField' }) + return this.achievementCollection + .doc(this.userId) + .collection("myAchievement", (ref) => ref.orderBy("achievedOn", "desc").limit(count)) + .valueChanges({ idField: "idField" }); + } else { + return this.achievementCollection + .doc(this.userId) + .collection("myAchievement", (ref) => ref.orderBy("achievedOn", "desc")) + .valueChanges({ idField: "idField" }); } } deleteAchievement(idField: string) { - this.achievementCollection.doc(this.userId).collection('myAchievement').doc(idField).delete().then( - () => { - this.successAlert(this.deletedMessage) - } - ).catch(err => { - alert(err) - }) + this.achievementCollection + .doc(this.userId) + .collection("myAchievement") + .doc(idField) + .delete() + .then(() => { + this.successAlert(this.deletedMessage); + }) + .catch((err) => { + alert(err); + }); } async successAlert(message: string) { const alert = await this.alertCtrl.create({ - header: 'Success', + header: "Success", subHeader: message, - cssClass: 'success-alert', + cssClass: "success-alert", // message: 'This is an alert!', - buttons: ['OK'], + buttons: ["OK"], }); await alert.present(); } - } diff --git a/src/app/services/alert/alert.service.spec.ts b/src/app/services/alert/alert.service.spec.ts index b20ed8c3..e6ebd6fc 100644 --- a/src/app/services/alert/alert.service.spec.ts +++ b/src/app/services/alert/alert.service.spec.ts @@ -1,8 +1,8 @@ -import { TestBed } from '@angular/core/testing'; +import { TestBed } from "@angular/core/testing"; -import { AlertService } from './alert.service'; +import { AlertService } from "./alert.service"; -describe('AlertService', () => { +describe("AlertService", () => { let service: AlertService; beforeEach(() => { @@ -10,7 +10,7 @@ describe('AlertService', () => { service = TestBed.inject(AlertService); }); - it('should be created', () => { + it("should be created", () => { expect(service).toBeTruthy(); }); }); diff --git a/src/app/services/alert/alert.service.ts b/src/app/services/alert/alert.service.ts index 4cac931e..b90c931c 100644 --- a/src/app/services/alert/alert.service.ts +++ b/src/app/services/alert/alert.service.ts @@ -1,30 +1,30 @@ -import { Injectable } from '@angular/core'; -import { AlertController } from '@ionic/angular'; +import { Injectable } from "@angular/core"; +import { AlertController } from "@ionic/angular"; @Injectable({ - providedIn: 'root' + providedIn: "root", }) export class AlertService { - handlerMessage = ''; - roleMessage = ''; - constructor(private alertController: AlertController) { } + handlerMessage = ""; + roleMessage = ""; + constructor(private alertController: AlertController) {} async presentAlert() { const alert = await this.alertController.create({ - header: 'Alert!', + header: "Alert!", buttons: [ { - text: 'Cancel', - role: 'cancel', + text: "Cancel", + role: "cancel", handler: () => { - this.handlerMessage = 'Alert canceled'; + this.handlerMessage = "Alert canceled"; }, }, { - text: 'OK', - role: 'confirm', + text: "OK", + role: "confirm", handler: () => { - this.handlerMessage = 'Alert confirmed'; + this.handlerMessage = "Alert confirmed"; }, }, ], @@ -37,26 +37,26 @@ export class AlertService { } async deleteAlert() { const alert = await this.alertController.create({ - header: 'Delete permanently?', + header: "Delete permanently?", buttons: [ { - text: 'Cancel', - role: 'cancel', + text: "Cancel", + role: "cancel", handler: () => { - this.handlerMessage = 'Delete canceled'; + this.handlerMessage = "Delete canceled"; }, }, { - text: 'OK', - role: 'confirm', + text: "OK", + role: "confirm", handler: () => { - this.handlerMessage = 'Delete confirmed'; + this.handlerMessage = "Delete confirmed"; }, }, ], }); await alert.present(); const role = await alert.onDidDismiss(); - return role.role + return role.role; } } diff --git a/src/app/services/expense/expense.service.spec.ts b/src/app/services/expense/expense.service.spec.ts index 92b7172f..898ce7b7 100644 --- a/src/app/services/expense/expense.service.spec.ts +++ b/src/app/services/expense/expense.service.spec.ts @@ -1,8 +1,8 @@ -import { TestBed } from '@angular/core/testing'; +import { TestBed } from "@angular/core/testing"; -import { ExpenseService } from './expense.service'; +import { ExpenseService } from "./expense.service"; -describe('ExpenseService', () => { +describe("ExpenseService", () => { let service: ExpenseService; beforeEach(() => { @@ -10,7 +10,7 @@ describe('ExpenseService', () => { service = TestBed.inject(ExpenseService); }); - it('should be created', () => { + it("should be created", () => { expect(service).toBeTruthy(); }); }); diff --git a/src/app/services/expense/expense.service.ts b/src/app/services/expense/expense.service.ts index 48112fbb..0df6130a 100644 --- a/src/app/services/expense/expense.service.ts +++ b/src/app/services/expense/expense.service.ts @@ -1,87 +1,125 @@ -import { Injectable } from '@angular/core'; +import { Injectable } from "@angular/core"; import { AngularFirestore } from "@angular/fire/compat/firestore"; -import { AlertController } from '@ionic/angular'; -import { ProfileService } from '../profile/profile.service'; -import { ToasterService } from '../toaster/toaster.service'; +import { AlertController } from "@ionic/angular"; +import { ProfileService } from "../profile/profile.service"; +import { ToasterService } from "../toaster/toaster.service"; @Injectable({ - providedIn: 'root' + providedIn: "root", }) export class ExpenseService { - constructor( private afs: AngularFirestore, private alertCtrl: AlertController, private profileService: ProfileService, - private toasterService: ToasterService - ) { } - analyseExpense:any; - userId = this.profileService.getUserProfile()?.uid - successMessage = "Expense Added Successfully!" - deletedMessage = "Expense Deleted Successfully!" - expenseCollection = this.afs.collection('userData') + private toasterService: ToasterService, + ) {} + analyseExpense: any; + userId = this.profileService.getUserProfile()?.uid; + successMessage = "Expense Added Successfully!"; + deletedMessage = "Expense Deleted Successfully!"; + expenseCollection = this.afs.collection("userData"); addExpense(data: any) { - this.expenseCollection.doc(this.userId).collection('myExpence').add(data).then(res => { - this.successAlert(this.successMessage); - }).catch(err => { - alert("There was an error in posting. \n Please try again later. Check console for detail."); - console.warn(err); - }) + this.expenseCollection + .doc(this.userId) + .collection("myExpence") + .add(data) + .then((res) => { + this.successAlert(this.successMessage); + }) + .catch((err) => { + alert( + "There was an error in posting. \n Please try again later. Check console for detail.", + ); + console.warn(err); + }); } getExpenses(count?: number) { if (count) { - return this.expenseCollection.doc(this.userId).collection('myExpence', ref => ref.orderBy('date', 'desc').limit(count)).valueChanges({ idField: 'idField' }) - } - else { - return this.expenseCollection.doc(this.userId).collection('myExpence', ref => ref.orderBy('date', 'desc')).valueChanges({ idField: 'idField' }) + return this.expenseCollection + .doc(this.userId) + .collection("myExpence", (ref) => ref.orderBy("date", "desc").limit(count)) + .valueChanges({ idField: "idField" }); + } else { + return this.expenseCollection + .doc(this.userId) + .collection("myExpence", (ref) => ref.orderBy("date", "desc")) + .valueChanges({ idField: "idField" }); } } - getCustomExpenses(filterBy?: string, data?: string, duration?:string) { + getCustomExpenses(filterBy?: string, data?: string, duration?: string) { // console.log(filterBy +" : " + data +" : " +duration ); let query = null; switch (filterBy) { case "duration": - query = this.expenseCollection.doc(this.userId).collection('myExpence', ref => ref.orderBy('date', 'desc').where('date', '>=', data)).valueChanges({ idField: 'idField' }) + query = this.expenseCollection + .doc(this.userId) + .collection("myExpence", (ref) => ref.orderBy("date", "desc").where("date", ">=", data)) + .valueChanges({ idField: "idField" }); break; case "spentOn": - query = this.expenseCollection.doc(this.userId).collection('myExpence', ref => ref.where('spendedOn', '==', data).orderBy('date').startAt(duration)).valueChanges({ idField: 'idField' }) + query = this.expenseCollection + .doc(this.userId) + .collection("myExpence", (ref) => + ref.where("spendedOn", "==", data).orderBy("date").startAt(duration), + ) + .valueChanges({ idField: "idField" }); break; case "type": - query = this.expenseCollection.doc(this.userId).collection('myExpence', ref => ref.where('type', '==', data).orderBy('date').startAt(duration)).valueChanges({ idField: 'idField' }) + query = this.expenseCollection + .doc(this.userId) + .collection("myExpence", (ref) => + ref.where("type", "==", data).orderBy("date").startAt(duration), + ) + .valueChanges({ idField: "idField" }); break; default: - query = this.expenseCollection.doc(this.userId).collection('myExpence', ref => ref.orderBy('date', 'desc').limit(5)).valueChanges({ idField: 'idField' }); + query = this.expenseCollection + .doc(this.userId) + .collection("myExpence", (ref) => ref.orderBy("date", "desc").limit(5)) + .valueChanges({ idField: "idField" }); break; } return query; } getExpenseByDate(date: string) { - return this.expenseCollection.doc(this.userId).collection('myExpence',(ref)=> ref.where('date','==',date).orderBy('amount','asc')).valueChanges({ idField: 'idField' }) + return this.expenseCollection + .doc(this.userId) + .collection("myExpence", (ref) => ref.where("date", "==", date).orderBy("amount", "asc")) + .valueChanges({ idField: "idField" }); } - - async updateExpense(data,idField){ + + async updateExpense(data, idField) { try { - await this.expenseCollection.doc(this.userId).collection('myExpence').doc(idField).update(data); - this.successAlert('Expense updated successfully'); + await this.expenseCollection + .doc(this.userId) + .collection("myExpence") + .doc(idField) + .update(data); + this.successAlert("Expense updated successfully"); return true; } catch (error) { - this.toasterService.showToast("Error updating expense. Please try again.","danger"); + this.toasterService.showToast("Error updating expense. Please try again.", "danger"); console.warn(error); return false; } } deleteExpense(idField: string) { - this.expenseCollection.doc(this.userId).collection('myExpence').doc(idField).delete().then( - () => { - this.successAlert(this.deletedMessage) - } - ).catch(err => { - alert(err) - }) + this.expenseCollection + .doc(this.userId) + .collection("myExpence") + .doc(idField) + .delete() + .then(() => { + this.successAlert(this.deletedMessage); + }) + .catch((err) => { + alert(err); + }); } async successAlert(message: string) { - this.toasterService.showToast(message,"success") + this.toasterService.showToast(message, "success"); // const alert = await this.alertCtrl.create({ // header: 'Success', // subHeader: message, @@ -93,27 +131,44 @@ export class ExpenseService { // await alert.present(); } - getBudget(){ - return this.expenseCollection.doc(this.userId).collection('myBudget', ref => ref.orderBy('month', 'desc')).valueChanges({ idField: 'idField' }) + getBudget() { + return this.expenseCollection + .doc(this.userId) + .collection("myBudget", (ref) => ref.orderBy("month", "desc")) + .valueChanges({ idField: "idField" }); } addBudget(data: any) { - this.expenseCollection.doc(this.userId).collection('myBudget').add(data).then(res => { - const msg ="Budget Added Successfully!" - this.successAlert(msg); - }).catch(err => { - alert("There was an error in posting.\n Please try again later. Check console for detail. \nContact /report us in case of no success "); - console.warn(err); - }) + this.expenseCollection + .doc(this.userId) + .collection("myBudget") + .add(data) + .then((res) => { + const msg = "Budget Added Successfully!"; + this.successAlert(msg); + }) + .catch((err) => { + alert( + "There was an error in posting.\n Please try again later. Check console for detail. \nContact /report us in case of no success ", + ); + console.warn(err); + }); } updateBudget(data: any) { - this.expenseCollection.doc(this.userId).collection('myBudget').doc(data.idField).update(data).then(res => { - const msg ="Budget updated successfully!" - this.successAlert(msg); - }).catch(err => { - alert("There was an error in updating budget. \n Please try again later. Check console for detail. \nContact /report us in case of no success "); - console.warn(err); - }) + this.expenseCollection + .doc(this.userId) + .collection("myBudget") + .doc(data.idField) + .update(data) + .then((res) => { + const msg = "Budget updated successfully!"; + this.successAlert(msg); + }) + .catch((err) => { + alert( + "There was an error in updating budget. \n Please try again later. Check console for detail. \nContact /report us in case of no success ", + ); + console.warn(err); + }); } - } diff --git a/src/app/services/firebase/firebase.service.spec.ts b/src/app/services/firebase/firebase.service.spec.ts index 8887a591..e394a431 100644 --- a/src/app/services/firebase/firebase.service.spec.ts +++ b/src/app/services/firebase/firebase.service.spec.ts @@ -1,8 +1,8 @@ -import { TestBed } from '@angular/core/testing'; +import { TestBed } from "@angular/core/testing"; -import { FirebaseService } from './firebase.service'; +import { FirebaseService } from "./firebase.service"; -describe('FirebaseService', () => { +describe("FirebaseService", () => { let service: FirebaseService; beforeEach(() => { @@ -10,7 +10,7 @@ describe('FirebaseService', () => { service = TestBed.inject(FirebaseService); }); - it('should be created', () => { + it("should be created", () => { expect(service).toBeTruthy(); }); }); diff --git a/src/app/services/firebase/firebase.service.ts b/src/app/services/firebase/firebase.service.ts index 4df1b2f8..7476d21d 100644 --- a/src/app/services/firebase/firebase.service.ts +++ b/src/app/services/firebase/firebase.service.ts @@ -1,10 +1,10 @@ -import { Injectable } from '@angular/core'; -import { Firestore, doc, setDoc } from '@angular/fire/firestore'; -import { Subscription } from 'rxjs'; -import { getDownloadURL, ref, Storage, uploadString } from '@angular/fire/storage'; -import { Auth } from '@angular/fire/auth'; -import { Photo } from '@capacitor/camera'; -import { AngularFireAuth } from '@angular/fire/compat/auth'; +import { Injectable } from "@angular/core"; +import { Firestore, doc, setDoc } from "@angular/fire/firestore"; +import { Subscription } from "rxjs"; +import { getDownloadURL, ref, Storage, uploadString } from "@angular/fire/storage"; +import { Auth } from "@angular/fire/auth"; +import { Photo } from "@capacitor/camera"; +import { AngularFireAuth } from "@angular/fire/compat/auth"; export interface Note { id?: string; @@ -13,17 +13,16 @@ export interface Note { } @Injectable({ - providedIn: 'root' + providedIn: "root", }) export class FirebaseService { - private authStateSubscription: Subscription; userData; constructor( private auth: Auth, private firestore: Firestore, private firebaseAuth: AngularFireAuth, - private storage: Storage + private storage: Storage, ) {} getUserProfile(): Promise { @@ -41,28 +40,29 @@ export class FirebaseService { } async uploadImage(cameraFile: Photo) { - const user = this.auth.currentUser; - if(user && cameraFile !== undefined ){ - const path = `uploads/${user.uid}/profile.webp`; - const storageRef = ref(this.storage, path); - try { - await uploadString(storageRef, cameraFile.base64String?cameraFile.base64String:"failed", 'base64'); + const user = this.auth.currentUser; + if (user && cameraFile !== undefined) { + const path = `uploads/${user.uid}/profile.webp`; + const storageRef = ref(this.storage, path); + try { + await uploadString( + storageRef, + cameraFile.base64String ? cameraFile.base64String : "failed", + "base64", + ); - const imageUrl = await getDownloadURL(storageRef); + const imageUrl = await getDownloadURL(storageRef); - const userDocRef = doc(this.firestore, `users/${user?.uid}`); - await setDoc(userDocRef, { - imageUrl - }); - return true; - } catch (e) { - return null; - } - } - else{ - return null + const userDocRef = doc(this.firestore, `users/${user?.uid}`); + await setDoc(userDocRef, { + imageUrl, + }); + return true; + } catch (e) { + return null; + } + } else { + return null; } - - } - + } } diff --git a/src/app/services/goal/goal.service.spec.ts b/src/app/services/goal/goal.service.spec.ts index 169f4ab5..15951322 100644 --- a/src/app/services/goal/goal.service.spec.ts +++ b/src/app/services/goal/goal.service.spec.ts @@ -1,8 +1,8 @@ -import { TestBed } from '@angular/core/testing'; +import { TestBed } from "@angular/core/testing"; -import { GoalService } from './goal.service'; +import { GoalService } from "./goal.service"; -describe('GoalService', () => { +describe("GoalService", () => { let service: GoalService; beforeEach(() => { @@ -10,7 +10,7 @@ describe('GoalService', () => { service = TestBed.inject(GoalService); }); - it('should be created', () => { + it("should be created", () => { expect(service).toBeTruthy(); }); }); diff --git a/src/app/services/goal/goal.service.ts b/src/app/services/goal/goal.service.ts index aa63f8f7..a334baa6 100644 --- a/src/app/services/goal/goal.service.ts +++ b/src/app/services/goal/goal.service.ts @@ -1,14 +1,14 @@ -import { Injectable } from '@angular/core'; -import { AngularFirestore } from '@angular/fire/compat/firestore'; -import { AlertController } from '@ionic/angular'; -import { ProfileService } from '../profile/profile.service'; -import { FirebaseService } from '../firebase/firebase.service'; -import { ToasterService } from '../toaster/toaster.service'; -import { GoalData } from 'src/app/models/interface/goals.interface'; -import { serverTimestamp } from '@angular/fire/firestore'; +import { Injectable } from "@angular/core"; +import { AngularFirestore } from "@angular/fire/compat/firestore"; +import { AlertController } from "@ionic/angular"; +import { ProfileService } from "../profile/profile.service"; +import { FirebaseService } from "../firebase/firebase.service"; +import { ToasterService } from "../toaster/toaster.service"; +import { GoalData } from "src/app/models/interface/goals.interface"; +import { serverTimestamp } from "@angular/fire/firestore"; @Injectable({ - providedIn: 'root', + providedIn: "root", }) export class GoalService { constructor( @@ -16,53 +16,47 @@ export class GoalService { private alertCtrl: AlertController, private fs: FirebaseService, private profileService: ProfileService, - private toasterService: ToasterService + private toasterService: ToasterService, ) {} - addMessage = 'Goal added successfully.'; - updateMessage = 'Goal updated successfully.'; - deletedMessage = 'Goal has been successfully deleted.'; + addMessage = "Goal added successfully."; + updateMessage = "Goal updated successfully."; + deletedMessage = "Goal has been successfully deleted."; // userId = this.profileService.getUserProfile()?.uid; - goalCollection = this.afs.collection('userGoals'); + goalCollection = this.afs.collection("userGoals"); getGoal() { const userId = this.fs.userData.uid; // console.log(userId); return this.goalCollection .doc(userId) - .collection('myGoal') - .valueChanges({ idField: 'idField' }); + .collection("myGoal") + .valueChanges({ idField: "idField" }); } getDailyGoal() { const userId = this.fs.userData.uid; // console.log('getting priority goals for: ', userId); return this.goalCollection .doc(userId) - .collection('dailyGoals', (ref) => - ref - .orderBy('gTerm') - .orderBy('date', 'asc') - .where('gTerm', '==', 'Daily') + .collection("dailyGoals", (ref) => + ref.orderBy("gTerm").orderBy("date", "asc").where("gTerm", "==", "Daily"), ) - .valueChanges({ idField: 'idField' }); + .valueChanges({ idField: "idField" }); } getPriorityGoal() { const userId = this.fs.userData.uid; // console.log('getting priority goals for: ', userId); return this.goalCollection .doc(userId) - .collection('priorityGoals', (ref) => - ref - .orderBy('gTerm') - .orderBy('date', 'asc') - .where('gTerm', '!=', 'Daily') + .collection("priorityGoals", (ref) => + ref.orderBy("gTerm").orderBy("date", "asc").where("gTerm", "!=", "Daily"), ) - .valueChanges({ idField: 'idField' }); + .valueChanges({ idField: "idField" }); } addGoal(data: GoalData) { // console.log(data); - const goalTerm = data.gTerm === 'Daily' ? 'dailyGoals' : 'priorityGoals'; + const goalTerm = data.gTerm === "Daily" ? "dailyGoals" : "priorityGoals"; const userId = this.fs.userData.uid; this.goalCollection .doc(userId) @@ -70,12 +64,11 @@ export class GoalService { .add(data) .then((res) => { // console.log(res); - this.toasterService.showToast(this.addMessage, 'success'); - + this.toasterService.showToast(this.addMessage, "success"); }) .catch((err) => { alert( - 'There was an error in posting. \n Please try again later. Check console for detail.' + "There was an error in posting. \n Please try again later. Check console for detail.", ); console.warn(err); }); @@ -84,49 +77,41 @@ export class GoalService { async updateGoal(data: GoalData, idField: string) { try { const userId = this.fs.userData.uid; - const goalTerm = data.gTerm === 'Daily' ? 'dailyGoals' : 'priorityGoals'; + const goalTerm = data.gTerm === "Daily" ? "dailyGoals" : "priorityGoals"; delete data.idField; // console.log(data); - await this.goalCollection - .doc(userId) - .collection(goalTerm) - .doc(idField) - .update(data); - this.toasterService.showToast(this.updateMessage, 'success'); + await this.goalCollection.doc(userId).collection(goalTerm).doc(idField).update(data); + this.toasterService.showToast(this.updateMessage, "success"); } catch (error) { - console.error('Error updating goal:', error); - this.toasterService.showToast('Error updating goal', 'danger'); + console.error("Error updating goal:", error); + this.toasterService.showToast("Error updating goal", "danger"); } } async updateDailyGoal(data: GoalData, idField: string) { try { const userId = this.fs.userData.uid; - const goalTerm = data.gTerm === 'Daily' ? 'completedGoals' : 'priorityGoals'; + const goalTerm = data.gTerm === "Daily" ? "completedGoals" : "priorityGoals"; delete data.idField; // console.log(data); - await this.goalCollection - .doc(userId) - .collection(goalTerm) - .doc(idField) - .update(data); - this.toasterService.showToast(this.updateMessage, 'success'); + await this.goalCollection.doc(userId).collection(goalTerm).doc(idField).update(data); + this.toasterService.showToast(this.updateMessage, "success"); } catch (error) { - console.error('Error updating goal:', error); - this.toasterService.showToast('Error updating goal', 'danger'); + console.error("Error updating goal:", error); + this.toasterService.showToast("Error updating goal", "danger"); } } deleteGoal(data: any, idField: string) { const userId = this.fs.userData.uid; - const goalTerm = data.gTerm === 'Daily' ? 'dailyGoals' : 'priorityGoals'; + const goalTerm = data.gTerm === "Daily" ? "dailyGoals" : "priorityGoals"; this.goalCollection .doc(userId) .collection(goalTerm) .doc(idField) .delete() .then(() => { - this.toasterService.showToast(this.deletedMessage,"danger"); + this.toasterService.showToast(this.deletedMessage, "danger"); }) .catch((err: Error) => { alert(err); @@ -135,84 +120,95 @@ export class GoalService { async markGoalAsCompleted(goalId: string) { try { const userId = this.fs.userData.uid; - const goalRef = this.goalCollection.doc(userId).collection('dailyGoals').doc(goalId); + const goalRef = this.goalCollection.doc(userId).collection("dailyGoals").doc(goalId); const goal = await goalRef.get().toPromise(); - + if (goal.exists) { const data = goal.data(); const completedGoalData = { ...data, completedOn: new Date(), // Set completedOn to current date }; - + // Determine the collection based on gTerm let goalTerm: string; - switch (data['gTerm']) { - case 'Daily': - goalTerm = 'completedGoals'; + switch (data["gTerm"]) { + case "Daily": + goalTerm = "completedGoals"; break; - case 'Short-term': - goalTerm = 'completedShortTermGoals'; + case "Short-term": + goalTerm = "completedShortTermGoals"; break; // Add cases for other gTerm values as needed default: // Handle default case (if any) break; } - + // Move completed goal to the appropriate collection - await this.goalCollection.doc(userId).collection(goalTerm).doc(goalId).set(completedGoalData); + await this.goalCollection + .doc(userId) + .collection(goalTerm) + .doc(goalId) + .set(completedGoalData); await goalRef.delete(); // Remove goal from original collection - this.toasterService.showToast('Goal marked as completed', 'success'); + this.toasterService.showToast("Goal marked as completed", "success"); } else { - console.error('Goal does not exist'); - this.toasterService.showToast('Goal does not exist', 'danger'); + console.error("Goal does not exist"); + this.toasterService.showToast("Goal does not exist", "danger"); } } catch (error) { - console.error('Error marking goal as completed:', error); - this.toasterService.showToast('Error marking goal as completed', 'danger'); + console.error("Error marking goal as completed:", error); + this.toasterService.showToast("Error marking goal as completed", "danger"); } } - + async markGoalAsUncompleted(goalId: string) { try { const userId = this.fs.userData.uid; - const completedGoalRef = this.goalCollection.doc(userId).collection('completedGoals').doc(goalId); + const completedGoalRef = this.goalCollection + .doc(userId) + .collection("completedGoals") + .doc(goalId); const completedGoal = await completedGoalRef.get().toPromise(); - + if (completedGoal.exists) { const data = completedGoal.data(); const uncompletedGoalData = { ...data, completedOn: null, // Reset completedOn field }; - + // Determine the original collection based on gTerm let originalGoalTerm: string; - switch (data['gTerm']) { - case 'Daily': - originalGoalTerm = 'dailyGoals'; + switch (data["gTerm"]) { + case "Daily": + originalGoalTerm = "dailyGoals"; break; - case 'Short-term': - originalGoalTerm = 'shortTermGoals'; + case "Short-term": + originalGoalTerm = "shortTermGoals"; break; // Add cases for other gTerm values as needed default: // Handle default case (if any) break; } - + // Move goal back to the original collection - await this.goalCollection.doc(userId).collection(originalGoalTerm).doc(goalId).set(uncompletedGoalData); + await this.goalCollection + .doc(userId) + .collection(originalGoalTerm) + .doc(goalId) + .set(uncompletedGoalData); await completedGoalRef.delete(); // Remove goal from completedGoals collection - this.toasterService.showToast('Goal marked as uncompleted', 'success'); + this.toasterService.showToast("Goal marked as uncompleted", "success"); } else { - console.error('Completed goal does not exist'); - this.toasterService.showToast('Completed goal does not exist', 'danger'); + console.error("Completed goal does not exist"); + this.toasterService.showToast("Completed goal does not exist", "danger"); } } catch (error) { - console.error('Error marking goal as uncompleted:', error); - this.toasterService.showToast('Error marking goal as uncompleted', 'danger'); + console.error("Error marking goal as uncompleted:", error); + this.toasterService.showToast("Error marking goal as uncompleted", "danger"); } } } diff --git a/src/app/services/office/office.service.spec.ts b/src/app/services/office/office.service.spec.ts index 3742449e..3d5a6b76 100644 --- a/src/app/services/office/office.service.spec.ts +++ b/src/app/services/office/office.service.spec.ts @@ -1,8 +1,8 @@ -import { TestBed } from '@angular/core/testing'; +import { TestBed } from "@angular/core/testing"; -import { OfficeService } from './office.service'; +import { OfficeService } from "./office.service"; -describe('OfficeService', () => { +describe("OfficeService", () => { let service: OfficeService; beforeEach(() => { @@ -10,7 +10,7 @@ describe('OfficeService', () => { service = TestBed.inject(OfficeService); }); - it('should be created', () => { + it("should be created", () => { expect(service).toBeTruthy(); }); }); diff --git a/src/app/services/office/office.service.ts b/src/app/services/office/office.service.ts index 7ab4ef49..381d5833 100644 --- a/src/app/services/office/office.service.ts +++ b/src/app/services/office/office.service.ts @@ -1,69 +1,80 @@ -import { Injectable } from '@angular/core'; -import { AngularFirestore, QuerySnapshot } from '@angular/fire/compat/firestore'; -import { AlertController, ToastController } from '@ionic/angular'; -import { ProfileService } from '../profile/profile.service'; +import { Injectable } from "@angular/core"; +import { AngularFirestore, QuerySnapshot } from "@angular/fire/compat/firestore"; +import { AlertController, ToastController } from "@ionic/angular"; +import { ProfileService } from "../profile/profile.service"; @Injectable({ - providedIn: 'root' + providedIn: "root", }) export class OfficeService { - - userData = localStorage.getItem('UserData') + userData = localStorage.getItem("UserData"); constructor( private afs: AngularFirestore, private alertCtrl: AlertController, - private profileService : ProfileService, - private toastController: ToastController - ) { } + private profileService: ProfileService, + private toastController: ToastController, + ) {} - userId = this.profileService.getUserProfile()?.uid + userId = this.profileService.getUserProfile()?.uid; - successMessage = "Time Log Added Successfully!" - deletedMessage = "Time Log Deleted Successfully!" - workCollection = this.afs.collection('userData') + successMessage = "Time Log Added Successfully!"; + deletedMessage = "Time Log Deleted Successfully!"; + workCollection = this.afs.collection("userData"); getWork(count: number) { if (count > 4) { - return this.workCollection.doc(this.userId).collection('myWork', ref => ref.orderBy('date', 'desc').limit(count)).valueChanges({ idField: 'idField' }) - } - else { - return this.workCollection.doc(this.userId).collection('myWork', ref => ref.orderBy('date', 'desc')).valueChanges({ idField: 'idField' }) + return this.workCollection + .doc(this.userId) + .collection("myWork", (ref) => ref.orderBy("date", "desc").limit(count)) + .valueChanges({ idField: "idField" }); + } else { + return this.workCollection + .doc(this.userId) + .collection("myWork", (ref) => ref.orderBy("date", "desc")) + .valueChanges({ idField: "idField" }); } } - async addWork(data: any) : Promise { + async addWork(data: any): Promise { try { - await this.workCollection.doc(this.userId).collection('myWork').add(data); - this.successAlert('Work added successfully'); + await this.workCollection.doc(this.userId).collection("myWork").add(data); + this.successAlert("Work added successfully"); return true; } catch (error) { - this.errorAlert('Error adding work. Please try again.'); + this.errorAlert("Error adding work. Please try again."); console.warn(error); return false; } } - async updateWork(data: any,idField) { + async updateWork(data: any, idField) { try { - await this.workCollection.doc(this.userId).collection('myWork').doc(idField).update(data); - this.successAlert('Work updated successfully'); + await this.workCollection.doc(this.userId).collection("myWork").doc(idField).update(data); + this.successAlert("Work updated successfully"); return true; } catch (error) { - this.errorAlert('Error adding work. Please try again.'); + this.errorAlert("Error adding work. Please try again."); console.warn(error); return false; } } - async getWorkByDate(date:string) { - return this.workCollection.doc(this.userId).collection('myWork',(ref)=> ref.where('date','==',date).orderBy('startTime','asc')).valueChanges() + async getWorkByDate(date: string) { + return this.workCollection + .doc(this.userId) + .collection("myWork", (ref) => ref.where("date", "==", date).orderBy("startTime", "asc")) + .valueChanges(); } deleteWork(idField: string) { - this.workCollection.doc(this.userId).collection('myWork').doc(idField).delete().then( - () => { - this.successAlert(this.deletedMessage) - } - ).catch(err => { - alert(err) - }) + this.workCollection + .doc(this.userId) + .collection("myWork") + .doc(idField) + .delete() + .then(() => { + this.successAlert(this.deletedMessage); + }) + .catch((err) => { + alert(err); + }); } // async successAlert(message: string) { @@ -82,7 +93,7 @@ export class OfficeService { const toast = await this.toastController.create({ message: message, duration: 2000, - color: 'success', + color: "success", }); toast.present(); } @@ -91,7 +102,7 @@ export class OfficeService { const toast = await this.toastController.create({ message: message, duration: 2000, - color: 'danger', + color: "danger", }); toast.present(); } diff --git a/src/app/services/profile/profile.service.spec.ts b/src/app/services/profile/profile.service.spec.ts index 2ddf7f2f..aaa02f9b 100644 --- a/src/app/services/profile/profile.service.spec.ts +++ b/src/app/services/profile/profile.service.spec.ts @@ -1,8 +1,8 @@ -import { TestBed } from '@angular/core/testing'; +import { TestBed } from "@angular/core/testing"; -import { ProfileService } from './profile.service'; +import { ProfileService } from "./profile.service"; -describe('ProfileService', () => { +describe("ProfileService", () => { let service: ProfileService; beforeEach(() => { @@ -10,7 +10,7 @@ describe('ProfileService', () => { service = TestBed.inject(ProfileService); }); - it('should be created', () => { + it("should be created", () => { expect(service).toBeTruthy(); }); }); diff --git a/src/app/services/profile/profile.service.ts b/src/app/services/profile/profile.service.ts index 004a91e9..14ef6fb8 100644 --- a/src/app/services/profile/profile.service.ts +++ b/src/app/services/profile/profile.service.ts @@ -1,15 +1,15 @@ -import { Injectable } from '@angular/core'; -import { Auth } from '@angular/fire/auth'; -import { AngularFirestore } from '@angular/fire/compat/firestore'; -import { getFirestore, getDoc } from 'firebase/firestore'; -import { AlertController } from '@ionic/angular'; -import { take } from 'rxjs/operators'; -import { doc } from '@angular/fire/firestore/firebase'; -import { ToasterService } from '../toaster/toaster.service'; -import { FirebaseService } from '../firebase/firebase.service'; +import { Injectable } from "@angular/core"; +import { Auth } from "@angular/fire/auth"; +import { AngularFirestore } from "@angular/fire/compat/firestore"; +import { getFirestore, getDoc } from "firebase/firestore"; +import { AlertController } from "@ionic/angular"; +import { take } from "rxjs/operators"; +import { doc } from "@angular/fire/firestore/firebase"; +import { ToasterService } from "../toaster/toaster.service"; +import { FirebaseService } from "../firebase/firebase.service"; @Injectable({ - providedIn: 'root', + providedIn: "root", }) export class ProfileService { constructor( @@ -17,20 +17,17 @@ export class ProfileService { private afs: AngularFirestore, private toasterService: ToasterService, private fs: FirebaseService, - private alertCtrl: AlertController + private alertCtrl: AlertController, ) {} userData; userId = this.getUserProfile()?.uid; - successMessage = 'Profile data updated successfully!'; - deletedMessage = 'Profile data Deleted successfully!'; - profileCollection = this.afs.collection('userData'); - projectsCollection = this.afs - .collection('userData') - .doc(this.userId) - .collection('myProjects'); - addProjectMessage = 'Projects added successfully.'; - updateProjectMessage = 'Projects updated successfully.'; - deletedProjectMessage = 'Projects has been successfully deleted.'; + successMessage = "Profile data updated successfully!"; + deletedMessage = "Profile data Deleted successfully!"; + profileCollection = this.afs.collection("userData"); + projectsCollection = this.afs.collection("userData").doc(this.userId).collection("myProjects"); + addProjectMessage = "Projects added successfully."; + updateProjectMessage = "Projects updated successfully."; + deletedProjectMessage = "Projects has been successfully deleted."; getUserProfile() { let user = this.auth.currentUser; @@ -40,58 +37,52 @@ export class ProfileService { async getProfileData() { const user = await this.fs.getUserProfile(); - let localData: string | null = localStorage.getItem('profileData'); + let localData: string | null = localStorage.getItem("profileData"); if (localData !== null) { let profileData: any = JSON.parse(localData); return profileData; - } - else { + } else { try { - this.toasterService.showToast('Loading Profile data', 'secondary'); + this.toasterService.showToast("Loading Profile data", "secondary"); let profileData = await this.afs .collection(`userData`) .doc(user.uid) .get() .subscribe((snap: any) => { let data = snap.data().profileData; - localStorage.setItem('profileData', JSON.stringify(data)); - this.toasterService.showToast('Profile data fetched.', 'success'); + localStorage.setItem("profileData", JSON.stringify(data)); + this.toasterService.showToast("Profile data fetched.", "success"); return data; }); return profileData; } catch (error) { - console.error('Error fetching profile data:', error); - this.toasterService.showToast('Error loading profile data', 'danger'); + console.error("Error fetching profile data:", error); + this.toasterService.showToast("Error loading profile data", "danger"); throw error; } } } async refreshProfileData() { - await localStorage.removeItem('profileData'); + await localStorage.removeItem("profileData"); this.getProfileData(); } async addEducationalDetail(data: any) { try { const user = await this.fs.getUserProfile(); - const profileCollection = this.afs.collection('userData').doc(user.uid); - const userDoc = profileCollection - .collection('myProjects') - .doc(this.userId); + const profileCollection = this.afs.collection("userData").doc(user.uid); + const userDoc = profileCollection.collection("myProjects").doc(this.userId); const profileData = data; await userDoc.set({ profileData }, { merge: true }); - this.toasterService.showToast(this.successMessage, 'success'); + this.toasterService.showToast(this.successMessage, "success"); this.refreshProfileData(); } catch (error) { - console.error('Error adding educational detail:', error); - this.toasterService.showToast( - 'Failed to add educational detail', - 'danger' - ); + console.error("Error adding educational detail:", error); + this.toasterService.showToast("Failed to add educational detail", "danger"); } } @@ -99,55 +90,55 @@ export class ProfileService { const user = await this.fs.getUserProfile(); try { const projectsCollection = this.afs - .collection('userData') + .collection("userData") .doc(user.uid) - .collection('myProjects'); + .collection("myProjects"); const res = await projectsCollection.add(data); - this.toasterService.showToast(this.addProjectMessage, 'success'); + this.toasterService.showToast(this.addProjectMessage, "success"); } catch (error) { - console.error('Error adding project:', error); - this.toasterService.showToast('Failed to add project', 'danger'); + console.error("Error adding project:", error); + this.toasterService.showToast("Failed to add project", "danger"); } } async updateProjects(data: any, idField: string) { const user = await this.fs.getUserProfile(); const projectsCollection = this.afs - .collection('userData') + .collection("userData") .doc(user.uid) - .collection('myProjects'); + .collection("myProjects"); try { await projectsCollection.doc(idField).update(data); - this.toasterService.showToast(this.updateProjectMessage, 'primary'); + this.toasterService.showToast(this.updateProjectMessage, "primary"); } catch (error) { - console.error('Error updating project:', error); - this.toasterService.showToast('Failed to update project', 'danger'); + console.error("Error updating project:", error); + this.toasterService.showToast("Failed to update project", "danger"); } } getProjects() { const userId = this.getUserProfile()?.uid; return this.afs - .collection('userData') + .collection("userData") .doc(userId) - .collection('myProjects') - .valueChanges({ idField: 'idField' }); + .collection("myProjects") + .valueChanges({ idField: "idField" }); } async deleteProjects(idField: string) { try { const user = await this.fs.getUserProfile(); const projectsCollection = this.afs - .collection('userData') + .collection("userData") .doc(user.uid) - .collection('myProjects'); + .collection("myProjects"); await projectsCollection.doc(idField).delete(); - this.toasterService.showToast(this.deletedProjectMessage, 'warning'); + this.toasterService.showToast(this.deletedProjectMessage, "warning"); } catch (error) { - console.error('Error deleting project:', error); - this.toasterService.showToast('Failed to delete project', 'danger'); + console.error("Error deleting project:", error); + this.toasterService.showToast("Failed to delete project", "danger"); } } } diff --git a/src/app/services/resource/resource.service.spec.ts b/src/app/services/resource/resource.service.spec.ts index 34ce1b19..e65fe6c0 100644 --- a/src/app/services/resource/resource.service.spec.ts +++ b/src/app/services/resource/resource.service.spec.ts @@ -1,8 +1,8 @@ -import { TestBed } from '@angular/core/testing'; +import { TestBed } from "@angular/core/testing"; -import { ResourceService } from './resource.service'; +import { ResourceService } from "./resource.service"; -describe('ResourceService', () => { +describe("ResourceService", () => { let service: ResourceService; beforeEach(() => { @@ -10,7 +10,7 @@ describe('ResourceService', () => { service = TestBed.inject(ResourceService); }); - it('should be created', () => { + it("should be created", () => { expect(service).toBeTruthy(); }); }); diff --git a/src/app/services/resource/resource.service.ts b/src/app/services/resource/resource.service.ts index 5618436b..0a9bdd2e 100644 --- a/src/app/services/resource/resource.service.ts +++ b/src/app/services/resource/resource.service.ts @@ -1,9 +1,8 @@ -import { Injectable } from '@angular/core'; +import { Injectable } from "@angular/core"; @Injectable({ - providedIn: 'root' + providedIn: "root", }) export class ResourceService { - - constructor() { } + constructor() {} } diff --git a/src/app/services/seo/seo.service.spec.ts b/src/app/services/seo/seo.service.spec.ts index 9f1cff79..e671e8c3 100644 --- a/src/app/services/seo/seo.service.spec.ts +++ b/src/app/services/seo/seo.service.spec.ts @@ -1,8 +1,8 @@ -import { TestBed } from '@angular/core/testing'; +import { TestBed } from "@angular/core/testing"; -import { SeoService } from './seo.service'; +import { SeoService } from "./seo.service"; -describe('SeoService', () => { +describe("SeoService", () => { let service: SeoService; beforeEach(() => { @@ -10,7 +10,7 @@ describe('SeoService', () => { service = TestBed.inject(SeoService); }); - it('should be created', () => { + it("should be created", () => { expect(service).toBeTruthy(); }); }); diff --git a/src/app/services/seo/seo.service.ts b/src/app/services/seo/seo.service.ts index 78db9c18..68350e2b 100644 --- a/src/app/services/seo/seo.service.ts +++ b/src/app/services/seo/seo.service.ts @@ -1,29 +1,28 @@ -import { Injectable } from '@angular/core'; -import { Title, Meta } from '@angular/platform-browser'; -import { GoogleTagManagerService } from 'angular-google-tag-manager'; +import { Injectable } from "@angular/core"; +import { Title, Meta } from "@angular/platform-browser"; +import { GoogleTagManagerService } from "angular-google-tag-manager"; @Injectable({ - providedIn: 'root' + providedIn: "root", }) export class SeoService { - constructor( private titleService: Title, private metaTags: Meta, - private gtmService: GoogleTagManagerService - ) { } + private gtmService: GoogleTagManagerService, + ) {} seo(pageTitle: any, metaTag: any) { - this.titleService.setTitle(pageTitle) - metaTag.forEach((tag:any) => { - this.metaTags.updateTag(tag) + this.titleService.setTitle(pageTitle); + metaTag.forEach((tag: any) => { + this.metaTags.updateTag(tag); }); } eventTrigger(eventName: string, pageName: string) { const gtmTag = { event: eventName, - pageName: pageName + pageName: pageName, }; this.gtmService.pushTag(gtmTag); } diff --git a/src/app/services/sidenav/sidenav.service.spec.ts b/src/app/services/sidenav/sidenav.service.spec.ts index feecc087..45bec33e 100644 --- a/src/app/services/sidenav/sidenav.service.spec.ts +++ b/src/app/services/sidenav/sidenav.service.spec.ts @@ -1,8 +1,8 @@ -import { TestBed } from '@angular/core/testing'; +import { TestBed } from "@angular/core/testing"; -import { SidenavService } from './sidenav.service'; +import { SidenavService } from "./sidenav.service"; -describe('SidenavService', () => { +describe("SidenavService", () => { let service: SidenavService; beforeEach(() => { @@ -10,7 +10,7 @@ describe('SidenavService', () => { service = TestBed.inject(SidenavService); }); - it('should be created', () => { + it("should be created", () => { expect(service).toBeTruthy(); }); }); diff --git a/src/app/services/sidenav/sidenav.service.ts b/src/app/services/sidenav/sidenav.service.ts index 08c05cd2..a57bb3f5 100644 --- a/src/app/services/sidenav/sidenav.service.ts +++ b/src/app/services/sidenav/sidenav.service.ts @@ -1,53 +1,52 @@ -import { Injectable } from '@angular/core'; +import { Injectable } from "@angular/core"; @Injectable({ - providedIn: 'root', + providedIn: "root", }) export class SidenavService { constructor() {} defaultPages = [ - { title: 'Dashboard', color: 'primary', url: 'home', icon: 'grid' }, - { title: 'About', color: 'medium', url: 'about', icon: 'reader' }, + { title: "Dashboard", color: "primary", url: "home", icon: "grid" }, + { title: "About", color: "medium", url: "about", icon: "reader" }, { - title: 'Help & Support', - color: 'tertiary', - url: 'help', - icon: 'help-circle', + title: "Help & Support", + color: "tertiary", + url: "help", + icon: "help-circle", }, - { title: 'Login', color: 'success', url: 'login', icon: 'log-in' }, + { title: "Login", color: "success", url: "login", icon: "log-in" }, ]; loggedInPages = [ - { title: 'Dashboard', color: 'primary', url: 'home', icon: 'grid' }, - { title: 'About', color: 'medium', url: 'about', icon: 'reader' }, - { title: 'Goal', color: 'secondary', url: 'goal', icon: 'bulb' }, - { title: 'Expenses', color: 'success', url: 'expenses', icon: 'cash' }, - { title: 'Studies', color: 'primary', url: 'studies', icon: 'book' }, - { title: 'Time', color: 'danger', url: 'time', icon: 'hourglass' }, + { title: "Dashboard", color: "primary", url: "home", icon: "grid" }, + { title: "About", color: "medium", url: "about", icon: "reader" }, + { title: "Goal", color: "secondary", url: "goal", icon: "bulb" }, + { title: "Expenses", color: "success", url: "expenses", icon: "cash" }, + { title: "Studies", color: "primary", url: "studies", icon: "book" }, + { title: "Time", color: "danger", url: "time", icon: "hourglass" }, { - title: 'Achievements', - color: 'warning', - url: 'achievement', - icon: 'trophy', + title: "Achievements", + color: "warning", + url: "achievement", + icon: "trophy", }, // { title: 'Analytics', color: 'success', url: 'analytics', icon: 'analytics' }, // { title: 'Setup', color: 'warning', url: 'setup', icon: 'settings' }, - { title: 'Profile', color: 'secondary', url: 'profile', icon: 'person' }, + { title: "Profile", color: "secondary", url: "profile", icon: "person" }, { - title: 'Need help', - color: 'tertiary', - url: 'help', - icon: 'help-circle', + title: "Need help", + color: "tertiary", + url: "help", + icon: "help-circle", }, ]; appPages = this.defaultPages; - setLoggedInPages(){ - this.appPages= this.loggedInPages; - + setLoggedInPages() { + this.appPages = this.loggedInPages; } - setDefaultPages(){ - this.appPages= this.defaultPages + setDefaultPages() { + this.appPages = this.defaultPages; } } diff --git a/src/app/services/studies/studies.service.spec.ts b/src/app/services/studies/studies.service.spec.ts index e6051f84..a7ccb83a 100644 --- a/src/app/services/studies/studies.service.spec.ts +++ b/src/app/services/studies/studies.service.spec.ts @@ -1,8 +1,8 @@ -import { TestBed } from '@angular/core/testing'; +import { TestBed } from "@angular/core/testing"; -import { StudiesService } from './studies.service'; +import { StudiesService } from "./studies.service"; -describe('StudiesService', () => { +describe("StudiesService", () => { let service: StudiesService; beforeEach(() => { @@ -10,7 +10,7 @@ describe('StudiesService', () => { service = TestBed.inject(StudiesService); }); - it('should be created', () => { + it("should be created", () => { expect(service).toBeTruthy(); }); }); diff --git a/src/app/services/studies/studies.service.ts b/src/app/services/studies/studies.service.ts index ccd5bee7..05d7a652 100644 --- a/src/app/services/studies/studies.service.ts +++ b/src/app/services/studies/studies.service.ts @@ -1,62 +1,83 @@ -import { Injectable } from '@angular/core'; -import { AngularFirestore } from '@angular/fire/compat/firestore'; -import { AlertController } from '@ionic/angular'; -import { ProfileService } from '../profile/profile.service'; +import { Injectable } from "@angular/core"; +import { AngularFirestore } from "@angular/fire/compat/firestore"; +import { AlertController } from "@ionic/angular"; +import { ProfileService } from "../profile/profile.service"; @Injectable({ - providedIn: 'root' + providedIn: "root", }) export class StudiesService { - constructor( private afs: AngularFirestore, private alertCtrl: AlertController, - private profileService: ProfileService - ) { } + private profileService: ProfileService, + ) {} - addMessage = "Studies added successfully." - updateMessage = "Studies updated successfully." - deletedMessage = "Studies has been successfully deleted." - userId = this.profileService.getUserProfile()?.uid - studiesCollection = this.afs.collection('userData') + addMessage = "Studies added successfully."; + updateMessage = "Studies updated successfully."; + deletedMessage = "Studies has been successfully deleted."; + userId = this.profileService.getUserProfile()?.uid; + studiesCollection = this.afs.collection("userData"); addStudies(data: any) { - this.studiesCollection.doc(this.userId).collection('myStudies').add(data).then(res => { - this.successAlert( this.addMessage ); - }).catch(err => { - alert("There was an error in posting. \n Please try again later. Check console for detail."); - console.warn(err); - }) + this.studiesCollection + .doc(this.userId) + .collection("myStudies") + .add(data) + .then((res) => { + this.successAlert(this.addMessage); + }) + .catch((err) => { + alert( + "There was an error in posting. \n Please try again later. Check console for detail.", + ); + console.warn(err); + }); } - updateStudies(data: any,idField:string) { - this.studiesCollection.doc(this.userId).collection('myStudies').doc(idField).update(data).then(res => { - this.successAlert( this.updateMessage ); - }).catch(err => { - alert("There was an error in posting. \n Please try again later. Check console for detail."); - console.warn(err); - }) + updateStudies(data: any, idField: string) { + this.studiesCollection + .doc(this.userId) + .collection("myStudies") + .doc(idField) + .update(data) + .then((res) => { + this.successAlert(this.updateMessage); + }) + .catch((err) => { + alert( + "There was an error in posting. \n Please try again later. Check console for detail.", + ); + console.warn(err); + }); } getStudies() { - return this.studiesCollection.doc(this.userId).collection('myStudies', ref => ref.orderBy('date', 'desc')).valueChanges({ idField: 'idField' }) + return this.studiesCollection + .doc(this.userId) + .collection("myStudies", (ref) => ref.orderBy("date", "desc")) + .valueChanges({ idField: "idField" }); } deleteStudies(idField: string) { - this.studiesCollection.doc(this.userId).collection('myStudies').doc(idField).delete().then( - () => { - this.successAlert(this.deletedMessage) - } - ).catch(err => { - alert(err) - }) + this.studiesCollection + .doc(this.userId) + .collection("myStudies") + .doc(idField) + .delete() + .then(() => { + this.successAlert(this.deletedMessage); + }) + .catch((err) => { + alert(err); + }); } - async successAlert(message:string) { + async successAlert(message: string) { const alert = await this.alertCtrl.create({ - header: 'Success', + header: "Success", subHeader: message, - cssClass: 'success-alert', + cssClass: "success-alert", // message: 'This is an alert!', - buttons: ['OK'], + buttons: ["OK"], }); await alert.present(); diff --git a/src/app/services/support/support.service.spec.ts b/src/app/services/support/support.service.spec.ts index 4881bd29..96e0619b 100644 --- a/src/app/services/support/support.service.spec.ts +++ b/src/app/services/support/support.service.spec.ts @@ -1,8 +1,8 @@ -import { TestBed } from '@angular/core/testing'; +import { TestBed } from "@angular/core/testing"; -import { SupportService } from './support.service'; +import { SupportService } from "./support.service"; -describe('SupportService', () => { +describe("SupportService", () => { let service: SupportService; beforeEach(() => { @@ -10,7 +10,7 @@ describe('SupportService', () => { service = TestBed.inject(SupportService); }); - it('should be created', () => { + it("should be created", () => { expect(service).toBeTruthy(); }); }); diff --git a/src/app/services/support/support.service.ts b/src/app/services/support/support.service.ts index 604d30e9..b9233942 100644 --- a/src/app/services/support/support.service.ts +++ b/src/app/services/support/support.service.ts @@ -1,21 +1,21 @@ -import { Injectable } from '@angular/core'; +import { Injectable } from "@angular/core"; import { AngularFirestore, AngularFirestoreCollection, AngularFirestoreDocument, -} from '@angular/fire/compat/firestore'; -import { AlertController } from '@ionic/angular'; +} from "@angular/fire/compat/firestore"; +import { AlertController } from "@ionic/angular"; @Injectable({ - providedIn: 'root', + providedIn: "root", }) export class SupportService { supportCollection: AngularFirestoreCollection; supportDoc!: AngularFirestoreDocument; constructor(private afs: AngularFirestore) { - this.supportCollection = this.afs.collection('support', (ref) => - ref.orderBy('createdAt', 'desc') + this.supportCollection = this.afs.collection("support", (ref) => + ref.orderBy("createdAt", "desc"), ); } @@ -23,7 +23,7 @@ export class SupportService { return this.supportCollection.add(value); } getSupport() { - return this.supportCollection.valueChanges({ idField: 'idField' }); + return this.supportCollection.valueChanges({ idField: "idField" }); } updateData(idField: string, data: any) { this.afs diff --git a/src/app/services/toaster/toaster.service.spec.ts b/src/app/services/toaster/toaster.service.spec.ts index 37defec6..e1de0429 100644 --- a/src/app/services/toaster/toaster.service.spec.ts +++ b/src/app/services/toaster/toaster.service.spec.ts @@ -1,8 +1,8 @@ -import { TestBed } from '@angular/core/testing'; +import { TestBed } from "@angular/core/testing"; -import { ToasterService } from './toaster.service'; +import { ToasterService } from "./toaster.service"; -describe('ToasterService', () => { +describe("ToasterService", () => { let service: ToasterService; beforeEach(() => { @@ -10,7 +10,7 @@ describe('ToasterService', () => { service = TestBed.inject(ToasterService); }); - it('should be created', () => { + it("should be created", () => { expect(service).toBeTruthy(); }); }); diff --git a/src/app/services/toaster/toaster.service.ts b/src/app/services/toaster/toaster.service.ts index 2c5b349f..bd133158 100644 --- a/src/app/services/toaster/toaster.service.ts +++ b/src/app/services/toaster/toaster.service.ts @@ -1,13 +1,13 @@ -import { Injectable } from '@angular/core'; -import { ToastController } from '@ionic/angular'; +import { Injectable } from "@angular/core"; +import { ToastController } from "@ionic/angular"; @Injectable({ - providedIn: 'root', + providedIn: "root", }) export class ToasterService { constructor(private toastController: ToastController) {} - async showToast(message: string,color:string) { + async showToast(message: string, color: string) { const toast = await this.toastController.create({ message: message, duration: 3000, @@ -15,5 +15,4 @@ export class ToasterService { }); toast.present(); } - } diff --git a/src/app/shared/db/real-time-data-base.service.spec.ts b/src/app/shared/db/real-time-data-base.service.spec.ts index 8d308d89..cfec2e25 100644 --- a/src/app/shared/db/real-time-data-base.service.spec.ts +++ b/src/app/shared/db/real-time-data-base.service.spec.ts @@ -1,8 +1,8 @@ -import { TestBed } from '@angular/core/testing'; +import { TestBed } from "@angular/core/testing"; -import { RealTimeDataBaseService } from './real-time-data-base.service'; +import { RealTimeDataBaseService } from "./real-time-data-base.service"; -describe('RealTimeDataBaseService', () => { +describe("RealTimeDataBaseService", () => { let service: RealTimeDataBaseService; beforeEach(() => { @@ -10,7 +10,7 @@ describe('RealTimeDataBaseService', () => { service = TestBed.inject(RealTimeDataBaseService); }); - it('should be created', () => { + it("should be created", () => { expect(service).toBeTruthy(); }); }); diff --git a/src/app/shared/db/real-time-data-base.service.ts b/src/app/shared/db/real-time-data-base.service.ts index ada286ec..5c82692a 100644 --- a/src/app/shared/db/real-time-data-base.service.ts +++ b/src/app/shared/db/real-time-data-base.service.ts @@ -1,42 +1,37 @@ -import { Injectable } from '@angular/core'; -import { AngularFireDatabase } from '@angular/fire/compat/database'; -import { Observable } from 'rxjs'; - +import { Injectable } from "@angular/core"; +import { AngularFireDatabase } from "@angular/fire/compat/database"; +import { Observable } from "rxjs"; @Injectable({ - providedIn: 'root' + providedIn: "root", }) export class RealTimeDataBaseService { - - dashboardContent = "/dynamic-content/dashboard" - constructor( - private db :AngularFireDatabase - ) { } + dashboardContent = "/dynamic-content/dashboard"; + constructor(private db: AngularFireDatabase) {} getDashboardContent(): Observable { - return this.db.list(this.dashboardContent).valueChanges() + return this.db.list(this.dashboardContent).valueChanges(); } addTemporaryData(): Promise { - const paragraphs = [ "Summarize is an app that helps you to manage your Time, Money, and work which includes but is not limited to subject-wise studies, notes, to-do's, or office works.", - 'Thinking when to use Summarize? To live better and managed, one should recall what they have done throughout the day daily before sleep . Also listing tasks for the next day and setting priorities increases the chances to get them done.', - 'Currently, Summarize is under development, we will keep on adding features one by one. Till then, please feel free to manage Achievements of day, Expenses, Studies, and Time. It is a web-app that can be easily installed on all devices ( Mobile & PC ). Install the app on your devices to keep in sync and to check how to install visit our Help page.', - 'Note: Your data will not be used for any advertisement or offering any deal/scheme. Also our app donot need any permission to work on your device. Your privacy is important to us. For more queries, you can contact us through the support page. We are also open to feature requests and suggestions.', + "Thinking when to use Summarize? To live better and managed, one should recall what they have done throughout the day daily before sleep . Also listing tasks for the next day and setting priorities increases the chances to get them done.", + "Currently, Summarize is under development, we will keep on adding features one by one. Till then, please feel free to manage Achievements of day, Expenses, Studies, and Time. It is a web-app that can be easily installed on all devices ( Mobile & PC ). Install the app on your devices to keep in sync and to check how to install visit our Help page.", + "Note: Your data will not be used for any advertisement or offering any deal/scheme. Also our app donot need any permission to work on your device. Your privacy is important to us. For more queries, you can contact us through the support page. We are also open to feature requests and suggestions.", ]; - const paragraphsData = paragraphs.map((paragraph, index) => { - return { - content: paragraph, - orderId: index + 1, - type: 'text' // or 'note' based on your condition - }; - }); - - return this.db.object('dynamicContent/home/paragraphs').set(paragraphsData); + const paragraphsData = paragraphs.map((paragraph, index) => { + return { + content: paragraph, + orderId: index + 1, + type: "text", // or 'note' based on your condition + }; + }); + + return this.db.object("dynamicContent/home/paragraphs").set(paragraphsData); } getHomeData(): Observable { - return this.db.object('dynamicContent/home').valueChanges(); + return this.db.object("dynamicContent/home").valueChanges(); } } diff --git a/src/app/shared/services/about/about.service.spec.ts b/src/app/shared/services/about/about.service.spec.ts index f5fe5a0d..e69bf01c 100644 --- a/src/app/shared/services/about/about.service.spec.ts +++ b/src/app/shared/services/about/about.service.spec.ts @@ -1,8 +1,8 @@ -import { TestBed } from '@angular/core/testing'; +import { TestBed } from "@angular/core/testing"; -import { AboutService } from './about.service'; +import { AboutService } from "./about.service"; -describe('AboutService', () => { +describe("AboutService", () => { let service: AboutService; beforeEach(() => { @@ -10,7 +10,7 @@ describe('AboutService', () => { service = TestBed.inject(AboutService); }); - it('should be created', () => { + it("should be created", () => { expect(service).toBeTruthy(); }); }); diff --git a/src/app/shared/services/about/about.service.ts b/src/app/shared/services/about/about.service.ts index bdb1f448..92920889 100644 --- a/src/app/shared/services/about/about.service.ts +++ b/src/app/shared/services/about/about.service.ts @@ -1,9 +1,8 @@ -import { Injectable } from '@angular/core'; +import { Injectable } from "@angular/core"; @Injectable({ - providedIn: 'root' + providedIn: "root", }) export class AboutService { - - constructor() { } + constructor() {} } diff --git a/src/app/shared/services/home/home.service.spec.ts b/src/app/shared/services/home/home.service.spec.ts index 1afaf229..3a306357 100644 --- a/src/app/shared/services/home/home.service.spec.ts +++ b/src/app/shared/services/home/home.service.spec.ts @@ -1,8 +1,8 @@ -import { TestBed } from '@angular/core/testing'; +import { TestBed } from "@angular/core/testing"; -import { HomeService } from './home.service'; +import { HomeService } from "./home.service"; -describe('HomeService', () => { +describe("HomeService", () => { let service: HomeService; beforeEach(() => { @@ -10,7 +10,7 @@ describe('HomeService', () => { service = TestBed.inject(HomeService); }); - it('should be created', () => { + it("should be created", () => { expect(service).toBeTruthy(); }); }); diff --git a/src/app/shared/services/home/home.service.ts b/src/app/shared/services/home/home.service.ts index 0026413a..c36aa51a 100644 --- a/src/app/shared/services/home/home.service.ts +++ b/src/app/shared/services/home/home.service.ts @@ -1,9 +1,8 @@ -import { Injectable } from '@angular/core'; +import { Injectable } from "@angular/core"; @Injectable({ - providedIn: 'root' + providedIn: "root", }) export class HomeService { - - constructor() { } + constructor() {} } diff --git a/src/app/shared/services/support/support.service.spec.ts b/src/app/shared/services/support/support.service.spec.ts index 4881bd29..96e0619b 100644 --- a/src/app/shared/services/support/support.service.spec.ts +++ b/src/app/shared/services/support/support.service.spec.ts @@ -1,8 +1,8 @@ -import { TestBed } from '@angular/core/testing'; +import { TestBed } from "@angular/core/testing"; -import { SupportService } from './support.service'; +import { SupportService } from "./support.service"; -describe('SupportService', () => { +describe("SupportService", () => { let service: SupportService; beforeEach(() => { @@ -10,7 +10,7 @@ describe('SupportService', () => { service = TestBed.inject(SupportService); }); - it('should be created', () => { + it("should be created", () => { expect(service).toBeTruthy(); }); }); diff --git a/src/app/shared/services/support/support.service.ts b/src/app/shared/services/support/support.service.ts index 6bbe4ac0..efe085e8 100644 --- a/src/app/shared/services/support/support.service.ts +++ b/src/app/shared/services/support/support.service.ts @@ -1,9 +1,8 @@ -import { Injectable } from '@angular/core'; +import { Injectable } from "@angular/core"; @Injectable({ - providedIn: 'root' + providedIn: "root", }) export class SupportService { - - constructor() { } + constructor() {} } diff --git a/src/index.html b/src/index.html index d806281d..8b3b70d9 100644 --- a/src/index.html +++ b/src/index.html @@ -1,29 +1,36 @@ - + + + + Summarize : Record, Analyse and Rise | Dashboard + + + + + + + + + + + + + + + + - - - Summarize : Record, Analyse and Rise | Dashboard - - - - - - - - - - - - - - - - - - - - - - + + + + diff --git a/src/main.ts b/src/main.ts index 91ec6da5..76d0a68c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,12 +1,13 @@ -import { enableProdMode } from '@angular/core'; -import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; +import { enableProdMode } from "@angular/core"; +import { platformBrowserDynamic } from "@angular/platform-browser-dynamic"; -import { AppModule } from './app/app.module'; -import { environment } from './environments/environment'; +import { AppModule } from "./app/app.module"; +import { environment } from "./environments/environment"; if (environment.production) { enableProdMode(); } -platformBrowserDynamic().bootstrapModule(AppModule) - .catch(err => console.log(err)); +platformBrowserDynamic() + .bootstrapModule(AppModule) + .catch((err) => console.log(err)); diff --git a/src/polyfills.ts b/src/polyfills.ts index 429bb9ef..40a0e9f0 100644 --- a/src/polyfills.ts +++ b/src/polyfills.ts @@ -45,8 +45,7 @@ /*************************************************************************************************** * Zone JS is required by default for Angular itself. */ -import 'zone.js'; // Included with Angular CLI. - +import "zone.js"; // Included with Angular CLI. /*************************************************************************************************** * APPLICATION IMPORTS diff --git a/src/test.ts b/src/test.ts index 51bb0206..870b6175 100644 --- a/src/test.ts +++ b/src/test.ts @@ -1,14 +1,11 @@ // This file is required by karma.conf.js and loads recursively all the .spec and framework files -import 'zone.js/testing'; -import { getTestBed } from '@angular/core/testing'; +import "zone.js/testing"; +import { getTestBed } from "@angular/core/testing"; import { BrowserDynamicTestingModule, - platformBrowserDynamicTesting -} from '@angular/platform-browser-dynamic/testing'; + platformBrowserDynamicTesting, +} from "@angular/platform-browser-dynamic/testing"; // First, initialize the Angular testing environment. -getTestBed().initTestEnvironment( - BrowserDynamicTestingModule, - platformBrowserDynamicTesting(), -); +getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting()); diff --git a/tsconfig.app.json b/tsconfig.app.json index 82d91dc4..ff396d4c 100644 --- a/tsconfig.app.json +++ b/tsconfig.app.json @@ -5,11 +5,6 @@ "outDir": "./out-tsc/app", "types": [] }, - "files": [ - "src/main.ts", - "src/polyfills.ts" - ], - "include": [ - "src/**/*.d.ts" - ] + "files": ["src/main.ts", "src/polyfills.ts"], + "include": ["src/**/*.d.ts"] } diff --git a/tsconfig.json b/tsconfig.json index 14f1a9a7..5013f6be 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -18,10 +18,7 @@ "importHelpers": true, "target": "ES2022", "module": "es2020", - "lib": [ - "es2018", - "dom" - ], + "lib": ["es2018", "dom"], "useDefineForClassFields": false }, "angularCompilerOptions": { diff --git a/tsconfig.spec.json b/tsconfig.spec.json index 092345b0..669344f8 100644 --- a/tsconfig.spec.json +++ b/tsconfig.spec.json @@ -3,16 +3,8 @@ "extends": "./tsconfig.json", "compilerOptions": { "outDir": "./out-tsc/spec", - "types": [ - "jasmine" - ] + "types": ["jasmine"] }, - "files": [ - "src/test.ts", - "src/polyfills.ts" - ], - "include": [ - "src/**/*.spec.ts", - "src/**/*.d.ts" - ] + "files": ["src/test.ts", "src/polyfills.ts"], + "include": ["src/**/*.spec.ts", "src/**/*.d.ts"] }