From 16eba244acc4606e7aac4ef4936dbc407976d7bf Mon Sep 17 00:00:00 2001 From: Mugilraj G Date: Thu, 6 Jul 2023 17:51:38 +0530 Subject: [PATCH] Sample(ES-837309): Schedule graphQl sample added --- GraphQl/package.json | 18 +++ GraphQl/src/db.js | 112 ++++++++++++++++++ GraphQl/src/resolvers.js | 49 ++++++++ GraphQl/src/schema.graphql | 63 ++++++++++ README.md | 33 +++++- Schedule/.browserslistrc | 16 +++ Schedule/.editorconfig | 16 +++ Schedule/.gitignore | 46 +++++++ Schedule/angular.json | 111 +++++++++++++++++ Schedule/karma.conf.js | 44 +++++++ Schedule/package.json | 42 +++++++ Schedule/src/app/app-routing.module.ts | 10 ++ Schedule/src/app/app.component.html | 2 + Schedule/src/app/app.component.scss | 0 Schedule/src/app/app.component.spec.ts | 35 ++++++ Schedule/src/app/app.component.ts | 41 +++++++ Schedule/src/app/app.module.ts | 25 ++++ Schedule/src/assets/.gitkeep | 0 Schedule/src/environments/environment.prod.ts | 3 + Schedule/src/environments/environment.ts | 16 +++ Schedule/src/favicon.ico | Bin 0 -> 948 bytes Schedule/src/index.html | 13 ++ Schedule/src/main.ts | 12 ++ Schedule/src/polyfills.ts | 53 +++++++++ Schedule/src/styles.scss | 10 ++ Schedule/src/test.ts | 26 ++++ Schedule/tsconfig.app.json | 15 +++ Schedule/tsconfig.json | 32 +++++ Schedule/tsconfig.spec.json | 18 +++ 29 files changed, 860 insertions(+), 1 deletion(-) create mode 100644 GraphQl/package.json create mode 100644 GraphQl/src/db.js create mode 100644 GraphQl/src/resolvers.js create mode 100644 GraphQl/src/schema.graphql create mode 100644 Schedule/.browserslistrc create mode 100644 Schedule/.editorconfig create mode 100644 Schedule/.gitignore create mode 100644 Schedule/angular.json create mode 100644 Schedule/karma.conf.js create mode 100644 Schedule/package.json create mode 100644 Schedule/src/app/app-routing.module.ts create mode 100644 Schedule/src/app/app.component.html create mode 100644 Schedule/src/app/app.component.scss create mode 100644 Schedule/src/app/app.component.spec.ts create mode 100644 Schedule/src/app/app.component.ts create mode 100644 Schedule/src/app/app.module.ts create mode 100644 Schedule/src/assets/.gitkeep create mode 100644 Schedule/src/environments/environment.prod.ts create mode 100644 Schedule/src/environments/environment.ts create mode 100644 Schedule/src/favicon.ico create mode 100644 Schedule/src/index.html create mode 100644 Schedule/src/main.ts create mode 100644 Schedule/src/polyfills.ts create mode 100644 Schedule/src/styles.scss create mode 100644 Schedule/src/test.ts create mode 100644 Schedule/tsconfig.app.json create mode 100644 Schedule/tsconfig.json create mode 100644 Schedule/tsconfig.spec.json diff --git a/GraphQl/package.json b/GraphQl/package.json new file mode 100644 index 0000000..546c7ff --- /dev/null +++ b/GraphQl/package.json @@ -0,0 +1,18 @@ +{ + "name": "graphql-server", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "dev": "graphpack --port 4400", + "build": "graphpack build" + }, + "author": "", + "license": "ISC", + "devDependencies": { + "graphpack": "^1.0.9" + }, + "dependencies": { + "@syncfusion/ej2-data": "^19.2.55" + } +} diff --git a/GraphQl/src/db.js b/GraphQl/src/db.js new file mode 100644 index 0000000..a93a4e3 --- /dev/null +++ b/GraphQl/src/db.js @@ -0,0 +1,112 @@ + +export let eventsData = [ + { + Id: 1, + Subject: 'Server Maintenance', + StartTime: new Date(2021, 1, 11, 10, 0).toISOString(), + EndTime: new Date(2021, 1, 11, 11, 30).toISOString(), + Location: 'Seattle' + }, { + Id: 2, + Subject: 'Art & Painting Gallery', + StartTime: new Date(2021, 1, 12, 12, 0).toISOString(), + EndTime: new Date(2021, 1, 12, 14, 0).toISOString(), + Location: 'Costa Rica' + }, { + Id: 3, + Subject: 'Dany Birthday Celebration', + StartTime: new Date(2021, 1, 13, 10, 0).toISOString(), + EndTime: new Date(2021, 1, 13, 11, 30).toISOString(), + Location: 'Kirkland' + }, { + Id: 4, + Subject: 'John Wedding Anniversary', + StartTime: new Date(2021, 1, 14, 9, 0).toISOString(), + EndTime: new Date(2021, 1, 14, 10, 0).toISOString(), + Location: 'Redmond' + }, { + Id: 5, + Subject: 'ISA Annual Conference', + StartTime: new Date(2021, 1, 15, 10, 0).toISOString(), + EndTime: new Date(2021, 1, 15, 11, 30).toISOString(), + Location: 'USA' + }, { + Id: 6, + Subject: 'Equipment Maintenance', + StartTime: new Date(2021, 1, 16, 12, 0).toISOString(), + EndTime: new Date(2021, 1, 16, 14, 0).toISOString(), + Location: 'Seattle', + }, { + Id: 7, + Subject: 'Aircraft Maintenance', + StartTime: new Date(2021, 1, 17, 10, 0).toISOString(), + EndTime: new Date(2021, 1, 17, 11, 30).toISOString(), + Location: 'Seattle' + }, { + Id: 8, + Subject: 'Facilities Maintenance', + StartTime: new Date(2021, 1, 19, 9, 30).toISOString(), + EndTime: new Date(2021, 1, 19, 11, 0).toISOString(), + Location: 'Seattle' + }, { + Id: 9, + Subject: 'Britto Birthday Celebration', + StartTime: new Date(2021, 1, 21, 11, 0).toISOString(), + EndTime: new Date(2021, 1, 21, 13, 0).toISOString(), + Location: 'Greenland' + }, { + Id: 10, + Subject: 'Justin Wedding Anniversary', + StartTime: new Date(2021, 1, 22, 9, 30).toISOString(), + EndTime: new Date(2021, 1, 22, 11, 0).toISOString(), + Location: 'Finland' + }, { + Id: 11, + Subject: 'AIEA Annual Meet', + StartTime: new Date(2021, 1, 9, 10, 0).toISOString(), + EndTime: new Date(2021, 1, 9, 11, 30).toISOString(), + Location: 'USA' + }, { + Id: 12, + Subject: 'AAN Conference', + StartTime: new Date(2021, 1, 7, 10, 30).toISOString(), + EndTime: new Date(2021, 1, 7, 12, 30).toISOString(), + Location: 'USA' + }, { + Id: 13, + Subject: 'Photography Gallery', + StartTime: new Date(2021, 1, 5, 10, 0).toISOString(), + EndTime: new Date(2021, 1, 5, 11, 30).toISOString(), + Location: 'Chennai' + }, { + Id: 14, + Subject: 'Beach Clean-up', + StartTime: new Date(2021, 1, 14, 12, 0).toISOString(), + EndTime: new Date(2021, 1, 14, 14, 0).toISOString(), + Location: 'Mumbai' + }, { + Id: 15, + Subject: 'Turtle Walk', + StartTime: new Date(2021, 1, 19, 13, 0).toISOString(), + EndTime: new Date(2021, 1, 19, 14, 30).toISOString(), + Location: 'Costa Rica' + }, { + Id: 16, + Subject: 'Silent Walk for Cancer day', + StartTime: new Date(2021, 1, 22, 13, 0).toISOString(), + EndTime: new Date(2021, 1, 22, 14, 30).toISOString(), + Location: 'Chennai' + }, { + Id: 17, + Subject: 'Beach Clean-up', + StartTime: new Date(2021, 1, 13, 14, 0).toISOString(), + EndTime: new Date(2021, 1, 13, 16, 0).toISOString(), + Location: 'Mumbai' + }, { + Id: 18, + Subject: 'Photography Gallery', + StartTime: new Date(2021, 1, 15, 14, 0).toISOString(), + EndTime: new Date(2021, 1, 15, 16, 0).toISOString(), + Location: 'Chennai' + } + ]; \ No newline at end of file diff --git a/GraphQl/src/resolvers.js b/GraphQl/src/resolvers.js new file mode 100644 index 0000000..ffcda85 --- /dev/null +++ b/GraphQl/src/resolvers.js @@ -0,0 +1,49 @@ +import { eventsData } from "./db"; + +const resolvers = { + Query: { + getEvents: (parent, datamanager, context, info) => { + const dataArgs = datamanager; + const params = JSON.parse(dataArgs.datamanager.params); + console.log('startDate: ' + params.StartDate + ' EndDate: ' + params.EndDate); + var data = eventsData.filter(x => new Date(x.StartTime) >= new Date(params.StartDate) && new Date(x.EndTime) <= new Date(params.EndDate)); + return {result: data || eventsData}; + } + }, + + Mutation: { + batchUpdate: (parent, { added, changed, deleted }, context, info) => { + if (added && added.length > 0) { + console.log('added: ' + added.length); + added.forEach((order) => { + eventsData.push(order); + }); + } + if (changed && changed.length > 0) { + console.log('changed: ' + changed.length); + changed.forEach((order) => { + let newOrder = eventsData.find(app => app.Id === order.Id); + newOrder.Id = order.Id; + newOrder.Subject = order.Subject; + newOrder.StartTime = order.StartTime; + newOrder.EndTime = order.EndTime; + newOrder.Location = order.Location; + newOrder.IsAllDay = order.IsAllDay; + newOrder.RecurrenceRule = order.RecurrenceRule; + newOrder.StartTimezone = order.StartTimezone; + newOrder.EndTimezone = order.EndTimezone; + }); + } + if (deleted && deleted.length > 0) { + console.log('deleted: ' + deleted.length); + deleted.forEach((order) => { + const orderIndex = eventsData.findIndex(app => app.Id === parseInt(order.Id)); + if (orderIndex === -1) throw new Error("app not found." + order.Id); + eventsData.splice(orderIndex, 1); + }); + } + } + } +}; + +export default resolvers; \ No newline at end of file diff --git a/GraphQl/src/schema.graphql b/GraphQl/src/schema.graphql new file mode 100644 index 0000000..0645653 --- /dev/null +++ b/GraphQl/src/schema.graphql @@ -0,0 +1,63 @@ +input Sort { + name: String! + direction: String! +} + +input Aggregate { + field: String! + type: String! +} + +#Syncfusion DataManager query params + +input DataManager { + skip: Int + take: Int + sorted: [Sort] + group: [String] + table: String + select: [String] + where: String + search: String + requiresCounts: Boolean + aggregates: [Aggregate] + params: String +} + +# Schedule Appointment field names +input AppointmentFields { + Id: Int! + Subject: String + StartTime: String! + EndTime: String! + Location: String + IsAllDay: Boolean + Guid: String + RecurrenceRule: String + StartTimezone: String + EndTimezone: String +} + +type Appointment { + Id: Int! + Subject: String + StartTime: String! + EndTime: String! + Location: String + IsAllDay: Boolean + RecurrenceRule: String + StartTimezone: String + EndTimezone: String +} + +type ReturnType { + result: [Appointment] +} + +type Query { + getEvents(datamanager: DataManager): ReturnType +} + +type Mutation { + batchUpdate(added: [AppointmentFields], changed: [AppointmentFields], deleted: [AppointmentFields]): Appointment +} \ No newline at end of file diff --git a/README.md b/README.md index 3024cc5..9eeffe6 100644 --- a/README.md +++ b/README.md @@ -1 +1,32 @@ -# ej2-angular-scheduler-crud-graphql-adaptor \ No newline at end of file +# ej2-angular-scheduler-crud-graphql-adaptor + +This project is a skeleton application used to create [Syncfusion Angular Components](https://www.syncfusion.com/angular-ui-components) web application. + +## Add Syncfusion Grid component in your application + +Refer the following UG documenation for adding Syncfusion Angular component in your application +* [Getting Started of Syncfusion Angular Scheduler component](https://ej2.syncfusion.com/angular/documentation/schedule/getting-started) + +## GraphQL Server setup + +You can setup GraphQL server by using `graphpack` npm package. Find the following link for getting more details for your reference. +[`https://www.npmjs.com/package/graphpack`](https://www.npmjs.com/package/graphpack) + +## Run the GraphQL Server + +``` +npm run dev +``` + +## Run the client Schedule application + +``` +npm start +``` + +## Resources + +You can also refer the below resources to know more details about Syncfusion Angular Scheduler components. +* [Demo](https://ej2.syncfusion.com/angular/demos/#/material/schedule/default) +* [Documentation](https://helpej2.syncfusion.com/angular/documentation/schedule/) +* [GraphQL with Syncfusion DataManager](https://ej2.syncfusion.com/angular/documentation/data/adaptors/#graphql-adaptor) \ No newline at end of file diff --git a/Schedule/.browserslistrc b/Schedule/.browserslistrc new file mode 100644 index 0000000..4f9ac26 --- /dev/null +++ b/Schedule/.browserslistrc @@ -0,0 +1,16 @@ +# This file is used by the build system to adjust CSS and JS output to support the specified browsers below. +# For additional information regarding the format and rule options, please see: +# https://github.com/browserslist/browserslist#queries + +# For the full list of supported browsers by the Angular framework, please see: +# https://angular.io/guide/browser-support + +# You can see what browsers were selected by your queries by running: +# npx browserslist + +last 1 Chrome version +last 1 Firefox version +last 2 Edge major versions +last 2 Safari major versions +last 2 iOS major versions +Firefox ESR diff --git a/Schedule/.editorconfig b/Schedule/.editorconfig new file mode 100644 index 0000000..59d9a3a --- /dev/null +++ b/Schedule/.editorconfig @@ -0,0 +1,16 @@ +# Editor configuration, see https://editorconfig.org +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +insert_final_newline = true +trim_trailing_whitespace = true + +[*.ts] +quote_type = single + +[*.md] +max_line_length = off +trim_trailing_whitespace = false diff --git a/Schedule/.gitignore b/Schedule/.gitignore new file mode 100644 index 0000000..105c00f --- /dev/null +++ b/Schedule/.gitignore @@ -0,0 +1,46 @@ +# See http://help.github.com/ignore-files/ for more about ignoring files. + +# compiled output +/dist +/tmp +/out-tsc +# Only exists if Bazel was run +/bazel-out + +# dependencies +/node_modules + +# profiling files +chrome-profiler-events*.json + +# IDEs and editors +/.idea +.project +.classpath +.c9/ +*.launch +.settings/ +*.sublime-workspace + +# IDE - VSCode +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +.history/* + +# misc +/.angular/cache +/.sass-cache +/connect.lock +/coverage +/libpeerconnection.log +npm-debug.log +yarn-error.log +testem.log +/typings + +# System Files +.DS_Store +Thumbs.db diff --git a/Schedule/angular.json b/Schedule/angular.json new file mode 100644 index 0000000..07fb341 --- /dev/null +++ b/Schedule/angular.json @@ -0,0 +1,111 @@ +{ + "$schema": "./node_modules/@angular/cli/lib/config/schema.json", + "version": 1, + "newProjectRoot": "projects", + "projects": { + "ej2-angular-app": { + "projectType": "application", + "schematics": { + "@schematics/angular:component": { + "style": "scss" + }, + "@schematics/angular:application": { + "strict": true + } + }, + "root": "", + "sourceRoot": "src", + "prefix": "app", + "architect": { + "build": { + "builder": "@angular-devkit/build-angular:browser", + "options": { + "outputPath": "dist/ej2-angular-app", + "index": "src/index.html", + "main": "src/main.ts", + "polyfills": "src/polyfills.ts", + "tsConfig": "tsconfig.app.json", + "inlineStyleLanguage": "scss", + "assets": [ + "src/favicon.ico", + "src/assets" + ], + "styles": [ + "src/styles.scss" + ], + "scripts": [] + }, + "configurations": { + "production": { + "budgets": [ + { + "type": "initial", + "maximumWarning": "500kb", + "maximumError": "1mb" + }, + { + "type": "anyComponentStyle", + "maximumWarning": "2kb", + "maximumError": "4kb" + } + ], + "fileReplacements": [ + { + "replace": "src/environments/environment.ts", + "with": "src/environments/environment.prod.ts" + } + ], + "outputHashing": "all" + }, + "development": { + "buildOptimizer": false, + "optimization": false, + "vendorChunk": true, + "extractLicenses": false, + "sourceMap": true, + "namedChunks": true + } + }, + "defaultConfiguration": "production" + }, + "serve": { + "builder": "@angular-devkit/build-angular:dev-server", + "configurations": { + "production": { + "browserTarget": "ej2-angular-app:build:production" + }, + "development": { + "browserTarget": "ej2-angular-app:build:development" + } + }, + "defaultConfiguration": "development" + }, + "extract-i18n": { + "builder": "@angular-devkit/build-angular:extract-i18n", + "options": { + "browserTarget": "ej2-angular-app:build" + } + }, + "test": { + "builder": "@angular-devkit/build-angular:karma", + "options": { + "main": "src/test.ts", + "polyfills": "src/polyfills.ts", + "tsConfig": "tsconfig.spec.json", + "karmaConfig": "karma.conf.js", + "inlineStyleLanguage": "scss", + "assets": [ + "src/favicon.ico", + "src/assets" + ], + "styles": [ + "src/styles.scss" + ], + "scripts": [] + } + } + } + } + }, + "defaultProject": "ej2-angular-app" +} diff --git a/Schedule/karma.conf.js b/Schedule/karma.conf.js new file mode 100644 index 0000000..15021a2 --- /dev/null +++ b/Schedule/karma.conf.js @@ -0,0 +1,44 @@ +// Karma configuration file, see link for more information +// https://karma-runner.github.io/1.0/config/configuration-file.html + +module.exports = function (config) { + config.set({ + 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') + ], + client: { + jasmine: { + // you can add configuration options for Jasmine here + // the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html + // 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 + }, + jasmineHtmlReporter: { + suppressAll: true // removes the duplicated traces + }, + coverageReporter: { + dir: require('path').join(__dirname, './coverage/ej2-angular-app'), + subdir: '.', + reporters: [ + { type: 'html' }, + { type: 'text-summary' } + ] + }, + reporters: ['progress', 'kjhtml'], + port: 9876, + colors: true, + logLevel: config.LOG_INFO, + autoWatch: true, + browsers: ['Chrome'], + singleRun: false, + restartOnFileChange: true + }); +}; diff --git a/Schedule/package.json b/Schedule/package.json new file mode 100644 index 0000000..d9d9d56 --- /dev/null +++ b/Schedule/package.json @@ -0,0 +1,42 @@ +{ + "name": "ej2-angular-app", + "version": "0.0.0", + "scripts": { + "ng": "ng", + "start": "ng serve", + "build": "ng build", + "watch": "ng build --watch --configuration development", + "test": "ng test" + }, + "private": true, + "dependencies": { + "@angular/animations": "~13.0.0-next.0", + "@angular/common": "~13.0.0-next.0", + "@angular/compiler": "~13.0.0-next.0", + "@angular/core": "~13.0.0-next.0", + "@angular/forms": "~13.0.0-next.0", + "@angular/platform-browser": "~13.0.0-next.0", + "@angular/platform-browser-dynamic": "~13.0.0-next.0", + "@angular/router": "~13.0.0-next.0", + "@syncfusion/ej2-angular-buttons": "^20.1.55", + "@syncfusion/ej2-angular-dropdowns": "^20.1.59", + "@syncfusion/ej2-angular-schedule": "^20.1.59", + "rxjs": "~7.4.0", + "tslib": "^2.3.0", + "zone.js": "~0.11.4" + }, + "devDependencies": { + "@angular-devkit/build-angular": "~13.0.0", + "@angular/cli": "~13.0.0", + "@angular/compiler-cli": "~13.0.0-next.0", + "@types/jasmine": "~3.10.0", + "@types/node": "^12.11.1", + "jasmine-core": "~3.10.0", + "karma": "~6.3.0", + "karma-chrome-launcher": "~3.1.0", + "karma-coverage": "~2.0.3", + "karma-jasmine": "~4.0.0", + "karma-jasmine-html-reporter": "~1.7.0", + "typescript": "~4.4.3" + } +} diff --git a/Schedule/src/app/app-routing.module.ts b/Schedule/src/app/app-routing.module.ts new file mode 100644 index 0000000..0297262 --- /dev/null +++ b/Schedule/src/app/app-routing.module.ts @@ -0,0 +1,10 @@ +import { NgModule } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; + +const routes: Routes = []; + +@NgModule({ + imports: [RouterModule.forRoot(routes)], + exports: [RouterModule] +}) +export class AppRoutingModule { } diff --git a/Schedule/src/app/app.component.html b/Schedule/src/app/app.component.html new file mode 100644 index 0000000..40c3b70 --- /dev/null +++ b/Schedule/src/app/app.component.html @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/Schedule/src/app/app.component.scss b/Schedule/src/app/app.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/Schedule/src/app/app.component.spec.ts b/Schedule/src/app/app.component.spec.ts new file mode 100644 index 0000000..af9af28 --- /dev/null +++ b/Schedule/src/app/app.component.spec.ts @@ -0,0 +1,35 @@ +import { TestBed } from '@angular/core/testing'; +import { RouterTestingModule } from '@angular/router/testing'; +import { AppComponent } from './app.component'; + +describe('AppComponent', () => { + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [ + RouterTestingModule + ], + declarations: [ + AppComponent + ], + }).compileComponents(); + }); + + it('should create the app', () => { + const fixture = TestBed.createComponent(AppComponent); + const app = fixture.componentInstance; + expect(app).toBeTruthy(); + }); + + it(`should have as title 'ej2-angular-app'`, () => { + const fixture = TestBed.createComponent(AppComponent); + const app = fixture.componentInstance; + expect(app.title).toEqual('ej2-angular-app'); + }); + + it('should render title', () => { + const fixture = TestBed.createComponent(AppComponent); + fixture.detectChanges(); + const compiled = fixture.nativeElement as HTMLElement; + expect(compiled.querySelector('.content span')?.textContent).toContain('ej2-angular-app app is running!'); + }); +}); diff --git a/Schedule/src/app/app.component.ts b/Schedule/src/app/app.component.ts new file mode 100644 index 0000000..59b1b7a --- /dev/null +++ b/Schedule/src/app/app.component.ts @@ -0,0 +1,41 @@ +import { Component, ViewChild } from '@angular/core'; +import { DataManager, GraphQLAdaptor } from '@syncfusion/ej2-data'; +import { DayService, WeekService, WorkWeekService, MonthService, AgendaService, ScheduleComponent, EventSettingsModel } from '@syncfusion/ej2-angular-schedule'; + +@Component({ + selector: 'app-root', + templateUrl: './app.component.html', + styleUrls: ['./app.component.scss'], + providers: [DayService, WeekService, WorkWeekService, MonthService, AgendaService] +}) +export class AppComponent { + @ViewChild('scheduleObj') scheduleObj: ScheduleComponent; + public dataSource: DataManager; + public eventSettings: EventSettingsModel; + ngOnInit(): void { + this.dataSource = new DataManager({ + url: 'http://localhost:4400/', + adaptor: new GraphQLAdaptor({ + response: { + result: 'getEvents.result', + }, + query:`query getEvents($datamanager: DataManager) { + getEvents(datamanager: $datamanager) { + result { Id, Subject, StartTime, EndTime, Location, IsAllDay, RecurrenceRule, StartTimezone, EndTimezone } + } + }`, + getMutation: function (action: any): string { + if (action === 'batch') { + return `mutation BatchUpdate($added: [AppointmentFields], $changed: [AppointmentFields], $deleted: [AppointmentFields]){ + batchUpdate(added: $added, changed: $changed, deleted: $deleted) { + Id, Subject, StartTime, EndTime, Location, IsAllDay, RecurrenceRule, StartTimezone, EndTimezone + } + }`; + } + } + }) + }); + this.eventSettings = { dataSource: this.dataSource }; + } + public selectedDate: Date = new Date(2021, 1, 11); +} \ No newline at end of file diff --git a/Schedule/src/app/app.module.ts b/Schedule/src/app/app.module.ts new file mode 100644 index 0000000..1f55264 --- /dev/null +++ b/Schedule/src/app/app.module.ts @@ -0,0 +1,25 @@ +import { NgModule } from '@angular/core'; +import { BrowserModule } from '@angular/platform-browser'; + +import { ScheduleModule } from '@syncfusion/ej2-angular-schedule'; +import { MultiSelectModule } from '@syncfusion/ej2-angular-dropdowns'; +import { ButtonModule } from '@syncfusion/ej2-angular-buttons'; + +import { AppRoutingModule } from './app-routing.module'; +import { AppComponent } from './app.component'; + +@NgModule({ + declarations: [ + AppComponent + ], + imports: [ + BrowserModule, + AppRoutingModule, + ScheduleModule, + MultiSelectModule, + ButtonModule + ], + providers: [], + bootstrap: [AppComponent] +}) +export class AppModule { } diff --git a/Schedule/src/assets/.gitkeep b/Schedule/src/assets/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Schedule/src/environments/environment.prod.ts b/Schedule/src/environments/environment.prod.ts new file mode 100644 index 0000000..3612073 --- /dev/null +++ b/Schedule/src/environments/environment.prod.ts @@ -0,0 +1,3 @@ +export const environment = { + production: true +}; diff --git a/Schedule/src/environments/environment.ts b/Schedule/src/environments/environment.ts new file mode 100644 index 0000000..f56ff47 --- /dev/null +++ b/Schedule/src/environments/environment.ts @@ -0,0 +1,16 @@ +// This file can be replaced during build by using the `fileReplacements` array. +// `ng build` replaces `environment.ts` with `environment.prod.ts`. +// The list of file replacements can be found in `angular.json`. + +export const environment = { + production: false +}; + +/* + * For easier debugging in development mode, you can import the following file + * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. + * + * This import should be commented out in production mode because it will have a negative impact + * on performance if an error is thrown. + */ +// import 'zone.js/plugins/zone-error'; // Included with Angular CLI. diff --git a/Schedule/src/favicon.ico b/Schedule/src/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..997406ad22c29aae95893fb3d666c30258a09537 GIT binary patch literal 948 zcmV;l155mgP)CBYU7IjCFmI-B}4sMJt3^s9NVg!P0 z6hDQy(L`XWMkB@zOLgN$4KYz;j0zZxq9KKdpZE#5@k0crP^5f9KO};h)ZDQ%ybhht z%t9#h|nu0K(bJ ztIkhEr!*UyrZWQ1k2+YkGqDi8Z<|mIN&$kzpKl{cNP=OQzXHz>vn+c)F)zO|Bou>E z2|-d_=qY#Y+yOu1a}XI?cU}%04)zz%anD(XZC{#~WreV!a$7k2Ug`?&CUEc0EtrkZ zL49MB)h!_K{H(*l_93D5tO0;BUnvYlo+;yss%n^&qjt6fZOa+}+FDO(~2>G z2dx@=JZ?DHP^;b7*Y1as5^uphBsh*s*z&MBd?e@I>-9kU>63PjP&^#5YTOb&x^6Cf z?674rmSHB5Fk!{Gv7rv!?qX#ei_L(XtwVqLX3L}$MI|kJ*w(rhx~tc&L&xP#?cQow zX_|gx$wMr3pRZIIr_;;O|8fAjd;1`nOeu5K(pCu7>^3E&D2OBBq?sYa(%S?GwG&_0-s%_v$L@R!5H_fc)lOb9ZoOO#p`Nn`KU z3LTTBtjwo`7(HA6 z7gmO$yTR!5L>Bsg!X8616{JUngg_@&85%>W=mChTR;x4`P=?PJ~oPuy5 zU-L`C@_!34D21{fD~Y8NVnR3t;aqZI3fIhmgmx}$oc-dKDC6Ap$Gy>a!`A*x2L1v0 WcZ@i?LyX}70000 + + + + Ej2AngularApp + + + + + + + + diff --git a/Schedule/src/main.ts b/Schedule/src/main.ts new file mode 100644 index 0000000..c7b673c --- /dev/null +++ b/Schedule/src/main.ts @@ -0,0 +1,12 @@ +import { enableProdMode } from '@angular/core'; +import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; + +import { AppModule } from './app/app.module'; +import { environment } from './environments/environment'; + +if (environment.production) { + enableProdMode(); +} + +platformBrowserDynamic().bootstrapModule(AppModule) + .catch(err => console.error(err)); diff --git a/Schedule/src/polyfills.ts b/Schedule/src/polyfills.ts new file mode 100644 index 0000000..429bb9e --- /dev/null +++ b/Schedule/src/polyfills.ts @@ -0,0 +1,53 @@ +/** + * This file includes polyfills needed by Angular and is loaded before the app. + * You can add your own extra polyfills to this file. + * + * This file is divided into 2 sections: + * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. + * 2. Application imports. Files imported after ZoneJS that should be loaded before your main + * file. + * + * The current setup is for so-called "evergreen" browsers; the last versions of browsers that + * automatically update themselves. This includes recent versions of Safari, Chrome (including + * Opera), Edge on the desktop, and iOS and Chrome on mobile. + * + * Learn more in https://angular.io/guide/browser-support + */ + +/*************************************************************************************************** + * BROWSER POLYFILLS + */ + +/** + * By default, zone.js will patch all possible macroTask and DomEvents + * user can disable parts of macroTask/DomEvents patch by setting following flags + * because those flags need to be set before `zone.js` being loaded, and webpack + * will put import in the top of bundle, so user need to create a separate file + * in this directory (for example: zone-flags.ts), and put the following flags + * into that file, and then add the following code before importing zone.js. + * import './zone-flags'; + * + * The flags allowed in zone-flags.ts are listed here. + * + * The following flags will work for all browsers. + * + * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame + * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick + * (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames + * + * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js + * with the following flag, it will bypass `zone.js` patch for IE/Edge + * + * (window as any).__Zone_enable_cross_context_check = true; + * + */ + +/*************************************************************************************************** + * Zone JS is required by default for Angular itself. + */ +import 'zone.js'; // Included with Angular CLI. + + +/*************************************************************************************************** + * APPLICATION IMPORTS + */ diff --git a/Schedule/src/styles.scss b/Schedule/src/styles.scss new file mode 100644 index 0000000..99be5d6 --- /dev/null +++ b/Schedule/src/styles.scss @@ -0,0 +1,10 @@ +/* You can add global styles to this file, and also import other style files */ +@import '../node_modules/@syncfusion/ej2-base/styles/material.css'; +@import '../node_modules/@syncfusion/ej2-buttons/styles/material.css'; +@import '../node_modules/@syncfusion/ej2-calendars/styles/material.css'; +@import '../node_modules/@syncfusion/ej2-dropdowns/styles/material.css'; +@import '../node_modules/@syncfusion/ej2-inputs/styles/material.css'; +@import '../node_modules/@syncfusion/ej2-lists/styles/material.css'; +@import '../node_modules/@syncfusion/ej2-popups/styles/material.css'; +@import '../node_modules/@syncfusion/ej2-navigations/styles/material.css'; +@import '../node_modules/@syncfusion/ej2-angular-schedule/styles/material.css'; \ No newline at end of file diff --git a/Schedule/src/test.ts b/Schedule/src/test.ts new file mode 100644 index 0000000..598d11e --- /dev/null +++ b/Schedule/src/test.ts @@ -0,0 +1,26 @@ +// 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 { + BrowserDynamicTestingModule, + platformBrowserDynamicTesting +} from '@angular/platform-browser-dynamic/testing'; + +declare const require: { + context(path: string, deep?: boolean, filter?: RegExp): { + keys(): string[]; + (id: string): T; + }; +}; + +// First, initialize the Angular testing environment. +getTestBed().initTestEnvironment( + BrowserDynamicTestingModule, + platformBrowserDynamicTesting(), +); + +// Then we find all the tests. +const context = require.context('./', true, /\.spec\.ts$/); +// And load the modules. +context.keys().map(context); diff --git a/Schedule/tsconfig.app.json b/Schedule/tsconfig.app.json new file mode 100644 index 0000000..82d91dc --- /dev/null +++ b/Schedule/tsconfig.app.json @@ -0,0 +1,15 @@ +/* To learn more about this file see: https://angular.io/config/tsconfig. */ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./out-tsc/app", + "types": [] + }, + "files": [ + "src/main.ts", + "src/polyfills.ts" + ], + "include": [ + "src/**/*.d.ts" + ] +} diff --git a/Schedule/tsconfig.json b/Schedule/tsconfig.json new file mode 100644 index 0000000..2bf522b --- /dev/null +++ b/Schedule/tsconfig.json @@ -0,0 +1,32 @@ +/* To learn more about this file see: https://angular.io/config/tsconfig. */ +{ + "compileOnSave": false, + "compilerOptions": { + "baseUrl": "./", + "outDir": "./dist/out-tsc", + "forceConsistentCasingInFileNames": true, + "strict": false, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noImplicitReturns": false, + "noFallthroughCasesInSwitch": true, + "sourceMap": true, + "declaration": false, + "downlevelIteration": true, + "experimentalDecorators": true, + "moduleResolution": "node", + "importHelpers": true, + "target": "es2017", + "module": "es2020", + "lib": [ + "es2020", + "dom" + ] + }, + "angularCompilerOptions": { + "enableI18nLegacyMessageIdFormat": false, + "strictInjectionParameters": true, + "strictInputAccessModifiers": true, + "strictTemplates": true + } +} diff --git a/Schedule/tsconfig.spec.json b/Schedule/tsconfig.spec.json new file mode 100644 index 0000000..092345b --- /dev/null +++ b/Schedule/tsconfig.spec.json @@ -0,0 +1,18 @@ +/* To learn more about this file see: https://angular.io/config/tsconfig. */ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./out-tsc/spec", + "types": [ + "jasmine" + ] + }, + "files": [ + "src/test.ts", + "src/polyfills.ts" + ], + "include": [ + "src/**/*.spec.ts", + "src/**/*.d.ts" + ] +}