Skip to content

Commit

Permalink
Merge pull request #325 from avored/dev
Browse files Browse the repository at this point in the history
merging dev to master
  • Loading branch information
indpurvesh authored Mar 8, 2019
2 parents fce1942 + 1c4a844 commit fbd68df
Show file tree
Hide file tree
Showing 65 changed files with 189,390 additions and 716 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ APP_LOG_LEVEL=debug
APP_URL=http://localhost

DB_CONNECTION=mysql
DB_TABLE_PREFIX=avored_
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=homestead
Expand Down
68 changes: 68 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
## How to contribute to Avored
- [Bug Reporting](#bug-reporting)
- [Did you fix a bug?](#Did-you-fix-a-bug)
- [Did you create a new feature or enhancement?](#did-you-create-a-new-feature-or-enhancement)
- [Issue and Pull Request Labels](#Issue-and-Pull-Request-Labels)
- [Types of Issue Labels](#Types-of-Issue-Labels)
- [Types of Pull Request Labels](#Types-of-Pull-Request-Labels)

#### **Bug Reporting**
* **Ensure the bug was not already reported** by searching on GitHub under [Issues.](https://github.com/avored/laravel-ecommerce/issues)
* If you're unable to find an open issue that relates to your problem, [open a new one.](https://github.com/avored/laravel-ecommerce/issues/new) Please be sure to follow the issue template as much as possible.
* **Ensure that the bug you are reporting is a Avored issue** and not specific to your individual setup. For these types of issues please use the [Community Forum.](https://www.avored.com/discussion)

#### **Did you fix a bug?**

* To provide a code contribution for an issue you will need to set up your own fork of the Avored repository, make your code changes, commit the changes and make a Pull Request to the dev branch on the Avored repository.
* Separate each fix into a new branch in your repository and name it with the issue ID e.g. bugfix_3062 or issue-1234.
* When committing to your individual bugfix branch, please try and use the following as your commit message
```Fixed #1234 - <the subject of the issue>```. By using this format we can easily include all bug fixes within major and minor release notes in our [Changelog](https://github.com/avored/laravel-ecommerce/blob/master/CHANGELOG.md).
* If you are new to writing commit messages in git, follow the guide [here.](http://chris.beams.io/posts/git-commit/#seven-rules)
* After you have made your commits and pushed them up to your forked repository you then create a [Pull Request](https://help.github.com/articles/about-pull-requests/) to be reviewed and merged into the Avored repository. Make a new Pull Request for each issue you fix. **do not combine multiple bugfixes into one Pull Request**.
* Ensure that you send your Pull Request to the dev.


#### **Did you create a new feature or enhancement?**

* Changes that can be considered a new feature or enhancement should be made to the dev branch.
* To contribute a feature you must create a fork of Avored and set up your git and development environment.
Once done, create a new branch from **dev** and name it relevant to the feature's purpose.
Make sure your commit messages are relevant and descriptive. When ready to submit for review, make a Pull Request detailing your feature's functionality.
Ensure that your Pull Requests base fork is **avored/laravel-ecommerce**, the base branch is **dev**, the head fork is your repository, and the base branch is your feature branch.
* Add any new PHPUnit tests to the new feature branch if required.

## Issue and Pull Request Labels

* This section lists the labels we use to help us track and manage issues and pull requests across the repositories.
* If an issue should be raised as a higher priority for a next release make a comment to that affect.

#### Types of Issue Labels

| Label name | Description |
| -------------------------| --------------------------------------------------------------------------- |
| backend | Issues relating to avored/framework. |
| bug | Confirmed or very likely to be a bug. |
| duplicate | Issues which are duplicates of other issues. |
| frontend | Issues relating to the frontend |
| Fix Proposed | Issues with a related pull request. |
| High Priority | A high impact. |
| invalid | Issues that are invalid or non-reproducible. |
| Language | Issues relating to language files. |
| Low Priority | Low impact. |
| Medium Priority | Medium impact. |
| Pending Input | Pending input from issue raiser. |
| Suggestion | Suggestions |
| Question | General questions (Should usually be posted to the community forum instead). |
| Resolved: Next Release | Solved issues that will be closed after the next release. |

#### Types of Pull Request Labels

| Label name | Description |
| ---------------------- | ------------------------------------------------------------------ |
| Community Contribution | Pull requests that have been created by a member of the community. |
| duplicate | Duplicate of other pull requests. |
| Enhancement | Pull requests that add additional features or functionality. |
| In Review | Currently in-review and requires additional work from creator. |
| Needs Tests | Pull requests that require unit tests before they can be merged. |
| Ready to Merge | Pull requests that have both been assessed and code reviewed. |
| Wrong Branch | Pull requests that have been created to the wrong branch. |
26 changes: 26 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!--- Provide a general summary of your changes in the Title above -->

## Description
<!--- Describe your changes in detail -->
<!--- If fixing a bug, there should be an issue describing it with steps to reproduce -->
<!--- Please link to the issue here unless your commit contains the issue number -->

## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->

## How To Test This
<!--- Please describe in detail how to test your changes. -->

## Types of changes
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->

- [ ] Bug fix (non-breaking change which fixes an issue).
- [ ] Breaking change (fix or feature that would cause existing functionality to change).
- [ ] New feature (non-breaking change which adds functionality).

### Final checklist
<!--- Go over all the following points and check all the boxes that apply. --->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! --->

- [ ] My change requires a change to the documentation.
- [ ] I have read the contribute guideline.
8 changes: 7 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ cache:
php:
- '7.2'
script:
- vendor/bin/phpunit -c phpunit.xml
- cp .env.example .env
- php artisan key:generate
- php artisan migrate
- vendor/bin/phpunit --coverage-clover=coverage.xml

install: composer install --no-interaction

after_success:
- bash <(curl -s https://codecov.io/bash)
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Changelog
All notable changes to this project will be documented in this file.

## 2.9.9
- Updated composer to use the framework branch instead version tag.
- Moved the translations from `/themes/vendor/name/lang` to `resources/lang`.


## 2.9.6
- Menu Group Feature
- Keep Pick from store as default shipping method
Expand Down
58 changes: 0 additions & 58 deletions CONTRIBUTING.md

This file was deleted.

5 changes: 0 additions & 5 deletions app/Http/Controllers/Auth/ForgotPasswordController.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,4 @@ public function __construct()
parent::__construct();
$this->middleware('guest');
}

protected function guard()
{
return Auth::guard('web');
}
}
1 change: 0 additions & 1 deletion app/Http/Controllers/Auth/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ public function providerLogin($provider)
$clientId = $rep->getValueByKey('users_' . $provider . '_client_id');
$clientSecret = $rep->getValueByKey('users_' . $provider . '_client_secret');

//dd($clientId, $clientSecret);
Config::set('services.' . $provider, [
'client_id' => $clientId,
'client_secret' => $clientSecret,
Expand Down
2 changes: 0 additions & 2 deletions app/Http/Controllers/CartController.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ public function __construct(ProductInterface $repository, ConfigurationInterface
}

/**
*
* Add To Cart Product
*
* @param Request $request
* @return \Illuminate\Http\RedirectResponse
*/
Expand Down
3 changes: 1 addition & 2 deletions app/Http/Controllers/CategoryViewController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class CategoryViewController extends Controller
public function __construct(CategoryInterface $repository)
{
parent::__construct();

$this->repository = $repository;
}

Expand All @@ -40,6 +39,6 @@ public function view(Request $request, $slug)
return view('category.view')
->with('category', $category)
->with('params', $request->all())
->with('products', $products);
->with('products', $products ?? []);
}
}
10 changes: 9 additions & 1 deletion app/Http/Controllers/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,22 @@
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\View;
use Illuminate\Support\Facades\DB;

class Controller extends BaseController
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;

public function __construct()
{
if (Schema::hasTable('configurations')) {
$dbConnectError = false;
try {
DB::connection()->getPdo();
} catch (\Exception $e) {
$dbConnectError = true;
}

if (false === $dbConnectError && Schema::hasTable('configurations')) {
$themeViewPath = Configuration::getConfiguration('active_theme_path');
$fileViewFinder = View::getFinder();
$fileViewFinder->prependLocation(base_path($themeViewPath));
Expand Down
10 changes: 4 additions & 6 deletions app/Http/Controllers/OrderController.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function myAccountOrderList()
{
$user = Auth::guard()->user();
$orders = Order::whereUserId($user->id)->get();
$view = view('order.my-account-order-list')->with('orders', $orders);
$view = view('order.list')->with('orders', $orders);

return $view;
}
Expand All @@ -123,8 +123,7 @@ public function myAccountOrderList()
*/
public function myAccountOrderView(Order $order)
{
return view('order.my-account-order-view')
->withOrder($order);
return view('order.view')->withOrder($order);
}

/**
Expand All @@ -134,8 +133,7 @@ public function myAccountOrderView(Order $order)
*/
public function return(Order $order)
{
return view('my-account.order.return')
->withOrder($order);
return view('order.return')->withOrder($order);
}

/**
Expand All @@ -158,7 +156,7 @@ public function returnPost(Order $order, OrderReturnRequest $request)
$returnRequest->products()->create($product);
}

return redirect()->back()->withNotificationText('Order Return Request placed successfully!');
return redirect()->back()->withNotificationText(__('return.success'));
}

private function getUser(Request $request)
Expand Down
43 changes: 38 additions & 5 deletions app/Http/Controllers/User/MyAccountController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,40 @@
use AvoRed\Framework\Models\Contracts\OrderReturnRequestInterface;
use AvoRed\Framework\Models\Contracts\OrderReturnProductInterface;
use AvoRed\Framework\Models\Contracts\ProductInterface;

use App\Http\Controllers\Controller;
use Carbon\Carbon;

class MyAccountController extends Controller
{
public function home()
/**
*
* @var \AvoRed\Framework\Models\Repository\ConfigurationRepository
*/
protected $configurationRepository;


public function __construct(ConfigurationInterface $configurationRepository)
{
$user = Auth::user();
$orders = Order::all();
parent::__construct();
$this->configurationRepository = $configurationRepository;
}

public function home()
{
$user = Auth::guard()->user();
$orders = Order::whereUserId($user->id)->get();

return view('user.my-account.home', ['user' => $user, 'orders' => $orders]);
}

public function edit()
{
$user = Auth::user();
$deleteRequestDays = $this->configurationRepository->getValueByKey('user_delete_request_days');

return view('user.my-account.edit')->with('user', $user);
return view('user.my-account.edit')
->withUser($user)
->withDeleteRequestDays($deleteRequestDays);
}

/**
Expand Down Expand Up @@ -99,4 +115,21 @@ public function changePasswordPost(ChangePasswordRequest $request)
return redirect()->back()->withErrors(['current_password' => 'Your Current Password Wrong!']);
}
}

/**
* Destroy the User Account as Soft Delete
* @return \Illuminate\Http\RedirectResponse
*/
public function destroy()
{
$days = $this->configurationRepository->getValueByKey('user_delete_request_days') ?? 60;
$dueData = Carbon::now()->addDay($days);
$user = Auth::user();
$user->delete_due_date = $dueData;
$user->status = 'DELETE_IN_PROGRESS';
$user->update();

$user->delete();
return redirect()->route('my-account.home');
}
}
8 changes: 6 additions & 2 deletions avored.admin.webpack.mix.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ let mix = require('laravel-mix');
mix.config.fileLoaderDirs.fonts = 'vendor/avored-admin/fonts';
mix.config.fileLoaderDirs.images = 'vendor/avored-admin/images';

mix.js('vendor/avored/framework/resources/js/app.js', 'public/vendor/avored-admin/js')
mix
//.js('vendor/avored/framework/resources/js/app.js', 'public/vendor/avored-admin/js')
.sass('vendor/avored/framework/resources/sass/app.scss', 'public/vendor/avored-admin/css')
// .copyDirectory('vendor/avored/framework/resources/assets/static/images','public/vendor/avored-admin/images');
.js('vendor/avored/framework/resources/js/vue.js', 'public/vendor/avored-admin/js/vue.js')
.sass('vendor/avored/framework/resources/sass/vue.scss', 'public/vendor/avored-admin/css/vue.css')
// .copyDirectory('vendor/avored/framework/resources/assets/static/images','public/vendor/avored-admin/images')
;
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"require" : {
"php": ">=7.1.3",
"andreasindal/laravel-markdown": "^3.0",
"avored/framework": "~2.8",
"avored/framework": "~2.9",
"avored/module-installer": "1.*",
"fabpot/goutte": "^3.2",
"fideloper/proxy": "~4.0",
Expand Down
Loading

0 comments on commit fbd68df

Please sign in to comment.