conflict_resolution
stringlengths 27
16k
|
---|
<<<<<<<
updateUserReactionStatus: any;
getUserReactionStatus: any;
getQuestionSuccess: any;
=======
getTopCategories: any;
getTopTags: any;
>>>>>>>
updateUserReactionStatus: any;
getUserReactionStatus: any;
getQuestionSuccess: any;
getTopCategories: any;
getTopTags: any;
<<<<<<<
userFriendInvitations: userFriendInvitations,
updateUserReactionStatus: updateUserReactionStatus,
getUserReactionStatus: getUserReactionStatus,
getQuestionSuccess: getQuestionSuccess
=======
userFriendInvitations: userFriendInvitations,
getTopCategories: topCategories,
getTopTags: topTags
>>>>>>>
userFriendInvitations: userFriendInvitations,
updateUserReactionStatus: updateUserReactionStatus,
getUserReactionStatus: getUserReactionStatus,
getQuestionSuccess: getQuestionSuccess,
getTopCategories: topCategories,
getTopTags: topTags |
<<<<<<<
countries: Countries,
userAnsweredQuestion: UserAnsweredQuestion,
=======
account: Account,
userAnsweredQuestions: UserAnsweredQuestions,
currentQuestion: CurrentQuestion,
>>>>>>>
countries: Countries,
userAnsweredQuestion: UserAnsweredQuestion,
account: Account,
userAnsweredQuestions: UserAnsweredQuestions,
currentQuestion: CurrentQuestion, |
<<<<<<<
import { FriendsList } from './friends-list';
=======
import { Question } from './question';
>>>>>>>
import { FriendsList } from './friends-list';
import { Question } from './question';
<<<<<<<
friendsList: FriendsList,
=======
question: Question,
>>>>>>>
friendsList: FriendsList,
question: Question, |
<<<<<<<
router.post('/question/update/:collectionName', generalController.updateQuestionCollection);
=======
router.post('/blog', generalAuth.adminOnly, generalController.generateBlogsData);
>>>>>>>
router.post('/question/update/:collectionName', generalAuth.adminOnly, generalController.updateQuestionCollection);
router.post('/blog', generalAuth.adminOnly, generalController.generateBlogsData); |
<<<<<<<
'editorUrl': 'https://rwa-trivia-dev-e57fc.firebaseapp.com/trivia-editor',
'hightlighJsURL': 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.6/highlight.min.js',
'hightlighCSSURL': 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.6/styles/a11y-light.min.css',
'katexCSSURL': 'https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css',
'addressByLatLongURL': 'https://maps.googleapis.com/maps/api/geocode/json',
'addressSuggestionsURL': 'https://maps.googleapis.com/maps/api/place/autocomplete/json',
=======
'editorUrl': 'https://rwa-trivia-dev-e57fc.firebaseapp.com/editor',
'hightlighJsURL' : 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.6/highlight.min.js',
'hightlighCSSURL' : 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.6/styles/a11y-light.min.css',
'katexCSSURL' : 'https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css',
>>>>>>>
'editorUrl': 'https://rwa-trivia-dev-e57fc.firebaseapp.com/trivia-editor',
'hightlighJsURL': 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.6/highlight.min.js',
'hightlighCSSURL': 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.6/styles/a11y-light.min.css',
'katexCSSURL': 'https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css',
<<<<<<<
'privacyUrl': 'https://rwa-trivia-dev-e57fc.firebaseapp.com/terms-and-conditions',
'ua_id': 'UA-122807814-1'
};
=======
'privacyUrl': 'https://rwa-trivia-dev-e57fc.firebaseapp.com/terms-and-conditions',
'ua_id': 'UA-122807814-1'
};
>>>>>>>
'privacyUrl': 'https://rwa-trivia-dev-e57fc.firebaseapp.com/terms-and-conditions',
'ua_id': 'UA-122807814-1'
}; |
<<<<<<<
isFriend?: boolean;
=======
totalFriends?: number;
>>>>>>>
isFriend?: boolean;
totalFriends?: number; |
<<<<<<<
import { Component, OnDestroy } from '@angular/core';
import { Observable, Subscription } from 'rxjs';
=======
import { Component, OnDestroy, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core';
import { Observable } from 'rxjs';
>>>>>>>
import { Component, OnDestroy, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core';
import { Observable } from 'rxjs';
<<<<<<<
private page: Page) {
super(store, questionActions);
=======
private page: Page, private cd: ChangeDetectorRef) {
super(store, questionActions, utils);
>>>>>>>
private page: Page, private cd: ChangeDetectorRef) {
super(store, questionActions);
<<<<<<<
this.subscription.push(this.userDict$.subscribe(userDict => this.userDict = userDict));
=======
this.subs.push(this.userDict$.subscribe(userDict => {
this.userDict = userDict;
this.cd.markForCheck();
}));
>>>>>>>
this.subscription.push(this.userDict$.subscribe(userDict => {
this.userDict = userDict;
this.cd.markForCheck();
})); |
<<<<<<<
import { Component, OnInit } from '@angular/core';
import { Observable } from 'rxjs';
=======
import { Component, OnInit, OnDestroy } from '@angular/core';
import { MatCheckboxChange, MatTabChangeEvent, PageEvent } from '@angular/material';
import { Router } from '@angular/router';
import { select, Store } from '@ngrx/store';
import { AutoUnsubscribe } from 'ngx-auto-unsubscribe';
import { Observable, Subscription } from 'rxjs';
>>>>>>>
import { Component, OnInit, OnDestroy } from '@angular/core';
import { MatCheckboxChange, MatTabChangeEvent, PageEvent } from '@angular/material';
import { Router } from '@angular/router';
import { select, Store } from '@ngrx/store';
import { AutoUnsubscribe } from 'ngx-auto-unsubscribe';
import { Observable, Subscription } from 'rxjs';
<<<<<<<
import { Store, select } from '@ngrx/store';
import { PageEvent, MatCheckboxChange } from '@angular/material';
import { AppState, appState, getCategories, getTags } from '../../../store';
import {
User, Question, Category, SearchResults,
SearchCriteria, ApplicationSettings, QuestionStatus
} from 'shared-library/shared/model';
=======
import { UserActions } from 'shared-library/core/store';
import { Category, Question, QuestionStatus, SearchCriteria, SearchResults, User } from 'shared-library/shared/model';
import * as bulkActions from '../../../bulk/store/actions';
import { AppState, appState, categoryDictionary, getCategories, getTags } from '../../../store';
>>>>>>>
import { UserActions } from 'shared-library/core/store';
import { Category, Question, QuestionStatus, SearchCriteria, SearchResults, User, ApplicationSettings } from 'shared-library/shared/model';
import * as bulkActions from '../../../bulk/store/actions';
import { AppState, appState, categoryDictionary, getCategories, getTags } from '../../../store';
<<<<<<<
applicationSettings: ApplicationSettings;
quillConfig = {
toolbar: {
container: [],
handlers: {
// handlers object will be merged with default handlers object
'mathEditor': () => {
}
}
},
mathEditor: {},
blotFormatter: {},
syntax: true
};
constructor(private store: Store<AppState>,
private router: Router,
private userActions: UserActions) {
this.store.select(appState.coreState).pipe(select(s => s.applicationSettings)).subscribe(appSettings => {
if (appSettings) {
this.applicationSettings = appSettings[0];
this.quillConfig.toolbar.container.push(this.applicationSettings.quill_options.options);
this.quillConfig.toolbar.container.push(this.applicationSettings.quill_options.list);
this.quillConfig.mathEditor = { mathOptions: this.applicationSettings };
}
});
=======
subscriptions: Subscription[] = [];
constructor(private store: Store<AppState>, private router: Router, private userActions: UserActions) {
>>>>>>>
applicationSettings: ApplicationSettings;
quillConfig = {
toolbar: {
container: [],
handlers: {
// handlers object will be merged with default handlers object
'mathEditor': () => {
}
}
},
mathEditor: {},
blotFormatter: {},
syntax: true
};
subscriptions: Subscription[] = [];
constructor(private store: Store<AppState>,
private router: Router,
private userActions: UserActions) {
this.store.select(appState.coreState).pipe(select(s => s.applicationSettings)).subscribe(appSettings => {
if (appSettings) {
this.applicationSettings = appSettings[0];
this.quillConfig.toolbar.container.push(this.applicationSettings.quill_options.options);
this.quillConfig.toolbar.container.push(this.applicationSettings.quill_options.list);
this.quillConfig.mathEditor = { mathOptions: this.applicationSettings };
}
}); |
<<<<<<<
router.post('/question/update/:collectionName', generalAuth.adminOnly, generalController.updateQuestionCollection);
router.post('/blog', generalAuth.adminOnly, generalController.generateBlogsData);
=======
router.post('/blog', generalAuth.authTokenOnly, generalController.generateBlogsData);
>>>>>>>
router.post('/question/update/:collectionName', generalAuth.adminOnly, generalController.updateQuestionCollection);
router.post('/blog', generalAuth.authTokenOnly, generalController.generateBlogsData); |
<<<<<<<
import { InviteMailFriendsComponent } from './invite-mail-friends/invite-mail-friends.component';
=======
import { SignupExtraInfoComponent } from './signup-extra-info/signup-extra-info.component';
import { CheckDisplayNameComponent } from './check-display-name/check-display-name.component';
import { InviteMailFriendsComponent } from './invite-mail-friends/invite-mail-friends.component';
>>>>>>>
import { SignupExtraInfoComponent } from './signup-extra-info/signup-extra-info.component';
import { CheckDisplayNameComponent } from './check-display-name/check-display-name.component';
import { InviteMailFriendsComponent } from './invite-mail-friends/invite-mail-friends.component';
<<<<<<<
=======
SignupExtraInfoComponent,
CheckDisplayNameComponent
>>>>>>>
SignupExtraInfoComponent,
CheckDisplayNameComponent
<<<<<<<
=======
UserCardComponent,
SignupExtraInfoComponent,
CheckDisplayNameComponent
>>>>>>>
SignupExtraInfoComponent,
CheckDisplayNameComponent |
<<<<<<<
=======
// console.log('getCategories--->', 'getCategories');
>>>>>>> |
<<<<<<<
import { RecentGamesComponent } from './recent-games/recent-games.component';
import { RecentGameCardComponent } from './recent-games/recent-game-card/recent-game-card.component';
=======
>>>>>>>
import { RecentGamesComponent } from './recent-games/recent-games.component';
import { RecentGameCardComponent } from './recent-games/recent-game-card/recent-game-card.component';
<<<<<<<
CheckDisplayNameComponent,
RecentGamesComponent,
RecentGameCardComponent
=======
CheckDisplayNameComponent,
FriendInviteComponent,
GameInviteComponent
>>>>>>>
CheckDisplayNameComponent,
FriendInviteComponent,
GameInviteComponent,
RecentGamesComponent,
RecentGameCardComponent |
<<<<<<<
=======
import { GameMechanics } from './game-mechanics';
>>>>>>>
import { GameMechanics } from './game-mechanics';
<<<<<<<
// console.log(doc.id, '=>', doc.data());
=======
console.log(doc.id, '=>', doc.data());
>>>>>>>
// console.log(doc.id, '=>', doc.data()); |
<<<<<<<
is_draft: boolean;
=======
appeared: number;
correct: number;
wrong: number;
>>>>>>>
is_draft: boolean;
appeared: number;
correct: number;
wrong: number;
<<<<<<<
question.is_draft = db.is_draft ? db.is_draft : false;
=======
question.appeared = db.appeared ? db.appeared : 0;
question.correct = db.correct ? db.correct : 0;
question.wrong = db.wrong ? db.wrong : 0;
>>>>>>>
question.is_draft = db.is_draft ? db.is_draft : false;
question.appeared = db.appeared ? db.appeared : 0;
question.correct = db.correct ? db.correct : 0;
question.wrong = db.wrong ? db.wrong : 0; |
<<<<<<<
private router: Router,
private utils: Utils) {
=======
private windowRef: WindowRef,
private router: Router) {
>>>>>>>
private windowRef: WindowRef,
private router: Router,
private utils: Utils) { |
<<<<<<<
import { StatsService } from '../services/stats.service';
const katex = require('katex');
=======
>>>>>>>
const katex = require('katex'); |
<<<<<<<
import { Component, OnInit, OnDestroy } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
=======
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
>>>>>>>
import { Component, OnInit, OnDestroy } from '@angular/core';
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; |
<<<<<<<
export * from './countryList/countryList.component';
export * from './question-card/question-card.component';
export * from './first-question/first-question.component';
=======
export * from './countryList/countryList.component';
export * from './select-category-tag/select-category-tag.component';
>>>>>>>
export * from './countryList/countryList.component';
export * from './question-card/question-card.component';
export * from './first-question/first-question.component';
export * from './select-category-tag/select-category-tag.component'; |
<<<<<<<
=======
import admin from '../db/firebase.client';
>>>>>>>
<<<<<<<
private static blogFireStoreClient = admin.firestore();
=======
private static blogFireStoreClient = admin.firestore();
>>>>>>>
private static blogFireStoreClient = admin.firestore();
<<<<<<<
const batch = this.blogFireStoreClient.batch();
=======
try {
const batch = this.blogFireStoreClient.batch();
>>>>>>>
try {
const batch = this.blogFireStoreClient.batch(); |
<<<<<<<
getCityAndCountryName(location) {
const userLocation: string[] = [];
location.results[0].address_components.map(component => {
const cityList = component.types.filter(typeName => typeName === 'administrative_area_level_2');
if (cityList.length > 0) {
userLocation.push(component.long_name);
}
const countryList = component.types.filter(typeName => typeName === 'country');
if (countryList.length > 0) {
userLocation.push(component.long_name);
}
});
return userLocation.toString();
}
=======
startNewGame() {
this.router.navigate(['/game-play/challenge/', this.user.userId]);
}
get isLivesEnable(): Boolean {
const isEnable = (this.loggedInUser && this.loggedInUserAccount && this.loggedInUserAccount.lives > 0 &&
this.applicationSettings.lives.enable) || (!this.applicationSettings.lives.enable) ? true : false;
return isEnable;
}
>>>>>>>
getCityAndCountryName(location) {
const userLocation: string[] = [];
location.results[0].address_components.map(component => {
const cityList = component.types.filter(typeName => typeName === 'administrative_area_level_2');
if (cityList.length > 0) {
userLocation.push(component.long_name);
}
const countryList = component.types.filter(typeName => typeName === 'country');
if (countryList.length > 0) {
userLocation.push(component.long_name);
}
});
return userLocation.toString();
}
startNewGame() {
this.router.navigate(['/game-play/challenge/', this.user.userId]);
}
get isLivesEnable(): Boolean {
const isEnable = (this.loggedInUser && this.loggedInUserAccount && this.loggedInUserAccount.lives > 0 &&
this.applicationSettings.lives.enable) || (!this.applicationSettings.lives.enable) ? true : false;
return isEnable;
} |
<<<<<<<
android_version: number;
ios_version: number;
=======
phone_authentication: boolean;
>>>>>>>
android_version: number;
ios_version: number;
phone_authentication: boolean; |
<<<<<<<
import { Component, OnInit, OnDestroy } from '@angular/core';
=======
import { Component, OnInit, ViewChildren, QueryList, ElementRef } from '@angular/core';
>>>>>>>
import { Component, OnInit, OnDestroy, ViewChildren, QueryList, ElementRef } from '@angular/core';
<<<<<<<
import { Utils } from 'shared-library/core/services';
=======
import { isAndroid } from 'tns-core-modules/ui/page/page';
>>>>>>>
import { Utils } from 'shared-library/core/services';
import { isAndroid } from 'tns-core-modules/ui/page/page';
<<<<<<<
subs: Subscription[] = [];
=======
@ViewChildren('textField') textField : QueryList<ElementRef>;
>>>>>>>
subs: Subscription[] = [];
@ViewChildren('textField') textField : QueryList<ElementRef>;
<<<<<<<
ngOnDestroy() {
this.utils.unsubscribe(this.subs);
}
=======
hideKeyboard() {
this.textField
.toArray()
.map((el) => {
if ( isAndroid ) {
el.nativeElement.android.clearFocus();
}
return el.nativeElement.dismissSoftInput(); });
}
>>>>>>>
ngOnDestroy() {
this.utils.unsubscribe(this.subs);
}
hideKeyboard() {
this.textField
.toArray()
.map((el) => {
if (isAndroid) {
el.nativeElement.android.clearFocus();
}
return el.nativeElement.dismissSoftInput();
});
} |
<<<<<<<
StatsModule,
BrowserModule.withServerTransition({ appId: 'trivia' })
=======
StatsModule,
ServiceWorkerModule.register('/ngsw-worker.js', { enabled: environment.production })
>>>>>>>
StatsModule,
BrowserModule.withServerTransition({ appId: 'trivia' })
ServiceWorkerModule.register('/ngsw-worker.js', { enabled: environment.production }) |
<<<<<<<
@ViewChild('autocomplete', { static: false }) autocomplete: RadAutoCompleteTextViewComponent;
@ViewChild('friendListView', { static: false }) listViewComponent: RadListViewComponent;
=======
modeAvailable: boolean;
@ViewChild('autocomplete') autocomplete: RadAutoCompleteTextViewComponent;
@ViewChild('friendListView') listViewComponent: RadListViewComponent;
>>>>>>>
@ViewChild('autocomplete', { static: false }) autocomplete: RadAutoCompleteTextViewComponent;
@ViewChild('friendListView', { static: false }) listViewComponent: RadListViewComponent;
modeAvailable: boolean; |
<<<<<<<
export * from './game-filter.pipe';
export * from './safe-html.pipe';
=======
export * from './game-filter.pipe';
export * from './search-country-filter.pipe';
>>>>>>>
export * from './game-filter.pipe';
export * from './safe-html.pipe';
export * from './search-country-filter.pipe'; |
<<<<<<<
=======
import * as userActions from '../../store/actions';
>>>>>>>
import * as userActions from '../../store/actions';
<<<<<<<
sendFriendRequest() {
const inviteeUserId = this.user.userId;
this.store.dispatch(this.userAction.addUserInvitation(
{ userId: this.loggedInUser.userId, inviteeUserId: inviteeUserId }));
}
=======
checkDisplayName(displayName: string) {
this.store.dispatch(new userActions.CheckDisplayName(displayName));
}
>>>>>>>
sendFriendRequest() {
const inviteeUserId = this.user.userId;
this.store.dispatch(this.userAction.addUserInvitation(
{ userId: this.loggedInUser.userId, inviteeUserId: inviteeUserId }));
}
checkDisplayName(displayName: string) {
this.store.dispatch(new userActions.CheckDisplayName(displayName));
} |
<<<<<<<
import { categories } from './categories.reducer';
import { tags } from './tags.reducer';
import { questionOfTheDay, questionSaveStatus, updateQuestion, firstQuestion } from './questions.reducer';
=======
import { categories, topCategories } from './categories.reducer';
import { tags, topTags } from './tags.reducer';
import { questionOfTheDay, questionSaveStatus, updateQuestion } from './questions.reducer';
>>>>>>>
import { categories, topCategories } from './categories.reducer';
import { tags, topTags } from './tags.reducer';
import { questionOfTheDay, questionSaveStatus, updateQuestion, firstQuestion } from './questions.reducer';
<<<<<<<
firstQuestionBits: any;
firstQuestion: Question;
=======
getTopCategories: any;
getTopTags: any;
>>>>>>>
firstQuestionBits: any;
firstQuestion: Question;
getTopCategories: any;
getTopTags: any;
<<<<<<<
userFriendInvitations: userFriendInvitations,
firstQuestionBits: firstQuestionBits,
firstQuestion: firstQuestion
=======
userFriendInvitations: userFriendInvitations,
getTopCategories: topCategories,
getTopTags: topTags
>>>>>>>
userFriendInvitations: userFriendInvitations,
firstQuestionBits: firstQuestionBits,
firstQuestion: firstQuestion,
getTopCategories: topCategories,
getTopTags: topTags |
<<<<<<<
import { ChangePasswordComponent } from 'shared-library/shared/mobile/component';
=======
import { BulkUploadRequestComponent } from '../../../../../shared-library/src/lib/shared/mobile/component';
>>>>>>>
import { ChangePasswordComponent } from 'shared-library/shared/mobile/component';
import { BulkUploadRequestComponent } from '../../../../../shared-library/src/lib/shared/mobile/component'; |
<<<<<<<
const generalQuestionService = require('../services/question.service');
=======
>>>>>>>
const generalQuestionService = require('../services/question.service');
<<<<<<<
/**
* changeQuestionCategoryIdType
* return status
*/
exports.changeQuestionCategoryIdType = (req, res) => {
const updatePromises = [];
generalQuestionService.getAllQuestions().then(questions => {
questions.docs.map(question => {
const questionObj: Question = question.data();
console.log('questionObj.categoryIds', questionObj.categoryIds);
const categoryId = questionObj.categoryIds[0];
const updatedCategory = [];
updatedCategory.push(Number(categoryId));
questionObj.categoryIds = updatedCategory;
console.log('updatedCategory', updatedCategory);
const dbQuestionObj = { ...questionObj };
updatePromises.push(generalQuestionService.updateQuestion('questions', dbQuestionObj));
});
Promise.all(updatePromises).then((updateResults) => {
res.send(updateResults);
})
.catch((e) => {
res.send(e);
});
});
};
=======
exports.removeSocialProfile = async (req, res) => {
res.status(200).send(await generalUserService.removeSocialProfile());
};
>>>>>>>
/**
* changeQuestionCategoryIdType
* return status
*/
exports.changeQuestionCategoryIdType = (req, res) => {
const updatePromises = [];
generalQuestionService.getAllQuestions().then(questions => {
questions.docs.map(question => {
const questionObj: Question = question.data();
console.log('questionObj.categoryIds', questionObj.categoryIds);
const categoryId = questionObj.categoryIds[0];
const updatedCategory = [];
updatedCategory.push(Number(categoryId));
questionObj.categoryIds = updatedCategory;
console.log('updatedCategory', updatedCategory);
const dbQuestionObj = { ...questionObj };
updatePromises.push(generalQuestionService.updateQuestion('questions', dbQuestionObj));
});
Promise.all(updatePromises).then((updateResults) => {
res.send(updateResults);
})
.catch((e) => {
res.send(e);
});
});
};
exports.removeSocialProfile = async (req, res) => {
res.status(200).send(await generalUserService.removeSocialProfile());
}; |
<<<<<<<
import {
Parameter, User, FirebaseAnalyticsKeyConstants, FirebaseAnalyticsEventConstants
} from '../../../../../../shared-library/src/lib/shared/model';
=======
import * as geolocation from 'nativescript-geolocation';
import { filter } from 'rxjs/operators';
import { ModalDialogService } from 'nativescript-angular/directives/dialogs';
import { LocationResetDialogComponent } from './location-reset-dialog/location-reset-dialog.component';
>>>>>>>
import { LocationResetDialogComponent } from './location-reset-dialog/location-reset-dialog.component';
import { ProfileSettings } from './profile-settings';
<<<<<<<
=======
private locations: ObservableArray<TokenModel>;
private isLocationEnalbed: boolean;
>>>>>>>
private locations: ObservableArray<TokenModel>;
private isLocationEnalbed: boolean;
<<<<<<<
this.saveUser(this.user, (this.user.location !== this.userCopyForReset.location) ? true : false);
=======
console.log(JSON.stringify(this.user));
this.saveUser(this.user);
>>>>>>>
this.saveUser(this.user, (this.user.location !== this.userCopyForReset.location) ? true : false); |
<<<<<<<
import { PLATFORM_ID, APP_ID, Component, OnInit, Inject, AfterViewInit, ChangeDetectorRef, OnDestroy } from '@angular/core';
=======
import { PLATFORM_ID, APP_ID, Component, OnInit, Inject, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core';
>>>>>>>
import { PLATFORM_ID, APP_ID, Component, OnInit, Inject, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core';
<<<<<<<
@AutoUnsubscribe({ 'arrayName': 'subscription' })
export class NewsletterComponent implements OnInit, AfterViewInit, OnDestroy {
=======
export class NewsletterComponent implements OnInit {
>>>>>>>
@AutoUnsubscribe({ 'arrayName': 'subscription' })
export class NewsletterComponent implements OnInit {
<<<<<<<
ngAfterViewInit(): void {
this.subscription.push(this.store.select(appState.coreState).pipe(select(s => s.user)).subscribe(user => {
=======
this.store.select(appState.coreState).pipe(select(s => s.user)).subscribe(user => {
>>>>>>>
this.subscription.push(this.store.select(appState.coreState).pipe(select(s => s.user)).subscribe(user => {
<<<<<<<
if (!this.cd['destroyed']) {
this.cd.detectChanges();
}
}));
=======
this.cd.markForCheck();
});
>>>>>>>
this.cd.markForCheck();
})); |
<<<<<<<
=======
import { MatSnackBar } from '@angular/material';
import * as firebase from 'firebase';
>>>>>>>
<<<<<<<
=======
profileImage: String;
data: any;
>>>>>>>
<<<<<<<
@ViewChild('cropper') cropper: ImageCropperComponent;
=======
file: File;
croppedFileBlobObject: Blob;
@ViewChild('cropper', undefined) cropper: ImageCropperComponent;
getImageUrl = false;
basePath = '/profile_picture';
croppedPicPath = 'croppedPic';
originalPicPath = 'originalPic';
>>>>>>>
@ViewChild('cropper') cropper: ImageCropperComponent;
<<<<<<<
private userActions: UserActions,
private snackBar: MatSnackBar) {
this.subs.push(this.store.take(1).subscribe(s => this.user = s.user));
=======
public snackBar: MatSnackBar,
private userActions: UserActions) {
>>>>>>>
private userActions: UserActions,
private snackBar: MatSnackBar) {
this.subs.push(this.store.take(1).subscribe(s => this.user = s.user));
<<<<<<<
private setCropperSettings() {
=======
this.userObs = this.store.select(s => s.userInfosById);
// For cropping image
>>>>>>>
private setCropperSettings() {
<<<<<<<
type: this.profileImageFile.type
=======
type: this.file.type
>>>>>>>
type: this.profileImageFile.type
<<<<<<<
getUserFromFormValue(formValue: any): void {
this.user.name = formValue.name;
this.user.displayName = formValue.displayName;
this.user.location = formValue.location;
this.user.categoryIds = [];
for (const obj of formValue.categoryList) {
if (obj['isSelected']) {
this.user.categoryIds.push(obj['category']);
=======
// user profile validation
onFileChange(event) {
const fileList: FileList = event.target.files;
if (fileList.length === 0) {
this.imageValidation = 'Please select Logo';
} else {
const file: File = fileList[0];
const fname = file.name;
const fsize = file.size;
const ftype = file.type;
if (fsize > 2097152) {
this.imageValidation = 'Your uploaded logo is not larger than 2 MB.';
} else {
if (ftype === 'image/jpeg' || ftype === 'image/jpg' || ftype === 'image/png' || ftype === 'image/gif') {
this.imageValidation = undefined;
} else {
this.imageValidation = 'Only PNG, GIF, JPG and JPEG Type Allow.';
}
>>>>>>>
getUserFromFormValue(formValue: any): void {
this.user.name = formValue.name;
this.user.displayName = formValue.displayName;
this.user.location = formValue.location;
this.user.categoryIds = [];
for (const obj of formValue.categoryList) {
if (obj['isSelected']) {
this.user.categoryIds.push(obj['category']);
<<<<<<<
this.store.dispatch(this.userActions.addUserProfile(user));
=======
this.store.dispatch(this.userActions.addUserProfileData(user));
this.snackBar.open('Profile Updated Successfuly', '', { duration: 3000 });
}
// Helper functions
getUserFromFormValue(formValue: any): void {
this.user.name = formValue.name;
this.user.displayName = formValue.displayName;
this.user.location = formValue.location;
this.user.categoryIds = (this.user.categoryIds) ? this.user.categoryIds : [];
for (const obj of formValue.categoryList) {
if (obj['isSelected']) {
this.user.categoryIds.push(obj['category']);
}
}
this.user.facebookUrl = formValue.facebookUrl;
this.user.linkedInUrl = formValue.linkedInUrl;
this.user.twitterUrl = formValue.twitterUrl;
this.user.profileSetting = formValue.profileSetting;
this.user.profileLocationSetting = formValue.profileLocationSetting;
this.user.privateProfileSetting = formValue.privateProfileSetting;
this.user.profilePicture = formValue.profilePicture ? formValue.profilePicture : '';
>>>>>>>
this.store.dispatch(this.userActions.addUserProfile(user)); |
<<<<<<<
import { Component, OnDestroy, AfterViewInit, ChangeDetectorRef } from '@angular/core';
=======
import { Component, OnDestroy, AfterViewInit, ChangeDetectorRef, ChangeDetectionStrategy} from '@angular/core';
>>>>>>>
import { Component, OnDestroy, AfterViewInit, ChangeDetectorRef, ChangeDetectionStrategy} from '@angular/core';
<<<<<<<
this.subscription.push(this.userDict$.subscribe(userDict => this.userDict = userDict));
=======
this.subs.push(this.userDict$.subscribe(userDict => {
this.userDict = userDict;
this.cd.markForCheck();
}));
>>>>>>>
this.subscription.push(this.userDict$.subscribe(userDict => {
this.userDict = userDict;
this.cd.markForCheck();
})); |
<<<<<<<
constructor(private store: Store<AppState>, private utils: Utils) {
this.subscription.push(store.select(appState.coreState).pipe(select(s => s.account)).subscribe(account => {
=======
constructor(private store: Store<AppState>, private utils: Utils, private cd: ChangeDetectorRef) {
this.subs.push(store.select(appState.coreState).pipe(select(s => s.account)).subscribe(account => {
>>>>>>>
constructor(private store: Store<AppState>, private utils: Utils, private cd: ChangeDetectorRef) {
this.subscription.push(store.select(appState.coreState).pipe(select(s => s.account)).subscribe(account => { |
<<<<<<<
RULES = 'rules',
GET_QUESTION_IMAGE = 'getQuestionImage',
UPLOAD_QUESTION_IMAGE = 'uploadQuestionImage',
=======
RULES = 'rules',
DISPLAY_NAME = 'display-name',
DISPLAY_DASH_NAME = 'displayName'
>>>>>>>
RULES = 'rules',
GET_QUESTION_IMAGE = 'getQuestionImage',
UPLOAD_QUESTION_IMAGE = 'uploadQuestionImage',
DISPLAY_NAME = 'display-name',
DISPLAY_DASH_NAME = 'displayName' |
<<<<<<<
this.subscription.push(this.userDict$.subscribe(userDict => this.userDict = userDict));
this.subscription.push(this.store.select(appState.coreState).pipe(select(s => s.applicationSettings)).subscribe(appSettings => {
=======
this.subs.push(this.userDict$.subscribe(userDict => { this.userDict = userDict; this.cd.markForCheck(); }));
this.subs.push(this.store.select(appState.coreState).pipe(select(s => s.applicationSettings)).subscribe(appSettings => {
>>>>>>>
this.subscription.push(this.userDict$.subscribe(userDict => { this.userDict = userDict; this.cd.markForCheck(); }));
this.subscription.push(this.store.select(appState.coreState).pipe(select(s => s.applicationSettings)).subscribe(appSettings => { |
<<<<<<<
router.post('/blog', generalAuth.authTokenOnly, generalController.generateBlogsData);
=======
router.post('/question/update/:collectionName', generalController.updateQuestionCollection);
>>>>>>>
router.post('/blog', generalAuth.authTokenOnly, generalController.generateBlogsData);
router.post('/question/update/:collectionName', generalController.updateQuestionCollection); |
<<<<<<<
constructor(private store: Store<AppState>, private renderer: Renderer2, public utils: Utils) {
this.subscription.push(this.store.select(appState.coreState).pipe(take(1)).subscribe(s => this.user = s.user));
=======
constructor(private store: Store<AppState>, private renderer: Renderer2, private utils: Utils) {
this.store.select(appState.coreState).pipe(take(1)).subscribe(s => this.user = s.user);
>>>>>>>
constructor(private store: Store<AppState>, private renderer: Renderer2, private utils: Utils) {
this.subscription.push(this.store.select(appState.coreState).pipe(take(1)).subscribe(s => this.user = s.user)); |
<<<<<<<
import { SharedModule } from '../shared/shared.module';
import { BlogComponent, NewsletterComponent, SocialPaletteComponent } from './components';
=======
import { StoreModule } from '@ngrx/store';
import { EffectsModule } from '@ngrx/effects';
import { SharedModule } from '../shared/shared.module';
import { BlogComponent, NewsletterComponent } from './components';
import { effects, reducer } from './store';
>>>>>>>
import { SharedModule } from '../shared/shared.module';
import { BlogComponent, NewsletterComponent, SocialPaletteComponent } from './components';
import { StoreModule } from '@ngrx/store';
import { EffectsModule } from '@ngrx/effects';
import { effects, reducer } from './store';
<<<<<<<
providers: [
],
exports: [
BlogComponent,
NewsletterComponent,
SocialPaletteComponent
=======
exports: [
BlogComponent,
NewsletterComponent
>>>>>>>
exports: [
BlogComponent,
NewsletterComponent,
SocialPaletteComponent |
<<<<<<<
this.subscription.push(this.store.select(gamePlayState).pipe(select(s => s.saveReportQuestion)).subscribe(state => { }));
this.subscription.push(this.store.select(coreState).pipe(select(s => s.userProfileSaveStatus)).subscribe((status: string) => {
=======
this.subs.push(this.store.select(gamePlayState).pipe(select(s => s.saveReportQuestion)).subscribe(state => {
this.cd.markForCheck();
}));
this.subs.push(this.store.select(coreState).pipe(select(s => s.userProfileSaveStatus)).subscribe((status: string) => {
>>>>>>>
this.subscription.push(this.store.select(gamePlayState).pipe(select(s => s.saveReportQuestion)).subscribe(state => {
this.cd.markForCheck();
}));
this.subscription.push(this.store.select(coreState).pipe(select(s => s.userProfileSaveStatus)).subscribe((status: string) => { |
<<<<<<<
const EMAIL_REGEXP = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
@AutoUnsubscribe({ 'arrayName': 'subscriptions' })
export class InviteMailFriends implements OnInit, OnDestroy {
user: User;
invitationForm: FormGroup;
showErrorMsg = false;
invalidEmailList = [];
errorMsg = '';
showSuccessMsg: string;
validEmail = [];
emailCheck: Boolean = false;
@ViewChildren('textField') textField: QueryList<ElementRef>;
subscriptions = [];
constructor(private fb: FormBuilder, private store: Store<CoreState>, private userAction: UserActions, private cd: ChangeDetectorRef,
private utils: Utils) {
this.subscriptions.push(this.store.select(coreState).pipe(select(s => s.user)).subscribe(user => {
if (user) {
this.user = user;
}
}));
this.subscriptions.push(this.store.select(coreState).pipe(select(s => s.userProfileSaveStatus)).subscribe((status: string) => {
if (status && status !== 'NONE' && status !== 'IN PROCESS' && status !== 'SUCCESS' && status !== 'MAKE FRIEND SUCCESS') {
this.showSuccessMsg = status;
this.cd.detectChanges();
}
=======
const EMAIL_REGEXP = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
@Component({
selector: 'app-invite-mail-friends',
templateUrl: './invite-mail-friends.component.html',
styleUrls: ['./invite-mail-friends.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
})
@AutoUnsubscribe({ 'arrayName': 'subscriptions' })
export class InviteMailFriends implements OnInit, OnDestroy {
user: User;
invitationForm: FormGroup;
showErrorMsg = false;
invalidEmailList = [];
errorMsg = '';
showSuccessMsg: string;
validEmail = [];
emailCheck: Boolean = false;
applicationSettings: ApplicationSettings;
@ViewChildren('textField') textField: QueryList<ElementRef>;
subscriptions = [];
constructor(private fb: FormBuilder, private store: Store<CoreState>, private userAction: UserActions, private cd: ChangeDetectorRef,
private utils: Utils) {
this.subscriptions.push(this.store.select(coreState).pipe(select(s => s.user)).subscribe(user => {
if (user) {
this.user = user;
}
}));
this.subscriptions.push(this.store.select(coreState).pipe(select(s => s.userProfileSaveStatus)).subscribe((status: string) => {
if (status && status !== 'NONE' && status !== 'IN PROCESS' && status !== 'SUCCESS' && status !== 'MAKE FRIEND SUCCESS') {
this.showSuccessMsg = status;
this.cd.detectChanges();
}
}));
}
ngOnInit() {
this.showSuccessMsg = undefined;
this.invitationForm = this.fb.group({
email: ['', Validators.required]
});
this.subscriptions.push(this.store.select(coreState).pipe(select(s => s.applicationSettings))
.subscribe(appSettings => {
this.applicationSettings = appSettings[0];
>>>>>>>
const EMAIL_REGEXP = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
@AutoUnsubscribe({ 'arrayName': 'subscriptions' })
export class InviteMailFriends implements OnInit, OnDestroy {
user: User;
invitationForm: FormGroup;
showErrorMsg = false;
invalidEmailList = [];
errorMsg = '';
showSuccessMsg: string;
validEmail = [];
emailCheck: Boolean = false;
applicationSettings: ApplicationSettings;
@ViewChildren('textField') textField: QueryList<ElementRef>;
subscriptions = [];
constructor(private fb: FormBuilder, private store: Store<CoreState>, private userAction: UserActions, private cd: ChangeDetectorRef,
private utils: Utils) {
this.subscriptions.push(this.store.select(coreState).pipe(select(s => s.user)).subscribe(user => {
if (user) {
this.user = user;
}
}));
this.subscriptions.push(this.store.select(coreState).pipe(select(s => s.userProfileSaveStatus)).subscribe((status: string) => {
if (status && status !== 'NONE' && status !== 'IN PROCESS' && status !== 'SUCCESS' && status !== 'MAKE FRIEND SUCCESS') {
this.showSuccessMsg = status;
this.cd.detectChanges();
}
}));
}
ngOnInit() {
this.showSuccessMsg = undefined;
this.invitationForm = this.fb.group({
email: ['', Validators.required]
});
this.subscriptions.push(this.store.select(coreState).pipe(select(s => s.applicationSettings))
.subscribe(appSettings => {
this.applicationSettings = appSettings[0];
<<<<<<<
}
ngOnInit() {
=======
}
isValid(email) {
return EMAIL_REGEXP.test(String(email).toLowerCase());
}
onSubscribe() {
this.emailCheck = true;
if (!this.invitationForm.valid) {
return;
} else {
let invalid = false;
this.errorMsg = '';
this.showErrorMsg = false;
this.invalidEmailList = [];
>>>>>>>
}
isValid(email) {
return EMAIL_REGEXP.test(String(email).toLowerCase());
}
onSubscribe() {
this.emailCheck = true;
if (!this.invitationForm.valid) {
return;
} else {
let invalid = false;
this.errorMsg = '';
this.showErrorMsg = false;
this.invalidEmailList = [];
<<<<<<<
this.invitationForm = this.fb.group({
email: ['', Validators.required]
});
}
isValid(email) {
return EMAIL_REGEXP.test(String(email).toLowerCase());
}
onSubscribe() {
this.emailCheck = true;
if (!this.invitationForm.valid) {
return;
} else {
let invalid = false;
this.errorMsg = '';
this.showErrorMsg = false;
this.invalidEmailList = [];
this.showSuccessMsg = undefined;
this.validEmail = [];
if (this.invitationForm.get('email').value.indexOf(',') > -1) {
const emails = this.invitationForm.get('email').value.split(',');
for (const e of emails) {
invalid = this.isValid(e);
if (!invalid) {
this.invalidEmailList.push(e);
} else {
this.validEmail.push(e);
}
}
if (this.invalidEmailList.length > 0) {
this.errorMsg = 'Following emails are not valid address!';
this.showErrorMsg = true;
}
} else {
const email = this.invitationForm.get('email').value.split(',');
if (email === '' || !this.isValid(email)) {
invalid = true;
this.invalidEmailList.push(email);
this.errorMsg = 'Following email is not valid address!';
this.showErrorMsg = true;
=======
this.validEmail = [];
if (this.invitationForm.get('email').value.indexOf(',') > -1) {
const emails = this.invitationForm.get('email').value.split(',');
for (const e of emails) {
invalid = this.isValid(e);
if (!invalid) {
this.invalidEmailList.push(e);
>>>>>>>
this.validEmail = [];
if (this.invitationForm.get('email').value.indexOf(',') > -1) {
const emails = this.invitationForm.get('email').value.split(',');
for (const e of emails) {
invalid = this.isValid(e);
if (!invalid) {
this.invalidEmailList.push(e);
<<<<<<<
=======
>>>>>>>
<<<<<<<
ngOnDestroy(): void {
}
}
=======
}
ngOnDestroy(): void {
}
hideKeyboard() {
this.textField
.toArray()
.map((el) => {
if (el.nativeElement && el.nativeElement.android) {
el.nativeElement.android.clearFocus();
}
// return el.nativeElement.dismissSoftInput();
});
}
}
>>>>>>>
}
ngOnDestroy(): void { }
} |
<<<<<<<
ActionBarComponent, DrawerComponent, CountryListComponent, QuestionsTableComponent, QuestionCardComponent, FirstQuestionComponent
=======
ActionBarComponent, DrawerComponent, CountryListComponent, QuestionsTableComponent,
SelectCategoryTagComponent
>>>>>>>
ActionBarComponent, DrawerComponent, CountryListComponent, QuestionsTableComponent, QuestionCardComponent, FirstQuestionComponent,
SelectCategoryTagComponent
<<<<<<<
import { RenderQuestionComponent, AuthorComponent, RenderAnswerComponent } from './components';
=======
import { RenderQuestionComponent, AuthorComponent, RenderAnswerComponent, UserCardComponent } from './components';
>>>>>>>
import { RenderQuestionComponent, AuthorComponent, RenderAnswerComponent, UserCardComponent } from './components';
<<<<<<<
QuestionCardComponent,
FirstQuestionComponent,
SafeHtmlPipe
=======
SelectCategoryTagComponent,
SafeHtmlPipe,
>>>>>>>
QuestionCardComponent,
FirstQuestionComponent,
SelectCategoryTagComponent,
<<<<<<<
RenderQuestionComponent,
QuestionCardComponent,
FirstQuestionComponent
=======
RenderQuestionComponent,
SelectCategoryTagComponent,
UserCardComponent
>>>>>>>
RenderQuestionComponent,
QuestionCardComponent,
FirstQuestionComponent,
SelectCategoryTagComponent,
UserCardComponent |
<<<<<<<
'editorUrl': 'https://bitwiser-edu.firebaseapp.com/editor',
'hightlighJsURL': 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.6/highlight.min.js',
'hightlighCSSURL': 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.6/styles/a11y-light.min.css',
'katexCSSURL': 'https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css',
'ua_id': 'UA-122807814-1'
};
=======
'editorUrl': 'https://bitwiser-edu.firebaseapp.com/trivia-editor',
'termsAndConditionsUrl': 'https://bitwiser-edu.io/terms-and-conditions',
'privacyUrl': 'https://bitwiser-edu.io/terms-and-conditions'
};
>>>>>>>
'editorUrl': 'https://bitwiser-edu.firebaseapp.com/editor',
'hightlighJsURL': 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.6/highlight.min.js',
'hightlighCSSURL': 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.6/styles/a11y-light.min.css',
'katexCSSURL': 'https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css',
'termsAndConditionsUrl': 'https://bitwiser-edu.io/terms-and-conditions',
'privacyUrl': 'https://bitwiser-edu.io/terms-and-conditions',
'ua_id': 'UA-122807814-1'
}; |
<<<<<<<
import { PLATFORM_ID, APP_ID, Component, OnInit, Inject, AfterViewInit, ChangeDetectorRef, OnDestroy } from '@angular/core';
=======
import { PLATFORM_ID, APP_ID, Component, OnInit, Inject, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core';
>>>>>>>
import { PLATFORM_ID, APP_ID, Component, OnInit, Inject, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core';
<<<<<<<
@AutoUnsubscribe({ 'arrayName': 'subscription' })
export class NewsletterComponent implements OnInit, AfterViewInit, OnDestroy {
=======
export class NewsletterComponent implements OnInit {
>>>>>>>
@AutoUnsubscribe({ 'arrayName': 'subscription' })
export class NewsletterComponent implements OnInit {
<<<<<<<
ngAfterViewInit(): void {
this.subscription.push(this.store.select(appState.coreState).pipe(select(s => s.user)).subscribe(user => {
=======
this.store.select(appState.coreState).pipe(select(s => s.user)).subscribe(user => {
>>>>>>>
this.subscription.push(this.store.select(appState.coreState).pipe(select(s => s.user)).subscribe(user => {
<<<<<<<
if (!this.cd['destroyed']) {
this.cd.detectChanges();
}
}));
=======
this.cd.markForCheck();
});
>>>>>>>
this.cd.markForCheck();
})); |
<<<<<<<
],
"userDict": {
'ssHmHkKq9BPByP9c4CtmEqvO4xp2': {
"userId": "ssHmHkKq9BPByP9c4CtmEqvO4xp2",
"displayName": "trivia",
"email": "[email protected]",
"roles": {},
"authState": null
}
}
=======
],
"leaderBoard": {
"1": [
{ "score": 123, "userId": "ssHmHkKq9BPByP9c4CtmEqvO4xp2" },
{ "score": 406, "userId": "ssHmHkKq9BPByo9c4CtmEqvO4xp2" },
{ "score": 10, "userId": "ssHmHkKq9BPSyP9c4CtmEqvO4xp2" },
{ "score": 80, "userId": "ssHmHkKq9BPSyP9c4CtmEqvO4xp2" },
{ "score": 100, "userId": "ssHmHkKq9BPPyP9c4CtmEqvO4xp2" },
{ "score": 102, "userId": "ssHmHkKq9BPYyP9c4CtmEqvO4xp2" },
{ "score": 109, "userId": "ssHmHkKq9BPOyP9c4CtmEqvO4xp2" },
{ "score": 105, "userId": "ssHmHkKq9BPLyP9c4CtmEqvO4xp2" },
{ "score": 1000, "userId": "ssHmHkKq9BPRyP9c4CtmEqvO4xp2" },
{ "score": 50, "userId": "ssHmHkKq9BPTyP9c4CtmEqvO4xp2" }
],
"2": [
{ "score": 100, "userId": "ssHmHkKq9BPByP9c4CtmEqvO4xp2" },
{ "score": 40, "userId": "ssHmHkKq9BPByo9c4CtmEqvO4xp2" },
{ "score": 54, "userId": "ssHmHkKq9BPSyP9c4CtmEqvO4xp2" },
{ "score": 100, "userId": "ssHmHkKq9BPPyP9c4CtmEqvO4xp2" },
{ "score": 102, "userId": "ssHmHkKq9BPYyP9c4CtmEqvO4xp2" },
{ "score": 109, "userId": "ssHmHkKq9BPOyP9c4CtmEqvO4xp2" },
{ "score": 105, "userId": "ssHmHkKq9BPLyP9c4CtmEqvO4xp2" },
{ "score": 1000, "userId": "ssHmHkKq9BPRyP9c4CtmEqvO4xp2" },
{ "score": 50, "userId": "ssHmHkKq9BPTyP9c4CtmEqvO4xp2" },
{ "score": 50, "userId": "ssHmHkKq9BPTyP9c4CtmEqvO4xp2" }],
"3": [
{ "score": 5, "userId": "ssHmHkKq9BPByP9c4CtmEqvO4xp2" },
{ "score": 80, "userId": "ssHmHkKq9BPByo9c4CtmEqvO4xp2" },
{ "score": 500, "userId": "ssHmHkKq9BPSyP9c4CtmEqvO4xp2" },
{ "score": 100, "userId": "ssHmHkKq9BPPyP9c4CtmEqvO4xp2" },
{ "score": 102, "userId": "ssHmHkKq9BPYyP9c4CtmEqvO4xp2" },
{ "score": 109, "userId": "ssHmHkKq9BPOyP9c4CtmEqvO4xp2" },
{ "score": 105, "userId": "ssHmHkKq9BPLyP9c4CtmEqvO4xp2" },
{ "score": 1000, "userId": "ssHmHkKq9BPRyP9c4CtmEqvO4xp2" },
{ "score": 50, "userId": "ssHmHkKq9BPTyP9c4CtmEqvO4xp2" },
{ "score": 50, "userId": "ssHmHkKq9BPTyP9c4CtmEqvO4xp2" }
]
}
>>>>>>>
],
"userDict": {
'ssHmHkKq9BPByP9c4CtmEqvO4xp2': {
"userId": "ssHmHkKq9BPByP9c4CtmEqvO4xp2",
"displayName": "trivia",
"email": "[email protected]",
"roles": {},
"authState": null
},
"leaderBoard": {
"1": [
{ "score": 123, "userId": "ssHmHkKq9BPByP9c4CtmEqvO4xp2" },
{ "score": 406, "userId": "ssHmHkKq9BPByo9c4CtmEqvO4xp2" },
{ "score": 10, "userId": "ssHmHkKq9BPSyP9c4CtmEqvO4xp2" },
{ "score": 80, "userId": "ssHmHkKq9BPSyP9c4CtmEqvO4xp2" },
{ "score": 100, "userId": "ssHmHkKq9BPPyP9c4CtmEqvO4xp2" },
{ "score": 102, "userId": "ssHmHkKq9BPYyP9c4CtmEqvO4xp2" },
{ "score": 109, "userId": "ssHmHkKq9BPOyP9c4CtmEqvO4xp2" },
{ "score": 105, "userId": "ssHmHkKq9BPLyP9c4CtmEqvO4xp2" },
{ "score": 1000, "userId": "ssHmHkKq9BPRyP9c4CtmEqvO4xp2" },
{ "score": 50, "userId": "ssHmHkKq9BPTyP9c4CtmEqvO4xp2" }
],
"2": [
{ "score": 100, "userId": "ssHmHkKq9BPByP9c4CtmEqvO4xp2" },
{ "score": 40, "userId": "ssHmHkKq9BPByo9c4CtmEqvO4xp2" },
{ "score": 54, "userId": "ssHmHkKq9BPSyP9c4CtmEqvO4xp2" },
{ "score": 100, "userId": "ssHmHkKq9BPPyP9c4CtmEqvO4xp2" },
{ "score": 102, "userId": "ssHmHkKq9BPYyP9c4CtmEqvO4xp2" },
{ "score": 109, "userId": "ssHmHkKq9BPOyP9c4CtmEqvO4xp2" },
{ "score": 105, "userId": "ssHmHkKq9BPLyP9c4CtmEqvO4xp2" },
{ "score": 1000, "userId": "ssHmHkKq9BPRyP9c4CtmEqvO4xp2" },
{ "score": 50, "userId": "ssHmHkKq9BPTyP9c4CtmEqvO4xp2" },
{ "score": 50, "userId": "ssHmHkKq9BPTyP9c4CtmEqvO4xp2" }],
"3": [
{ "score": 5, "userId": "ssHmHkKq9BPByP9c4CtmEqvO4xp2" },
{ "score": 80, "userId": "ssHmHkKq9BPByo9c4CtmEqvO4xp2" },
{ "score": 500, "userId": "ssHmHkKq9BPSyP9c4CtmEqvO4xp2" },
{ "score": 100, "userId": "ssHmHkKq9BPPyP9c4CtmEqvO4xp2" },
{ "score": 102, "userId": "ssHmHkKq9BPYyP9c4CtmEqvO4xp2" },
{ "score": 109, "userId": "ssHmHkKq9BPOyP9c4CtmEqvO4xp2" },
{ "score": 105, "userId": "ssHmHkKq9BPLyP9c4CtmEqvO4xp2" },
{ "score": 1000, "userId": "ssHmHkKq9BPRyP9c4CtmEqvO4xp2" },
{ "score": 50, "userId": "ssHmHkKq9BPTyP9c4CtmEqvO4xp2" },
{ "score": 50, "userId": "ssHmHkKq9BPTyP9c4CtmEqvO4xp2" }
]
} |
<<<<<<<
/**
* updateBits
* return account
*/
static async updateBits(userId: string): Promise<any> {
try {
const appSetting = await AppSettings.Instance.getAppSettings();
const bits = appSetting.first_question_bits;
const accountData = await AccountService.getAccountById(userId);
accountData.bits = accountData.bits ? Utils.changeFieldValue(bits) : accountData.bits;
await AccountService.updateAccountData(accountData);
} catch (error) {
return Utils.throwError(error);
}
}
=======
/**
* updateBits
* return account
*/
static async updateBits(userId: string, bits: number): Promise<any> {
try {
// const appSetting = await AppSettings.Instance.getAppSettings();
let accountData = await AccountService.getAccountById(userId);
accountData.bits = accountData.bits ? Utils.changeFieldValue(bits) : bits;
await AccountService.updateAccountData(accountData);
} catch (error) {
return Utils.throwError(error);
}
}
>>>>>>>
/**
* updateBits
* return account
*/
static async updateBits(userId: string, bits: number): Promise<any> {
try {
// const appSetting = await AppSettings.Instance.getAppSettings();
const accountData = await AccountService.getAccountById(userId);
accountData.bits = accountData.bits ? Utils.changeFieldValue(bits) : bits;
await AccountService.updateAccountData(accountData);
} catch (error) {
return Utils.throwError(error);
}
} |
<<<<<<<
import { user, authInitialized, categories, categoryDictionary, tags,
questionsSearchResults, unpublishedQuestions, questionOfTheDay, questionSaveStatus,
userPublishedQuestions, userUnpublishedQuestions,fileUnpublishedQuestions, filePublishedQuestions,
loginRedirectUrl,
currentGame, newGameId, currentGameQuestion, activeGames, bulkUploadFileInfo } from './reducers';
=======
import { user, authInitialized, categories, categoryDictionary, tags,
questionsSearchResults, unpublishedQuestions, questionOfTheDay, questionSaveStatus,
userPublishedQuestions, userUnpublishedQuestions,
loginRedirectUrl,
currentGame, newGameId, currentGameQuestion, activeGames, bulkUploadFileInfos, userBulkUploadFileInfos } from './reducers';
>>>>>>>
import { user, authInitialized, categories, categoryDictionary, tags,
questionsSearchResults, unpublishedQuestions, questionOfTheDay, questionSaveStatus,
userPublishedQuestions, userUnpublishedQuestions,
loginRedirectUrl,
currentGame, newGameId, currentGameQuestion, activeGames, bulkUploadFileInfos, userBulkUploadFileInfos, fileUnpublishedQuestions, filePublishedQuestions } from './reducers';
<<<<<<<
bulkUploadFileInfo: BulkUploadFileInfo[];
fileUnpublishedQuestions: Question[];
filePublishedQuestions: Question[];
=======
bulkUploadFileInfos: BulkUploadFileInfo[];
userBulkUploadFileInfos: BulkUploadFileInfo[];
>>>>>>>
bulkUploadFileInfos: BulkUploadFileInfo[];
userBulkUploadFileInfos: BulkUploadFileInfo[];
fileUnpublishedQuestions: Question[];
filePublishedQuestions: Question[];
<<<<<<<
bulkUploadFileInfo: bulkUploadFileInfo,
fileUnpublishedQuestions: fileUnpublishedQuestions,
filePublishedQuestions: filePublishedQuestions
=======
bulkUploadFileInfos: bulkUploadFileInfos,
userBulkUploadFileInfos: userBulkUploadFileInfos
>>>>>>>
bulkUploadFileInfos: bulkUploadFileInfos,
userBulkUploadFileInfos: userBulkUploadFileInfos,
fileUnpublishedQuestions: fileUnpublishedQuestions,
filePublishedQuestions: filePublishedQuestions |
<<<<<<<
static LOAD_TOP_TOPICS_SUCCESS = 'LOAD_TOP_TOPICS_SUCCESS';
=======
>>>>>>> |
<<<<<<<
renderWebView: boolean;
=======
display_achievements: boolean;
>>>>>>>
renderWebView: boolean;
display_achievements: boolean; |
<<<<<<<
export const CURR_VER_DEV = '0.913';
export const CURR_VER_PROD = '0.913';
=======
export const CURR_VER_DEV = '0.904';
export const CURR_VER_PROD = '0.915';
>>>>>>>
export const CURR_VER_DEV = '0.913';
export const CURR_VER_PROD = '0.913';
export const CURR_VER_DEV = '0.904';
export const CURR_VER_PROD = '0.915'; |
<<<<<<<
import { RSSFeedConstants, Blog } from '../../src/app/model';
=======
import { QuestionBifurcation } from '../utils/question-bifurcation';
>>>>>>>
import { RSSFeedConstants, Blog } from '../../src/app/model';
import { QuestionBifurcation } from '../utils/question-bifurcation';
<<<<<<<
}
/**
* generateBlogsData
* return status
*/
exports.generateBlogsData = (req, res) => {
const blogs: Array<Blog> = [];
Feed.load(RSSFeedConstants.feedURL, function (err, rss) {
let index = 0;
let viewCount = 100;
let commentCount = 5;
let items = rss.items.sort((itemA: Blog, itemB: Blog) => {
return new Date(itemB.pubDate).getTime() - new Date(itemA.pubDate).getTime()
});
items = items.slice(0, 3);
items.map((item) => {
const blog: Blog = item;
blog.blogNo = index;
blog.commentCount = commentCount;
blog.viewCount = viewCount;
blog.share_status = false;
delete blog['description'];
const result = blog.content.match(/<em>(.*?)<\/em>/g).map(function (val) {
return val.replace(/<\/?em>/g, '');
});
blog.subtitle = result[0];
blogs.push({ ...blog });
index++;
viewCount = viewCount + Math.floor((Math.random() * 100) + 1);
commentCount = commentCount + Math.floor((Math.random() * 5) + 1);
});
console.log('blogs', blogs);
blogService.setBlog(blogs).then((ref) => {
res.send('created feed blogs');
});
});
};
=======
}
/**
* update bulk upload collection by adding isUserArchived or isAdminArchived based on user role
* return status
*/
exports.updateQuestionCollection = (req, res) => {
console.log(req.params.collectionName);
const questionBifurcation: QuestionBifurcation = new QuestionBifurcation();
switch (req.params.collectionName) {
case 'questions':
console.log('Updating questions ...');
questionBifurcation.getQuestionList(req.params.collectionName).then((bulkUploadResults) => {
res.send('updated question collection');
});
break;
case 'unpublished_questions':
console.log('Updating unpublished questions ...');
questionBifurcation.getQuestionList(req.params.collectionName).then((bulkUploadResults) => {
res.send('updated unpublished question collection');
});
break;
}
}
>>>>>>>
}
/**
* generateBlogsData
* return status
*/
exports.generateBlogsData = (req, res) => {
const blogs: Array<Blog> = [];
Feed.load(RSSFeedConstants.feedURL, function (err, rss) {
let index = 0;
let viewCount = 100;
let commentCount = 5;
let items = rss.items.sort((itemA: Blog, itemB: Blog) => {
return new Date(itemB.pubDate).getTime() - new Date(itemA.pubDate).getTime()
});
items = items.slice(0, 3);
items.map((item) => {
const blog: Blog = item;
blog.blogNo = index;
blog.commentCount = commentCount;
blog.viewCount = viewCount;
blog.share_status = false;
delete blog['description'];
const result = blog.content.match(/<em>(.*?)<\/em>/g).map(function (val) {
return val.replace(/<\/?em>/g, '');
});
blog.subtitle = result[0];
blogs.push({ ...blog });
index++;
viewCount = viewCount + Math.floor((Math.random() * 100) + 1);
commentCount = commentCount + Math.floor((Math.random() * 5) + 1);
});
console.log('blogs', blogs);
blogService.setBlog(blogs).then((ref) => {
res.send('created feed blogs');
});
});
};
/**
* update bulk upload collection by adding isUserArchived or isAdminArchived based on user role
* return status
*/
exports.updateQuestionCollection = (req, res) => {
console.log(req.params.collectionName);
const questionBifurcation: QuestionBifurcation = new QuestionBifurcation();
switch (req.params.collectionName) {
case 'questions':
console.log('Updating questions ...');
questionBifurcation.getQuestionList(req.params.collectionName).then((bulkUploadResults) => {
res.send('updated question collection');
});
break;
case 'unpublished_questions':
console.log('Updating unpublished questions ...');
questionBifurcation.getQuestionList(req.params.collectionName).then((bulkUploadResults) => {
res.send('updated unpublished question collection');
});
break;
}
} |
<<<<<<<
ngOnDestroy() {
Utils.unsubscribe(this.subs);
}
=======
rejectGameInvitation() {
this.store.dispatch(new gameplayactions.RejectGameInvitation(this.game.gameId));
}
>>>>>>>
rejectGameInvitation() {
this.store.dispatch(new gameplayactions.RejectGameInvitation(this.game.gameId));
}
ngOnDestroy() {
Utils.unsubscribe(this.subs);
} |
<<<<<<<
import { QuestionActions, BulkUploadActions } from '../../../core/store/actions';
import { AppStore } from '../../../core/store/app-store';
=======
import { AppState, appState } from '../../../store';
>>>>>>>
import { QuestionActions, BulkUploadActions } from '../../../core/store/actions';
import { AppState, appState } from '../../../store';
<<<<<<<
private store: Store<AppStore>,
private bulkUploadActions: BulkUploadActions,
private questionActions: QuestionActions) {
this.categoriesObs = store.select(s => s.categories);
this.tagsObs = store.select(s => s.tags);
this.store.take(1).subscribe(s => this.user = s.user);
=======
private store: Store<AppState>) {
this.categoriesObs = store.select(appState.coreState).select(s => s.categories);
this.tagsObs = store.select(appState.coreState).select(s => s.tags);
>>>>>>>
private store: Store<AppState>,
private bulkUploadActions: BulkUploadActions,
private questionActions: QuestionActions) {
this.categoriesObs = store.select(appState.coreState).select(s => s.categories);
this.tagsObs = store.select(appState.coreState).select(s => s.tags);
this.store.select(appState.coreState).take(1).subscribe(s => this.user = s.user); |
<<<<<<<
import { UploadTaskSnapshot } from 'angularfire2/storage/interfaces';
=======
import { of } from 'rxjs';
>>>>>>>
import { UploadTaskSnapshot } from 'angularfire2/storage/interfaces';
import { of } from 'rxjs';
<<<<<<<
switchMap((action: socialActions.LoadSocialScoreShareUrl) =>
this.socialService.generateScoreShareImage(action.payload.imageBlob, action.payload.userId)
.pipe(
map((imageUrl: UploadTaskSnapshot) => new socialActions.LoadSocialScoreShareUrlSuccess(imageUrl)))
));
=======
switchMap((action: socialActions.LoadSocialScoreShareUrl) =>
this.socialService.generateScoreShareImage(action.payload.imageBlob, action.payload.userId)
.pipe(
map((imageUrl: string) => new socialActions.LoadSocialScoreShareUrlSuccess(imageUrl)))
));
>>>>>>>
switchMap((action: socialActions.LoadSocialScoreShareUrl) =>
this.socialService.generateScoreShareImage(action.payload.imageBlob, action.payload.userId)
.pipe(
map((imageUrl: UploadTaskSnapshot) => new socialActions.LoadSocialScoreShareUrlSuccess(imageUrl)))
)); |
<<<<<<<
private renderer: Renderer2) {
=======
private renderer: Renderer2,
private utils: Utils,
private cd: ChangeDetectorRef) {
>>>>>>>
private renderer: Renderer2,
private cd: ChangeDetectorRef) {
<<<<<<<
this.store.select(appState.coreState).pipe(take(1)).subscribe(s => this.user = s.user); //logged in user
=======
this.subs.push(this.store.select(appState.coreState).pipe(take(1)).subscribe(s => { this.user = s.user; this.cd.detectChanges(); })); //logged in user
>>>>>>>
this.subscription.push(this.store.select(appState.coreState).pipe(take(1)).subscribe(s => { this.user = s.user; this.cd.detectChanges(); })); //logged in user
<<<<<<<
this.subscription.push(this.dialogRef.afterOpen().subscribe(x => {
=======
this.dialogRef.afterOpen().subscribe(x => {
this.cd.detectChanges();
>>>>>>>
this.subscription.push(this.dialogRef.afterOpen().subscribe(x => {
this.cd.detectChanges(); |
<<<<<<<
this.userDataProvider.addWallet(newWallet, passphrase, password).subscribe((result) => {
this.navCtrl.push('WalletDashboardPage', { address: newWallet.address });
=======
this.userDataProvider.addWallet(newWallet, privateKey.toWIF(), password).subscribe((result) => {
this.navCtrl.push('WalletDashboardPage', { address: newWallet.address })
.then(() => {
this.navCtrl.remove(this.navCtrl.getActive().index - 1, 1).then(() => {
this.navCtrl.remove(this.navCtrl.getActive().index - 1, 1);
});
});
>>>>>>>
this.userDataProvider.addWallet(newWallet, passphrase, password).subscribe((result) => {
this.navCtrl.push('WalletDashboardPage', { address: newWallet.address })
.then(() => {
this.navCtrl.remove(this.navCtrl.getActive().index - 1, 1).then(() => {
this.navCtrl.remove(this.navCtrl.getActive().index - 1, 1);
});
}); |
<<<<<<<
getNodeConfiguration(host: string): Observable<PeerApiResponse> {
return Observable.create(observer => {
this.get(`node/configuration`, {}, host).subscribe((response: any) => {
observer.next(response.data);
observer.complete();
}, (error) => observer.error(error));
});
}
getPeerSyncing(host: string): Observable<LoaderStatusSync> {
=======
getPeerSyncing(host: string, timeout?: number): Observable<LoaderStatusSync> {
>>>>>>>
getNodeConfiguration(host: string): Observable<PeerApiResponse> {
return Observable.create(observer => {
this.get(`node/configuration`, {}, host).subscribe((response: any) => {
observer.next(response.data);
observer.complete();
}, (error) => observer.error(error));
});
}
getPeerSyncing(host: string, timeout?: number): Observable<LoaderStatusSync> { |
<<<<<<<
// Load User Profile By Id
export function user(state: any = null, action: UserActions): User {
switch (action.type) {
case UserActionTypes.LOAD_USER_PROFILE_SUCCESS || UserActionTypes.UPDATE_USER_SUCCESS:
return { ...state, ...action.payload };
default:
return state;
}
}
=======
>>>>>>> |
<<<<<<<
if (changes.game && changes.game.currentValue && this.game.gameOptions.isBadgeWithCategory) {
if (this.user.userId && this.game.stats.badge) {
this.earnedBadges = this.game.stats.badge[this.user.userId].reverse();
}
if (Number(this.game.gameOptions.playerMode) === PlayerMode.Opponent && this.game.stats.badge) {
this.earnedBadgesByOtherUser = this.game.stats.badge[this.otherUserId].reverse();
}
}
if (changes.applicationSettings && changes.applicationSettings.currentValue) {
this.totalBadges = Object.keys(this.applicationSettings.badges);
}
=======
if (this.game && this.categoryDict) {
this.categoryList = [
...this.game.gameOptions.categoryIds
.map(id =>
this.categoryDict[id] ? this.capitalizeFirstLetter(this.categoryDict[id].categoryName) : ""
)
.filter(name => name !== '')
];
}
>>>>>>>
if (changes.game && changes.game.currentValue && this.game.gameOptions.isBadgeWithCategory) {
if (this.user.userId && this.game.stats.badge) {
this.earnedBadges = this.game.stats.badge[this.user.userId].reverse();
}
if (Number(this.game.gameOptions.playerMode) === PlayerMode.Opponent && this.game.stats.badge) {
this.earnedBadgesByOtherUser = this.game.stats.badge[this.otherUserId].reverse();
}
}
if (changes.applicationSettings && changes.applicationSettings.currentValue) {
this.totalBadges = Object.keys(this.applicationSettings.badges);
}
if (this.game && this.categoryDict) {
this.categoryList = [
...this.game.gameOptions.categoryIds
.map(id =>
this.categoryDict[id] ? this.capitalizeFirstLetter(this.categoryDict[id].categoryName) : ""
)
.filter(name => name !== '')
];
} |
<<<<<<<
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, NgZone, OnDestroy, ViewChild, ElementRef } from '@angular/core';
=======
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, NgZone, OnDestroy, OnInit } from '@angular/core';
>>>>>>>
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, NgZone, OnDestroy, ViewChild, ElementRef, OnInit } from '@angular/core';
<<<<<<<
export class LeaderboardComponent extends Leaderboard implements OnDestroy {
@ViewChild('dropdown', { static: false }) dropdown: ElementRef;
=======
export class LeaderboardComponent extends Leaderboard implements OnDestroy, OnInit {
>>>>>>>
export class LeaderboardComponent extends Leaderboard implements OnDestroy, OnInit {
@ViewChild('dropdown', { static: false }) dropdown: ElementRef;
<<<<<<<
this.page.on('loaded', () => this.ngZone.run(() => {
this.renderView = true;
this.cd.markForCheck();
}));
=======
>>>>>>>
<<<<<<<
openDropdown() {
let dropdown = <DropDown>this.dropdown.nativeElement;
dropdown.open();
}
=======
ngOnInit() {
this.page.on('loaded', () => { this.renderView = true; this.cd.markForCheck(); });
}
>>>>>>>
openDropdown() {
let dropdown = <DropDown>this.dropdown.nativeElement;
dropdown.open();
}
ngOnInit() {
this.page.on('loaded', () => { this.renderView = true; this.cd.markForCheck(); });
} |
<<<<<<<
import { Account, Game } from '../../projects/shared-library/src/lib/shared/model';
=======
import { AppSettings } from './app-settings.service';
import { Utils } from '../utils/utils';
>>>>>>>
import { Account, Game } from '../../projects/shared-library/src/lib/shared/model';
import { AppSettings } from './app-settings.service';
import { Utils } from '../utils/utils';
<<<<<<<
exports.getAccountById = async (id: string): Promise<any> => {
try {
return await accountFireStoreClient.doc(`/accounts/${id}`).get();
} catch (error) {
console.error(error);
return error;
}
=======
exports.getAccountById = async (id: string): Promise<any> => {
try {
return await accountFireStoreClient.doc(`/accounts/${id}`).get();
} catch (error) {
console.error(error);
return error;
}
>>>>>>>
exports.getAccountById = async (id: string): Promise<any> => {
try {
return await accountFireStoreClient.doc(`/accounts/${id}`).get();
} catch (error) {
console.error(error);
return error;
}
<<<<<<<
exports.getAccounts = async (): Promise<any> => {
try {
return await accountFireStoreClient.collection('accounts').get();
} catch (error) {
console.error(error);
return error;
}
};
/**
* calcualteAccountStat
* return account
*/
exports.calcualteAccountStat = (account: Account, game: Game, categoryIds: Array<number>, userId: string): Account => {
const score = game.stats[userId].score;
const avgAnsTime = game.stats[userId].avgAnsTime;
// console.log('categoryIds', categoryIds);
account = (account) ? account : new Account();
categoryIds.map((id) => {
account.leaderBoardStats = (account.leaderBoardStats) ? account.leaderBoardStats : {};
account.leaderBoardStats[id] = (account.leaderBoardStats && account.leaderBoardStats[id]) ?
account.leaderBoardStats[id] + score : score;
});
account['leaderBoardStats'] = { ...account.leaderBoardStats };
account.gamePlayed = (account.gamePlayed) ? account.gamePlayed + 1 : 1;
account.categories = Object.keys(account.leaderBoardStats).length;
if (game.winnerPlayerId) {
(game.winnerPlayerId === userId) ?
account.wins = (account.wins) ? account.wins + 1 : 1 :
account.losses = (account.losses) ? account.losses + 1 : 1;
}
account.badges = (account.badges) ? account.badges + score : score;
account.avgAnsTime = (account.avgAnsTime) ? Math.floor((account.avgAnsTime + avgAnsTime) / 2) : avgAnsTime;
return account;
=======
exports.getAccounts = async (): Promise<any> => {
try {
return await accountFireStoreClient.collection('accounts').get();
} catch (error) {
console.error(error);
return error;
}
};
/**
* updated account
* return ref
*/
exports.updateAccount = async (userId): Promise<any> => {
try {
const appSetting = await appSettings.getAppSettings();
if (appSetting.lives.enable) {
const maxLives = appSetting.lives.max_lives;
const livesMillis = appSetting.lives.lives_after_add_millisecond;
const accountRef = accountFireStoreClient.collection(`accounts`).doc(userId);
const docRef = await accountRef.get();
const timestamp = utils.getUTCTimeStamp();
if (docRef.exists) {
const lives = docRef.data();
if (lives.lives === maxLives || !lives.lastLiveUpdate) {
lives.lastLiveUpdate = timestamp;
lives.nextLiveUpdate = utils.addMinutes(timestamp, livesMillis);
}
if (lives.lives > 0) {
lives.lives += -1;
}
accountRef.update(lives);
}
}
} catch (error) {
console.error(error);
return error;
}
};
/**
* incrase number of lives set in appSettings
* return ref
*/
exports.increaseLives = async (userId): Promise<any> => {
try {
const appSetting = await appSettings.getAppSettings();
if (appSetting.lives.enable) {
const maxLives = appSetting.lives.max_lives;
const livesAdd = appSetting.lives.lives_add;
const livesMillis = appSetting.lives.lives_after_add_millisecond;
const accountRef = accountFireStoreClient.collection(`accounts`).doc(userId);
const docRef = await accountRef.get();
const timestamp = utils.getUTCTimeStamp();
if (docRef.exists) {
const lives = docRef.data();
if (lives.lives < maxLives && lives.nextLiveUpdate <= timestamp) {
lives.lives += livesAdd;
if (lives.lives > maxLives) {
lives.lives = maxLives;
} else {
lives.nextLiveUpdate = utils.addMinutes(timestamp, livesMillis);
}
lives.lastLiveUpdate = timestamp;
accountRef.update(lives);
}
} else {
accountRef.set({ lives: maxLives, id: userId });
}
}
} catch (error) {
console.error(error);
return error;
}
};
/**
* add default number of lives into account
* return ref
*/
exports.addDefaultLives = async (user: any): Promise<any> => {
try {
const appSetting = await appSettings.getAppSettings();
if (appSetting.lives.enable) {
const maxLives = appSetting.lives.max_lives;
const accountRef = accountFireStoreClient.collection(`accounts`).doc(user.id);
const docRef = await accountRef.get();
if (docRef.exists) {
const lives = docRef.data();
if (!lives.lives) {
lives.lives = maxLives;
lives.id = user.id;
accountRef.update(lives);
}
} else {
accountRef.set({ lives: maxLives, id: user.id });
}
}
} catch (error) {
console.error(error);
return error;
}
>>>>>>>
exports.getAccounts = async (): Promise<any> => {
try {
return await accountFireStoreClient.collection('accounts').get();
} catch (error) {
console.error(error);
return error;
}
};
/**
* calcualteAccountStat
* return account
*/
exports.calcualteAccountStat = (account: Account, game: Game, categoryIds: Array<number>, userId: string): Account => {
const score = game.stats[userId].score;
const avgAnsTime = game.stats[userId].avgAnsTime;
// console.log('categoryIds', categoryIds);
account = (account) ? account : new Account();
categoryIds.map((id) => {
account.leaderBoardStats = (account.leaderBoardStats) ? account.leaderBoardStats : {};
account.leaderBoardStats[id] = (account.leaderBoardStats && account.leaderBoardStats[id]) ?
account.leaderBoardStats[id] + score : score;
});
account['leaderBoardStats'] = { ...account.leaderBoardStats };
account.gamePlayed = (account.gamePlayed) ? account.gamePlayed + 1 : 1;
account.categories = Object.keys(account.leaderBoardStats).length;
if (game.winnerPlayerId) {
(game.winnerPlayerId === userId) ?
account.wins = (account.wins) ? account.wins + 1 : 1 :
account.losses = (account.losses) ? account.losses + 1 : 1;
}
account.badges = (account.badges) ? account.badges + score : score;
account.avgAnsTime = (account.avgAnsTime) ? Math.floor((account.avgAnsTime + avgAnsTime) / 2) : avgAnsTime;
return account;
};
/**
* updated account
* return ref
*/
exports.updateAccount = async (userId): Promise<any> => {
try {
const appSetting = await appSettings.getAppSettings();
if (appSetting.lives.enable) {
const maxLives = appSetting.lives.max_lives;
const livesMillis = appSetting.lives.lives_after_add_millisecond;
const accountRef = accountFireStoreClient.collection(`accounts`).doc(userId);
const docRef = await accountRef.get();
const timestamp = utils.getUTCTimeStamp();
if (docRef.exists) {
const lives = docRef.data();
if (lives.lives === maxLives || !lives.lastLiveUpdate) {
lives.lastLiveUpdate = timestamp;
lives.nextLiveUpdate = utils.addMinutes(timestamp, livesMillis);
}
if (lives.lives > 0) {
lives.lives += -1;
}
accountRef.update(lives);
}
}
} catch (error) {
console.error(error);
return error;
}
};
/**
* incrase number of lives set in appSettings
* return ref
*/
exports.increaseLives = async (userId): Promise<any> => {
try {
const appSetting = await appSettings.getAppSettings();
if (appSetting.lives.enable) {
const maxLives = appSetting.lives.max_lives;
const livesAdd = appSetting.lives.lives_add;
const livesMillis = appSetting.lives.lives_after_add_millisecond;
const accountRef = accountFireStoreClient.collection(`accounts`).doc(userId);
const docRef = await accountRef.get();
const timestamp = utils.getUTCTimeStamp();
if (docRef.exists) {
const lives = docRef.data();
if (lives.lives < maxLives && lives.nextLiveUpdate <= timestamp) {
lives.lives += livesAdd;
if (lives.lives > maxLives) {
lives.lives = maxLives;
} else {
lives.nextLiveUpdate = utils.addMinutes(timestamp, livesMillis);
}
lives.lastLiveUpdate = timestamp;
accountRef.update(lives);
}
} else {
accountRef.set({ lives: maxLives, id: userId });
}
}
} catch (error) {
console.error(error);
return error;
}
};
/**
* add default number of lives into account
* return ref
*/
exports.addDefaultLives = async (user: any): Promise<any> => {
try {
const appSetting = await appSettings.getAppSettings();
if (appSetting.lives.enable) {
const maxLives = appSetting.lives.max_lives;
const accountRef = accountFireStoreClient.collection(`accounts`).doc(user.id);
const docRef = await accountRef.get();
if (docRef.exists) {
const lives = docRef.data();
if (!lives.lives) {
lives.lives = maxLives;
lives.id = user.id;
accountRef.update(lives);
}
} else {
accountRef.set({ lives: maxLives, id: user.id });
}
}
} catch (error) {
console.error(error);
return error;
} |
<<<<<<<
import { Component, ChangeDetectorRef, ChangeDetectionStrategy } from '@angular/core';
import { Store } from '@ngrx/store';
import { Observable } from 'rxjs';
import { Category, User, LeaderBoardUser, LeaderBoardConstants } from './../../../../../../shared-library/src/lib/shared/model';
=======
import { Component, OnDestroy, AfterViewInit, ChangeDetectorRef, ChangeDetectionStrategy} from '@angular/core';
import { Store, select } from '@ngrx/store';
import { Observable, Subscription } from 'rxjs';
import { Category, User, LeaderBoardUser, LeaderBoardConstants } from 'shared-library/shared/model';
>>>>>>>
import { Component, ChangeDetectorRef, ChangeDetectionStrategy } from '@angular/core';
import { Category, User, LeaderBoardUser, LeaderBoardConstants } from './../../../../../../shared-library/src/lib/shared/model';
import { Store, select } from '@ngrx/store';
import { Observable, Subscription } from 'rxjs';
<<<<<<<
constructor(store: Store<AppState>,
userActions: UserActions,
utils: Utils,
route: ActivatedRoute,
cd: ChangeDetectorRef) {
super(store, userActions, utils, route, cd);
=======
constructor(private store: Store<AppState>,
private userActions: UserActions,
private utils: Utils,
public route: ActivatedRoute,
private cd: ChangeDetectorRef) {
this.route.params.subscribe((params) => {
this.category = params['category'];
});
// if (isPlatformBrowser(this.platformId)) {
this.store.dispatch(new leaderBoardActions.LoadLeaderBoard());
// }
this.maxLeaderBoardDisplay = 10;
this.userDict$ = this.store.select(appState.coreState).pipe(select(s => s.userDict));
this.subscriptions.push(this.userDict$.subscribe(userDict => {
this.userDict = userDict;
this.cd.markForCheck();
}));
this.categoryDict$ = this.store.select(categoryDictionary);
this.subscriptions.push(this.categoryDict$.subscribe(categoryDict => {
this.categoryDict = categoryDict;
this.cd.markForCheck();
}));
this.subscriptions.push(this.store.select(dashboardState).pipe(select(s => s.scoreBoard)).subscribe(lbsStat => {
if (lbsStat) {
this.leaderBoardStatDict = lbsStat;
this.leaderBoardCat = Object.keys(lbsStat);
// this.cd.detectChanges();
if (this.leaderBoardCat.length > 0) {
this.leaderBoardCat.map((cat) => {
this.leaderBoardStatDict[cat].map((user: LeaderBoardUser) => {
const userId = user.userId;
if (this.userDict && !this.userDict[userId]) {
this.store.dispatch(this.userActions.loadOtherUserProfile(userId));
}
});
});
if (this.lbsSliceStartIndex === -1) {
this.lbsSliceStartIndex = Math.floor((Math.random() * (this.leaderBoardCat.length - 3)) + 1);
this.lbsSliceLastIndex = this.lbsSliceStartIndex + 3;
this.lbsUsersSliceStartIndex = 0;
this.lbsUsersSliceLastIndex = 3;
}
}
}
this.cd.markForCheck();
}));
}
ngAfterViewInit(): void {
}
displayMore(): void {
this.lbsUsersSliceLastIndex = this.lbsUsersSliceLastIndex + 7;
this.cd.markForCheck();
}
getImageUrl(user: User) {
return this.utils.getImageUrl(user, 44, 40, '44X40');
}
ngOnDestroy() {
>>>>>>>
constructor(store: Store<AppState>,
userActions: UserActions,
utils: Utils,
route: ActivatedRoute,
cd: ChangeDetectorRef) {
super(store, userActions, utils, route, cd); |
<<<<<<<
import { User, GameOptions, Game, Question, PlayerQnA, GameOperations, GameStatus } from '../../model';
=======
import { User, GameOptions, Game, Question, PlayerQnA, GameOperations, QuestionStatus } from '../../model';
>>>>>>>
import { User, GameOptions, Game, Question, PlayerQnA, GameOperations, GameStatus } from '../../model';
<<<<<<<
getGameInvites(userId: String): Observable<Game[]> {
return this.db.collection('/games', ref => ref.where('GameStatus', '==', GameStatus.WAITING_FOR_FRIEND_INVITATION_ACCEPTANCE)
.where('playerId_1', '==', userId).where('gameOver', '==', false)
.orderBy('turnAt', 'desc'))
.valueChanges()
.map(gs => gs.map(g => Game.getViewModel(g))
.sort((a: any, b: any) => { return b.turnAt - a.turnAt; }));
}
=======
checkUserQuestion(playerQnA: PlayerQnA): Observable<any> {
return this.db.doc(`/questions/${playerQnA.questionId}`)
.snapshotChanges()
.take(1)
.map(qs => {
const question = Question.getViewModelFromDb(qs.payload.data());
if (playerQnA.playerAnswerId !== null) {
const answerObj = question.answers[playerQnA.playerAnswerId];
question.userGivenAnswer = answerObj.answerText;
} else {
question.userGivenAnswer = null;
}
return question;
})
}
getUsersAnsweredQuestion(userId: string, game: Game): Observable<Question[]> {
const observables = [];
game.playerQnAs.map(playerQnA => {
observables.push(this.checkUserQuestion(playerQnA));
});
return Observable.forkJoin(observables);
}
>>>>>>>
getGameInvites(userId: String): Observable<Game[]> {
return this.db.collection('/games', ref => ref.where('GameStatus', '==', GameStatus.WAITING_FOR_FRIEND_INVITATION_ACCEPTANCE)
.where('playerId_1', '==', userId).where('gameOver', '==', false)
.orderBy('turnAt', 'desc'))
.valueChanges()
.map(gs => gs.map(g => Game.getViewModel(g))
.sort((a: any, b: any) => { return b.turnAt - a.turnAt; }));
}
checkUserQuestion(playerQnA: PlayerQnA): Observable<any> {
return this.db.doc(`/questions/${playerQnA.questionId}`)
.snapshotChanges()
.take(1)
.map(qs => {
const question = Question.getViewModelFromDb(qs.payload.data());
if (playerQnA.playerAnswerId !== null) {
const answerObj = question.answers[playerQnA.playerAnswerId];
question.userGivenAnswer = answerObj.answerText;
} else {
question.userGivenAnswer = null;
}
return question;
})
}
getUsersAnsweredQuestion(userId: string, game: Game): Observable<Question[]> {
const observables = [];
game.playerQnAs.map(playerQnA => {
observables.push(this.checkUserQuestion(playerQnA));
});
return Observable.forkJoin(observables);
} |
<<<<<<<
import { User, Question, RouterStateUrl, Friends } from '../../../model';
import { UserActionTypes } from '../actions';
=======
import { User, Question, RouterStateUrl, Game } from '../../../model';
import { UserActions, UserActionTypes } from '../actions';
>>>>>>>
import { User, Question, RouterStateUrl, Friends, Game } from '../../../model';
import { UserActionTypes } from '../actions';
<<<<<<<
import { UserService, QuestionService } from '../../../core/services';
import { UserActions } from '../../../../app/core/store/actions';
=======
import { UserService, QuestionService, GameService } from '../../../core/services';
import { Observable } from 'rxjs/Observable';
>>>>>>>
import { UserService, QuestionService, GameService } from '../../../core/services';
import { UserActions } from '../../../../app/core/store/actions';
import { Observable } from 'rxjs/Observable';
<<<<<<<
// Save user profile
@Effect()
saveInvitation$ = this.actions$
.ofType(UserActionTypes.ADD_USER_INVITATION)
.pipe(
switchMap((action: userActions.AddUserInvitation) =>
this.userService.saveUserInvitations(action.payload).pipe(
map(() => new userActions.AddUserInvitationSuccess())
)
)
);
// Make friend
@Effect()
makeFriend$ = this.actions$
.ofType(UserActionTypes.MAKE_FRIEND)
.pipe(
switchMap((action: userActions.MakeFriend) =>
this.userService.checkInvitationToken(action.payload).pipe(
map((friend: string) => this.userAction.storeInvitationToken(''))
).map(() => new userActions.MakeFriendSuccess())
)
);
=======
//Get Game list
@Effect()
getGameResult$ = this.actions$
.ofType(UserActionTypes.GET_GAME_RESULT)
.pipe(
switchMap((action: userActions.GetGameResult) =>
this.gameService.getGameResult(action.payload.userId)
.map((games: Game[]) => new userActions.GetGameResultSuccess(games))
)
);
>>>>>>>
// Save user profile
@Effect()
saveInvitation$ = this.actions$
.ofType(UserActionTypes.ADD_USER_INVITATION)
.pipe(
switchMap((action: userActions.AddUserInvitation) =>
this.userService.saveUserInvitations(action.payload).pipe(
map(() => new userActions.AddUserInvitationSuccess())
)
)
);
// Make friend
@Effect()
makeFriend$ = this.actions$
.ofType(UserActionTypes.MAKE_FRIEND)
.pipe(
switchMap((action: userActions.MakeFriend) =>
this.userService.checkInvitationToken(action.payload).pipe(
map((friend: string) => this.userAction.storeInvitationToken(''))
).map(() => new userActions.MakeFriendSuccess())
));
// Get Game list
@Effect()
getGameResult$ = this.actions$
.ofType(UserActionTypes.GET_GAME_RESULT)
.pipe(
switchMap((action: userActions.GetGameResult) =>
this.gameService.getGameResult(action.payload.userId)
.map((games: Game[]) => new userActions.GetGameResultSuccess(games))
)
);
<<<<<<<
private questionService: QuestionService,
private userAction: UserActions
=======
private questionService: QuestionService,
private gameService: GameService
>>>>>>>
private questionService: QuestionService,
private userAction: UserActions,
private gameService: GameService |
<<<<<<<
private wordlist;
private suggestLanguageFound = false;
=======
public manualImportFormGroup: FormGroup;
>>>>>>>
public manualImportFormGroup: FormGroup;
private wordlist;
private suggestLanguageFound = false;
<<<<<<<
settingsDataProvider: SettingsDataProvider,
private inAppBrowser: InAppBrowser) {
super(navParams, navCtrl, userDataProvider, arkApiProvider, toastProvider, modalCtrl, networkProvider, settingsDataProvider);
=======
private inAppBrowser: InAppBrowser,
private formBuilder: FormBuilder,
private addressValidator: AddressValidator,
settingsDataProvider: SettingsDataProvider) {
super(navParams, navCtrl, userDataProvider, arkApiProvider, toastProvider, modalCtrl, networkProvider, settingsDataProvider);
>>>>>>>
private inAppBrowser: InAppBrowser,
private formBuilder: FormBuilder,
private addressValidator: AddressValidator,
settingsDataProvider: SettingsDataProvider) {
super(navParams, navCtrl, userDataProvider, arkApiProvider, toastProvider, modalCtrl, networkProvider, settingsDataProvider);
<<<<<<<
this.wordlist = bip39.wordlists.english;
if (this.wordlistLanguage && this.wordlistLanguage !== 'english') {
this.wordlist = bip39.wordlists[this.wordlistLanguage].concat(this.wordlist);
}
=======
this.initFormValidation();
>>>>>>>
this.wordlist = bip39.wordlists.english;
if (this.wordlistLanguage && this.wordlistLanguage !== 'english') {
this.wordlist = bip39.wordlists[this.wordlistLanguage].concat(this.wordlist);
}
this.initFormValidation();
<<<<<<<
=======
if (this.useAddress || this.nonBIP39Passphrase || !passphrase) { return; }
>>>>>>>
if (this.useAddress || this.nonBIP39Passphrase || !passphrase) { return; } |
<<<<<<<
import { AutoUnsubscribe } from 'ngx-auto-unsubscribe';
=======
import { ListViewEventData } from 'nativescript-ui-listview';
>>>>>>>
import { AutoUnsubscribe } from 'ngx-auto-unsubscribe';
import { ListViewEventData } from 'nativescript-ui-listview';
<<<<<<<
this.subscriptions.push(this.store.select(coreState).pipe(select(s => s.newGameId), filter(g => g !== '')).subscribe(gameObj => {
this.routerExtension.navigate(['/game-play', gameObj['gameId']]);
this.store.dispatch(new gamePlayActions.ResetCurrentQuestion());
this.cd.markForCheck();
=======
this.subs.push(this.store.select(coreState).pipe(select(s => s.newGameId), filter(g => g !== '')).subscribe(gameObj => {
if (gameObj && gameObj['gameId']) {
this.routerExtension.navigate(['/game-play', gameObj['gameId']], { clearHistory: true });
this.store.dispatch(new gamePlayActions.ResetCurrentQuestion());
}
>>>>>>>
this.subscriptions.push(this.store.select(coreState).pipe(select(s => s.newGameId), filter(g => g !== '')).subscribe(gameObj => {
if (gameObj && gameObj['gameId']) {
this.routerExtension.navigate(['/game-play', gameObj['gameId']], { clearHistory: true });
this.store.dispatch(new gamePlayActions.ResetCurrentQuestion());
this.cd.markForCheck();
}
<<<<<<<
this.cd.markForCheck();
return categories;
=======
>>>>>>>
this.cd.markForCheck();
return categories;
<<<<<<<
this.subscriptions.push(this.userDict$.subscribe(userDict => { this.userDict = userDict; this.cd.markForCheck(); }));
this.subscriptions.push(this.store.select(appState.coreState).pipe(select(s => s.applicationSettings)).subscribe(appSettings => {
=======
this.subs.push(this.userDict$.subscribe(userDict => this.userDict = userDict));
this.subs.push(this.store.select(appState.coreState).pipe(select(s => s.applicationSettings)).subscribe(appSettings => {
>>>>>>>
this.subscriptions.push(this.userDict$.subscribe(userDict => { this.userDict = userDict; this.cd.markForCheck(); }));
this.subscriptions.push(this.store.select(appState.coreState).pipe(select(s => s.applicationSettings)).subscribe(appSettings => {
<<<<<<<
=======
this.utils.unsubscribe(this.subs);
this.playerMode = undefined;
this.showSelectPlayer = undefined;
this.showSelectCategory = undefined;
this.showSelectTag = undefined;
this.dataItem = undefined;
this.categoriesObs = undefined;
this.categories = [];
this.subs = [];
this.customTag = undefined;
this.categoryIds = [];
this.tagItems = undefined;
this.filteredCategories = [];
this.destroy();
>>>>>>>
this.utils.unsubscribe(this.subscriptions);
this.playerMode = undefined;
this.showSelectPlayer = undefined;
this.showSelectCategory = undefined;
this.showSelectTag = undefined;
this.dataItem = undefined;
this.categoriesObs = undefined;
this.categories = [];
this.subscriptions = [];
this.customTag = undefined;
this.categoryIds = [];
this.tagItems = undefined;
this.filteredCategories = [];
this.destroy(); |
<<<<<<<
closeAllPopOver() {
this.questionsArray.map((res) => {
res.openReport = false;
});
}
handlePopOver(row) {
this.questionsArray.map((res) => {
if (res.id === row.id) {
res.openReport = !res.openReport;
} else {
res.openReport = false;
}
});
}
openDialog(question) {
this.handlePopOver(question);
const options = {
context: { 'question': question, 'user': this.user, 'game': this.game, 'userDict': this.userDict },
fullscreen: false,
viewContainerRef: this.vcRef
};
this.modal.showModal(ReportGameComponent, options);
=======
closeDialogReport(closePopUp) {
this.openReportDialog = this.page.actionBarHidden = closePopUp;
}
openDialogReport(question) {
this.reportQuestion = new Question();
this.reportQuestion = question;
this.openReportDialog = this.page.actionBarHidden = true;
>>>>>>>
closeAllPopOver() {
this.questionsArray.map((res) => {
res.openReport = false;
});
}
handlePopOver(row) {
this.questionsArray.map((res) => {
if (res.id === row.id) {
res.openReport = !res.openReport;
} else {
res.openReport = false;
}
});
}
closeDialogReport(closePopUp) {
this.openReportDialog = this.page.actionBarHidden = closePopUp;
}
openDialogReport(question) {
this.reportQuestion = new Question();
this.reportQuestion = question;
this.openReportDialog = this.page.actionBarHidden = true; |
<<<<<<<
import admin from '../db/firebase.client';
const accountFireStoreClient = admin.firestore();
=======
const accountFireBaseClient = require('../db/firebase-client');
const accountFireStoreClient = accountFireBaseClient.firestore();
import { Account, Game } from '../../projects/shared-library/src/lib/shared/model';
>>>>>>>
import admin from '../db/firebase.client';
const accountFireStoreClient = admin.firestore();
import { Account, Game } from '../../projects/shared-library/src/lib/shared/model'; |
<<<<<<<
constructor(private fb: FormBuilder, private store: Store<AppState>, private userAction: UserActions,
private utils: Utils) {
this.subscription.push(this.store.select(appState.coreState).pipe(select(s => s.user)).subscribe(user => {
=======
constructor(private fb: FormBuilder, private store: Store<AppState>, private userAction: UserActions, private cd: ChangeDetectorRef,
private utils: Utils) {
this.store.select(appState.coreState).pipe(select(s => s.user)).subscribe(user => {
>>>>>>>
constructor(private fb: FormBuilder, private store: Store<AppState>, private userAction: UserActions, private cd: ChangeDetectorRef,
private utils: Utils) {
this.subscription.push(this.store.select(appState.coreState).pipe(select(s => s.user)).subscribe(user => { |
<<<<<<<
private calculateItems() {
// sometimes in IE 11 this throw exception even it was run in runOutsideAngular function
if (!this.doNotCheckAngularZone) {
NgZone.assertNotInAngularZone();
}
=======
private calculateItems(forceViewportUpdate: boolean = false) {
NgZone.assertNotInAngularZone();
>>>>>>>
private calculateItems(forceViewportUpdate: boolean = false) {
if (!this.doNotCheckAngularZone) {
NgZone.assertNotInAngularZone();
} |
<<<<<<<
=======
>>>>>>> |
<<<<<<<
checkDisplayName: boolean;
=======
updateQuestionStatSuccess: any;
>>>>>>>
checkDisplayName: boolean;
updateQuestionStatSuccess: any;
<<<<<<<
getTopTags: topTags,
checkDisplayName: checkDisplayName
=======
getTopTags: topTags,
updateQuestionStatSuccess: updateQuestionStatSuccess
>>>>>>>
getTopTags: topTags,
checkDisplayName: checkDisplayName
updateQuestionStatSuccess: updateQuestionStatSuccess |
<<<<<<<
systemStatPromises.push(statQuestionService.getAllQuestions());
systemStatPromises.push(GameService.getLiveGames());
systemStatPromises.push(GameService.getCompletedGames());
=======
systemStatPromises.push(QuestionService.getAllQuestions());
systemStatPromises.push(statGameService.getLiveGames());
systemStatPromises.push(statGameService.getCompletedGames());
>>>>>>>
systemStatPromises.push(QuestionService.getAllQuestions());
systemStatPromises.push(GameService.getLiveGames());
systemStatPromises.push(GameService.getCompletedGames()); |
<<<<<<<
// Save user profile
@Effect()
addUser$ = this.actions$
.pipe(ofType(UserActionTypes.ADD_USER_PROFILE))
.pipe(
switchMap((action: userActions.AddUserProfile) => {
return this.userService.saveUserProfile(action.payload.user).pipe(
map((status: any) => new userActions.AddUserProfileSuccess())
)
})
);
=======
>>>>>>>
<<<<<<<
// Save user profile
@Effect()
saveInvitation$ = this.actions$
.pipe(ofType(UserActionTypes.ADD_USER_INVITATION))
.pipe(
switchMap((action: userActions.AddUserInvitation) =>
this.userService.saveUserInvitations(action.payload).pipe(
map((statusMessages: any) => new userActions.AddUserInvitationSuccess(statusMessages['messages']))
)
)
);
// Make friend
@Effect()
makeFriend$ = this.actions$
.pipe(ofType(UserActionTypes.MAKE_FRIEND))
.pipe(
switchMap((action: userActions.MakeFriend) =>
this.userService.checkInvitationToken(action.payload).pipe(
map((friend: any) => this.userAction.storeInvitationToken('NONE'))
).pipe(map(() => new userActions.MakeFriendSuccess()))
));
=======
>>>>>>>
<<<<<<<
// Load Friend Invitations
@Effect()
loadFriendInvitations$ = this.actions$
.pipe(ofType(ROUTER_NAVIGATION))
.pipe(
map((action: any): RouterStateUrl => action.payload.routerState),
filter((routerState: RouterStateUrl) =>
routerState.url.toLowerCase().startsWith('/dashboard')),
mergeMap((routerState: RouterStateUrl) =>
this.store.select(coreState).pipe(
map(s => s.user),
filter(u => !!u),
take(1),
map(user => user.email))
))
.pipe(
switchMap((email: string) => {
return this.userService.loadFriendInvitations(email).pipe(map((invitations: Invitation[]) =>
new userActions.LoadUserInvitationsSuccess(invitations)
));
})
);
// Update Invitation
@Effect()
UpdateInvitation$ = this.actions$
.pipe(ofType(UserActionTypes.UPDATE_INVITATION))
.pipe(
switchMap((action: userActions.UpdateInvitation) => {
this.userService.setInvitation(action.payload);
return empty();
}
)
);
=======
>>>>>>> |
<<<<<<<
import { Component, OnInit, Input, OnDestroy } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
=======
import { Component, OnInit, Input, ElementRef, QueryList, ViewChildren } from '@angular/core';
import { FormBuilder, FormGroup, Validators, FormArray, FormControl } from '@angular/forms';
>>>>>>>
import { Component, OnInit, Input, OnDestroy, ElementRef, QueryList, ViewChildren } from '@angular/core';
import { FormBuilder, FormGroup, Validators, FormArray, FormControl } from '@angular/forms';
<<<<<<<
sub: Subscription[] = [];
=======
@ViewChildren('textField') textField: QueryList<ElementRef>;
>>>>>>>
sub: Subscription[] = [];
@ViewChildren('textField') textField: QueryList<ElementRef>;
<<<<<<<
ngOnDestroy(): void {
this.utils.unsubscribe(this.sub);
}
=======
hideKeyboard() {
this.textField
.toArray()
.map((el) => {
if ( el.nativeElement && el.nativeElement.android ) {
el.nativeElement.android.clearFocus();
}
return el.nativeElement.dismissSoftInput(); });
}
>>>>>>>
ngOnDestroy(): void {
this.utils.unsubscribe(this.sub);
}
hideKeyboard() {
this.textField
.toArray()
.map((el) => {
if ( el.nativeElement && el.nativeElement.android ) {
el.nativeElement.android.clearFocus();
}
return el.nativeElement.dismissSoftInput(); });
} |
<<<<<<<
const generalQuestionService = require('../services/question.service');
=======
>>>>>>>
const generalQuestionService = require('../services/question.service');
<<<<<<<
/**
* changeQuestionCategoryIdType
* return status
*/
exports.changeQuestionCategoryIdType = (req, res) => {
const updatePromises = [];
generalQuestionService.getAllQuestions().then(questions => {
questions.docs.map(question => {
const questionObj: Question = question.data();
console.log('questionObj.categoryIds', questionObj.categoryIds);
const categoryId = questionObj.categoryIds[0];
const updatedCategory = [];
updatedCategory.push(Number(categoryId));
questionObj.categoryIds = updatedCategory;
console.log('updatedCategory', updatedCategory);
const dbQuestionObj = { ...questionObj };
updatePromises.push(generalQuestionService.updateQuestion('questions', dbQuestionObj));
});
Promise.all(updatePromises).then((updateResults) => {
res.send(updateResults);
})
.catch((e) => {
res.send(e);
});
});
};
=======
exports.removeSocialProfile = async (req, res) => {
res.status(200).send(await generalUserService.removeSocialProfile());
};
>>>>>>>
/**
* changeQuestionCategoryIdType
* return status
*/
exports.changeQuestionCategoryIdType = (req, res) => {
const updatePromises = [];
generalQuestionService.getAllQuestions().then(questions => {
questions.docs.map(question => {
const questionObj: Question = question.data();
console.log('questionObj.categoryIds', questionObj.categoryIds);
const categoryId = questionObj.categoryIds[0];
const updatedCategory = [];
updatedCategory.push(Number(categoryId));
questionObj.categoryIds = updatedCategory;
console.log('updatedCategory', updatedCategory);
const dbQuestionObj = { ...questionObj };
updatePromises.push(generalQuestionService.updateQuestion('questions', dbQuestionObj));
});
Promise.all(updatePromises).then((updateResults) => {
res.send(updateResults);
})
.catch((e) => {
res.send(e);
});
});
};
exports.removeSocialProfile = async (req, res) => {
res.status(200).send(await generalUserService.removeSocialProfile());
}; |
<<<<<<<
=======
actionText: string;
>>>>>>>
actionText: string;
<<<<<<<
this.cd.markForCheck();
=======
this.cd.markForCheck();
>>>>>>>
this.cd.markForCheck(); |
<<<<<<<
private static appSettings: AppSettings;
private static FS = GeneralConstants.FORWARD_SLASH;
private static QC = CollectionConstants.QUESTIONS;
=======
>>>>>>>
private static FS = GeneralConstants.FORWARD_SLASH;
private static QC = CollectionConstants.QUESTIONS; |
<<<<<<<
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { Store } from '@ngrx/store';
import { RouterExtensions } from 'nativescript-angular/router';
=======
import {
Component, OnInit, OnDestroy, ViewChild, ViewContainerRef, ChangeDetectionStrategy, ChangeDetectorRef, NgZone
} from '@angular/core';
import { Observable, Subscription } from 'rxjs';
import { Store, select } from '@ngrx/store';
import { GameActions, UserActions } from 'shared-library/core/store/actions';
import { AppState, appState } from '../../../store';
import { NewGame } from './new-game';
import { ObservableArray } from 'tns-core-modules/data/observable-array';
>>>>>>>
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { Store } from '@ngrx/store';
import { RouterExtensions } from 'nativescript-angular/router';
<<<<<<<
=======
import { Router, ActivatedRoute } from '@angular/router';
>>>>>>>
<<<<<<<
import { Utils, WindowRef } from 'shared-library/core/services';
import { GameActions, UserActions } from 'shared-library/core/store/actions';
import { Category, PlayerMode } from 'shared-library/shared/model';
import { ObservableArray } from 'tns-core-modules/data/observable-array';
import { Page } from 'tns-core-modules/ui/page/page';
import { AppState } from '../../../store';
import { NewGame } from './new-game';
=======
import { filter, take } from 'rxjs/operators';
import { Utils } from 'shared-library/core/services';
import { coreState } from 'shared-library/core/store';
import {
Category, GameConstant, GameMode, OpponentType, Parameter, PlayerMode,
FirebaseAnalyticsKeyConstants, FirebaseAnalyticsEventConstants, FirebaseScreenNameConstants
} from 'shared-library/shared/model';
import { Page } from 'tns-core-modules/ui/page/page';
import { RouterExtensions } from 'nativescript-angular/router';
import * as gamePlayActions from './../../store/actions';
>>>>>>>
import { Utils, WindowRef } from 'shared-library/core/services';
import { GameActions, UserActions } from 'shared-library/core/store/actions';
import { Category, PlayerMode } from 'shared-library/shared/model';
import { ObservableArray } from 'tns-core-modules/data/observable-array';
import { Page } from 'tns-core-modules/ui/page/page';
import { AppState } from '../../../store';
import { NewGame } from './new-game';
<<<<<<<
=======
}
}));
this.subscriptions.push(this.store.select(coreState).pipe(select(s => s.newGameId), filter(g => g !== '')).subscribe(gameObj => {
if (gameObj && gameObj['gameId']) {
this.routerExtension.navigate(['/game-play', gameObj['gameId']], { clearHistory: true });
this.store.dispatch(new gamePlayActions.ResetCurrentQuestion());
this.cd.markForCheck();
}
}));
this.categoriesObs.pipe(take(1)).subscribe(categories => {
categories.map(category => {
if (this.user.categoryIds && this.user.categoryIds.length > 0) {
category.isSelected = this.user.categoryIds.includes(category.id);
} else if (this.user.lastGamePlayOption && this.user.lastGamePlayOption.categoryIds.length > 0) {
category.isSelected = this.user.lastGamePlayOption.categoryIds.includes(category.id);
} else {
category.isSelected = true;
>>>>>>>
<<<<<<<
}
=======
}
>>>>>>>
} |
<<<<<<<
import { CONFIG } from '../../environments/environment';
import { User, Answer } from '../../shared/model';
=======
import { CONFIG } from '../../environments/environment'
import { User } from '../../shared/model'
import { isPlatformBrowser, isPlatformServer } from '@angular/common';
>>>>>>>
import { CONFIG } from '../../environments/environment';
import { User, Answer } from '../../shared/model';
import { isPlatformBrowser, isPlatformServer } from '@angular/common'; |
<<<<<<<
social_profile: SocialProfile;
=======
tokens: Tokens;
>>>>>>>
social_profile: SocialProfile;
tokens: Tokens;
<<<<<<<
}
export class SocialProfile {
display: String;
enable: Boolean;
position: Number;
social_name: String;
url: String;
=======
}
export class Tokens {
enable: boolean;
earn_bits: number;
earn_bytes: number;
>>>>>>>
}
export class SocialProfile {
display: String;
enable: Boolean;
position: Number;
social_name: String;
url: String;
}
export class Tokens {
enable: boolean;
earn_bits: number;
earn_bytes: number; |
<<<<<<<
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { select, Store } from '@ngrx/store';
import { RouterExtensions } from 'nativescript-angular/router';
=======
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { Store } from '@ngrx/store';
import { RouterExtensions } from 'nativescript-angular/router';
>>>>>>>
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { select, Store } from '@ngrx/store';
import { RouterExtensions } from 'nativescript-angular/router';
<<<<<<<
import { Observable } from 'rxjs';
import { filter, take } from 'rxjs/operators';
import { Utils, WindowRef } from 'shared-library/core/services';
import { coreState } from 'shared-library/core/store';
import { GameActions, UserActions } from 'shared-library/core/store/actions';
import { Category, PlayerMode } from 'shared-library/shared/model';
import { ObservableArray } from 'tns-core-modules/data/observable-array';
=======
import { Utils, WindowRef } from 'shared-library/core/services';
import { GameActions, UserActions } from 'shared-library/core/store/actions';
import { Category, PlayerMode } from 'shared-library/shared/model';
import { ObservableArray } from 'tns-core-modules/data/observable-array';
>>>>>>>
import { Utils, WindowRef } from 'shared-library/core/services';
import { GameActions, UserActions } from 'shared-library/core/store/actions';
import { Category, PlayerMode } from 'shared-library/shared/model';
import { ObservableArray } from 'tns-core-modules/data/observable-array';
<<<<<<<
import { AppState, appState } from '../../../store';
import * as gamePlayActions from './../../store/actions';
import { NewGame } from './new-game';
=======
import { AppState } from '../../../store';
import { NewGame } from './new-game';
>>>>>>>
import { AppState } from '../../../store';
import { NewGame } from './new-game';
<<<<<<<
dataItem;
categoriesObs: Observable<Category[]>;
=======
>>>>>>>
<<<<<<<
}
}));
this.subscriptions.push(this.store.select(coreState).pipe(select(s => s.newGameId), filter(g => g !== '')).subscribe(gameObj => {
if (gameObj && gameObj['gameId']) {
this.routerExtension.navigate(['/game-play', gameObj['gameId']], { clearHistory: true });
this.store.dispatch(new gamePlayActions.ResetCurrentQuestion());
this.cd.markForCheck();
}
}));
this.categoriesObs.pipe(take(1)).subscribe(categories => {
categories.map(category => {
if (this.user.categoryIds && this.user.categoryIds.length > 0) {
category.isSelected = this.user.categoryIds.includes(category.id);
} else if (this.user.lastGamePlayOption && this.user.lastGamePlayOption.categoryIds.length > 0) {
category.isSelected = this.user.lastGamePlayOption.categoryIds.includes(category.id);
} else {
category.isSelected = true;
=======
>>>>>>>
<<<<<<<
}
=======
}
>>>>>>>
} |
<<<<<<<
import { User, Question, RouterStateUrl, Friends } from '../../../model';
import { UserActionTypes } from '../actions';
=======
import { User, Question, RouterStateUrl, Game } from '../../../model';
import { UserActions, UserActionTypes } from '../actions';
>>>>>>>
import { User, Question, RouterStateUrl, Friends, Game } from '../../../model';
import { UserActionTypes } from '../actions';
<<<<<<<
import { UserService, QuestionService } from '../../../core/services';
import { UserActions } from '../../../../app/core/store/actions';
=======
import { UserService, QuestionService, GameService } from '../../../core/services';
import { Observable } from 'rxjs/Observable';
>>>>>>>
import { UserService, QuestionService, GameService } from '../../../core/services';
import { UserActions } from '../../../../app/core/store/actions';
import { Observable } from 'rxjs/Observable';
<<<<<<<
// Save user profile
@Effect()
saveInvitation$ = this.actions$
.ofType(UserActionTypes.ADD_USER_INVITATION)
.pipe(
switchMap((action: userActions.AddUserInvitation) =>
this.userService.saveUserInvitations(action.payload).pipe(
map(() => new userActions.AddUserInvitationSuccess())
)
)
);
// Make friend
@Effect()
makeFriend$ = this.actions$
.ofType(UserActionTypes.MAKE_FRIEND)
.pipe(
switchMap((action: userActions.MakeFriend) =>
this.userService.checkInvitationToken(action.payload).pipe(
map((friend: string) => this.userAction.storeInvitationToken(''))
).map(() => new userActions.MakeFriendSuccess())
)
);
=======
//Get Game list
@Effect()
getGameResult$ = this.actions$
.ofType(UserActionTypes.GET_GAME_RESULT)
.pipe(
switchMap((action: userActions.GetGameResult) =>
this.gameService.getGameResult(action.payload.userId)
.map((games: Game[]) => new userActions.GetGameResultSuccess(games))
)
);
>>>>>>>
// Save user profile
@Effect()
saveInvitation$ = this.actions$
.ofType(UserActionTypes.ADD_USER_INVITATION)
.pipe(
switchMap((action: userActions.AddUserInvitation) =>
this.userService.saveUserInvitations(action.payload).pipe(
map(() => new userActions.AddUserInvitationSuccess())
)
)
);
// Make friend
@Effect()
makeFriend$ = this.actions$
.ofType(UserActionTypes.MAKE_FRIEND)
.pipe(
switchMap((action: userActions.MakeFriend) =>
this.userService.checkInvitationToken(action.payload).pipe(
map((friend: string) => this.userAction.storeInvitationToken(''))
).map(() => new userActions.MakeFriendSuccess())
));
// Get Game list
@Effect()
getGameResult$ = this.actions$
.ofType(UserActionTypes.GET_GAME_RESULT)
.pipe(
switchMap((action: userActions.GetGameResult) =>
this.gameService.getGameResult(action.payload.userId)
.map((games: Game[]) => new userActions.GetGameResultSuccess(games))
)
);
<<<<<<<
private questionService: QuestionService,
private userAction: UserActions
=======
private questionService: QuestionService,
private gameService: GameService
>>>>>>>
private questionService: QuestionService,
private userAction: UserActions,
private gameService: GameService |
<<<<<<<
import { Account } from './account';
import { UserAnsweredQuestions } from './user-answered-questions';
=======
import { Countries } from './counties';
>>>>>>>
import { Account } from './account';
import { UserAnsweredQuestions } from './user-answered-questions';
import { Countries } from './counties';
<<<<<<<
bulkUploads: BulkUploads,
account: Account,
userAnsweredQuestions: UserAnsweredQuestions
=======
bulkUploads: BulkUploads,
countries: Countries
>>>>>>>
bulkUploads: BulkUploads,
account: Account,
userAnsweredQuestions: UserAnsweredQuestions,
countries: Countries |
<<<<<<<
getUsers = async (authUsers: User[], pageToken?: string): Promise<User[]> => {
try {
const listUsersResult = await firebaseAuthService.getAuthUsers(pageToken);
for (const afUser of listUsersResult.users) {
=======
async getUsers(authUsers: User[], pageToken?: string): Promise<User[]> {
const listUsersResult = await FirebaseAuthService.getAuthUsers(pageToken);
listUsersResult.users.map((afUser) => {
>>>>>>>
async getUsers (authUsers: User[], pageToken?: string): Promise<User[]> {
try {
const listUsersResult = await FirebaseAuthService.getAuthUsers(pageToken);
for (const afUser of listUsersResult.users) {
<<<<<<<
} catch (error) {
console.error(error);
throw error;
}
=======
>>>>>>>
} catch (error) {
console.error(error);
throw error;
} |
<<<<<<<
import * as html2canvas from 'html2canvas';
=======
import { ReportGameComponent } from '../report-game/report-game.component';
import { MatDialog, MatDialogRef } from '@angular/material';
import { Utils } from '../../../core/services';
>>>>>>>
import * as html2canvas from 'html2canvas';
import { ReportGameComponent } from '../report-game/report-game.component';
import { MatDialog, MatDialogRef } from '@angular/material';
import { Utils } from '../../../core/services'; |
<<<<<<<
this.subscription.push(this.store.select(gamePlayState).pipe(select(s => s.saveReportQuestion)).subscribe(state => { }));
this.subscription.push(this.store.select(coreState).pipe(select(s => s.userProfileSaveStatus)).subscribe((status: string) => {
=======
this.subs.push(this.store.select(gamePlayState).pipe(select(s => s.saveReportQuestion)).subscribe(state => {
this.cd.markForCheck();
}));
this.subs.push(this.store.select(coreState).pipe(select(s => s.userProfileSaveStatus)).subscribe((status: string) => {
>>>>>>>
this.subscription.push(this.store.select(gamePlayState).pipe(select(s => s.saveReportQuestion)).subscribe(state => {
this.cd.markForCheck();
}));
this.subscription.push(this.store.select(coreState).pipe(select(s => s.userProfileSaveStatus)).subscribe((status: string) => { |
<<<<<<<
ActionBarComponent, DrawerComponent, CountryListComponent, QuestionsTableComponent, QuestionCardComponent, FirstQuestionComponent
=======
ActionBarComponent, DrawerComponent, CountryListComponent, QuestionsTableComponent,
SelectCategoryTagComponent
>>>>>>>
ActionBarComponent, DrawerComponent, CountryListComponent, QuestionsTableComponent, QuestionCardComponent, FirstQuestionComponent, SelectCategoryTagComponent
<<<<<<<
RenderAnswerComponent,
RenderQuestionComponent,
CountryListComponent,
QuestionCardComponent,
FirstQuestionComponent,
SafeHtmlPipe
=======
UserReactionComponent,
SelectCategoryTagComponent
>>>>>>>
QuestionCardComponent,
FirstQuestionComponent,
UserReactionComponent,
SelectCategoryTagComponent
<<<<<<<
QuestionCardComponent,
FirstQuestionComponent,
=======
UserReactionComponent,
SelectCategoryTagComponent,
>>>>>>>
QuestionCardComponent,
FirstQuestionComponent,
UserReactionComponent,
SelectCategoryTagComponent, |
<<<<<<<
import { Component, OnInit, OnDestroy, ViewContainerRef, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core';
import { Utils, WindowRef } from 'shared-library/core/services';
import { AppState, appState } from '../../../store';
import { UserActions } from 'shared-library/core/store/actions';
import { Store, select } from '@ngrx/store';
import { gamePlayState } from '../../store';
import { GameOver } from './game-over';
=======
import { Component, OnDestroy, OnInit, ViewContainerRef } from '@angular/core';
import { select, Store } from '@ngrx/store';
>>>>>>>
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnDestroy, OnInit, ViewContainerRef } from '@angular/core';
import { select, Store } from '@ngrx/store';
<<<<<<<
import { AutoUnsubscribe } from 'ngx-auto-unsubscribe';
import { Subscription } from 'rxjs';
=======
import { Utils, WindowRef } from 'shared-library/core/services';
import { coreState } from 'shared-library/core/store';
import { UserActions } from 'shared-library/core/store/actions';
import { Image } from "tns-core-modules/ui/image";
import { AppState, appState } from '../../../store';
import { gamePlayState } from '../../store';
import { ReportGameComponent } from './../report-game/report-game.component';
import { GameOver } from './game-over';
>>>>>>>
import { AutoUnsubscribe } from 'ngx-auto-unsubscribe';
import { Utils, WindowRef } from 'shared-library/core/services';
import { coreState } from 'shared-library/core/store';
import { UserActions } from 'shared-library/core/store/actions';
import { AppState, appState } from '../../../store';
import { gamePlayState } from '../../store';
import { GameOver } from './game-over';
import { ReportGameComponent } from './../report-game/report-game.component';
import { Image } from "tns-core-modules/ui/image";
<<<<<<<
private modal: ModalDialogService, private vcRef: ViewContainerRef,
public cd: ChangeDetectorRef) {
super(store, userActions, utils, cd);
=======
private modal: ModalDialogService, private vcRef: ViewContainerRef,
private routerExtensions: RouterExtensions) {
super(store, userActions, utils);
>>>>>>>
private modal: ModalDialogService, private vcRef: ViewContainerRef,
public cd: ChangeDetectorRef, private routerExtensions: RouterExtensions) {
super(store, userActions, utils, cd);
<<<<<<<
=======
this.utils.unsubscribe(this.subs);
this.destroy();
>>>>>>>
this.utils.unsubscribe(this.subscriptions);
this.destroy(); |
<<<<<<<
=======
>>>>>>>
<<<<<<<
}
=======
}
>>>>>>>
} |
<<<<<<<
private storage: AngularFireStorage,
private store: Store<AppStore>,
private questionActions: QuestionActions,
private http: HttpClient) {
=======
private store: Store<AppState>,
private questionActions: QuestionActions,
private http: HttpClient) {
>>>>>>>
private storage: AngularFireStorage,
private store: Store<AppState>,
private questionActions: QuestionActions,
private http: HttpClient) {
<<<<<<<
saveBulkQuestions(bulkUpload: BulkUpload) {
const dbQuestions: Array<any> = [];
const bulkUploadFileInfo = bulkUpload.bulkUploadFileInfo;
const questions = bulkUpload.questions;
const bulkUploadId = this.db.createId();
// store file in file storage
// Not written any code monitor progress or error
this.storage.upload(`bulk_upload/${bulkUploadFileInfo.created_uid}/${bulkUploadId}-${bulkUpload.file.name}`, bulkUpload.file);
for (const question of questions) {
if (question !== null) {
question.bulkUploadId = bulkUploadId;
const dbQuestion = Object.assign({}, question); // object to be saved
dbQuestion.id = this.db.createId();
// Do we really need to copy answer object as well?
dbQuestion.answers = dbQuestion.answers.map((obj) => { return Object.assign({}, obj) });
dbQuestions.push(dbQuestion);
}
}
this.addBulkUpload(bulkUploadFileInfo, dbQuestions, bulkUploadId);
}
addBulkUpload(bulkUploadFileInfo: BulkUploadFileInfo, questions: Array<Question>, id: string) {
// save question
const dbFile = Object.assign({}, bulkUploadFileInfo);
dbFile.id = id;
dbFile.rejected = 0;
dbFile.approved = 0;
dbFile.status = 'Under Review';
this.db.doc('/bulk_uploads/' + dbFile['id']).set(dbFile).then(ref => {
this.storeQuestion(0, questions);
=======
//TODO: why is dispatch here. should be from effect, right??
//Use the set method of the doc instead of the add method on the collection, so the id field of the data matches the id of the document
this.db.doc('/unpublished_questions/' + questionId).set(dbQuestion).then(ref => {
this.store.dispatch(this.questionActions.addQuestionSuccess());
>>>>>>>
saveBulkQuestions(bulkUpload: BulkUpload) {
const dbQuestions: Array<any> = [];
const bulkUploadFileInfo = bulkUpload.bulkUploadFileInfo;
const questions = bulkUpload.questions;
const bulkUploadId = this.db.createId();
// store file in file storage
// Not written any code monitor progress or error
this.storage.upload(`bulk_upload/${bulkUploadFileInfo.created_uid}/${bulkUploadId}-${bulkUpload.file.name}`, bulkUpload.file);
for (const question of questions) {
if (question !== null) {
question.bulkUploadId = bulkUploadId;
const dbQuestion = Object.assign({}, question); // object to be saved
dbQuestion.id = this.db.createId();
// Do we really need to copy answer object as well?
dbQuestion.answers = dbQuestion.answers.map((obj) => { return Object.assign({}, obj) });
dbQuestions.push(dbQuestion);
}
}
this.addBulkUpload(bulkUploadFileInfo, dbQuestions, bulkUploadId);
}
addBulkUpload(bulkUploadFileInfo: BulkUploadFileInfo, questions: Array<Question>, id: string) {
// save question
const dbFile = Object.assign({}, bulkUploadFileInfo);
dbFile.id = id;
dbFile.rejected = 0;
dbFile.approved = 0;
dbFile.status = 'Under Review';
this.db.doc('/bulk_uploads/' + dbFile['id']).set(dbFile).then(ref => {
this.storeQuestion(0, questions); |
<<<<<<<
app.engine('html', ngExpressEngine({
bootstrap: AppServerModuleNgFactory,
providers: [
provideModuleMap(LAZY_MODULE_MAP)
]
}));
app.set('view engine', 'html');
app.set('views', join(DIST_FOLDER, 'browser'));
// Server static files from /browser
app.get('*.*', express.static(join(DIST_FOLDER, 'browser')));
// All regular routes use the Universal engine
app.get('*', (req, res) => {
res.render('index', { req });
});
=======
app.use((req, res, next) => {
if (req.url.indexOf(`/${API_PREFIX}/`) === 0) {
req.url = req.url.substring(API_PREFIX.length + 1);
}
next();
});
// Routes
app.use(require('./routes/routes'))
>>>>>>>
app.engine('html', ngExpressEngine({
bootstrap: AppServerModuleNgFactory,
providers: [
provideModuleMap(LAZY_MODULE_MAP)
]
}));
app.set('view engine', 'html');
app.set('views', join(DIST_FOLDER, 'browser'));
// Server static files from /browser
app.get('*.*', express.static(join(DIST_FOLDER, 'browser')));
// All regular routes use the Universal engine
app.get('*', (req, res) => {
res.render('index', { req });
});
app.use((req, res, next) => {
if (req.url.indexOf(`/${API_PREFIX}/`) === 0) {
req.url = req.url.substring(API_PREFIX.length + 1);
}
next();
});
// Routes
app.use(require('./routes/routes')) |
<<<<<<<
import { FirstQuestionComponent } from 'shared-library/shared/mobile/component/first-question/first-question.component';
=======
import { SelectCategoryTagComponent } from 'shared-library/shared/mobile/component/select-category-tag/select-category-tag.component'
>>>>>>>
import { FirstQuestionComponent } from 'shared-library/shared/mobile/component/first-question/first-question.component';
import { SelectCategoryTagComponent } from 'shared-library/shared/mobile/component/select-category-tag/select-category-tag.component'
<<<<<<<
},
{
path: 'first-question',
component: FirstQuestionComponent,
// canActivate: [AuthGuard]
},
=======
}, {
path: 'select-category-tag',
component: SelectCategoryTagComponent,
}
>>>>>>>
},
{
path: 'first-question',
component: FirstQuestionComponent,
canActivate: [AuthGuard]
}, {
path: 'select-category-tag',
component: SelectCategoryTagComponent,
canActivate: [AuthGuard]
} |
<<<<<<<
super(store, userActions, utils);
this.subscription.push(this.store.select(gamePlayState).pipe(select(s => s.saveReportQuestion)).subscribe(state => {
=======
super(store, userActions, utils, cd);
this.subs.push(this.store.select(gamePlayState).pipe(select(s => s.saveReportQuestion)).subscribe(state => {
>>>>>>>
super(store, userActions, utils, cd);
this.subscription.push(this.store.select(gamePlayState).pipe(select(s => s.saveReportQuestion)).subscribe(state => { |
<<<<<<<
Subquery(_) : None()
=======
IfElse(exp1, exp2, exp3): ty2
where exp1 : ty1
and exp2 : ty2
and exp3 : ty3
and (ty1 == BooleanTy() or ty1 == UnknownTy()) else error $[Boolean expected here] on exp1
and not (ty2 == VertexTy() or ty2 == EdgeTy()) else error $[CASE does not allow vertex or edge output] on exp2
and not (ty3 == VertexTy() or ty3 == EdgeTy()) else error $[CASE does not allow vertex or edge output] on exp3
Null(): UnknownTy()
Subquery(_) : UnknownTy()
>>>>>>>
Subquery(_) : None()
IfElse(exp1, exp2, exp3): ty2
where exp1 : ty1
and exp2 : ty2
and exp3 : ty3
and (ty1 == BooleanTy() or ty1 == UnknownTy()) else error $[Boolean expected here] on exp1
and not (ty2 == VertexTy() or ty2 == EdgeTy()) else error $[CASE does not allow vertex or edge output] on exp2
and not (ty3 == VertexTy() or ty3 == EdgeTy()) else error $[CASE does not allow vertex or edge output] on exp3
Null(): UnknownTy() |
<<<<<<<
StatsModule,
BrowserModule.withServerTransition({ appId: 'trivia' })
=======
StatsModule,
ServiceWorkerModule.register('/ngsw-worker.js', { enabled: environment.production })
>>>>>>>
StatsModule,
BrowserModule.withServerTransition({ appId: 'trivia' })
ServiceWorkerModule.register('/ngsw-worker.js', { enabled: environment.production }) |
<<<<<<<
=======
import { MatSnackBar } from '@angular/material';
import * as firebase from 'firebase';
>>>>>>>
<<<<<<<
=======
profileImage: String;
data: any;
>>>>>>>
<<<<<<<
@ViewChild('cropper') cropper: ImageCropperComponent;
=======
file: File;
croppedFileBlobObject: Blob;
@ViewChild('cropper', undefined) cropper: ImageCropperComponent;
getImageUrl = false;
basePath = '/profile_picture';
croppedPicPath = 'croppedPic';
originalPicPath = 'originalPic';
>>>>>>>
@ViewChild('cropper') cropper: ImageCropperComponent;
<<<<<<<
private userActions: UserActions,
private snackBar: MatSnackBar) {
this.subs.push(this.store.take(1).subscribe(s => this.user = s.user));
=======
public snackBar: MatSnackBar,
private userActions: UserActions) {
>>>>>>>
private userActions: UserActions,
private snackBar: MatSnackBar) {
this.subs.push(this.store.take(1).subscribe(s => this.user = s.user));
<<<<<<<
private setCropperSettings() {
=======
this.userObs = this.store.select(s => s.userInfosById);
// For cropping image
>>>>>>>
private setCropperSettings() {
<<<<<<<
type: this.profileImageFile.type
=======
type: this.file.type
>>>>>>>
type: this.profileImageFile.type
<<<<<<<
getUserFromFormValue(formValue: any): void {
this.user.name = formValue.name;
this.user.displayName = formValue.displayName;
this.user.location = formValue.location;
this.user.categoryIds = [];
for (const obj of formValue.categoryList) {
if (obj['isSelected']) {
this.user.categoryIds.push(obj['category']);
=======
// user profile validation
onFileChange(event) {
const fileList: FileList = event.target.files;
if (fileList.length === 0) {
this.imageValidation = 'Please select Logo';
} else {
const file: File = fileList[0];
const fname = file.name;
const fsize = file.size;
const ftype = file.type;
if (fsize > 2097152) {
this.imageValidation = 'Your uploaded logo is not larger than 2 MB.';
} else {
if (ftype === 'image/jpeg' || ftype === 'image/jpg' || ftype === 'image/png' || ftype === 'image/gif') {
this.imageValidation = undefined;
} else {
this.imageValidation = 'Only PNG, GIF, JPG and JPEG Type Allow.';
}
>>>>>>>
getUserFromFormValue(formValue: any): void {
this.user.name = formValue.name;
this.user.displayName = formValue.displayName;
this.user.location = formValue.location;
this.user.categoryIds = [];
for (const obj of formValue.categoryList) {
if (obj['isSelected']) {
this.user.categoryIds.push(obj['category']);
<<<<<<<
this.store.dispatch(this.userActions.addUserProfile(user));
=======
this.store.dispatch(this.userActions.addUserProfileData(user));
this.snackBar.open('Profile Updated Successfuly', '', { duration: 3000 });
}
// Helper functions
getUserFromFormValue(formValue: any): void {
this.user.name = formValue.name;
this.user.displayName = formValue.displayName;
this.user.location = formValue.location;
this.user.categoryIds = (this.user.categoryIds) ? this.user.categoryIds : [];
for (const obj of formValue.categoryList) {
if (obj['isSelected']) {
this.user.categoryIds.push(obj['category']);
}
}
this.user.facebookUrl = formValue.facebookUrl;
this.user.linkedInUrl = formValue.linkedInUrl;
this.user.twitterUrl = formValue.twitterUrl;
this.user.profileSetting = formValue.profileSetting;
this.user.profileLocationSetting = formValue.profileLocationSetting;
this.user.privateProfileSetting = formValue.privateProfileSetting;
this.user.profilePicture = formValue.profilePicture ? formValue.profilePicture : '';
>>>>>>>
this.store.dispatch(this.userActions.addUserProfile(user)); |
<<<<<<<
=======
const userService = require('../services/user.service');
>>>>>>>
const userService = require('../services/user.service');
<<<<<<<
=======
// Add lastGamePlayOption when new game create
private updateUser(userId: string, gameOptions: any): Promise<string> {
return userService.getUserById(userId).then((user) => {
const dbUser = user.data();
dbUser.lastGamePlayOption = gameOptions;
return userService.setUser(dbUser).then(ref => dbUser.userId);
});
}
>>>>>>>
// Add lastGamePlayOption when new game create
private updateUser(userId: string, gameOptions: any): Promise<string> {
return userService.getUserById(userId).then((user) => {
const dbUser = user.data();
dbUser.lastGamePlayOption = gameOptions;
return userService.setUser(dbUser).then(ref => dbUser.userId);
});
} |
<<<<<<<
import { RecentGameCardComponent, RecentGamesComponent, PrivacyPolicyComponent, AchievementsComponent } from './components';
=======
import { RecentGameCardComponent, RecentGamesComponent, PrivacyPolicyComponent } from './components';
import { UserFeedbackComponent } from './components/index.tns';
>>>>>>>
import { RecentGameCardComponent, RecentGamesComponent, PrivacyPolicyComponent, AchievementsComponent } from './components';
import { UserFeedbackComponent } from './components/index.tns';
<<<<<<<
PrivacyPolicyComponent,
AchievementsComponent
=======
PrivacyPolicyComponent,
UserFeedbackComponent
>>>>>>>
PrivacyPolicyComponent,
AchievementsComponent,
UserFeedbackComponent |
<<<<<<<
import { Component, OnInit, OnDestroy, ViewContainerRef, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core';
import { Utils, WindowRef } from 'shared-library/core/services';
import { AppState, appState } from '../../../store';
import { UserActions } from 'shared-library/core/store/actions';
import { Store, select } from '@ngrx/store';
import { gamePlayState } from '../../store';
import { GameOver } from './game-over';
=======
import { Component, OnDestroy, OnInit, ViewContainerRef } from '@angular/core';
import { select, Store } from '@ngrx/store';
>>>>>>>
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnDestroy, OnInit, ViewContainerRef } from '@angular/core';
import { select, Store } from '@ngrx/store';
<<<<<<<
import { AutoUnsubscribe } from 'ngx-auto-unsubscribe';
import { Subscription } from 'rxjs';
=======
import { Utils, WindowRef } from 'shared-library/core/services';
import { coreState } from 'shared-library/core/store';
import { UserActions } from 'shared-library/core/store/actions';
import { Image } from "tns-core-modules/ui/image";
import { AppState, appState } from '../../../store';
import { gamePlayState } from '../../store';
import { ReportGameComponent } from './../report-game/report-game.component';
import { GameOver } from './game-over';
>>>>>>>
import { AutoUnsubscribe } from 'ngx-auto-unsubscribe';
import { Utils, WindowRef } from 'shared-library/core/services';
import { coreState } from 'shared-library/core/store';
import { UserActions } from 'shared-library/core/store/actions';
import { AppState, appState } from '../../../store';
import { gamePlayState } from '../../store';
import { GameOver } from './game-over';
import { ReportGameComponent } from './../report-game/report-game.component';
import { Image } from "tns-core-modules/ui/image";
<<<<<<<
private modal: ModalDialogService, private vcRef: ViewContainerRef,
public cd: ChangeDetectorRef) {
super(store, userActions, utils, cd);
=======
private modal: ModalDialogService, private vcRef: ViewContainerRef,
private routerExtensions: RouterExtensions) {
super(store, userActions, utils);
>>>>>>>
private modal: ModalDialogService, private vcRef: ViewContainerRef,
public cd: ChangeDetectorRef, private routerExtensions: RouterExtensions) {
super(store, userActions, utils, cd);
<<<<<<<
=======
this.utils.unsubscribe(this.subs);
this.destroy();
>>>>>>>
this.utils.unsubscribe(this.subscriptions);
this.destroy(); |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.