Skip to content

Commit

Permalink
Just some changes...
Browse files Browse the repository at this point in the history
  • Loading branch information
EugeunieOrz committed Feb 28, 2019
1 parent ae61120 commit 5a09ea1
Show file tree
Hide file tree
Showing 85 changed files with 921 additions and 927 deletions.
Binary file removed Screenshot (13).png
Binary file not shown.
Binary file removed Screenshot (15).png
Binary file not shown.
Binary file removed Screenshot (16).png
Binary file not shown.
Binary file removed Screenshot (17).png
Binary file not shown.
Binary file removed Screenshot (18).png
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ class PasswordController @Inject() (
)),
email => {
val loginInfo = LoginInfo(CredentialsProvider.ID, email)
val result = Ok(ApiResponse("auth.password.recover.successful", Messages("auth.reset.email.sent"), email))
val result = Ok(
ApiResponse(
"auth.password.recover.successful",
Messages("auth.reset.email.sent"), Json.toJson(email)))
userService.retrieve(loginInfo).flatMap {
case Some(user) =>
val c = configuration.underlying
Expand Down
12 changes: 7 additions & 5 deletions app-core/src/main/scala/core/models/Item.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@ import reactivemongo.bson.BSONObjectID
case class Item(
id: BSONObjectID,
name: String,
description: Option[String],
details: Option[Seq[String]],
composition: Option[Seq[String]],
color: Option[String],
description: String,
details: Seq[String],
composition: Seq[String],
color: String,
size: Seq[Size],
inventory: Double,
price: Double,
currency: String
currency: String,
nameOfImg: Int,
stateOfProduct: String
)

case class Size(
Expand Down
4 changes: 3 additions & 1 deletion app-shopping/src/main/resources/shopping.routes
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Routes
# This file defines all module routes (Higher priority routes first)
# ~~~~
GET /products shopping.controllers.ShoppingController.get
GET / shopping.controllers.ShoppingController.get
POST /product/:productID shopping.controllers.ShoppingController.passProductID(productID: reactivemongo.bson.BSONObjectID)
GET /product/selected shopping.controllers.ProductController.get
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package shopping.controllers

import core.controllers.ApiController
import core.models.{ Item, Size }
import core.utils.DefaultEnv
import core.utils.json.APIFormats._
import shopping.models.services.ProductService

import javax.inject.Inject

import org.joda.time.DateTime

import play.api.i18n.{ Messages, MessagesProvider }
import play.api.libs.json._
import play.api.mvc._

import reactivemongo.bson.BSONObjectID

import scala.concurrent.duration._
import scala.concurrent.{ ExecutionContext, Future }

/**
* The `Shopping` controller.
*
* @param controllerComponents The Play controller components.
* @param productService The products service.
* @param ex The execution context.
*/
class ProductController @Inject() (
val controllerComponents: ControllerComponents,
val productService: ProductService
)(
implicit
ex: ExecutionContext
) extends ApiController {

/**
* Gets a selected product from the Kafka topic.
*
* @return The products.
*/
def get: Action[AnyContent] = Action.async { implicit request =>

Future.successful(Ok(ApiResponse("shopping.products", Messages("request.ok"))))
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,8 @@ class ShoppingController @Inject() (
Ok(ApiResponse("shopping.products", Messages("request.ok"), Json.toJson(products)))
}
}

def passProductID(productID: reactivemongo.bson.BSONObjectID): Action[AnyContent] = Action.async { implicit request =>
Future.successful(Ok(ApiResponse("shopping.products", Messages("request.ok"))))
}
}
25 changes: 9 additions & 16 deletions app-ui/package-lock.json

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

2 changes: 1 addition & 1 deletion app-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
"fetch-mock": "^6.5.0",
"flow-bin": "^0.76.0",
"flow-typed": "^2.5.1",
"immutability-helper": "^3.0.0",
"karma": "^2.0.4",
"karma-sourcemap-loader": "^0.3.7",
"lingui-cli": "^1.4.2",
Expand All @@ -94,7 +95,6 @@
"postcss-loader": "^2.1.5",
"react-infinite-scroll-component": "^4.5.0",
"react-masonry-component": "^6.2.1",
"react-photo-gallery": "^6.3.1",
"react-test-renderer": "^16.4.1",
"redbox-react": "^1.6.0",
"redux-batched-actions": "^0.4.0",
Expand Down
2 changes: 1 addition & 1 deletion app-ui/src/apis/ProductsAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default class ProductsAPI extends API {
* @returns An object indicating if the process was successful or not.
*/
async get(): Promise<APIResponse> {
const response = await this.request('api/shopping/products');
const response = await this.request('api/shopping');

return response.json();
}
Expand Down
2 changes: 0 additions & 2 deletions app-ui/src/bundles/Admin/sagas/RemoveAddressSaga.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ import config from 'config/index';
export function* removeAddressSaga(api: AdminAPI): Generator<*, *, *> {
while (true) {
const { payload: { userID, indexToRemoveAddress } } = yield take(removeAddress().type);
console.log("userID: ", userID);
console.log("index: ", indexToRemoveAddress);
try {
const response = yield call([api, api.removeAddress], userID, indexToRemoveAddress);
yield put(fetchUserFulfilled(response.details));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const ChangedPasswordComponent = ({
<Row className="changedpasswd-title">{i18n.t`Congratulations!`}</Row>
<Row className="changedpasswd-txt"><Trans>You've successfully changed your password</Trans></Row>
<Row className="home-link">
<Link to={config.route.auth.passwordSurvey}>
<Link to={config.route.index}>
<Trans>Continue to V.O. Fashion Boutique</Trans>
</Link>
</Row>
Expand Down
24 changes: 12 additions & 12 deletions app-ui/src/bundles/Auth/components/Layout/Layout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@ export default () => (
<CoreLayout>
<div className="authentication-container">
<Switch>
<Redirect exact from={config.route.auth.index} to={config.route.auth.signIn} />
<Route exact path={config.route.auth.signIn} component={SignInContainer} />
<Route exact path={config.route.auth.signUp} component={SignUpContainer} />
<Route exact path={config.route.auth.passwordRecovery} component={RecoverPasswordContainer} />
<Route exact path={config.route.auth.emailSent} component={RecoverPasswordEmailSentContainer} />
<Route exact path={`${config.route.auth.passwordRecovery}/:token`} component={ResetPasswordContainer} />
<Route exact path={config.route.auth.signOut} component={SignOutContainer} />
<Route exact path={config.route.auth.alreadyInUse} component={AlreadyRegisteredContainer} />
<Route exact path={config.route.auth.passwordSurvey} component={PasswordSurveyContainer} />
<Route exact path={config.route.auth.changedPassword} component={ChangedPassword} />
<Route exact path={config.route.auth.errorPage} component={ErrorPage} />
<NotFoundRoute />
<Redirect exact from={config.route.auth.index} to={config.route.auth.signIn} />
<Route exact path={config.route.auth.signIn} component={SignInContainer} />
<Route exact path={config.route.auth.signUp} component={SignUpContainer} />
<Route exact path={config.route.auth.passwordRecovery} component={RecoverPasswordContainer} />
<Route exact path={config.route.auth.emailSent} component={RecoverPasswordEmailSentContainer} />
<Route exact path={`${config.route.auth.passwordRecovery}/:token`} component={ResetPasswordContainer} />
<Route exact path={config.route.auth.signOut} component={SignOutContainer} />
<Route exact path={config.route.auth.alreadyInUse} component={AlreadyRegisteredContainer} />
<Route exact path={config.route.auth.passwordSurvey} component={PasswordSurveyContainer} />
<Route exact path={config.route.auth.changedPassword} component={ChangedPassword} />
<Route exact path={config.route.auth.errorPage} component={ErrorPage} />
<NotFoundRoute />
</Switch>
</div>
</CoreLayout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@ export const PasswordSurveyComponent = ({
onChange={(v) => onToggleBtn(v.target.value)}
/><label>Another reason</label>
<Button id="submit-btn" onClick={() => onSubmit({
userID : userID.replace("BSONObjectID(\"", "").replace("\")", ""), psInfo : passwordSurvey
})}
block>
userID : userID.replace("BSONObjectID(\"", "").replace("\")", ""), psInfo : passwordSurvey
})}>
<Trans>SUBMIT</Trans>
</Button>
</Grid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
width:220px!important;
margin-left:80px;
margin-top: 44px;
background-color:transparent;
background-color:#fff;
border:.15em solid #000!important;
color:#000!important;
padding:10px 44px;
Expand All @@ -49,5 +49,5 @@
#submit-btn:hover {
background-color:#eb3346!important;
color:silver!important;
cursor:url(/static/close-30.png),auto!important
cursor:url(/static/calla-30x39.png),auto!important
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
width:260px!important;
margin-top:18px;
color:#000;
background-color:transparent;
background-color:#fff;
padding:10px 44px;
text-align:center;
text-decoration:none;
Expand All @@ -53,7 +53,7 @@
}
.recover-password button {
width:200px!important;
background-color:transparent;
background-color:#fff;
border:.12em solid #000!important;
color:#000!important;
padding:10px 44px;
Expand All @@ -77,4 +77,4 @@
.recover-password {
margin-left: 570px
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,30 @@ type Props = {
export const RecoverPasswordEmailSentComponent = ({
i18n, email,
}: Props) => (
<Grid className="email-sent">
<Row id="email-sent-header">{i18n.t`Check your email`}</Row>
<Row id="email-sent-txt1">
<Trans>We've sent an email to {email}. Click the link in the email to reset your password.</Trans>
</Row>
<Row id="email-sent-txt2">
<Trans>If you don't see the email, check other places it might be, like your junk, spam, social, or other folders.</Trans>
</Row>
<Row id="did-not-receive-the-email-link">
<Link to={config.route.auth.passwordRecovery}>
<Trans>I didn't receive the email</Trans>
</Link>
</Row>
</Grid>
<div className="recover-password-email-sent-container">
{ Object.entries(email).length === 0 && email.constructor === Object ?
<div className="not-found-container">
<p className="code">404</p>
<p className="page-not-found"><Trans>The Page you are looking for could not be found!</Trans></p>
<p className="back-to-home-link"><Link to={config.route.home.index}><Trans>Back to Home</Trans></Link></p>
</div>
:
<Grid className="email-sent">
<Row id="email-sent-header">{i18n.t`Check your email`}</Row>
<Row id="email-sent-txt1">
<Trans>We've sent an email to {email}. Click the link in the email to reset your password.</Trans>
</Row>
<Row id="email-sent-txt2">
<Trans>If you don't see the email, check other places it might be, like your junk, spam, social, or other folders.</Trans>
</Row>
<Row id="did-not-receive-the-email-link">
<Link to={config.route.auth.passwordRecovery}>
<Trans>I didn't receive the email</Trans>
</Link>
</Row>
</Grid>
}
</div>
);

export default withI18n()(RecoverPasswordEmailSentComponent);
Loading

0 comments on commit 5a09ea1

Please sign in to comment.