Commit 1287f33a authored by prumde's avatar prumde

Added a New Actions


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@174214 ce508802-f39f-4f6c-b175-0d175dae99d5
parent b9fc61b1
...@@ -5,6 +5,11 @@ import { ItemActions } from './item'; ...@@ -5,6 +5,11 @@ import { ItemActions } from './item';
import { WishListActions } from './wishlist'; import { WishListActions } from './wishlist';
import { LocationActions } from './location'; import { LocationActions } from './location';
import { MenuActions } from './menu'; import { MenuActions } from './menu';
import { ProfileActions } from './profile-info';
import { AdressAction } from './manage-adress';
import { ReviewAction } from './my-review';
import { SavedCardAction } from './saved-card';
//import { ChangePasswordAction } from './change-password';
export { export {
CartActions, CartActions,
...@@ -13,7 +18,12 @@ export { ...@@ -13,7 +18,12 @@ export {
ItemActions, ItemActions,
LocationActions, LocationActions,
WishListActions, WishListActions,
MenuActions MenuActions,
ProfileActions,
AdressAction,
ReviewAction,
SavedCardAction
}; };
export default [ export default [
...@@ -23,5 +33,9 @@ export default [ ...@@ -23,5 +33,9 @@ export default [
ItemActions, ItemActions,
LocationActions, LocationActions,
WishListActions, WishListActions,
MenuActions MenuActions,
ProfileActions,
AdressAction,
ReviewAction,
SavedCardAction
]; ];
\ No newline at end of file
import {Injectable} from '@angular/core';
import {Action} from '@ngrx/store';
import {Address} from '../../user-address/address-manager/address.model';
export class AdressAction {
static LOAD_ADDRESS = '[Address] Load Address';
loadAddress(): Action {
return {
type: AdressAction.LOAD_ADDRESS
};
}
static LOAD_ADDRESS_SUCCESS = '[Address] Load Address Success';
loadAddressSuccess(userAddresses): Action {
console.log('[Address] Load Address Success',userAddresses.length);
if(!userAddresses.length)
{
userAddresses = [];
}
return {
type: AdressAction.LOAD_ADDRESS_SUCCESS,
payload: userAddresses
};
}
static ADD_NEW_ADDRESS = '[Address] Add new Address';
addNewAdddress(userAddress): Action {
return {
type: AdressAction.ADD_NEW_ADDRESS,
payload: userAddress
};
}
static ADD_NEW_ADDRESS_SUCCESS = '[Address] Add new Address Success';
addNewAddressSuccess(userAddress): Action {
return {
type: AdressAction.ADD_NEW_ADDRESS_SUCCESS,
payload: userAddress
};
}
static UPDATE_ADDRESS = '[Address] Update Address';
updateAddress(userAddress): Action {
return {
type: AdressAction.UPDATE_ADDRESS,
payload: userAddress
};
}
static UPDATE_ADDRESS_SUCCESS = '[Address] Update Address Success';
updateAddressSuccess(userAddress): Action {
return {
type: AdressAction.UPDATE_ADDRESS_SUCCESS,
payload: userAddress
};
}
static DELETE_ADDRESS = '[Address] Delete Address';
deleteAddress(userAddress): Action {
return {
type: AdressAction.DELETE_ADDRESS,
payload: userAddress
};
}
static DELETE_ADDRESS_SUCCESS = '[Address] Delete AddressSuccess';
deleteAddressSuccess(userAddress): Action {
return {
type: AdressAction.DELETE_ADDRESS_SUCCESS,
payload: userAddress
};
}
}
import {Injectable} from '@angular/core';
import {Action} from '@ngrx/store';
import {Review} from '../../user-review/review-manager/review.model';
export class ReviewAction {
static LOAD_REVIEWS = '[Reviews] Load Reviews';
loadReviews(): Action {
return {
type: ReviewAction.LOAD_REVIEWS
};
}
static LOAD_REVIEWS_SUCCESS = '[Reviews] Load Reviews Success';
loadReviewsSuccess(userReview): Action {
// if(!cartItems.length)
// {
// cartItems = [];
// }
return {
type: ReviewAction.LOAD_REVIEWS_SUCCESS,
payload: userReview
};
}
static UPDATE_REVIEWS = '[Reviews] Update Reviews';
updateReviews(userReview): Action {
return {
type: ReviewAction.UPDATE_REVIEWS,
payload: userReview
};
}
static UPDATE_REVIEWS_SUCCESS = '[Reviews] Update Reviews Success';
updateReviewsSuccess(userReview): Action {
return {
type: ReviewAction.UPDATE_REVIEWS_SUCCESS,
payload: userReview
};
}
static DELETE_REVIEWS = '[Reviews] Delete Reviews';
deleteReviews(userReview): Action {
return {
type: ReviewAction.DELETE_REVIEWS,
payload: userReview
};
}
static DELETE_REVIEWS_SUCCESS = '[Reviews] Delete ReviewsSuccess';
deleteReviewsSuccess(userReview): Action {
return {
type: ReviewAction.DELETE_REVIEWS_SUCCESS,
payload: userReview
};
}
static RESET_REVIEWS = '[Reviews] Reset Reviews';
resetReviews(): Action {
return {
type: ReviewAction.RESET_REVIEWS
};
}
}
import {Injectable} from '@angular/core';
import {Action} from '@ngrx/store';
import {Profile} from '../../user-profile/profile-manager/profile.model';
@Injectable()
export class ProfileActions {
static LOAD_USER_INFO = '[userInfo] Load Profile';
loadProfile(): Action {
console.log('Prajyot Initiate...');
return {
type: ProfileActions.LOAD_USER_INFO
};
}
static LOAD_USER_INFO_SUCCESS = '[userInfo] Load Profile Success';
loadProfileSuccess(user): Action {
console.log('Prajyot Success...', user);
return {
type: ProfileActions.LOAD_USER_INFO_SUCCESS,
payload: user
};
}
static UPDATE_USER_INFO = '[userInfo] Update userInfo';
updateUserInfo(user): Action {
return {
type: ProfileActions.UPDATE_USER_INFO,
payload: user
};
}
static UPDATE_USER_INFO_SUCCESS = '[userInfo] Update userInfo Success';
updateUserInfoSuccess(user): Action {
return {
type: ProfileActions.UPDATE_USER_INFO_SUCCESS,
payload: user
};
}
}
import {Injectable} from '@angular/core';
import {Action} from '@ngrx/store';
import {Card} from '../../user-card/card-manager/card.model';
export class SavedCardAction {
static LOAD_SAVED_CARDS = '[Cards] Load Saved Cards';
loadSavedCards(): Action {
return {
type: SavedCardAction.LOAD_SAVED_CARDS
};
}
static LOAD_SAVED_CARDS_SUCCESS = '[Cards] Load Saved Cards Success';
loadSavedCardsSuccess(userCard): Action {
// if(!cartItems.length)
// {
// cartItems = [];
// }
return {
type: SavedCardAction.LOAD_SAVED_CARDS_SUCCESS,
payload: userCard
};
}
static ADD_NEW_CARD = '[Cards] Add new Card';
addNewCard(userCard): Action {
return {
type: SavedCardAction.ADD_NEW_CARD,
payload: userCard
};
}
static ADD_NEW_CARD_SUCCESS = '[Cards] Add new Card Success';
addNewCardSuccess(userCard): Action {
return {
type: SavedCardAction.ADD_NEW_CARD_SUCCESS,
payload: userCard
};
}
static RESET_CARD = '[Cards] Reset Cards';
resetCard(): Action {
return {
type: SavedCardAction.RESET_CARD
};
}
static DELETE_CARD = '[Cards] Delete Cards';
deleteCard(userAddress): Action {
return {
type: SavedCardAction.DELETE_CARD,
payload: userAddress
};
}
static DELETE_CARD_SUCCESS = '[Cards] Delete Cards Success';
deleteCardSuccess(userAddress): Action {
return {
type: SavedCardAction.DELETE_CARD_SUCCESS,
payload: userAddress
};
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment