mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-16 19:16:49 +00:00
Compare commits
439 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
49f78f3706 | ||
|
|
9563dd6c51 | ||
|
|
aa36986d66 | ||
|
|
9843e0e450 | ||
|
|
53978de632 | ||
|
|
d9f5f7995d | ||
|
|
f201b9fd11 | ||
|
|
d53b2b94b9 | ||
|
|
4452ad2c51 | ||
|
|
6594419b22 | ||
|
|
dd2e77a244 | ||
|
|
be561d1032 | ||
|
|
24fc941b4c | ||
|
|
21054c1a8a | ||
|
|
0778c5f550 | ||
|
|
1d04510365 | ||
|
|
6c7a089527 | ||
|
|
eaca953106 | ||
|
|
cc5125f49e | ||
|
|
3f2b3b88eb | ||
|
|
7101bacc8c | ||
|
|
d76b274d25 | ||
|
|
8d7f39941a | ||
|
|
95839f88f2 | ||
|
|
728eee6d3f | ||
|
|
7089bd597e | ||
|
|
2aade10aaf | ||
|
|
4057df5b93 | ||
|
|
8270a3f386 | ||
|
|
a2aa5f2607 | ||
|
|
30a9e80024 | ||
|
|
612001fc3f | ||
|
|
2a93968370 | ||
|
|
b0a4fcdc26 | ||
|
|
326b0af35f | ||
|
|
91eaa522cf | ||
|
|
2a57dc9766 | ||
|
|
f37b681fac | ||
|
|
f4466b1aad | ||
|
|
33feb7f63f | ||
|
|
02e3184945 | ||
|
|
04778c6fa8 | ||
|
|
8861b6d077 | ||
|
|
52b1f40acb | ||
|
|
8ace56956b | ||
|
|
7718f7c0fc | ||
|
|
b74c368de2 | ||
|
|
e0a20bf8af | ||
|
|
17afdb5912 | ||
|
|
d55a43d4b1 | ||
|
|
bf3da0531e | ||
|
|
3a365b6dc6 | ||
|
|
ee7dc821ca | ||
|
|
07018370e0 | ||
|
|
bba665e2e1 | ||
|
|
5e69320ff5 | ||
|
|
d0242d28d2 | ||
|
|
9dbdcc9181 | ||
|
|
7819495d57 | ||
|
|
8723520848 | ||
|
|
b76d9045ce | ||
|
|
b42d6cf2ac | ||
|
|
f78e72af0d | ||
|
|
5e021b76b5 | ||
|
|
d03a5458ff | ||
|
|
3aef0b4029 | ||
|
|
cd5a83e814 | ||
|
|
a943d2fee6 | ||
|
|
b016ebd5b4 | ||
|
|
314459df92 | ||
|
|
eb0051c033 | ||
|
|
ca9a7d255e | ||
|
|
7cb74f2452 | ||
|
|
8f42c6fbed | ||
|
|
bb233c5656 | ||
|
|
be021f4697 | ||
|
|
f47d86c15b | ||
|
|
ae391f8af4 | ||
|
|
f28c52342c | ||
|
|
d3f1d4a5f9 | ||
|
|
cedfa35a98 | ||
|
|
c11b7ed268 | ||
|
|
b992daa1d8 | ||
|
|
10aa534f52 | ||
|
|
de990b906d | ||
|
|
41ef2a4ea5 | ||
|
|
077479346e | ||
|
|
19c33e4050 | ||
|
|
1ff3d4a534 | ||
|
|
8ae6a36b33 | ||
|
|
d8687f30cd | ||
|
|
bff2ddb8db | ||
|
|
2a9db0eea4 | ||
|
|
5c41022f76 | ||
|
|
a9dec41cc1 | ||
|
|
918cbb8d92 | ||
|
|
7cc7de7a5f | ||
|
|
56d8d1eaf7 | ||
|
|
b57685e9d5 | ||
|
|
a3fa4a0d3e | ||
|
|
d86aeaa22a | ||
|
|
97f18d7b86 | ||
|
|
bded15a869 | ||
|
|
fff5927cdf | ||
|
|
f9881b9af5 | ||
|
|
79182a2d32 | ||
|
|
77eec6e6f3 | ||
|
|
a6e3f43344 | ||
|
|
f525a9f5da | ||
|
|
2427bfa6ea | ||
|
|
7eea4fdd1c | ||
|
|
dde4bd39b2 | ||
|
|
091c271237 | ||
|
|
141a2a507d | ||
|
|
36aabbb5b6 | ||
|
|
82f38c9aea | ||
|
|
689720b749 | ||
|
|
50600b9d00 | ||
|
|
232088f3a2 | ||
|
|
66b9679a7c | ||
|
|
42753d85c7 | ||
|
|
3eca13e2bc | ||
|
|
abdef21381 | ||
|
|
1fd09617cb | ||
|
|
e5eb74f077 | ||
|
|
f474947d2d | ||
|
|
d1b90193a4 | ||
|
|
53ee5c32eb | ||
|
|
79ba223e12 | ||
|
|
27552c99b8 | ||
|
|
6b56a8df0a | ||
|
|
e18a242b90 | ||
|
|
4a3bd510a7 | ||
|
|
bb85473eba | ||
|
|
d5fa5e298e | ||
|
|
dab4939819 | ||
|
|
43b29af922 | ||
|
|
2c1acc14e6 | ||
|
|
84f9da4a23 | ||
|
|
d817319aa4 | ||
|
|
093b851395 | ||
|
|
e3a150226e | ||
|
|
5122ed9af4 | ||
|
|
ac5a3beb15 | ||
|
|
19481fc55e | ||
|
|
c8cab8aae5 | ||
|
|
d7428015ac | ||
|
|
700f91efb5 | ||
|
|
43e4047447 | ||
|
|
892e843e9e | ||
|
|
85904f57b8 | ||
|
|
60a5bf682b | ||
|
|
47c07831c1 | ||
|
|
b5e23717f2 | ||
|
|
d8d99c930e | ||
|
|
ce96094f49 | ||
|
|
6c655e6fbc | ||
|
|
2d1483febb | ||
|
|
42d7383ff0 | ||
|
|
df4ddf45c4 | ||
|
|
e0b40222dd | ||
|
|
61928cbc05 | ||
|
|
c6884f96e1 | ||
|
|
f0b5a04f6b | ||
|
|
b8ffddb533 | ||
|
|
71536767b5 | ||
|
|
938056d1d8 | ||
|
|
63d2d69d08 | ||
|
|
78ec086111 | ||
|
|
bf53a02270 | ||
|
|
2aded5b459 | ||
|
|
5aa6b14756 | ||
|
|
07bd84ffbb | ||
|
|
d2794f328f | ||
|
|
8b146fc72a | ||
|
|
0c491a6651 | ||
|
|
e8529754f1 | ||
|
|
d95dc84c34 | ||
|
|
b61ee0211f | ||
|
|
c777a00874 | ||
|
|
a0a2dab44f | ||
|
|
f0aa7f44a5 | ||
|
|
a51940937a | ||
|
|
f1e401070a | ||
|
|
999b04ef99 | ||
|
|
da5e8fcb9f | ||
|
|
e22b9997fe | ||
|
|
609cbe2893 | ||
|
|
425970aba2 | ||
|
|
ace5151afa | ||
|
|
3b652581b5 | ||
|
|
17692e722a | ||
|
|
a2826b0fdf | ||
|
|
d766f6c0b2 | ||
|
|
0f715e531c | ||
|
|
fba83f847b | ||
|
|
5603745744 | ||
|
|
2b2f9c205e | ||
|
|
feff2b726b | ||
|
|
8b3d513aa2 | ||
|
|
dd17f98edb | ||
|
|
c9adcd1479 | ||
|
|
29c8b0b1a5 | ||
|
|
6404c7427c | ||
|
|
85eab5b436 | ||
|
|
912713a0c9 | ||
|
|
ca3b9f8085 | ||
|
|
ac00a20639 | ||
|
|
139c994e06 | ||
|
|
3621616f7c | ||
|
|
41ddd653a0 | ||
|
|
d8c7c0141a | ||
|
|
3fa2dd4772 | ||
|
|
cf26c465cc | ||
|
|
1bc50fd7cb | ||
|
|
719724de0b | ||
|
|
804ed81acb | ||
|
|
e980f8882c | ||
|
|
73f910e90c | ||
|
|
5135d32cd8 | ||
|
|
91d87c887b | ||
|
|
786fe55fc8 | ||
|
|
b202678a6b | ||
|
|
0e8d2d307b | ||
|
|
832b8caa8b | ||
|
|
a50b75659f | ||
|
|
df44898557 | ||
|
|
5a70985e0e | ||
|
|
4791b570e4 | ||
|
|
f087b7184c | ||
|
|
fa9c2b24f2 | ||
|
|
e3683d25ca | ||
|
|
21c0baa965 | ||
|
|
75a8d9caf0 | ||
|
|
1089a66fff | ||
|
|
1feb7b4065 | ||
|
|
e7cbcf2b51 | ||
|
|
7b7c6ec7d7 | ||
|
|
db99ecf255 | ||
|
|
87846529a2 | ||
|
|
e50f298a0a | ||
|
|
bbc54d4467 | ||
|
|
006bcd2cf8 | ||
|
|
e56c803610 | ||
|
|
5a9ff58bcf | ||
|
|
7747f2592e | ||
|
|
59504c3d84 | ||
|
|
57535af982 | ||
|
|
66358240dc | ||
|
|
a283a7fe49 | ||
|
|
42cdfe3c1e | ||
|
|
806dd6254b | ||
|
|
40b53442a8 | ||
|
|
7662d3fd6a | ||
|
|
e4ea9d8cd1 | ||
|
|
c6374555b9 | ||
|
|
bda5ca33d9 | ||
|
|
7a10037de8 | ||
|
|
a8d5fede17 | ||
|
|
daa2bd5127 | ||
|
|
506574aefd | ||
|
|
4f099da58f | ||
|
|
59c9f0957b | ||
|
|
6baa36cdaa | ||
|
|
e0a8b320a9 | ||
|
|
116f503cf6 | ||
|
|
023ebe1909 | ||
|
|
d54eb48662 | ||
|
|
542e8e22bf | ||
|
|
e0426d6dc0 | ||
|
|
a09900c98d | ||
|
|
f563fcad7f | ||
|
|
34b76f8683 | ||
|
|
ec82bdda97 | ||
|
|
e4c2df4989 | ||
|
|
a1f577dc01 | ||
|
|
edbf92424d | ||
|
|
35c18664fc | ||
|
|
be568cdfa6 | ||
|
|
0bb90d764c | ||
|
|
34c8748b9c | ||
|
|
875c22346e | ||
|
|
c57d5a2408 | ||
|
|
825058472b | ||
|
|
b419f063dc | ||
|
|
0ebc803e22 | ||
|
|
cd2119707a | ||
|
|
8c27406a7a | ||
|
|
b6defc76a8 | ||
|
|
50529d7ab3 | ||
|
|
b695f3d47f | ||
|
|
90ce61fa47 | ||
|
|
7c2352f2d6 | ||
|
|
ef7194af85 | ||
|
|
09adc8f690 | ||
|
|
86b448445f | ||
|
|
ba9ba7da95 | ||
|
|
f02e1ea04a | ||
|
|
f88b31ec67 | ||
|
|
6906dd47e8 | ||
|
|
2a35c48498 | ||
|
|
ce0031934a | ||
|
|
4766c7a00b | ||
|
|
9d470c7a18 | ||
|
|
9cb0d66f39 | ||
|
|
7ba6f8c04b | ||
|
|
19ff6d011a | ||
|
|
9b1dcdcc78 | ||
|
|
5eb3c486b2 | ||
|
|
20ee0d5009 | ||
|
|
a3cb1e6ecc | ||
|
|
89d68c7708 | ||
|
|
371d517436 | ||
|
|
17a016eca5 | ||
|
|
2b67a0fa80 | ||
|
|
84fcc8f1ac | ||
|
|
baefe37d0b | ||
|
|
1e13d579ba | ||
|
|
becfb09b3c | ||
|
|
4767030035 | ||
|
|
b20385db95 | ||
|
|
019911068a | ||
|
|
da266fed40 | ||
|
|
dd6c066f5a | ||
|
|
9de939c1b1 | ||
|
|
35030bfd02 | ||
|
|
3833fb6e52 | ||
|
|
0a03c0a0fb | ||
|
|
0599acbcb8 | ||
|
|
97dcd44662 | ||
|
|
1165c997bc | ||
|
|
1d54777d72 | ||
|
|
0144e940c4 | ||
|
|
753a643bf1 | ||
|
|
19018c2564 | ||
|
|
c8a65d2fac | ||
|
|
6c0d4cffe5 | ||
|
|
6b042e4a17 | ||
|
|
ae2c56b29d | ||
|
|
55feb7648d | ||
|
|
cc135c8190 | ||
|
|
2f01351ad2 | ||
|
|
3d6842db80 | ||
|
|
e1dd92b406 | ||
|
|
a8160aac8a | ||
|
|
5e7bfc05d2 | ||
|
|
3c741f0686 | ||
|
|
afa40ea82f | ||
|
|
6a9fcd0b30 | ||
|
|
a80cf37fa6 | ||
|
|
073bad2118 | ||
|
|
6ad0749ce8 | ||
|
|
5a40ccb7df | ||
|
|
a56375eaf8 | ||
|
|
6291e3c587 | ||
|
|
5221e776da | ||
|
|
a290779ef7 | ||
|
|
ac2b8e1ebe | ||
|
|
a1adcadd6c | ||
|
|
4a53c818fd | ||
|
|
fa59117fd5 | ||
|
|
3b6b2ea936 | ||
|
|
ef4a71c048 | ||
|
|
bc82401c24 | ||
|
|
849ceeaa96 | ||
|
|
77bac0c24e | ||
|
|
227220e2a6 | ||
|
|
b88c85555e | ||
|
|
b7a49ced39 | ||
|
|
dc31ebebb1 | ||
|
|
2f550725e3 | ||
|
|
3834724d45 | ||
|
|
ce39f3c119 | ||
|
|
7aaa31b137 | ||
|
|
656143db48 | ||
|
|
decfbc9658 | ||
|
|
e91a87d83b | ||
|
|
040422c6c0 | ||
|
|
7535883416 | ||
|
|
f71c84cea5 | ||
|
|
1586320115 | ||
|
|
13f81ca20e | ||
|
|
25b5b66ae1 | ||
|
|
f2b02f6c6b | ||
|
|
3139ba7ad0 | ||
|
|
1ab1e20bb7 | ||
|
|
f3806ea5ea | ||
|
|
182a7f0f93 | ||
|
|
6f228781d4 | ||
|
|
c39b00b6c2 | ||
|
|
06b1c9aa40 | ||
|
|
75b71738df | ||
|
|
8cb07c4a37 | ||
|
|
4cbd520cb9 | ||
|
|
b2a0310e6f | ||
|
|
d71994189c | ||
|
|
89809aed5f | ||
|
|
de8c71d098 | ||
|
|
576faff3d7 | ||
|
|
90af6bd22d | ||
|
|
3f1099d968 | ||
|
|
7fbe893927 | ||
|
|
c6ab9f8a6a | ||
|
|
3143cc9d92 | ||
|
|
e4be757d96 | ||
|
|
e44845c327 | ||
|
|
c8cab86b0c | ||
|
|
a3cbe8e878 | ||
|
|
727c74907d | ||
|
|
04c38a3c1d | ||
|
|
9b51f85e9a | ||
|
|
544377a624 | ||
|
|
a5f6773a4d | ||
|
|
43b09640a9 | ||
|
|
066879fe62 | ||
|
|
54ec4e5016 | ||
|
|
e483ef8ccd | ||
|
|
0deb3cd782 | ||
|
|
624485ff25 | ||
|
|
cace62a718 | ||
|
|
77360f41af | ||
|
|
79e762a815 | ||
|
|
62ee3c2de1 | ||
|
|
b565b6ba4d | ||
|
|
a2bc61475b | ||
|
|
77d12a3e54 | ||
|
|
fdba33baa3 | ||
|
|
6f303a5244 | ||
|
|
43b6ab5dc5 | ||
|
|
2ba9d250f2 | ||
|
|
84b711e130 | ||
|
|
4007b17b1e | ||
|
|
9ab672d0b1 | ||
|
|
f3ff835902 | ||
|
|
004c7eef9e | ||
|
|
f3f0a84915 | ||
|
|
5f11b6a650 | ||
|
|
6b733ad7e2 | ||
|
|
831aa3aae0 |
13
.github/FUNDING.yml
vendored
Normal file
13
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: openfoodfoundation
|
||||
patreon: # Replace with a single Patreon username
|
||||
open_collective: #
|
||||
ko_fi: # Replace with a single Ko-fi username
|
||||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||
liberapay: # Replace with a single Liberapay username
|
||||
issuehunt: # Replace with a single IssueHunt username
|
||||
otechie: # Replace with a single Otechie username
|
||||
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
|
||||
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
||||
19
.github/ISSUE_TEMPLATE/release.md
vendored
19
.github/ISSUE_TEMPLATE/release.md
vendored
@@ -10,7 +10,6 @@ assignees: ''
|
||||
## Preparation on Thursday
|
||||
|
||||
- [ ] Merge pull requests in the [Ready To Go] column
|
||||
- [ ] Merge [Transifex pull request]
|
||||
- [ ] Include translations: `tx pull --force`
|
||||
- [ ] [Draft new release]. Look at previous [releases] for inspiration.
|
||||
- [ ] Notify [#instance-managers] of user-facing changes.
|
||||
@@ -18,24 +17,12 @@ assignees: ''
|
||||
## Testing
|
||||
|
||||
- [ ] [Find build] of the release commit and copy it below.
|
||||
- [ ] Move this issue to Test Ready and notify testers.
|
||||
- [ ] Test: :warning: link to the build of the release commit https://semaphoreci.com/openfoodfoundation/openfoodnetwork-2/branches/master
|
||||
- [ ] Move this issue to Test Ready.
|
||||
- [ ] Notify testers.
|
||||
- [ ] Test build: <!-- paste build link here, e.g. https://semaphore...builds/1234 -->
|
||||
|
||||
## Finish on Tuesday
|
||||
|
||||
- [ ] Update translations unless content has been removed from config/locales/en.yml between this release draft and current master.
|
||||
<details><summary>Command line instructions</summary>
|
||||
<pre>
|
||||
git checkout master # same version as the release draft
|
||||
git fetch upstream
|
||||
git diff upstream/master -- config/locales/en.yml
|
||||
tx pull --force # if no changes or only additions in the locale
|
||||
git checkout --detach # if we need to commit new translations
|
||||
git commit -a -m "Update translations"
|
||||
git tag vx.y.z # put the release number in here
|
||||
git push upstream vx.y.z
|
||||
</pre>
|
||||
</details>
|
||||
- [ ] Publish and notify [#global-community]:
|
||||
> The next release is ready: https://github.com/openfoodfoundation/openfoodnetwork/releases/latest
|
||||
- [ ] Deploy the new release to all managed instances.
|
||||
|
||||
5
.github/workflows/build.yml
vendored
5
.github/workflows/build.yml
vendored
@@ -17,7 +17,7 @@ permissions:
|
||||
|
||||
jobs:
|
||||
rspec:
|
||||
runs-on: ubuntu-18.04
|
||||
runs-on: ubuntu-20.04
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:10
|
||||
@@ -36,7 +36,6 @@ jobs:
|
||||
specs:
|
||||
- "spec/controllers"
|
||||
- "spec/models"
|
||||
- "spec/features/admin/[a-o0-9]*_spec.rb"
|
||||
- "spec/lib"
|
||||
- "spec/migrations"
|
||||
- "spec/serializers"
|
||||
@@ -78,7 +77,7 @@ jobs:
|
||||
if-no-files-found: ignore
|
||||
|
||||
test-the-rest:
|
||||
runs-on: ubuntu-18.04
|
||||
runs-on: ubuntu-20.04
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:10
|
||||
|
||||
13
.github/workflows/linters.yml
vendored
13
.github/workflows/linters.yml
vendored
@@ -16,3 +16,16 @@ jobs:
|
||||
reporter: github-pr-check
|
||||
level: error
|
||||
fail_on_error: true
|
||||
prettier:
|
||||
name: runner / prettier
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v2
|
||||
- name: prettier
|
||||
uses: EPMatt/reviewdog-action-prettier@v1
|
||||
with:
|
||||
github_token: ${{ secrets.github_token }}
|
||||
reporter: github-pr-check
|
||||
level: error
|
||||
fail_on_error: true
|
||||
|
||||
2
.github/workflows/mapi.yml
vendored
2
.github/workflows/mapi.yml
vendored
@@ -1,5 +1,5 @@
|
||||
name: 'Mayhem for API'
|
||||
on: [push]
|
||||
on: workflow_dispatch
|
||||
jobs:
|
||||
test:
|
||||
if: ${{ github.repository_owner == 'openfoodfoundation' }}
|
||||
|
||||
4
.husky/pre-commit
Executable file
4
.husky/pre-commit
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env sh
|
||||
. "$(dirname -- "$0")/_/husky.sh"
|
||||
|
||||
yarn pretty-quick --check --staged
|
||||
21
.prettierignore
Normal file
21
.prettierignore
Normal file
@@ -0,0 +1,21 @@
|
||||
# Basically, ignore everythings expect app/webpacker/controllers/*.js and app/webpacker/packs/*.js
|
||||
*.css
|
||||
*.scss
|
||||
*.md
|
||||
*.yml
|
||||
*.yaml
|
||||
*.json
|
||||
*.html
|
||||
|
||||
babel.config.js
|
||||
postcss.config.js
|
||||
|
||||
.storybook/
|
||||
/app/assets/
|
||||
/config/
|
||||
/coverage/
|
||||
/engines/
|
||||
/public/
|
||||
/spec/
|
||||
/tmp/
|
||||
/vendor/
|
||||
1
.prettierrc.json
Normal file
1
.prettierrc.json
Normal file
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -23,7 +23,7 @@ Metrics:
|
||||
Enabled: true
|
||||
|
||||
Metrics/BlockLength:
|
||||
IgnoredMethods: [
|
||||
AllowedMethods: [
|
||||
"class_eval",
|
||||
"collection",
|
||||
"context",
|
||||
@@ -41,6 +41,7 @@ Metrics/BlockLength:
|
||||
"resources",
|
||||
"scenario",
|
||||
"shared_examples",
|
||||
"xdescribe",
|
||||
]
|
||||
|
||||
Rails/SkipsModelValidations:
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
# This configuration was generated by
|
||||
# `rubocop --auto-gen-config --auto-gen-only-exclude --exclude-limit 1400`
|
||||
# on 2022-03-29 16:07:39 UTC using RuboCop version 1.22.2.
|
||||
# on 2022-08-29 05:26:26 UTC using RuboCop version 1.35.1.
|
||||
# The point is for the user to remove these configuration records
|
||||
# one by one as the offenses are removed from the code base.
|
||||
# Note that changes in the inspected code, or installation of new
|
||||
# versions of RuboCop, may require this file to be generated again.
|
||||
|
||||
# Offense count: 1
|
||||
# Cop supports --auto-correct.
|
||||
# Offense count: 2
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
# Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include.
|
||||
# Include: **/*.gemfile, **/Gemfile, **/gems.rb
|
||||
Bundler/OrderedGems:
|
||||
@@ -25,20 +25,13 @@ Gemspec/RequiredRubyVersion:
|
||||
- 'engines/web/web.gemspec'
|
||||
|
||||
# Offense count: 1
|
||||
# Cop supports --auto-correct.
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
Layout/ClosingParenthesisIndentation:
|
||||
Exclude:
|
||||
- 'lib/reporting/queries/joins.rb'
|
||||
|
||||
# Offense count: 2
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: EmptyLineBetweenMethodDefs, EmptyLineBetweenClassDefs, EmptyLineBetweenModuleDefs, AllowAdjacentOneLineDefs, NumberOfEmptyLines.
|
||||
Layout/EmptyLineBetweenDefs:
|
||||
Exclude:
|
||||
- 'spec/lib/reports/report_loader_spec.rb'
|
||||
|
||||
# Offense count: 2
|
||||
# Cop supports --auto-correct.
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
# Configuration parameters: EnforcedStyle.
|
||||
# SupportedStyles: empty_lines, no_empty_lines
|
||||
Layout/EmptyLinesAroundBlockBody:
|
||||
@@ -47,15 +40,15 @@ Layout/EmptyLinesAroundBlockBody:
|
||||
- 'spec/system/admin/order_cycles/list_spec.rb'
|
||||
|
||||
# Offense count: 1
|
||||
# Cop supports --auto-correct.
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
# Configuration parameters: AllowDoxygenCommentStyle, AllowGemfileRubyComment.
|
||||
Layout/LeadingCommentSpace:
|
||||
Exclude:
|
||||
- 'spec/system/admin/enterprises_spec.rb'
|
||||
|
||||
# Offense count: 856
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: Max, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
||||
# Offense count: 862
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
# Configuration parameters: Max, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, IgnoredPatterns.
|
||||
# URISchemes: http, https
|
||||
Layout/LineLength:
|
||||
Exclude:
|
||||
@@ -68,7 +61,6 @@ Layout/LineLength:
|
||||
- 'app/controllers/admin/subscriptions_controller.rb'
|
||||
- 'app/controllers/api/v0/order_cycles_controller.rb'
|
||||
- 'app/controllers/payment_gateways/paypal_controller.rb'
|
||||
- 'app/controllers/spree/admin/reports_controller.rb'
|
||||
- 'app/controllers/spree/users_controller.rb'
|
||||
- 'app/controllers/user_confirmations_controller.rb'
|
||||
- 'app/helpers/angular_form_builder.rb'
|
||||
@@ -85,7 +77,6 @@ Layout/LineLength:
|
||||
- 'app/models/concerns/variant_stock.rb'
|
||||
- 'app/models/customer.rb'
|
||||
- 'app/models/enterprise.rb'
|
||||
- 'app/models/enterprise_group.rb'
|
||||
- 'app/models/product_import/entry_processor.rb'
|
||||
- 'app/models/product_import/spreadsheet_entry.rb'
|
||||
- 'app/models/product_import/unit_converter.rb'
|
||||
@@ -111,23 +102,15 @@ Layout/LineLength:
|
||||
- 'engines/order_management/app/services/order_management/subscriptions/validator.rb'
|
||||
- 'engines/order_management/spec/services/order_management/order/updater_spec.rb'
|
||||
- 'engines/web/app/helpers/web/cookies_policy_helper.rb'
|
||||
- 'engines/web/spec/features/consumer/cookies_spec.rb'
|
||||
- 'lib/discourse/single_sign_on.rb'
|
||||
- 'lib/open_food_network/enterprise_fee_applicator.rb'
|
||||
- 'lib/open_food_network/enterprise_fee_calculator.rb'
|
||||
- 'lib/open_food_network/enterprise_issue_validator.rb'
|
||||
- 'lib/open_food_network/order_cycle_form_applicator.rb'
|
||||
- 'lib/open_food_network/order_cycle_permissions.rb'
|
||||
- 'lib/open_food_network/scope_variants_for_search.rb'
|
||||
- 'lib/reporting/line_items.rb'
|
||||
- 'lib/reporting/reports/bulk_coop/bulk_coop_report.rb'
|
||||
- 'lib/reporting/reports/enterprise_fee_summary/report_data/enterprise_fee_type_total.rb'
|
||||
- 'lib/reporting/reports/order_cycle_management/order_cycle_management_report.rb'
|
||||
- 'lib/open_food_network/order_cycle_permissions.rb'
|
||||
- 'lib/reporting/reports/orders_and_fulfillment/customer_totals_report.rb'
|
||||
- 'lib/reporting/reports/orders_and_fulfillment/distributor_totals_by_supplier_report.rb'
|
||||
- 'lib/reporting/reports/payments/payments_report.rb'
|
||||
- 'lib/reporting/reports/products_and_inventory/lettuce_share_report.rb'
|
||||
- 'lib/reporting/reports/sales_tax/sales_tax_report.rb'
|
||||
- 'lib/reporting/reports/xero_invoices/base.rb'
|
||||
- 'lib/spree/localized_number.rb'
|
||||
- 'lib/tasks/data.rake'
|
||||
@@ -145,12 +128,10 @@ Layout/LineLength:
|
||||
- 'spec/controllers/admin/subscriptions_controller_spec.rb'
|
||||
- 'spec/controllers/admin/variant_overrides_controller_spec.rb'
|
||||
- 'spec/controllers/api/v0/base_controller_spec.rb'
|
||||
- 'spec/controllers/api/v0/enterprises_controller_spec.rb'
|
||||
- 'spec/controllers/api/v0/exchange_products_controller_spec.rb'
|
||||
- 'spec/controllers/api/v0/logos_controller_spec.rb'
|
||||
- 'spec/controllers/api/v0/order_cycles_controller_spec.rb'
|
||||
- 'spec/controllers/api/v0/orders_controller_spec.rb'
|
||||
- 'spec/controllers/api/v0/product_images_controller_spec.rb'
|
||||
- 'spec/controllers/api/v0/products_controller_spec.rb'
|
||||
- 'spec/controllers/api/v0/promo_images_controller_spec.rb'
|
||||
- 'spec/controllers/api/v0/terms_and_conditions_controller_spec.rb'
|
||||
@@ -164,7 +145,6 @@ Layout/LineLength:
|
||||
- 'spec/controllers/spree/admin/orders/invoices_spec.rb'
|
||||
- 'spec/controllers/spree/admin/orders_controller_spec.rb'
|
||||
- 'spec/controllers/spree/admin/payment_methods_controller_spec.rb'
|
||||
- 'spec/controllers/spree/admin/reports_controller_spec.rb'
|
||||
- 'spec/controllers/spree/admin/variants_controller_spec.rb'
|
||||
- 'spec/controllers/spree/credit_cards_controller_spec.rb'
|
||||
- 'spec/controllers/spree/orders_controller_spec.rb'
|
||||
@@ -187,13 +167,9 @@ Layout/LineLength:
|
||||
- 'spec/lib/open_food_network/tag_rule_applicator_spec.rb'
|
||||
- 'spec/lib/reports/customers_report_spec.rb'
|
||||
- 'spec/lib/reports/order_cycle_management_report_spec.rb'
|
||||
- 'spec/lib/reports/order_grouper_spec.rb'
|
||||
- 'spec/lib/reports/orders_and_fulfillment/orders_and_fulfillment_report_spec.rb'
|
||||
- 'spec/lib/reports/packing/packing_report_spec.rb'
|
||||
- 'spec/lib/reports/products_and_inventory_report_spec.rb'
|
||||
- 'spec/lib/reports/users_and_enterprises_report_spec.rb'
|
||||
- 'spec/lib/reports/xero_invoices_report_spec.rb'
|
||||
- 'spec/lib/stripe/authorize_response_patcher_spec.rb'
|
||||
- 'spec/mailers/order_mailer_spec.rb'
|
||||
- 'spec/mailers/producer_mailer_spec.rb'
|
||||
- 'spec/mailers/subscription_mailer_spec.rb'
|
||||
@@ -201,7 +177,6 @@ Layout/LineLength:
|
||||
- 'spec/models/concerns/calculated_adjustments_spec.rb'
|
||||
- 'spec/models/concerns/order_shipment_spec.rb'
|
||||
- 'spec/models/concerns/product_stock_spec.rb'
|
||||
- 'spec/models/enterprise_group_spec.rb'
|
||||
- 'spec/models/enterprise_relationship_spec.rb'
|
||||
- 'spec/models/enterprise_spec.rb'
|
||||
- 'spec/models/exchange_spec.rb'
|
||||
@@ -227,7 +202,6 @@ Layout/LineLength:
|
||||
- 'spec/models/tag_rule/filter_payment_methods_spec.rb'
|
||||
- 'spec/models/tag_rule/filter_products_spec.rb'
|
||||
- 'spec/models/tag_rule/filter_shipping_methods_spec.rb'
|
||||
- 'spec/models/terms_of_service_file_spec.rb'
|
||||
- 'spec/models/variant_override_spec.rb'
|
||||
- 'spec/requests/api/orders_spec.rb'
|
||||
- 'spec/requests/checkout/failed_checkout_spec.rb'
|
||||
@@ -287,6 +261,7 @@ Layout/LineLength:
|
||||
- 'spec/system/admin/variant_overrides_spec.rb'
|
||||
- 'spec/system/consumer/authentication_spec.rb'
|
||||
- 'spec/system/consumer/caching/shops_caching_spec.rb'
|
||||
- 'spec/system/consumer/cookies_spec.rb'
|
||||
- 'spec/system/consumer/shopping/cart_spec.rb'
|
||||
- 'spec/system/consumer/shopping/checkout_auth_spec.rb'
|
||||
- 'spec/system/consumer/shopping/checkout_spec.rb'
|
||||
@@ -300,35 +275,20 @@ Layout/LineLength:
|
||||
- 'spec/views/spree/admin/payment_methods/index.html.haml_spec.rb'
|
||||
|
||||
# Offense count: 1
|
||||
# Cop supports --auto-correct.
|
||||
Layout/MultilineBlockLayout:
|
||||
Exclude:
|
||||
- 'spec/lib/reports/report_renderer_spec.rb'
|
||||
|
||||
# Offense count: 1
|
||||
# Cop supports --auto-correct.
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
# Configuration parameters: EnforcedStyle.
|
||||
# SupportedStyles: symmetrical, new_line, same_line
|
||||
Layout/MultilineMethodCallBraceLayout:
|
||||
Exclude:
|
||||
- 'lib/reporting/queries/joins.rb'
|
||||
|
||||
# Offense count: 2
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: EnforcedStyle, IndentationWidth.
|
||||
# SupportedStyles: aligned, indented, indented_relative_to_receiver
|
||||
Layout/MultilineMethodCallIndentation:
|
||||
Exclude:
|
||||
- 'lib/reporting/reports/customers/customers_report.rb'
|
||||
|
||||
# Offense count: 20
|
||||
# Cop supports --auto-correct.
|
||||
# Offense count: 22
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
# Configuration parameters: AllowInHeredoc.
|
||||
Layout/TrailingWhitespace:
|
||||
Exclude:
|
||||
- 'app/controllers/spree/admin/shipping_methods_controller.rb'
|
||||
- 'spec/controllers/spree/admin/shipping_methods_controller_spec.rb'
|
||||
- 'spec/system/admin/enterprises_spec.rb'
|
||||
- 'spec/system/admin/order_spec.rb'
|
||||
- 'spec/system/admin/shipping_methods_spec.rb'
|
||||
- 'spec/system/flatpickr_spec.rb'
|
||||
@@ -357,6 +317,7 @@ Lint/DuplicateMethods:
|
||||
- 'lib/discourse/single_sign_on.rb'
|
||||
|
||||
# Offense count: 1
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
Lint/DuplicateRequire:
|
||||
Exclude:
|
||||
- 'spec/lib/open_food_network/scope_variants_to_search_spec.rb'
|
||||
@@ -378,9 +339,8 @@ Lint/IneffectiveAccessModifier:
|
||||
Exclude:
|
||||
- 'app/models/spree/user.rb'
|
||||
|
||||
|
||||
# Offense count: 1
|
||||
# Cop supports --auto-correct.
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
# Configuration parameters: AllowedMethods.
|
||||
# AllowedMethods: instance_of?, kind_of?, is_a?, eql?, respond_to?, equal?
|
||||
Lint/RedundantSafeNavigation:
|
||||
@@ -388,6 +348,7 @@ Lint/RedundantSafeNavigation:
|
||||
- 'app/models/spree/payment.rb'
|
||||
|
||||
# Offense count: 2
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
# Configuration parameters: AllowedMethods.
|
||||
# AllowedMethods: present?, blank?, presence, try, try!, in?
|
||||
Lint/SafeNavigationChain:
|
||||
@@ -396,22 +357,21 @@ Lint/SafeNavigationChain:
|
||||
- 'app/models/spree/stock/availability_validator.rb'
|
||||
|
||||
# Offense count: 2
|
||||
# Cop supports --auto-correct.
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
# Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods.
|
||||
Lint/UnusedMethodArgument:
|
||||
Exclude:
|
||||
- 'lib/reporting/queries/query_interface.rb'
|
||||
|
||||
# Offense count: 5
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: AllowComments.
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
Lint/UselessMethodDefinition:
|
||||
Exclude:
|
||||
- 'app/controllers/spree/user_registrations_controller.rb'
|
||||
- 'app/models/spree/gateway.rb'
|
||||
|
||||
# Offense count: 38
|
||||
# Configuration parameters: IgnoredMethods, CountRepeatedAttributes, Max.
|
||||
# Offense count: 28
|
||||
# Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods, CountRepeatedAttributes, Max.
|
||||
Metrics/AbcSize:
|
||||
Exclude:
|
||||
- 'app/controllers/admin/enterprises_controller.rb'
|
||||
@@ -433,20 +393,14 @@ Metrics/AbcSize:
|
||||
- 'app/models/spree/return_authorization.rb'
|
||||
- 'lib/discourse/single_sign_on.rb'
|
||||
- 'lib/open_food_network/order_cycle_form_applicator.rb'
|
||||
- 'lib/reporting/reports/bulk_coop/bulk_coop_report.rb'
|
||||
- 'lib/reporting/reports/customers/customers_report.rb'
|
||||
- 'lib/open_food_network/order_cycle_permissions.rb'
|
||||
- 'lib/reporting/reports/orders_and_distributors/orders_and_distributors_report.rb'
|
||||
- 'lib/reporting/reports/packing/customer.rb'
|
||||
- 'lib/reporting/reports/payments/payments_report.rb'
|
||||
- 'lib/reporting/reports/sales_tax/sales_tax_report.rb'
|
||||
- 'lib/spree/core/controller_helpers/order.rb'
|
||||
- 'lib/tasks/enterprises.rake'
|
||||
- 'spec/services/order_checkout_restart_spec.rb'
|
||||
|
||||
# Offense count: 43
|
||||
# Configuration parameters: CountComments, Max, CountAsOne, ExcludedMethods, IgnoredMethods.
|
||||
# IgnoredMethods: refine
|
||||
# Offense count: 42
|
||||
# Configuration parameters: CountComments, Max, CountAsOne, ExcludedMethods, AllowedMethods, AllowedPatterns, IgnoredMethods.
|
||||
# AllowedMethods: refine
|
||||
Metrics/BlockLength:
|
||||
Exclude:
|
||||
- 'app/models/spree/order/checkout.rb'
|
||||
@@ -474,7 +428,6 @@ Metrics/BlockLength:
|
||||
- 'spec/support/matchers/select2_matchers.rb'
|
||||
- 'spec/support/matchers/table_matchers.rb'
|
||||
- 'spec/swagger_helper.rb'
|
||||
- 'spec/system/admin/order_cycles/complex_updating_specific_time_spec.rb'
|
||||
- 'spec/system/consumer/shopping/checkout_spec.rb'
|
||||
|
||||
# Offense count: 1
|
||||
@@ -483,7 +436,7 @@ Metrics/BlockNesting:
|
||||
Exclude:
|
||||
- 'app/models/spree/payment/processing.rb'
|
||||
|
||||
# Offense count: 50
|
||||
# Offense count: 45
|
||||
# Configuration parameters: CountComments, Max, CountAsOne.
|
||||
Metrics/ClassLength:
|
||||
Exclude:
|
||||
@@ -502,7 +455,6 @@ Metrics/ClassLength:
|
||||
- 'app/controllers/spree/admin/payment_methods_controller.rb'
|
||||
- 'app/controllers/spree/admin/payments_controller.rb'
|
||||
- 'app/controllers/spree/admin/products_controller.rb'
|
||||
- 'app/controllers/spree/admin/reports_controller.rb'
|
||||
- 'app/controllers/spree/admin/users_controller.rb'
|
||||
- 'app/controllers/spree/orders_controller.rb'
|
||||
- 'app/models/enterprise.rb'
|
||||
@@ -529,16 +481,13 @@ Metrics/ClassLength:
|
||||
- 'engines/order_management/app/services/order_management/order/updater.rb'
|
||||
- 'lib/open_food_network/enterprise_fee_calculator.rb'
|
||||
- 'lib/open_food_network/order_cycle_form_applicator.rb'
|
||||
- 'lib/open_food_network/permissions.rb'
|
||||
- 'lib/reporting/reports/bulk_coop/bulk_coop_report.rb'
|
||||
- 'lib/reporting/reports/enterprise_fee_summary/scope.rb'
|
||||
- 'lib/reporting/reports/order_cycle_management/order_cycle_management_report.rb'
|
||||
- 'lib/open_food_network/order_cycle_permissions.rb'
|
||||
- 'lib/reporting/reports/payments/payments_report.rb'
|
||||
- 'lib/open_food_network/permissions.rb'
|
||||
- 'lib/reporting/reports/enterprise_fee_summary/scope.rb'
|
||||
- 'lib/reporting/reports/xero_invoices/base.rb'
|
||||
|
||||
# Offense count: 39
|
||||
# Configuration parameters: IgnoredMethods, Max.
|
||||
# Offense count: 35
|
||||
# Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods, Max.
|
||||
Metrics/CyclomaticComplexity:
|
||||
Exclude:
|
||||
- 'app/controllers/admin/enterprises_controller.rb'
|
||||
@@ -565,18 +514,14 @@ Metrics/CyclomaticComplexity:
|
||||
- 'app/models/spree/zone.rb'
|
||||
- 'lib/discourse/single_sign_on.rb'
|
||||
- 'lib/open_food_network/enterprise_issue_validator.rb'
|
||||
- 'lib/reporting/reports/bulk_coop/bulk_coop_report.rb'
|
||||
- 'lib/reporting/reports/customers/customers_report.rb'
|
||||
- 'lib/reporting/reports/orders_and_fulfillment/customer_totals_report.rb'
|
||||
- 'lib/reporting/reports/payments/payments_report.rb'
|
||||
- 'lib/reporting/reports/xero_invoices/base.rb'
|
||||
- 'lib/spree/core/controller_helpers/order.rb'
|
||||
- 'lib/spree/core/controller_helpers/respond_with.rb'
|
||||
- 'lib/spree/localized_number.rb'
|
||||
- 'spec/models/product_importer_spec.rb'
|
||||
|
||||
# Offense count: 32
|
||||
# Configuration parameters: CountComments, Max, CountAsOne, ExcludedMethods, IgnoredMethods.
|
||||
# Offense count: 26
|
||||
# Configuration parameters: CountComments, Max, CountAsOne, ExcludedMethods, AllowedMethods, AllowedPatterns, IgnoredMethods.
|
||||
Metrics/MethodLength:
|
||||
Exclude:
|
||||
- 'app/controllers/admin/enterprises_controller.rb'
|
||||
@@ -593,15 +538,12 @@ Metrics/MethodLength:
|
||||
- 'app/models/spree/preferences/preferable_class_methods.rb'
|
||||
- 'lib/discourse/single_sign_on.rb'
|
||||
- 'lib/open_food_network/order_cycle_form_applicator.rb'
|
||||
- 'lib/reporting/reports/bulk_coop/bulk_coop_report.rb'
|
||||
- 'lib/reporting/reports/enterprise_fee_summary/scope.rb'
|
||||
- 'lib/reporting/reports/order_cycle_management/order_cycle_management_report.rb'
|
||||
- 'lib/open_food_network/order_cycle_permissions.rb'
|
||||
- 'lib/reporting/reports/payments/payments_report.rb'
|
||||
- 'lib/reporting/reports/enterprise_fee_summary/scope.rb'
|
||||
- 'lib/reporting/reports/xero_invoices/base.rb'
|
||||
- 'lib/tasks/sample_data/product_factory.rb'
|
||||
|
||||
# Offense count: 54
|
||||
# Offense count: 51
|
||||
# Configuration parameters: CountComments, Max, CountAsOne.
|
||||
Metrics/ModuleLength:
|
||||
Exclude:
|
||||
@@ -641,9 +583,6 @@ Metrics/ModuleLength:
|
||||
- 'spec/lib/reports/customers_report_spec.rb'
|
||||
- 'spec/lib/reports/enterprise_fee_summary/authorizer_spec.rb'
|
||||
- 'spec/lib/reports/order_cycle_management_report_spec.rb'
|
||||
- 'spec/lib/reports/order_grouper_spec.rb'
|
||||
- 'spec/lib/reports/orders_and_fulfillment/customer_totals_report_spec.rb'
|
||||
- 'spec/lib/reports/orders_and_fulfillment/orders_and_fulfillment_report_spec.rb'
|
||||
- 'spec/lib/reports/products_and_inventory_report_spec.rb'
|
||||
- 'spec/lib/reports/users_and_enterprises_report_spec.rb'
|
||||
- 'spec/models/spree/adjustment_spec.rb'
|
||||
@@ -670,8 +609,8 @@ Metrics/ParameterLists:
|
||||
- 'spec/support/controller_requests_helper.rb'
|
||||
- 'spec/system/admin/reports_spec.rb'
|
||||
|
||||
# Offense count: 7
|
||||
# Configuration parameters: IgnoredMethods, Max.
|
||||
# Offense count: 5
|
||||
# Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods, Max.
|
||||
Metrics/PerceivedComplexity:
|
||||
Exclude:
|
||||
- 'app/controllers/spree/admin/taxons_controller.rb'
|
||||
@@ -679,10 +618,8 @@ Metrics/PerceivedComplexity:
|
||||
- 'app/models/enterprise_relationship.rb'
|
||||
- 'app/models/spree/ability.rb'
|
||||
- 'app/models/spree/order/checkout.rb'
|
||||
- 'lib/reporting/reports/bulk_coop/bulk_coop_report.rb'
|
||||
- 'lib/reporting/reports/payments/payments_report.rb'
|
||||
|
||||
# Offense count: 9
|
||||
# Offense count: 8
|
||||
Naming/AccessorMethodName:
|
||||
Exclude:
|
||||
- 'app/controllers/spree/admin/taxonomies_controller.rb'
|
||||
@@ -716,8 +653,8 @@ Naming/MethodParameterName:
|
||||
Exclude:
|
||||
- 'app/services/process_payment_intent.rb'
|
||||
|
||||
# Offense count: 30
|
||||
# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers.
|
||||
# Offense count: 28
|
||||
# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns.
|
||||
# SupportedStyles: snake_case, normalcase, non_integer
|
||||
# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339
|
||||
Naming/VariableNumber:
|
||||
@@ -725,7 +662,6 @@ Naming/VariableNumber:
|
||||
- 'app/controllers/spree/orders_controller.rb'
|
||||
- 'app/models/content_configuration.rb'
|
||||
- 'app/models/preference_sections/main_links_section.rb'
|
||||
- 'lib/reporting/reports/orders_and_fulfillment/customer_totals_report.rb'
|
||||
- 'lib/spree/core/controller_helpers/common.rb'
|
||||
- 'spec/controllers/spree/admin/search_controller_spec.rb'
|
||||
- 'spec/factories/stock_location_factory.rb'
|
||||
@@ -741,13 +677,13 @@ Rails/ActiveRecordOverride:
|
||||
- 'app/models/spree/product.rb'
|
||||
|
||||
# Offense count: 1
|
||||
# Cop supports --auto-correct.
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
Rails/ApplicationController:
|
||||
Exclude:
|
||||
- 'engines/dfc_provider/app/controllers/dfc_provider/api/base_controller.rb'
|
||||
|
||||
# Offense count: 6
|
||||
# Cop supports --auto-correct.
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
Rails/ApplicationJob:
|
||||
Exclude:
|
||||
- 'app/jobs/bulk_invoice_job.rb'
|
||||
@@ -758,19 +694,19 @@ Rails/ApplicationJob:
|
||||
- 'app/jobs/subscription_placement_job.rb'
|
||||
|
||||
# Offense count: 1
|
||||
# Cop supports --auto-correct.
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
Rails/ApplicationMailer:
|
||||
Exclude:
|
||||
- 'app/mailers/spree/base_mailer.rb'
|
||||
|
||||
# Offense count: 1
|
||||
# Cop supports --auto-correct.
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
Rails/ApplicationRecord:
|
||||
Exclude:
|
||||
- 'lib/tasks/data/remove_transient_data.rb'
|
||||
|
||||
# Offense count: 5
|
||||
# Cop supports --auto-correct.
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
# Configuration parameters: NilOrEmpty, NotPresent, UnlessPresent.
|
||||
Rails/Blank:
|
||||
Exclude:
|
||||
@@ -812,7 +748,7 @@ Rails/HasAndBelongsToMany:
|
||||
- 'app/models/spree/variant.rb'
|
||||
- 'app/models/spree/zone.rb'
|
||||
|
||||
# Offense count: 47
|
||||
# Offense count: 45
|
||||
# Configuration parameters: Include.
|
||||
# Include: app/models/**/*.rb
|
||||
Rails/HasManyOrHasOneDependent:
|
||||
@@ -838,9 +774,8 @@ Rails/HasManyOrHasOneDependent:
|
||||
- 'app/models/spree/taxonomy.rb'
|
||||
- 'app/models/spree/user.rb'
|
||||
- 'app/models/spree/variant.rb'
|
||||
- 'app/models/subscription.rb'
|
||||
|
||||
# Offense count: 59
|
||||
# Offense count: 62
|
||||
# Configuration parameters: Include.
|
||||
# Include: app/helpers/**/*.rb
|
||||
Rails/HelperInstanceVariable:
|
||||
@@ -881,7 +816,7 @@ Rails/InverseOf:
|
||||
|
||||
# Offense count: 38
|
||||
# Configuration parameters: Include.
|
||||
# Include: app/controllers/**/*.rb
|
||||
# Include: app/controllers/**/*.rb, app/mailers/**/*.rb
|
||||
Rails/LexicallyScopedActionFilter:
|
||||
Exclude:
|
||||
- 'app/controllers/admin/enterprise_groups_controller.rb'
|
||||
@@ -904,10 +839,9 @@ Rails/LexicallyScopedActionFilter:
|
||||
- 'app/controllers/spree/admin/zones_controller.rb'
|
||||
- 'app/controllers/spree/users_controller.rb'
|
||||
|
||||
# Offense count: 19
|
||||
# Offense count: 18
|
||||
Rails/OutputSafety:
|
||||
Exclude:
|
||||
- 'app/controllers/spree/admin/reports_controller.rb'
|
||||
- 'app/helpers/angular_form_helper.rb'
|
||||
- 'app/helpers/application_helper.rb'
|
||||
- 'app/helpers/reports_helper.rb'
|
||||
@@ -922,7 +856,7 @@ Rails/OutputSafety:
|
||||
- 'spec/system/admin/order_print_ticket_spec.rb'
|
||||
|
||||
# Offense count: 1
|
||||
# Cop supports --auto-correct.
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
Rails/RelativeDateConstant:
|
||||
Exclude:
|
||||
- 'lib/tasks/data/remove_transient_data.rb'
|
||||
@@ -936,7 +870,7 @@ Rails/SkipsModelValidations:
|
||||
- 'spec/models/spree/line_item_spec.rb'
|
||||
|
||||
# Offense count: 5
|
||||
# Cop supports --auto-correct.
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
# Configuration parameters: EnforcedStyle.
|
||||
# SupportedStyles: strict, flexible
|
||||
Rails/TimeZone:
|
||||
@@ -971,20 +905,20 @@ Security/Open:
|
||||
- 'app/services/image_importer.rb'
|
||||
|
||||
# Offense count: 1
|
||||
# Cop supports --auto-correct.
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
Style/BlockComments:
|
||||
Exclude:
|
||||
- 'spec/system/admin/tag_rules_spec.rb'
|
||||
|
||||
# Offense count: 1
|
||||
# Cop supports --auto-correct.
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
# Configuration parameters: AllowOnConstant.
|
||||
Style/CaseEquality:
|
||||
Exclude:
|
||||
- 'spec/models/spree/payment_spec.rb'
|
||||
|
||||
# Offense count: 3
|
||||
# Cop supports --auto-correct.
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
Style/CaseLikeIf:
|
||||
Exclude:
|
||||
- 'app/controllers/admin/order_cycles_controller.rb'
|
||||
@@ -992,7 +926,7 @@ Style/CaseLikeIf:
|
||||
- 'app/models/spree/payment/processing.rb'
|
||||
|
||||
# Offense count: 25
|
||||
# Cop supports --auto-correct.
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
# Configuration parameters: EnforcedStyle.
|
||||
# SupportedStyles: nested, compact
|
||||
Style/ClassAndModuleChildren:
|
||||
@@ -1027,13 +961,14 @@ Style/ClassVars:
|
||||
- 'lib/spree/core/delegate_belongs_to.rb'
|
||||
|
||||
# Offense count: 2
|
||||
# Configuration parameters: MaxUnannotatedPlaceholdersAllowed, IgnoredMethods.
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
# Configuration parameters: MaxUnannotatedPlaceholdersAllowed, AllowedMethods, AllowedPatterns, IgnoredMethods.
|
||||
# SupportedStyles: annotated, template, unannotated
|
||||
Style/FormatStringToken:
|
||||
EnforcedStyle: unannotated
|
||||
|
||||
# Offense count: 1
|
||||
# Cop supports --auto-correct.
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
# Configuration parameters: EnforcedStyle.
|
||||
# SupportedStyles: always, always_true, never
|
||||
Style/FrozenStringLiteralComment:
|
||||
@@ -1041,7 +976,7 @@ Style/FrozenStringLiteralComment:
|
||||
- '.simplecov'
|
||||
|
||||
# Offense count: 6
|
||||
# Cop supports --auto-correct.
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
Style/GlobalStdStream:
|
||||
Exclude:
|
||||
- 'lib/tasks/data.rake'
|
||||
@@ -1050,8 +985,8 @@ Style/GlobalStdStream:
|
||||
- 'lib/tasks/subscriptions/debug.rake'
|
||||
- 'lib/tasks/subscriptions/test.rake'
|
||||
|
||||
# Offense count: 39
|
||||
# Configuration parameters: MinBodyLength.
|
||||
# Offense count: 40
|
||||
# Configuration parameters: MinBodyLength, AllowConsecutiveConditionals.
|
||||
Style/GuardClause:
|
||||
Exclude:
|
||||
- 'app/controllers/admin/enterprises_controller.rb'
|
||||
@@ -1085,8 +1020,8 @@ Style/HashLikeCase:
|
||||
- 'app/models/enterprise.rb'
|
||||
|
||||
# Offense count: 1
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: IgnoredMethods.
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
# Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods.
|
||||
Style/MethodCallWithoutArgsParentheses:
|
||||
Exclude:
|
||||
- 'spec/system/flatpickr_spec.rb'
|
||||
@@ -1098,22 +1033,8 @@ Style/MissingRespondToMissing:
|
||||
- 'app/models/spree/gateway.rb'
|
||||
- 'app/models/spree/preferences/configuration.rb'
|
||||
|
||||
# Offense count: 1
|
||||
Style/MixinUsage:
|
||||
Exclude:
|
||||
- 'lib/reporting/reports/orders_and_fulfillment/orders_and_fulfillment_report.rb'
|
||||
|
||||
# Offense count: 3
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: EnforcedStyle.
|
||||
# SupportedStyles: literals, strict
|
||||
Style/MutableConstant:
|
||||
Exclude:
|
||||
- 'lib/reporting/report_template.rb'
|
||||
- 'lib/reporting/reports/packing/base.rb'
|
||||
|
||||
# Offense count: 22
|
||||
# Cop supports --auto-correct.
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
Style/NestedModifier:
|
||||
Exclude:
|
||||
- 'spec/controllers/admin/subscriptions_controller_spec.rb'
|
||||
@@ -1127,7 +1048,7 @@ Style/NestedModifier:
|
||||
- 'spec/system/admin/payments_stripe_spec.rb'
|
||||
- 'spec/system/admin/reports_spec.rb'
|
||||
|
||||
# Offense count: 26
|
||||
# Offense count: 17
|
||||
# Configuration parameters: AllowedMethods.
|
||||
# AllowedMethods: respond_to_missing?
|
||||
Style/OptionalBooleanParameter:
|
||||
@@ -1139,7 +1060,6 @@ Style/OptionalBooleanParameter:
|
||||
- 'app/models/enterprise_relationship.rb'
|
||||
- 'app/models/product_import/entry_processor.rb'
|
||||
- 'app/models/spree/order_contents.rb'
|
||||
- 'app/models/spree/preferences/file_configuration.rb'
|
||||
- 'app/models/spree/shipment.rb'
|
||||
- 'engines/order_management/app/services/order_management/stock/estimator.rb'
|
||||
- 'lib/spree/core/controller_helpers/order.rb'
|
||||
@@ -1147,7 +1067,7 @@ Style/OptionalBooleanParameter:
|
||||
- 'spec/support/request/web_helper.rb'
|
||||
|
||||
# Offense count: 1
|
||||
# Cop supports --auto-correct.
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
# Configuration parameters: EnforcedStyle.
|
||||
# SupportedStyles: short, verbose
|
||||
Style/PreferredHashMethods:
|
||||
@@ -1155,13 +1075,13 @@ Style/PreferredHashMethods:
|
||||
- 'app/controllers/api/v0/shipments_controller.rb'
|
||||
|
||||
# Offense count: 1
|
||||
# Cop supports --auto-correct.
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
# Configuration parameters: AllowMultipleReturnValues.
|
||||
Style/RedundantReturn:
|
||||
Exclude:
|
||||
- 'app/controllers/spree/admin/shipping_methods_controller.rb'
|
||||
|
||||
# Offense count: 205
|
||||
# Offense count: 209
|
||||
Style/Send:
|
||||
Exclude:
|
||||
- 'app/controllers/split_checkout_controller.rb'
|
||||
@@ -1195,17 +1115,16 @@ Style/Send:
|
||||
- 'spec/services/cart_service_spec.rb'
|
||||
- 'spec/services/products_renderer_spec.rb'
|
||||
- 'spec/services/variant_units/option_value_namer_spec.rb'
|
||||
- 'spec/spec_helper.rb'
|
||||
- 'spec/support/localized_number_helper.rb'
|
||||
|
||||
# Offense count: 1
|
||||
# Cop supports --auto-correct.
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
Style/SingleArgumentDig:
|
||||
Exclude:
|
||||
- 'app/services/checkout/form_data_adapter.rb'
|
||||
|
||||
# Offense count: 4
|
||||
# Cop supports --auto-correct.
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
Style/SlicingWithRange:
|
||||
Exclude:
|
||||
- 'app/helpers/spree/admin/navigation_helper.rb'
|
||||
@@ -1213,8 +1132,8 @@ Style/SlicingWithRange:
|
||||
- 'engines/order_management/app/services/order_management/subscriptions/validator.rb'
|
||||
- 'lib/discourse/single_sign_on.rb'
|
||||
|
||||
# Offense count: 28
|
||||
# Cop supports --auto-correct.
|
||||
# Offense count: 29
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
# Configuration parameters: Mode.
|
||||
Style/StringConcatenation:
|
||||
Exclude:
|
||||
|
||||
13
Gemfile
13
Gemfile
@@ -104,7 +104,7 @@ gem 'wicked_pdf'
|
||||
gem 'wkhtmltopdf-binary'
|
||||
|
||||
gem 'immigrant'
|
||||
gem 'roo', github: "roo-rb/roo" # master is currently needed for Ruby 3.x (awaiting new release)
|
||||
gem 'roo'
|
||||
gem 'spreadsheet_architect'
|
||||
|
||||
gem 'whenever', require: false
|
||||
@@ -131,7 +131,7 @@ gem 'flipper'
|
||||
gem 'flipper-active_record'
|
||||
gem 'flipper-ui'
|
||||
|
||||
gem "view_component", require: "view_component/engine"
|
||||
gem "view_component"
|
||||
|
||||
group :production, :staging do
|
||||
gem 'ddtrace'
|
||||
@@ -140,8 +140,6 @@ group :production, :staging do
|
||||
end
|
||||
|
||||
group :test, :development do
|
||||
# Pretty printed test output
|
||||
gem 'awesome_print'
|
||||
gem 'bullet'
|
||||
gem 'capybara'
|
||||
gem 'cuprite'
|
||||
@@ -154,14 +152,12 @@ group :test, :development do
|
||||
gem 'rspec-rails', ">= 3.5.2"
|
||||
gem 'rspec-retry'
|
||||
gem 'rswag-specs'
|
||||
gem 'selenium-webdriver'
|
||||
gem 'shoulda-matchers'
|
||||
gem 'timecop'
|
||||
gem 'webdrivers'
|
||||
gem 'debug', '>= 1.0.0'
|
||||
end
|
||||
|
||||
group :test do
|
||||
gem 'byebug'
|
||||
gem 'pdf-reader'
|
||||
gem 'rails-controller-testing'
|
||||
gem 'simplecov', require: false
|
||||
@@ -176,14 +172,13 @@ group :development do
|
||||
gem 'foreman'
|
||||
gem 'listen'
|
||||
gem 'pry', '~> 0.13.0'
|
||||
gem 'pry-byebug', '~> 3.9.0'
|
||||
gem 'rubocop'
|
||||
gem 'rubocop-rails'
|
||||
gem 'spring'
|
||||
gem 'spring-commands-rspec'
|
||||
gem 'web-console'
|
||||
|
||||
gem "view_component_storybook", require: "view_component/storybook/engine"
|
||||
gem "view_component_storybook"
|
||||
|
||||
gem 'rack-mini-profiler', '< 3.0.0'
|
||||
end
|
||||
|
||||
320
Gemfile.lock
320
Gemfile.lock
@@ -24,14 +24,6 @@ GIT
|
||||
sass-rails
|
||||
thor (>= 0.14)
|
||||
|
||||
GIT
|
||||
remote: https://github.com/roo-rb/roo.git
|
||||
revision: 709464c77623be2bc09b2103405d90ded7604a75
|
||||
specs:
|
||||
roo (2.8.3)
|
||||
nokogiri (~> 1)
|
||||
rubyzip (>= 1.3.0, < 3.0.0)
|
||||
|
||||
PATH
|
||||
remote: engines/catalog
|
||||
specs:
|
||||
@@ -59,67 +51,67 @@ GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
Ascii85 (1.1.0)
|
||||
actioncable (6.1.4.4)
|
||||
actionpack (= 6.1.4.4)
|
||||
activesupport (= 6.1.4.4)
|
||||
actioncable (6.1.6.1)
|
||||
actionpack (= 6.1.6.1)
|
||||
activesupport (= 6.1.6.1)
|
||||
nio4r (~> 2.0)
|
||||
websocket-driver (>= 0.6.1)
|
||||
actionmailbox (6.1.4.4)
|
||||
actionpack (= 6.1.4.4)
|
||||
activejob (= 6.1.4.4)
|
||||
activerecord (= 6.1.4.4)
|
||||
activestorage (= 6.1.4.4)
|
||||
activesupport (= 6.1.4.4)
|
||||
actionmailbox (6.1.6.1)
|
||||
actionpack (= 6.1.6.1)
|
||||
activejob (= 6.1.6.1)
|
||||
activerecord (= 6.1.6.1)
|
||||
activestorage (= 6.1.6.1)
|
||||
activesupport (= 6.1.6.1)
|
||||
mail (>= 2.7.1)
|
||||
actionmailer (6.1.4.4)
|
||||
actionpack (= 6.1.4.4)
|
||||
actionview (= 6.1.4.4)
|
||||
activejob (= 6.1.4.4)
|
||||
activesupport (= 6.1.4.4)
|
||||
actionmailer (6.1.6.1)
|
||||
actionpack (= 6.1.6.1)
|
||||
actionview (= 6.1.6.1)
|
||||
activejob (= 6.1.6.1)
|
||||
activesupport (= 6.1.6.1)
|
||||
mail (~> 2.5, >= 2.5.4)
|
||||
rails-dom-testing (~> 2.0)
|
||||
actionpack (6.1.4.4)
|
||||
actionview (= 6.1.4.4)
|
||||
activesupport (= 6.1.4.4)
|
||||
actionpack (6.1.6.1)
|
||||
actionview (= 6.1.6.1)
|
||||
activesupport (= 6.1.6.1)
|
||||
rack (~> 2.0, >= 2.0.9)
|
||||
rack-test (>= 0.6.3)
|
||||
rails-dom-testing (~> 2.0)
|
||||
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
||||
actionpack-action_caching (1.2.2)
|
||||
actionpack (>= 4.0.0)
|
||||
actiontext (6.1.4.4)
|
||||
actionpack (= 6.1.4.4)
|
||||
activerecord (= 6.1.4.4)
|
||||
activestorage (= 6.1.4.4)
|
||||
activesupport (= 6.1.4.4)
|
||||
actiontext (6.1.6.1)
|
||||
actionpack (= 6.1.6.1)
|
||||
activerecord (= 6.1.6.1)
|
||||
activestorage (= 6.1.6.1)
|
||||
activesupport (= 6.1.6.1)
|
||||
nokogiri (>= 1.8.5)
|
||||
actionview (6.1.4.4)
|
||||
activesupport (= 6.1.4.4)
|
||||
actionview (6.1.6.1)
|
||||
activesupport (= 6.1.6.1)
|
||||
builder (~> 3.1)
|
||||
erubi (~> 1.4)
|
||||
rails-dom-testing (~> 2.0)
|
||||
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
||||
active_model_serializers (0.8.4)
|
||||
activemodel (>= 3.0)
|
||||
active_storage_validations (0.9.7)
|
||||
active_storage_validations (0.9.8)
|
||||
activejob (>= 5.2.0)
|
||||
activemodel (>= 5.2.0)
|
||||
activestorage (>= 5.2.0)
|
||||
activesupport (>= 5.2.0)
|
||||
activejob (6.1.4.4)
|
||||
activesupport (= 6.1.4.4)
|
||||
activejob (6.1.6.1)
|
||||
activesupport (= 6.1.6.1)
|
||||
globalid (>= 0.3.6)
|
||||
activemerchant (1.123.0)
|
||||
activesupport (>= 4.2)
|
||||
builder (>= 2.1.2, < 4.0.0)
|
||||
i18n (>= 0.6.9)
|
||||
nokogiri (~> 1.4)
|
||||
activemodel (6.1.4.4)
|
||||
activesupport (= 6.1.4.4)
|
||||
activerecord (6.1.4.4)
|
||||
activemodel (= 6.1.4.4)
|
||||
activesupport (= 6.1.4.4)
|
||||
activerecord-import (1.3.0)
|
||||
activemodel (6.1.6.1)
|
||||
activesupport (= 6.1.6.1)
|
||||
activerecord (6.1.6.1)
|
||||
activemodel (= 6.1.6.1)
|
||||
activesupport (= 6.1.6.1)
|
||||
activerecord-import (1.4.0)
|
||||
activerecord (>= 4.2)
|
||||
activerecord-postgresql-adapter (0.0.1)
|
||||
pg
|
||||
@@ -129,14 +121,14 @@ GEM
|
||||
multi_json (~> 1.11, >= 1.11.2)
|
||||
rack (>= 2.0.8, < 3)
|
||||
railties (>= 5.2.4.1)
|
||||
activestorage (6.1.4.4)
|
||||
actionpack (= 6.1.4.4)
|
||||
activejob (= 6.1.4.4)
|
||||
activerecord (= 6.1.4.4)
|
||||
activesupport (= 6.1.4.4)
|
||||
marcel (~> 1.0.0)
|
||||
activestorage (6.1.6.1)
|
||||
actionpack (= 6.1.6.1)
|
||||
activejob (= 6.1.6.1)
|
||||
activerecord (= 6.1.6.1)
|
||||
activesupport (= 6.1.6.1)
|
||||
marcel (~> 1.0)
|
||||
mini_mime (>= 1.1.0)
|
||||
activesupport (6.1.4.4)
|
||||
activesupport (6.1.6.1)
|
||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||
i18n (>= 1.6, < 2)
|
||||
minitest (>= 5.1)
|
||||
@@ -149,20 +141,20 @@ GEM
|
||||
addressable (2.8.0)
|
||||
public_suffix (>= 2.0.2, < 5.0)
|
||||
afm (0.2.2)
|
||||
angular-rails-templates (1.1.0)
|
||||
railties (>= 4.2, < 7)
|
||||
angular-rails-templates (1.2.0)
|
||||
railties (>= 5.0, < 7.1)
|
||||
sprockets (>= 3.0, < 5)
|
||||
sprockets-rails
|
||||
tilt
|
||||
angular_rails_csrf (4.5.0)
|
||||
railties (>= 3, < 7)
|
||||
angular_rails_csrf (5.0.0)
|
||||
railties (>= 3, < 8)
|
||||
angularjs-file-upload-rails (2.4.1)
|
||||
angularjs-rails (1.8.0)
|
||||
arel-helpers (2.14.0)
|
||||
activerecord (>= 3.1.0, < 8)
|
||||
ast (2.4.2)
|
||||
awesome_nested_set (3.4.0)
|
||||
activerecord (>= 4.0.0, < 7.0)
|
||||
awesome_print (1.9.2)
|
||||
awesome_nested_set (3.5.0)
|
||||
activerecord (>= 4.0.0, < 7.1)
|
||||
aws-eventstream (1.2.0)
|
||||
aws-partitions (1.601.0)
|
||||
aws-sdk-core (3.131.2)
|
||||
@@ -185,20 +177,19 @@ GEM
|
||||
bcrypt (3.1.18)
|
||||
bigdecimal (3.0.2)
|
||||
bindex (0.8.1)
|
||||
bootsnap (1.10.1)
|
||||
bootsnap (1.13.0)
|
||||
msgpack (~> 1.2)
|
||||
bugsnag (6.24.2)
|
||||
concurrent-ruby (~> 1.0)
|
||||
builder (3.2.4)
|
||||
bullet (7.0.2)
|
||||
bullet (7.0.3)
|
||||
activesupport (>= 3.0.0)
|
||||
uniform_notifier (~> 1.11)
|
||||
byebug (11.1.3)
|
||||
cable_ready (5.0.0.pre3)
|
||||
rails (>= 5.2)
|
||||
thread-local (>= 1.1.0)
|
||||
cancancan (1.15.0)
|
||||
capybara (3.36.0)
|
||||
capybara (3.37.1)
|
||||
addressable
|
||||
matrix
|
||||
mini_mime (>= 0.1.3)
|
||||
@@ -212,7 +203,6 @@ GEM
|
||||
marcel (~> 1.0)
|
||||
nokogiri (~> 1.10, >= 1.10.4)
|
||||
rubyzip (>= 1.3.0, < 3)
|
||||
childprocess (4.1.0)
|
||||
chronic (0.10.2)
|
||||
cliver (0.3.2)
|
||||
coderay (1.1.3)
|
||||
@@ -223,7 +213,8 @@ GEM
|
||||
coffee-script-source
|
||||
execjs
|
||||
coffee-script-source (1.12.2)
|
||||
combine_pdf (1.0.21)
|
||||
combine_pdf (1.0.22)
|
||||
matrix
|
||||
ruby-rc4 (>= 0.1.5)
|
||||
concurrent-ruby (1.1.10)
|
||||
connection_pool (2.2.5)
|
||||
@@ -245,8 +236,11 @@ GEM
|
||||
debase-ruby_core_source (= 0.10.12)
|
||||
msgpack
|
||||
debase-ruby_core_source (0.10.12)
|
||||
debug (1.6.2)
|
||||
irb (>= 1.3.6)
|
||||
reline (>= 0.3.1)
|
||||
debugger-linecache (1.2.0)
|
||||
devise (4.8.0)
|
||||
devise (4.8.1)
|
||||
bcrypt (~> 3.0)
|
||||
orm_adapter (~> 0.1)
|
||||
railties (>= 4.1.0)
|
||||
@@ -258,15 +252,15 @@ GEM
|
||||
devise (>= 4.8.0)
|
||||
devise-token_authenticatable (1.1.0)
|
||||
devise (>= 4.0.0, < 5.0.0)
|
||||
diff-lcs (1.4.4)
|
||||
diff-lcs (1.5.0)
|
||||
digest (3.1.0)
|
||||
docile (1.4.0)
|
||||
dotenv (2.7.6)
|
||||
dotenv-rails (2.7.6)
|
||||
dotenv (= 2.7.6)
|
||||
dotenv (2.8.1)
|
||||
dotenv-rails (2.8.1)
|
||||
dotenv (= 2.8.1)
|
||||
railties (>= 3.2)
|
||||
dry-inflector (0.2.1)
|
||||
erubi (1.10.0)
|
||||
erubi (1.11.0)
|
||||
et-orbi (1.2.7)
|
||||
tzinfo
|
||||
excon (0.81.0)
|
||||
@@ -276,15 +270,10 @@ GEM
|
||||
factory_bot_rails (6.2.0)
|
||||
factory_bot (~> 6.2.0)
|
||||
railties (>= 5.0.0)
|
||||
faraday (1.4.1)
|
||||
faraday-excon (~> 1.1)
|
||||
faraday-net_http (~> 1.0)
|
||||
faraday-net_http_persistent (~> 1.1)
|
||||
multipart-post (>= 1.2, < 3)
|
||||
faraday (2.3.0)
|
||||
faraday-net_http (~> 2.0)
|
||||
ruby2_keywords (>= 0.0.4)
|
||||
faraday-excon (1.1.0)
|
||||
faraday-net_http (1.0.1)
|
||||
faraday-net_http_persistent (1.1.0)
|
||||
faraday-net_http (2.0.3)
|
||||
ferrum (0.11)
|
||||
addressable (~> 2.5)
|
||||
cliver (~> 0.3)
|
||||
@@ -339,7 +328,7 @@ GEM
|
||||
highline (2.0.3)
|
||||
hiredis (0.6.3)
|
||||
htmlentities (4.3.4)
|
||||
i18n (1.8.10)
|
||||
i18n (1.12.0)
|
||||
concurrent-ruby (~> 1.0)
|
||||
i18n-js (3.9.2)
|
||||
i18n (>= 0.6.6)
|
||||
@@ -348,7 +337,10 @@ GEM
|
||||
ruby-vips (>= 2.0.17, < 3)
|
||||
immigrant (0.3.6)
|
||||
activerecord (>= 3.0)
|
||||
io-console (0.5.11)
|
||||
ipaddress (0.8.3)
|
||||
irb (1.4.1)
|
||||
reline (>= 0.3.0)
|
||||
jmespath (1.6.1)
|
||||
jquery-rails (4.4.0)
|
||||
rails-dom-testing (>= 1, < 3)
|
||||
@@ -356,7 +348,7 @@ GEM
|
||||
thor (>= 0.14, < 2.0)
|
||||
jquery-ui-rails (4.2.1)
|
||||
railties (>= 3.2.16)
|
||||
json (2.6.1)
|
||||
json (2.6.2)
|
||||
json-schema (2.8.1)
|
||||
addressable (>= 2.4)
|
||||
json_spec (1.1.5)
|
||||
@@ -364,13 +356,13 @@ GEM
|
||||
rspec (>= 2.0, < 4.0)
|
||||
jsonapi-serializer (2.2.0)
|
||||
activesupport (>= 4.2)
|
||||
jwt (2.3.0)
|
||||
jwt (2.5.0)
|
||||
knapsack (4.0.0)
|
||||
rake
|
||||
launchy (2.5.0)
|
||||
addressable (~> 2.7)
|
||||
letter_opener (1.7.0)
|
||||
launchy (~> 2.2)
|
||||
letter_opener (1.8.1)
|
||||
launchy (>= 2.2, < 3)
|
||||
libv8-node (15.14.0.1)
|
||||
listen (3.7.1)
|
||||
rb-fsevent (~> 0.10, >= 0.10.3)
|
||||
@@ -394,41 +386,41 @@ GEM
|
||||
mini_portile2 (2.8.0)
|
||||
mini_racer (0.4.0)
|
||||
libv8-node (~> 15.14.0.0)
|
||||
minitest (5.16.1)
|
||||
minitest (5.16.3)
|
||||
monetize (1.12.0)
|
||||
money (~> 6.12)
|
||||
money (6.16.0)
|
||||
i18n (>= 0.6.4, <= 2)
|
||||
msgpack (1.4.2)
|
||||
msgpack (1.5.4)
|
||||
multi_json (1.15.0)
|
||||
multi_xml (0.6.0)
|
||||
multipart-post (2.1.1)
|
||||
nio4r (2.5.8)
|
||||
nokogiri (1.13.6)
|
||||
nokogiri (1.13.8)
|
||||
mini_portile2 (~> 2.8.0)
|
||||
racc (~> 1.4)
|
||||
oauth2 (1.4.7)
|
||||
faraday (>= 0.8, < 2.0)
|
||||
oauth2 (1.4.10)
|
||||
faraday (>= 0.17.3, < 3.0)
|
||||
jwt (>= 1.0, < 3.0)
|
||||
multi_json (~> 1.3)
|
||||
multi_xml (~> 0.5)
|
||||
rack (>= 1.2, < 3)
|
||||
orm_adapter (0.5.0)
|
||||
pagy (5.1.2)
|
||||
pagy (5.10.1)
|
||||
activesupport
|
||||
paper_trail (12.1.0)
|
||||
activerecord (>= 5.2)
|
||||
request_store (~> 1.1)
|
||||
parallel (1.21.0)
|
||||
paranoia (2.4.3)
|
||||
activerecord (>= 4.0, < 6.2)
|
||||
parser (3.1.0.0)
|
||||
parallel (1.22.1)
|
||||
paranoia (2.6.0)
|
||||
activerecord (>= 5.1, < 7.1)
|
||||
parser (3.1.2.1)
|
||||
ast (~> 2.4.1)
|
||||
paypal-sdk-core (0.3.4)
|
||||
multi_json (~> 1.0)
|
||||
xml-simple
|
||||
paypal-sdk-merchant (1.117.2)
|
||||
paypal-sdk-core (~> 0.3.0)
|
||||
pdf-reader (2.5.0)
|
||||
pdf-reader (2.10.0)
|
||||
Ascii85 (~> 1.0)
|
||||
afm (~> 0.2.1)
|
||||
hashery (~> 2.0)
|
||||
@@ -439,15 +431,12 @@ GEM
|
||||
pry (0.13.1)
|
||||
coderay (~> 1.1)
|
||||
method_source (~> 1.0)
|
||||
pry-byebug (3.9.0)
|
||||
byebug (~> 11.0)
|
||||
pry (~> 0.13.0)
|
||||
public_suffix (4.0.7)
|
||||
puma (5.6.4)
|
||||
puma (5.6.5)
|
||||
nio4r (~> 2.0)
|
||||
raabro (1.4.0)
|
||||
racc (1.6.0)
|
||||
rack (2.2.3.1)
|
||||
rack (2.2.4)
|
||||
rack-mini-profiler (2.3.4)
|
||||
rack (>= 1.2.0)
|
||||
rack-protection (2.1.0)
|
||||
@@ -457,23 +446,23 @@ GEM
|
||||
rack-rewrite (1.5.1)
|
||||
rack-ssl (1.4.1)
|
||||
rack
|
||||
rack-test (1.1.0)
|
||||
rack (>= 1.0, < 3)
|
||||
rack-timeout (0.6.0)
|
||||
rails (6.1.4.4)
|
||||
actioncable (= 6.1.4.4)
|
||||
actionmailbox (= 6.1.4.4)
|
||||
actionmailer (= 6.1.4.4)
|
||||
actionpack (= 6.1.4.4)
|
||||
actiontext (= 6.1.4.4)
|
||||
actionview (= 6.1.4.4)
|
||||
activejob (= 6.1.4.4)
|
||||
activemodel (= 6.1.4.4)
|
||||
activerecord (= 6.1.4.4)
|
||||
activestorage (= 6.1.4.4)
|
||||
activesupport (= 6.1.4.4)
|
||||
rack-test (2.0.2)
|
||||
rack (>= 1.3)
|
||||
rack-timeout (0.6.3)
|
||||
rails (6.1.6.1)
|
||||
actioncable (= 6.1.6.1)
|
||||
actionmailbox (= 6.1.6.1)
|
||||
actionmailer (= 6.1.6.1)
|
||||
actionpack (= 6.1.6.1)
|
||||
actiontext (= 6.1.6.1)
|
||||
actionview (= 6.1.6.1)
|
||||
activejob (= 6.1.6.1)
|
||||
activemodel (= 6.1.6.1)
|
||||
activerecord (= 6.1.6.1)
|
||||
activestorage (= 6.1.6.1)
|
||||
activesupport (= 6.1.6.1)
|
||||
bundler (>= 1.15.0)
|
||||
railties (= 6.1.4.4)
|
||||
railties (= 6.1.6.1)
|
||||
sprockets-rails (>= 2.0.0)
|
||||
rails-controller-testing (1.0.5)
|
||||
actionpack (>= 5.0.1.rc1)
|
||||
@@ -484,15 +473,15 @@ GEM
|
||||
nokogiri (>= 1.6)
|
||||
rails-html-sanitizer (1.4.3)
|
||||
loofah (~> 2.3)
|
||||
rails-i18n (7.0.1)
|
||||
rails-i18n (7.0.5)
|
||||
i18n (>= 0.7, < 2)
|
||||
railties (>= 6.0.0, < 8)
|
||||
rails_safe_tasks (1.0.0)
|
||||
railties (6.1.4.4)
|
||||
actionpack (= 6.1.4.4)
|
||||
activesupport (= 6.1.4.4)
|
||||
railties (6.1.6.1)
|
||||
actionpack (= 6.1.6.1)
|
||||
activesupport (= 6.1.6.1)
|
||||
method_source
|
||||
rake (>= 0.13)
|
||||
rake (>= 12.2)
|
||||
thor (~> 1.0)
|
||||
rainbow (3.1.1)
|
||||
rake (13.0.6)
|
||||
@@ -504,8 +493,10 @@ GEM
|
||||
rb-inotify (0.10.1)
|
||||
ffi (~> 1.0)
|
||||
redcarpet (3.5.1)
|
||||
redis (4.7.0)
|
||||
regexp_parser (2.2.0)
|
||||
redis (4.8.0)
|
||||
regexp_parser (2.5.0)
|
||||
reline (0.3.1)
|
||||
io-console (~> 0.5)
|
||||
request_store (1.5.0)
|
||||
rack (>= 1.4)
|
||||
responders (3.0.1)
|
||||
@@ -522,19 +513,22 @@ GEM
|
||||
builder (>= 3.0)
|
||||
dry-inflector (~> 0.1)
|
||||
rubyzip (>= 1.0)
|
||||
roo (2.9.0)
|
||||
nokogiri (~> 1)
|
||||
rubyzip (>= 1.3.0, < 3.0.0)
|
||||
rspec (3.10.0)
|
||||
rspec-core (~> 3.10.0)
|
||||
rspec-expectations (~> 3.10.0)
|
||||
rspec-mocks (~> 3.10.0)
|
||||
rspec-core (3.10.1)
|
||||
rspec-core (3.10.2)
|
||||
rspec-support (~> 3.10.0)
|
||||
rspec-expectations (3.10.1)
|
||||
rspec-expectations (3.10.2)
|
||||
diff-lcs (>= 1.2.0, < 2.0)
|
||||
rspec-support (~> 3.10.0)
|
||||
rspec-mocks (3.10.2)
|
||||
diff-lcs (>= 1.2.0, < 2.0)
|
||||
rspec-support (~> 3.10.0)
|
||||
rspec-rails (5.0.2)
|
||||
rspec-rails (5.1.2)
|
||||
actionpack (>= 5.2)
|
||||
activesupport (>= 5.2)
|
||||
railties (>= 5.2)
|
||||
@@ -544,28 +538,29 @@ GEM
|
||||
rspec-support (~> 3.10)
|
||||
rspec-retry (0.6.2)
|
||||
rspec-core (> 3.3)
|
||||
rspec-support (3.10.2)
|
||||
rswag-api (2.4.0)
|
||||
railties (>= 3.1, < 7.0)
|
||||
rswag-specs (2.4.0)
|
||||
activesupport (>= 3.1, < 7.0)
|
||||
rspec-support (3.10.3)
|
||||
rswag-api (2.5.1)
|
||||
railties (>= 3.1, < 7.1)
|
||||
rswag-specs (2.5.1)
|
||||
activesupport (>= 3.1, < 7.1)
|
||||
json-schema (~> 2.2)
|
||||
railties (>= 3.1, < 7.0)
|
||||
rswag-ui (2.4.0)
|
||||
actionpack (>= 3.1, < 7.0)
|
||||
railties (>= 3.1, < 7.0)
|
||||
rubocop (1.22.2)
|
||||
railties (>= 3.1, < 7.1)
|
||||
rswag-ui (2.5.1)
|
||||
actionpack (>= 3.1, < 7.1)
|
||||
railties (>= 3.1, < 7.1)
|
||||
rubocop (1.36.0)
|
||||
json (~> 2.3)
|
||||
parallel (~> 1.10)
|
||||
parser (>= 3.0.0.0)
|
||||
parser (>= 3.1.2.1)
|
||||
rainbow (>= 2.2.2, < 4.0)
|
||||
regexp_parser (>= 1.8, < 3.0)
|
||||
rexml
|
||||
rubocop-ast (>= 1.12.0, < 2.0)
|
||||
rexml (>= 3.2.5, < 4.0)
|
||||
rubocop-ast (>= 1.20.1, < 2.0)
|
||||
ruby-progressbar (~> 1.7)
|
||||
unicode-display_width (>= 1.4.0, < 3.0)
|
||||
rubocop-ast (1.15.1)
|
||||
parser (>= 3.0.1.1)
|
||||
rubocop-rails (2.13.2)
|
||||
rubocop-ast (1.21.0)
|
||||
parser (>= 3.1.1.0)
|
||||
rubocop-rails (2.15.2)
|
||||
activesupport (>= 4.2.0)
|
||||
rack (>= 1.1)
|
||||
rubocop (>= 1.7.0, < 2.0)
|
||||
@@ -573,7 +568,7 @@ GEM
|
||||
ruby-rc4 (0.1.5)
|
||||
ruby-vips (2.1.4)
|
||||
ffi (~> 1.12)
|
||||
ruby2_keywords (0.0.4)
|
||||
ruby2_keywords (0.0.5)
|
||||
rubyzip (2.3.2)
|
||||
rufus-scheduler (3.8.1)
|
||||
fugit (~> 1.1, >= 1.1.6)
|
||||
@@ -585,17 +580,13 @@ GEM
|
||||
sprockets-rails (>= 2.0, < 4.0)
|
||||
tilt (>= 1.1, < 3)
|
||||
sd_notify (0.1.1)
|
||||
selenium-webdriver (4.0.3)
|
||||
childprocess (>= 0.5, < 5.0)
|
||||
rexml (~> 3.2, >= 3.2.5)
|
||||
rubyzip (>= 1.2.2)
|
||||
semantic_range (3.0.0)
|
||||
shoulda-matchers (5.1.0)
|
||||
activesupport (>= 5.2.0)
|
||||
sidekiq (6.3.1)
|
||||
connection_pool (>= 2.2.2)
|
||||
sidekiq (6.5.6)
|
||||
connection_pool (>= 2.2.5)
|
||||
rack (~> 2.0)
|
||||
redis (>= 4.2.0)
|
||||
redis (>= 4.5.0, < 5)
|
||||
sidekiq-scheduler (4.0.2)
|
||||
redis (>= 4.2.0)
|
||||
rufus-scheduler (~> 3.2)
|
||||
@@ -611,7 +602,7 @@ GEM
|
||||
axlsx_styler (>= 1.0.0, < 2)
|
||||
caxlsx (>= 2.0.2, < 4)
|
||||
rodf (>= 1.0.0, < 2)
|
||||
spring (3.0.0)
|
||||
spring (4.0.0)
|
||||
spring-commands-rspec (1.0.4)
|
||||
spring (>= 0.9.1)
|
||||
sprockets (3.7.2)
|
||||
@@ -629,27 +620,28 @@ GEM
|
||||
activerecord (>= 5.1)
|
||||
state_machines-activemodel (>= 0.8.0)
|
||||
stringex (2.8.5)
|
||||
stripe (5.42.0)
|
||||
stripe (7.1.0)
|
||||
temple (0.8.2)
|
||||
test-prof (1.0.9)
|
||||
test-unit (3.5.0)
|
||||
test-prof (1.0.10)
|
||||
test-unit (3.5.3)
|
||||
power_assert
|
||||
thor (1.2.1)
|
||||
thread-local (1.1.0)
|
||||
tilt (2.0.10)
|
||||
timecop (0.9.4)
|
||||
tilt (2.0.11)
|
||||
timecop (0.9.5)
|
||||
ttfunk (1.7.0)
|
||||
tzinfo (2.0.4)
|
||||
tzinfo (2.0.5)
|
||||
concurrent-ruby (~> 1.0)
|
||||
uglifier (4.2.0)
|
||||
execjs (>= 0.3.0, < 3)
|
||||
unicode-display_width (2.1.0)
|
||||
unicode-display_width (2.2.0)
|
||||
uniform_notifier (1.16.0)
|
||||
valid_email2 (4.0.0)
|
||||
valid_email2 (4.0.4)
|
||||
activemodel (>= 3.2)
|
||||
mail (~> 2.5)
|
||||
view_component (2.57.1)
|
||||
view_component (2.71.0)
|
||||
activesupport (>= 5.0.0, < 8.0)
|
||||
concurrent-ruby (~> 1.0)
|
||||
method_source (~> 1.0)
|
||||
view_component_storybook (0.11.1)
|
||||
view_component (>= 2.36)
|
||||
@@ -660,11 +652,7 @@ GEM
|
||||
activemodel (>= 6.0.0)
|
||||
bindex (>= 0.4.0)
|
||||
railties (>= 6.0.0)
|
||||
webdrivers (5.0.0)
|
||||
nokogiri (~> 1.6)
|
||||
rubyzip (>= 1.3.0)
|
||||
selenium-webdriver (~> 4.0)
|
||||
webmock (3.14.0)
|
||||
webmock (3.18.1)
|
||||
addressable (>= 2.8.0)
|
||||
crack (>= 0.3.2)
|
||||
hashdiff (>= 0.4.0, < 2.0.0)
|
||||
@@ -705,13 +693,11 @@ DEPENDENCIES
|
||||
angularjs-rails (= 1.8.0)
|
||||
arel-helpers (~> 2.12)
|
||||
awesome_nested_set
|
||||
awesome_print
|
||||
aws-sdk-s3
|
||||
bigdecimal (= 3.0.2)
|
||||
bootsnap
|
||||
bugsnag
|
||||
bullet
|
||||
byebug
|
||||
cable_ready (= 5.0.0.pre3)
|
||||
cancancan (~> 1.15.0)
|
||||
capybara
|
||||
@@ -722,6 +708,7 @@ DEPENDENCIES
|
||||
database_cleaner
|
||||
db2fog!
|
||||
ddtrace
|
||||
debug (>= 1.0.0)
|
||||
debugger-linecache
|
||||
devise
|
||||
devise-encryptable
|
||||
@@ -771,7 +758,6 @@ DEPENDENCIES
|
||||
pdf-reader
|
||||
pg (~> 1.2.3)
|
||||
pry (~> 0.13.0)
|
||||
pry-byebug (~> 3.9.0)
|
||||
puma
|
||||
rack-mini-profiler (< 3.0.0)
|
||||
rack-rewrite
|
||||
@@ -787,7 +773,7 @@ DEPENDENCIES
|
||||
responders
|
||||
rexml
|
||||
roadie-rails
|
||||
roo!
|
||||
roo
|
||||
rspec-rails (>= 3.5.2)
|
||||
rspec-retry
|
||||
rswag-api
|
||||
@@ -797,7 +783,6 @@ DEPENDENCIES
|
||||
rubocop-rails
|
||||
sd_notify
|
||||
select2-rails!
|
||||
selenium-webdriver
|
||||
shoulda-matchers
|
||||
sidekiq
|
||||
sidekiq-scheduler
|
||||
@@ -817,7 +802,6 @@ DEPENDENCIES
|
||||
view_component_storybook
|
||||
web!
|
||||
web-console
|
||||
webdrivers
|
||||
webmock
|
||||
webpacker (~> 5)
|
||||
whenever
|
||||
|
||||
@@ -39,7 +39,7 @@ We use [BrowserStack](https://www.browserstack.com/) as a manual testing tool. B
|
||||
|
||||
## Licence
|
||||
|
||||
Copyright (c) 2012 - 2021 Open Food Foundation, released under the AGPL licence.
|
||||
Copyright (c) 2012 - 2022 Open Food Foundation, released under the AGPL licence.
|
||||
|
||||
[survey]: https://docs.google.com/a/eaterprises.com.au/forms/d/1zxR5vSiU9CigJ9cEaC8-eJLgYid8CR8er7PPH9Mc-30/edit#
|
||||
[slack-invite]: https://join.slack.com/t/openfoodnetwork/shared_invite/zt-9sjkjdlu-r02kUMP1zbrTgUhZhYPF~A
|
||||
|
||||
@@ -105,6 +105,8 @@
|
||||
//= require moment/locale/tr.js
|
||||
//= require moment/locale/pl.js
|
||||
|
||||
//= require js-big-decimal/dist/web/js-big-decimal.min.js
|
||||
|
||||
// foundation
|
||||
//= require ../shared/mm-foundation-tpls-0.9.0-20180826174721.min.js
|
||||
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
angular.module("admin.enterprise_groups")
|
||||
.controller "sideMenuCtrl", ($scope, SideMenu) ->
|
||||
$scope.menu = SideMenu
|
||||
$scope.select = SideMenu.select
|
||||
|
||||
$scope.menu.setItems [
|
||||
{ name: 'primary_details', label: t('primary_details'), icon_class: "icon-user" }
|
||||
{ name: 'users', label: t('users'), icon_class: "icon-user" }
|
||||
{ name: 'about', label: t('about'), icon_class: "icon-pencil" }
|
||||
{ name: 'images', label: t('images'), icon_class: "icon-picture" }
|
||||
{ name: 'contact', label: t('admin_enterprise_groups_contact'), icon_class: "icon-phone" }
|
||||
{ name: 'web', label: t('admin_enterprise_groups_web'), icon_class: "icon-globe" }
|
||||
]
|
||||
|
||||
$scope.select(0)
|
||||
@@ -1,27 +0,0 @@
|
||||
angular.module("admin.enterprises")
|
||||
.controller "permalinkCtrl", ($scope, PermalinkChecker) ->
|
||||
# locals
|
||||
initialPermalink = $scope.Enterprise.permalink
|
||||
pendingRequest = null
|
||||
|
||||
# variables on $scope
|
||||
$scope.availablility = ""
|
||||
$scope.checking = false
|
||||
|
||||
$scope.$watch "Enterprise.permalink", (newValue, oldValue) ->
|
||||
if newValue == initialPermalink
|
||||
$scope.availability = ""
|
||||
return
|
||||
|
||||
$scope.checking = true
|
||||
pendingRequest = PermalinkChecker.check(newValue)
|
||||
|
||||
pendingRequest.then (data) ->
|
||||
if data.permalink == initialPermalink
|
||||
$scope.availability = ""
|
||||
else
|
||||
$scope.availability = data.available
|
||||
$scope.Enterprise.permalink = data.permalink
|
||||
$scope.checking = false
|
||||
, (data) ->
|
||||
# Do nothing (this is hopefully an aborted request)
|
||||
@@ -1,49 +0,0 @@
|
||||
angular.module("admin.enterprises")
|
||||
.controller "sideMenuCtrl", ($scope, $parse, enterprise, SideMenu, enterprisePermissions) ->
|
||||
$scope.Enterprise = enterprise
|
||||
$scope.menu = SideMenu
|
||||
$scope.select = SideMenu.select
|
||||
|
||||
$scope.menu.setItems [
|
||||
{ name: 'primary_details', label: t('primary_details'), icon_class: "icon-home" }
|
||||
{ name: 'address', label: t('address'), icon_class: "icon-map-marker" }
|
||||
{ name: 'contact', label: t('contact'), icon_class: "icon-phone" }
|
||||
{ name: 'social', label: t('social'), icon_class: "icon-twitter" }
|
||||
{ name: 'about', label: t('about'), icon_class: "icon-pencil" }
|
||||
{ name: 'business_details', label: t('business_details'), icon_class: "icon-briefcase" }
|
||||
{ name: 'images', label: t('images'), icon_class: "icon-picture" }
|
||||
{ name: 'properties', label: t('properties'), icon_class: "icon-tags", show: "showProperties()" }
|
||||
{ name: 'shipping_methods', label: t('shipping_methods'), icon_class: "icon-truck", show: "showShippingMethods()" }
|
||||
{ name: 'payment_methods', label: t('payment_methods'), icon_class: "icon-money", show: "showPaymentMethods()" }
|
||||
{ name: 'enterprise_fees', label: t('enterprise_fees'), icon_class: "icon-tasks", show: "showEnterpriseFees()" }
|
||||
{ name: 'enterprise_permissions', label: t('enterprise_permissions'), icon_class: "icon-plug" }
|
||||
{ name: 'inventory_settings', label: t('inventory_settings'), icon_class: "icon-list-ol", show: "enterpriseIsShop()" }
|
||||
{ name: 'tag_rules', label: t('tag_rules'), icon_class: "icon-random", show: "enterpriseIsShop()" }
|
||||
{ name: 'shop_preferences', label: t('shop_preferences'), icon_class: "icon-shopping-cart", show: "enterpriseIsShop()" }
|
||||
{ name: 'users', label: t('users'), icon_class: "icon-user" }
|
||||
]
|
||||
|
||||
SideMenu.init()
|
||||
|
||||
$scope.showItem = (item) ->
|
||||
if item.show?
|
||||
$parse(item.show)($scope)
|
||||
else
|
||||
true
|
||||
|
||||
$scope.showProperties = ->
|
||||
!!$scope.Enterprise.is_primary_producer
|
||||
|
||||
$scope.showShippingMethods = ->
|
||||
enterprisePermissions.can_manage_shipping_methods && $scope.Enterprise.sells != "none"
|
||||
|
||||
$scope.showPaymentMethods = ->
|
||||
enterprisePermissions.can_manage_payment_methods && $scope.Enterprise.sells != "none"
|
||||
|
||||
$scope.showEnterpriseFees = ->
|
||||
enterprisePermissions.can_manage_enterprise_fees && ($scope.Enterprise.sells != "none" || $scope.Enterprise.is_primary_producer)
|
||||
|
||||
$scope.enterpriseIsShop = ->
|
||||
$scope.Enterprise.sells != "none"
|
||||
|
||||
$scope.menu.redirect_function('enterprise_permissions', '/admin/enterprise_relationships')
|
||||
@@ -32,7 +32,7 @@ angular.module("admin.products")
|
||||
if match
|
||||
$scope.product.master.unit_value = PriceParser.parse(match[1])
|
||||
$scope.product.master.unit_value = null if isNaN($scope.product.master.unit_value)
|
||||
$scope.product.master.unit_value *= $scope.product.variant_unit_scale if $scope.product.master.unit_value && $scope.product.variant_unit_scale
|
||||
$scope.product.master.unit_value = window.bigDecimal.multiply($scope.product.master.unit_value, $scope.product.variant_unit_scale, 2) if $scope.product.master.unit_value && $scope.product.variant_unit_scale
|
||||
$scope.product.master.unit_description = match[3]
|
||||
else
|
||||
value = $scope.product.master.unit_value
|
||||
|
||||
@@ -23,10 +23,10 @@ angular.module("admin.products").controller "variantUnitsCtrl", ($scope, Variant
|
||||
|
||||
$scope.updateValue = ->
|
||||
unit_value_human = angular.element('#unit_value_human').val()
|
||||
$scope.unit_value = PriceParser.parse(unit_value_human) * $scope.scale
|
||||
$scope.unit_value = bigDecimal.multiply(PriceParser.parse(unit_value_human), $scope.scale, 2)
|
||||
|
||||
variant_unit_value = angular.element('#variant_unit_value').val()
|
||||
$scope.unit_value_human = variant_unit_value / $scope.scale
|
||||
$scope.unit_value_human = parseFloat(bigDecimal.divide(variant_unit_value, $scope.scale, 2))
|
||||
|
||||
$timeout -> $scope.processUnitPrice()
|
||||
$timeout -> $scope.updateValue()
|
||||
|
||||
@@ -13,3 +13,9 @@ angular.module("ofn.admin").factory "ProductImageService", (FileUploader, SpreeA
|
||||
@imageUploader.onSuccessItem = (image, response) =>
|
||||
product.thumb_url = response.thumb_url
|
||||
product.image_url = response.image_url
|
||||
@imageUploader.onErrorItem = (image, response) =>
|
||||
if Array.isArray(response.errors)
|
||||
message = response.errors.join("\n")
|
||||
else
|
||||
message = response.error.toString()
|
||||
alert(message)
|
||||
|
||||
@@ -39,25 +39,94 @@ $(document).ready(function() {
|
||||
}
|
||||
$('[data-hook=admin_order_edit_form] a.save-method').click(handle_shipping_method_save);
|
||||
|
||||
//handle tracking edit click
|
||||
//handle tracking info edit/delete
|
||||
|
||||
// Show the input field to edit the tracking info
|
||||
// And hide the input field when cancel is clicked
|
||||
$('a.edit-tracking').click(toggleTrackingEdit);
|
||||
$('a.cancel-tracking').click(toggleTrackingEdit);
|
||||
|
||||
handle_tracking_save = function(){
|
||||
var link = $(this);
|
||||
var shipment_number = link.data('shipment-number');
|
||||
var tracking = link.parents('tbody').find('input#tracking').val();
|
||||
var url = Spree.url( Spree.routes.orders_api + "/" + order_number + "/shipments/" + shipment_number + ".json");
|
||||
saveTrackingInfo = function(){
|
||||
let shipmentNumber = $(this).data('shipment-number');
|
||||
let tracking = document.getElementById('tracking').value
|
||||
|
||||
makeApiCall(trackingUrl(shipmentNumber), { shipment: { tracking: tracking } } )
|
||||
}
|
||||
|
||||
deleteTrackingInfo = function(){
|
||||
let shipmentNumber = $(this).data('shipment-number');
|
||||
let tracking = ''
|
||||
|
||||
confirmDelete(trackingUrl(shipmentNumber), { shipment: { tracking: tracking } })
|
||||
}
|
||||
|
||||
trackingUrl = function(shipmentNumber){
|
||||
return Spree.url( Spree.routes.orders_api + "/" + order_number + "/shipments/" + shipmentNumber + ".json");
|
||||
}
|
||||
|
||||
$('[data-hook=admin_order_edit_form] a.save-tracking').click(saveTrackingInfo);
|
||||
$('[data-hook=admin_order_edit_form] a.delete-tracking').click(deleteTrackingInfo);
|
||||
|
||||
// handle note edit/delete
|
||||
|
||||
// Show the input field to edit the note
|
||||
// And hide the input field when cancel is clicked
|
||||
$('a.edit-note.icon-edit').click(toggleNoteEdit);
|
||||
$('a.cancel-note').click(toggleNoteEdit);
|
||||
|
||||
saveNote = function(){
|
||||
let note = document.getElementById('note').value
|
||||
makeApiCall(getNoteUrl(), { note: note })
|
||||
}
|
||||
|
||||
deleteNote = function(){
|
||||
let note = ''
|
||||
confirmDelete(getNoteUrl(), { note: note })
|
||||
}
|
||||
|
||||
getNoteUrl = function(){
|
||||
return Spree.url( Spree.routes.orders_api + "/" + order_number);
|
||||
}
|
||||
|
||||
confirmDelete = function(url, params){
|
||||
displayDeleteAlert(function(confirmation) {
|
||||
if (confirmation) {
|
||||
makeApiCall(url, params)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$('[data-hook=admin_order_edit_form] a.save-note').click(saveNote);
|
||||
$('[data-hook=admin_order_edit_form] a.delete-note').click(deleteNote);
|
||||
|
||||
// Makes API call for notes/tracking info
|
||||
makeApiCall = function(url, params) {
|
||||
$.ajax({
|
||||
type: "PUT",
|
||||
url: url,
|
||||
data: { shipment: { tracking: tracking } }
|
||||
data: params
|
||||
}).done(function( msg ) {
|
||||
window.location.reload();
|
||||
}).error(function( msg ) {
|
||||
console.log(msg);
|
||||
});
|
||||
}
|
||||
$('[data-hook=admin_order_edit_form] a.save-tracking').click(handle_tracking_save);
|
||||
|
||||
displayDeleteAlert = function(callback) {
|
||||
i18nKey = "are_you_sure";
|
||||
$('#custom-confirm .message').html(
|
||||
` ${t(i18nKey)}
|
||||
<div class="form">
|
||||
</div>`);
|
||||
$('#custom-confirm button.confirm').unbind( "click" ).click(() => {
|
||||
$('#custom-confirm').hide();
|
||||
callback(true);
|
||||
});
|
||||
$('#custom-confirm button.cancel').click(() => {
|
||||
$('#custom-confirm').hide();
|
||||
callback(false)
|
||||
});
|
||||
$('#custom-confirm').show();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
@@ -141,8 +141,26 @@ doAdjustItems = function(shipment_number, variant_id, quantity, inventory_units,
|
||||
|
||||
toggleTrackingEdit = function(){
|
||||
var link = $(this);
|
||||
link.parents('tbody').find('tr.edit-tracking').toggle();
|
||||
link.parents('tbody').find('tr.show-tracking').toggle();
|
||||
var parent_node = link.parents('tbody')
|
||||
let input = parent_node.find('#tracking')[0]
|
||||
parent_node.find('tr.edit-tracking').toggle();
|
||||
// Set focus on input and
|
||||
// put cursor at it's end
|
||||
input.focus()
|
||||
input.setSelectionRange(-1, -1)
|
||||
parent_node.find('tr.show-tracking').toggle();
|
||||
}
|
||||
|
||||
toggleNoteEdit = function(){
|
||||
var link = $(this);
|
||||
var parent_node = link.parents('tbody')
|
||||
let input = parent_node.find('#note')[0]
|
||||
parent_node.find('tr.edit-note').toggle();
|
||||
// Set focus on input and
|
||||
// put cursor at it's end
|
||||
input.focus()
|
||||
input.setSelectionRange(-1, -1)
|
||||
parent_node.find('tr.show-note').toggle();
|
||||
}
|
||||
|
||||
toggleMethodEdit = function(){
|
||||
|
||||
@@ -3,6 +3,7 @@ angular.module("admin.utils").directive "tagsWithTranslation", ($timeout) ->
|
||||
templateUrl: "admin/tags_input.html"
|
||||
scope:
|
||||
object: "="
|
||||
form: "="
|
||||
tagsAttr: "@?"
|
||||
tagListAttr: "@?"
|
||||
findTags: "&"
|
||||
@@ -18,7 +19,15 @@ angular.module("admin.utils").directive "tagsWithTranslation", ($timeout) ->
|
||||
scope.limitReached = scope.object[scope.tagsAttr].length >= scope.max if scope.max != undefined
|
||||
scope.object[scope.tagListAttr] = (tag.text for tag in scope.object[scope.tagsAttr]).join(",")
|
||||
|
||||
scope.$watch "object", (newObject) ->
|
||||
scope.object = newObject
|
||||
init()
|
||||
|
||||
$timeout ->
|
||||
init()
|
||||
|
||||
init = ->
|
||||
return unless scope.object
|
||||
# Initialize properties if necessary
|
||||
scope.tagsAttr ||= "tags"
|
||||
scope.tagListAttr ||= "tag_list"
|
||||
|
||||
@@ -5,15 +5,16 @@ angular.module("admin.utils").factory "ErrorsParser", ->
|
||||
return defaultContent unless errors?
|
||||
|
||||
errorsString = ""
|
||||
if errors.length > 0
|
||||
if Array.isArray(errors)
|
||||
# it is an array of errors
|
||||
errorsString = errors.join("\n") + "\n"
|
||||
else
|
||||
else if typeof errors == "object"
|
||||
# it is a hash of errors
|
||||
keys = Object.keys(errors)
|
||||
for key in keys
|
||||
errorsString += errors[key].join("\n") + "\n"
|
||||
|
||||
else # string
|
||||
errorsString = errors
|
||||
this.defaultIfEmpty(errorsString, defaultContent)
|
||||
|
||||
defaultIfEmpty: (content, defaultContent) =>
|
||||
|
||||
@@ -20,3 +20,6 @@ angular.module('Darkswarm').controller "CreditCardsCtrl", ($scope, $http, Credit
|
||||
).finally ->
|
||||
window.location.reload()
|
||||
|
||||
|
||||
$scope.hasOneDefaultSavedCards = () ->
|
||||
$scope.savedCreditCards.some((card) -> card.is_default)
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
%div.contact-container
|
||||
%div.modal-centered{"ng-if" => "::enterprise.email_address || enterprise.website || enterprise.phone"}
|
||||
%div.modal-centered{"ng-if" => "::enterprise.email_address || enterprise.website || enterprise.phone || enterprise.whatsapp_phone"}
|
||||
%p.modal-header {{'contact' | t}}
|
||||
%p{"ng-if" => "::enterprise.phone", "ng-bind" => "::enterprise.phone"}
|
||||
|
||||
%p{"ng-if" => "::enterprise.whatsapp_phone"}
|
||||
%img{ src: image_path("/map_icons/social-logos/whatsapp.svg") }
|
||||
%a{"ng-href" => "{{::enterprise.whatsapp_url}}", target: "_blank", "ng-bind" => "::enterprise.whatsapp_phone"}
|
||||
|
||||
%p{"ng-if" => "::enterprise.email_address"}
|
||||
%a{"ng-href" => "{{::enterprise.email_address | stripUrl}}", target: "_blank", mailto: true}
|
||||
%span.obfuscatedEmail.email{"ng-bind" => "::enterprise.email_address | stripUrl"}
|
||||
|
||||
@@ -7,6 +7,7 @@ require 'open_food_network/order_cycle_permissions'
|
||||
module Admin
|
||||
class EnterprisesController < Admin::ResourceController
|
||||
include GeocodeEnterpriseAddress
|
||||
include CablecarResponses
|
||||
|
||||
# These need to run before #load_resource so that @object is initialised with sanitised values
|
||||
prepend_before_action :override_owner, only: :create
|
||||
@@ -44,7 +45,12 @@ module Admin
|
||||
def edit
|
||||
@object = Enterprise.where(permalink: params[:id]).
|
||||
includes(users: [:ship_address, :bill_address]).first
|
||||
super
|
||||
if params[:stimulus]
|
||||
@enterprise.is_primary_producer = params[:is_primary_producer]
|
||||
@enterprise.sells = params[:enterprise_sells]
|
||||
render operations: cable_car.morph("#side_menu", partial("admin/shared/side_menu"))
|
||||
.morph("#permalink", partial("admin/enterprises/form/permalink"))
|
||||
end
|
||||
end
|
||||
|
||||
def welcome
|
||||
|
||||
@@ -26,6 +26,13 @@ module Api
|
||||
}
|
||||
end
|
||||
|
||||
def update
|
||||
authorize! :admin, order
|
||||
|
||||
order.update!(order_params)
|
||||
render json: order, serializer: Api::OrderDetailedSerializer, current_order: order
|
||||
end
|
||||
|
||||
def ship
|
||||
authorize! :admin, order
|
||||
|
||||
@@ -72,6 +79,10 @@ module Api
|
||||
includes(line_items: { variant: [:product, :stock_items, :default_price] }).
|
||||
first!
|
||||
end
|
||||
|
||||
def order_params
|
||||
params.permit(:note)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -6,20 +6,21 @@ module Api
|
||||
respond_to :json
|
||||
|
||||
def update_product_image
|
||||
@product = Spree::Product.find(params[:product_id])
|
||||
authorize! :update, @product
|
||||
product = Spree::Product.find(params[:product_id])
|
||||
authorize! :update, product
|
||||
|
||||
if @product.images.first.nil?
|
||||
@image = Spree::Image.create(
|
||||
attachment: params[:file],
|
||||
viewable_id: @product.master.id,
|
||||
viewable_type: 'Spree::Variant'
|
||||
)
|
||||
render json: @image, serializer: ImageSerializer, status: :created
|
||||
image = product.images.first || Spree::Image.new(
|
||||
viewable_id: product.master.id,
|
||||
viewable_type: 'Spree::Variant'
|
||||
)
|
||||
|
||||
success_status = image.persisted? ? :ok : :created
|
||||
|
||||
if image.update(attachment: params[:file])
|
||||
render json: image, serializer: ImageSerializer, status: success_status
|
||||
else
|
||||
@image = @product.images.first
|
||||
@image.update(attachment: params[:file])
|
||||
render json: @image, serializer: ImageSerializer, status: :ok
|
||||
error_json = { errors: image.errors.full_messages }
|
||||
render json: error_json, status: :unprocessable_entity
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -5,9 +5,10 @@ require 'open_food_network/permissions'
|
||||
module Api
|
||||
module V1
|
||||
class CustomersController < Api::V1::BaseController
|
||||
include AddressTransformation
|
||||
|
||||
skip_authorization_check only: :index
|
||||
|
||||
before_action :set_customer, only: [:show, :update, :destroy]
|
||||
before_action :authorize_action, only: [:show, :update, :destroy]
|
||||
|
||||
def index
|
||||
@@ -17,44 +18,44 @@ module Api
|
||||
end
|
||||
|
||||
def show
|
||||
render json: Api::V1::CustomerSerializer.new(@customer, include_options)
|
||||
render json: Api::V1::CustomerSerializer.new(customer, include_options)
|
||||
end
|
||||
|
||||
def create
|
||||
authorize! :update, Enterprise.find(customer_params[:enterprise_id])
|
||||
@customer = Customer.new(customer_params)
|
||||
customer = Customer.new(customer_params)
|
||||
|
||||
if @customer.save
|
||||
render json: Api::V1::CustomerSerializer.new(@customer), status: :created
|
||||
if customer.save
|
||||
render json: Api::V1::CustomerSerializer.new(customer), status: :created
|
||||
else
|
||||
invalid_resource! @customer
|
||||
invalid_resource! customer
|
||||
end
|
||||
end
|
||||
|
||||
def update
|
||||
if @customer.update(customer_params)
|
||||
render json: Api::V1::CustomerSerializer.new(@customer)
|
||||
if customer.update(customer_params)
|
||||
render json: Api::V1::CustomerSerializer.new(customer)
|
||||
else
|
||||
invalid_resource! @customer
|
||||
invalid_resource! customer
|
||||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
if @customer.destroy
|
||||
render json: Api::V1::CustomerSerializer.new(@customer)
|
||||
if customer.destroy
|
||||
render json: Api::V1::CustomerSerializer.new(customer)
|
||||
else
|
||||
invalid_resource! @customer
|
||||
invalid_resource! customer
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def set_customer
|
||||
@customer = Customer.find(params[:id])
|
||||
def customer
|
||||
@customer ||= Customer.find(params[:id])
|
||||
end
|
||||
|
||||
def authorize_action
|
||||
authorize! action_name.to_sym, @customer
|
||||
authorize! action_name.to_sym, customer
|
||||
end
|
||||
|
||||
def search_customers
|
||||
@@ -77,7 +78,8 @@ module Api
|
||||
:phone, :latitude, :longitude,
|
||||
:first_name, :last_name,
|
||||
:street_address_1, :street_address_2,
|
||||
:postal_code, :locality, :region, :country,
|
||||
:postal_code, :locality,
|
||||
{ region: [:name, :code], country: [:name, :code] },
|
||||
]
|
||||
).to_h
|
||||
|
||||
@@ -89,39 +91,6 @@ module Api
|
||||
attributes
|
||||
end
|
||||
|
||||
def transform_address!(attributes, from, to)
|
||||
return unless attributes.key?(from)
|
||||
|
||||
address = attributes.delete(from)
|
||||
|
||||
if address.nil?
|
||||
attributes[to] = nil
|
||||
return
|
||||
end
|
||||
|
||||
address.transform_keys! do |key|
|
||||
{
|
||||
phone: :phone, latitude: :latitude, longitude: :longitude,
|
||||
first_name: :firstname, last_name: :lastname,
|
||||
street_address_1: :address1, street_address_2: :address2,
|
||||
postal_code: :zipcode,
|
||||
locality: :city,
|
||||
region: :state_name,
|
||||
country: :country,
|
||||
}.with_indifferent_access[key]
|
||||
end
|
||||
|
||||
if address[:state_name].present?
|
||||
address[:state] = Spree::State.find_by(name: address[:state_name])
|
||||
end
|
||||
|
||||
if address[:country].present?
|
||||
address[:country] = Spree::Country.find_by(name: address[:country])
|
||||
end
|
||||
|
||||
attributes["#{to}_attributes"] = address
|
||||
end
|
||||
|
||||
def editable_enterprises
|
||||
OpenFoodNetwork::Permissions.new(current_api_user).editable_enterprises.select(:id)
|
||||
end
|
||||
|
||||
@@ -165,8 +165,9 @@ class ApplicationController < ActionController::Base
|
||||
return unless current_spree_user.disabled
|
||||
|
||||
flash[:success] = nil
|
||||
flash.now[:error] = I18n.t("devise.failure.disabled")
|
||||
flash[:error] = I18n.t("devise.failure.disabled")
|
||||
sign_out current_spree_user
|
||||
redirect_to main_app.root_path
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
48
app/controllers/concerns/address_transformation.rb
Normal file
48
app/controllers/concerns/address_transformation.rb
Normal file
@@ -0,0 +1,48 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# Our internal data structures are different to the API data strurctures.
|
||||
module AddressTransformation
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
def transform_address!(attributes, from, to)
|
||||
return unless attributes.key?(from)
|
||||
|
||||
address = attributes.delete(from)
|
||||
|
||||
if address.nil?
|
||||
attributes[to] = nil
|
||||
return
|
||||
end
|
||||
|
||||
address.transform_keys! do |key|
|
||||
{
|
||||
phone: :phone, latitude: :latitude, longitude: :longitude,
|
||||
first_name: :firstname, last_name: :lastname,
|
||||
street_address_1: :address1, street_address_2: :address2,
|
||||
postal_code: :zipcode,
|
||||
locality: :city,
|
||||
region: :state,
|
||||
country: :country,
|
||||
}.with_indifferent_access[key]
|
||||
end
|
||||
|
||||
address[:state] = find_state(address) if address[:state].present?
|
||||
address[:country] = find_country(address) if address[:country].present?
|
||||
|
||||
attributes["#{to}_attributes"] = address
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def find_state(address)
|
||||
Spree::State.find_by("LOWER(abbr) = ? OR LOWER(name) = ?",
|
||||
address.dig(:state, :code)&.downcase,
|
||||
address.dig(:state, :name)&.downcase)
|
||||
end
|
||||
|
||||
def find_country(address)
|
||||
Spree::Country.find_by("LOWER(iso) = ? OR LOWER(name) = ?",
|
||||
address.dig(:country, :code)&.downcase,
|
||||
address.dig(:country, :name)&.downcase)
|
||||
end
|
||||
end
|
||||
17
app/controllers/errors_controller.rb
Normal file
17
app/controllers/errors_controller.rb
Normal file
@@ -0,0 +1,17 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class ErrorsController < ApplicationController
|
||||
layout "errors"
|
||||
|
||||
def not_found
|
||||
render status: :not_found
|
||||
end
|
||||
|
||||
def internal_server_error
|
||||
render status: :internal_server_error
|
||||
end
|
||||
|
||||
def unprocessable_entity
|
||||
render status: :unprocessable_entity
|
||||
end
|
||||
end
|
||||
@@ -21,6 +21,8 @@ class SplitCheckoutController < ::BaseController
|
||||
|
||||
def edit
|
||||
redirect_to_step_based_on_order unless params[:step]
|
||||
check_step if params[:step]
|
||||
recalculate_tax if params[:step] == "summary"
|
||||
end
|
||||
|
||||
def update
|
||||
@@ -145,4 +147,18 @@ class SplitCheckoutController < ::BaseController
|
||||
end
|
||||
redirect_to_step_based_on_order
|
||||
end
|
||||
|
||||
def check_step
|
||||
case @order.state
|
||||
when "cart", "address", "delivery"
|
||||
redirect_to checkout_step_path(:details) unless params[:step] == "details"
|
||||
when "payment"
|
||||
redirect_to checkout_step_path(:payment) if params[:step] == "summary"
|
||||
end
|
||||
end
|
||||
|
||||
def recalculate_tax
|
||||
@order.create_tax_charge!
|
||||
@order.update_order!
|
||||
end
|
||||
end
|
||||
|
||||
@@ -42,6 +42,10 @@ module Spree
|
||||
@order.update_order!
|
||||
end
|
||||
|
||||
if params[:set_distribution_step] && @order.update(order_params)
|
||||
return redirect_to spree.admin_order_customer_path(@order)
|
||||
end
|
||||
|
||||
unless order_params.present? && @order.update(order_params) && @order.line_items.present?
|
||||
if @order.line_items.empty? && !params[:suppress_error_msg]
|
||||
@order.errors.add(:line_items, Spree.t('errors.messages.blank'))
|
||||
@@ -55,7 +59,7 @@ module Spree
|
||||
redirect_to spree.edit_admin_order_path(@order)
|
||||
else
|
||||
# Jump to next step if order is not complete
|
||||
redirect_to spree.admin_order_customer_path(@order)
|
||||
redirect_to spree.admin_order_payments_path(@order)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -126,7 +130,7 @@ module Spree
|
||||
end
|
||||
|
||||
def require_distributor_abn
|
||||
return if @order.distributor.abn.present?
|
||||
return if @order.distributor.can_invoice?
|
||||
|
||||
flash[:error] = t(:must_have_valid_business_number,
|
||||
enterprise_name: @order.distributor.name)
|
||||
|
||||
@@ -48,30 +48,11 @@ module Spree
|
||||
@user.spree_roles = roles.reject(&:blank?).collect{ |r| Spree::Role.find(r) }
|
||||
end
|
||||
|
||||
message = if new_email_unconfirmed?
|
||||
Spree.t(:email_updated)
|
||||
else
|
||||
Spree.t(:account_updated)
|
||||
end
|
||||
flash.now[:success] = message
|
||||
flash.now[:success] = update_message
|
||||
end
|
||||
render :edit
|
||||
end
|
||||
|
||||
def generate_api_key
|
||||
if @user.generate_spree_api_key!
|
||||
flash[:success] = t('spree.api.key_generated')
|
||||
end
|
||||
redirect_to spree.edit_admin_user_path(@user)
|
||||
end
|
||||
|
||||
def clear_api_key
|
||||
if @user.clear_spree_api_key!
|
||||
flash[:success] = t('spree.api.key_cleared')
|
||||
end
|
||||
redirect_to spree.edit_admin_user_path(@user)
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def collection
|
||||
@@ -100,6 +81,16 @@ module Spree
|
||||
|
||||
private
|
||||
|
||||
def update_message
|
||||
return Spree.t(:show_api_key_view_toggled) if @user.show_api_key_view_previously_changed?
|
||||
|
||||
if new_email_unconfirmed?
|
||||
Spree.t(:email_updated)
|
||||
else
|
||||
Spree.t(:account_updated)
|
||||
end
|
||||
end
|
||||
|
||||
# handling raise from Admin::ResourceController#destroy
|
||||
def user_destroy_with_orders_error
|
||||
render status: :forbidden, text: Spree.t(:error_user_destroy_with_orders)
|
||||
@@ -137,7 +128,9 @@ module Spree
|
||||
end
|
||||
|
||||
def user_params
|
||||
::PermittedAttributes::User.new(params).call([:enterprise_limit])
|
||||
::PermittedAttributes::User.new(params).call(
|
||||
%i[enterprise_limit show_api_key_view]
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
57
app/controllers/spree/api_keys_controller.rb
Normal file
57
app/controllers/spree/api_keys_controller.rb
Normal file
@@ -0,0 +1,57 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Spree
|
||||
class ApiKeysController < ::BaseController
|
||||
include Spree::Core::ControllerHelpers
|
||||
include I18nHelper
|
||||
|
||||
prepend_before_action :load_object
|
||||
|
||||
def create
|
||||
@user.generate_api_key
|
||||
|
||||
if @user.save
|
||||
flash[:success] = t('spree.api.key_generated')
|
||||
end
|
||||
|
||||
redirect_to redirect_path
|
||||
end
|
||||
|
||||
def destroy
|
||||
@user.spree_api_key = nil
|
||||
|
||||
if @user.save
|
||||
flash[:success] = t('spree.api.key_cleared')
|
||||
end
|
||||
|
||||
redirect_to redirect_path
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def load_object
|
||||
@user ||= find_user
|
||||
if @user
|
||||
authorize! params[:action].to_sym, @user
|
||||
else
|
||||
redirect_to main_app.login_path
|
||||
end
|
||||
end
|
||||
|
||||
def find_user
|
||||
Spree::User.find_by(id: params[:id]) || spree_current_user
|
||||
end
|
||||
|
||||
def redirect_path
|
||||
if request.referer.blank? || request.referer.include?(spree.account_path)
|
||||
developer_settings_path
|
||||
else
|
||||
request.referer
|
||||
end
|
||||
end
|
||||
|
||||
def developer_settings_path
|
||||
"#{spree.account_path}#/developer_settings"
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -49,7 +49,10 @@ module Spree
|
||||
|
||||
# Using try because we may not have a card here
|
||||
if @credit_card.try(:destroy)
|
||||
remove_shop_authorizations if @credit_card.is_default
|
||||
if @credit_card.is_default
|
||||
remove_shop_authorizations
|
||||
mark_as_default_next_credit_card if credit_cards_with_payment_profile.count > 0
|
||||
end
|
||||
flash[:success] = I18n.t(:card_has_been_removed, number: "x-#{@credit_card.last_digits}")
|
||||
else
|
||||
flash[:error] = I18n.t(:card_could_not_be_removed)
|
||||
@@ -67,6 +70,14 @@ module Spree
|
||||
@credit_card.user.customers.update_all(allow_charges: false)
|
||||
end
|
||||
|
||||
def mark_as_default_next_credit_card
|
||||
credit_cards_with_payment_profile.first.update(is_default: true)
|
||||
end
|
||||
|
||||
def credit_cards_with_payment_profile
|
||||
spree_current_user.credit_cards.with_payment_profile
|
||||
end
|
||||
|
||||
def create_customer(token)
|
||||
Stripe::Customer.create(email: spree_current_user.email, source: token)
|
||||
end
|
||||
|
||||
@@ -4,6 +4,7 @@ module Spree
|
||||
class OrdersController < ::BaseController
|
||||
include OrderCyclesHelper
|
||||
include Rails.application.routes.url_helpers
|
||||
include CablecarResponses
|
||||
|
||||
layout 'darkswarm'
|
||||
|
||||
@@ -99,7 +100,8 @@ module Spree
|
||||
else
|
||||
flash[:error] = I18n.t(:orders_could_not_cancel)
|
||||
end
|
||||
redirect_to request.referer || main_app.order_path(@order)
|
||||
render status: :found,
|
||||
operations: cable_car.redirect_to(url: request.referer || main_app.order_path(@order))
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
@@ -16,6 +16,7 @@ module Spree
|
||||
prepend_before_action :handle_unconfirmed_email
|
||||
before_action :set_checkout_redirect, only: :create
|
||||
after_action :ensure_valid_locale_persisted, only: :create
|
||||
skip_before_action :check_disabled_user
|
||||
|
||||
def create
|
||||
authenticate_spree_user!
|
||||
|
||||
@@ -78,7 +78,7 @@ module Spree
|
||||
|
||||
def load_object
|
||||
@user ||= spree_current_user
|
||||
if @user
|
||||
if @user && !@user.disabled
|
||||
authorize! params[:action].to_sym, @user
|
||||
else
|
||||
redirect_to main_app.login_path
|
||||
|
||||
17
app/helpers/admin/enterprise_groups_helper.rb
Normal file
17
app/helpers/admin/enterprise_groups_helper.rb
Normal file
@@ -0,0 +1,17 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Admin
|
||||
module EnterpriseGroupsHelper
|
||||
def enterprise_group_side_menu_items
|
||||
[
|
||||
{ name: 'primary_details', label: 'primary_details', icon_class: "icon-user",
|
||||
selected: "selected" },
|
||||
{ name: 'users', label: 'users', icon_class: "icon-user" },
|
||||
{ name: 'about', label: 'about', icon_class: "icon-pencil" },
|
||||
{ name: 'images', label: 'images', icon_class: "icon-picture" },
|
||||
{ name: 'contact', label: 'admin_enterprise_groups_contact', icon_class: "icon-phone" },
|
||||
{ name: 'web', label: 'admin_enterprise_groups_web', icon_class: "icon-globe" },
|
||||
]
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -13,5 +13,34 @@ module Admin
|
||||
def select_only_item(producers)
|
||||
producers.size == 1 ? producers.first.id : nil
|
||||
end
|
||||
|
||||
def enterprise_side_menu_items(enterprise)
|
||||
is_shop = enterprise.sells != "none"
|
||||
show_properties = !!enterprise.is_primary_producer
|
||||
show_shipping_methods = can?(:manage_shipping_methods, enterprise) && is_shop
|
||||
show_payment_methods = can?(:manage_payment_methods, enterprise) && is_shop
|
||||
show_enterprise_fees = can?(:manage_enterprise_fees,
|
||||
enterprise) && (is_shop || enterprise.is_primary_producer)
|
||||
|
||||
[
|
||||
{ name: 'primary_details', icon_class: "icon-home", show: true, selected: 'selected' },
|
||||
{ name: 'address', icon_class: "icon-map-marker", show: true },
|
||||
{ name: 'contact', icon_class: "icon-phone", show: true },
|
||||
{ name: 'social', icon_class: "icon-twitter", show: true },
|
||||
{ name: 'about', icon_class: "icon-pencil", show: true, form_name: "about_us" },
|
||||
{ name: 'business_details', icon_class: "icon-briefcase", show: true },
|
||||
{ name: 'images', icon_class: "icon-picture", show: true },
|
||||
{ name: 'properties', icon_class: "icon-tags", show: show_properties },
|
||||
{ name: 'shipping_methods', icon_class: "icon-truck", show: show_shipping_methods },
|
||||
{ name: 'payment_methods', icon_class: "icon-money", show: show_payment_methods },
|
||||
{ name: 'enterprise_fees', icon_class: "icon-tasks", show: show_enterprise_fees },
|
||||
{ name: 'enterprise_permissions', icon_class: "icon-plug", show: true,
|
||||
href: admin_enterprise_relationships_path },
|
||||
{ name: 'inventory_settings', icon_class: "icon-list-ol", show: is_shop },
|
||||
{ name: 'tag_rules', icon_class: "icon-random", show: is_shop },
|
||||
{ name: 'shop_preferences', icon_class: "icon-shopping-cart", show: is_shop },
|
||||
{ name: 'users', icon_class: "icon-user", show: true }
|
||||
]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -70,10 +70,13 @@ module CheckoutHelper
|
||||
def display_checkout_taxes_hash(order)
|
||||
totals = OrderTaxAdjustmentsFetcher.new(order).totals
|
||||
|
||||
totals.each_with_object({}) do |(tax_rate, tax_amount), hash|
|
||||
hash[number_to_percentage(tax_rate.amount * 100, precision: 1)] =
|
||||
Spree::Money.new tax_amount, currency: order.currency
|
||||
end
|
||||
totals.map do |tax_rate, tax_amount|
|
||||
{
|
||||
amount: Spree::Money.new(tax_amount, currency: order.currency),
|
||||
percentage: number_to_percentage(tax_rate.amount * 100, precision: 1),
|
||||
rate_amount: tax_rate.amount,
|
||||
}
|
||||
end.sort_by { |tax| tax[:rate_amount] }
|
||||
end
|
||||
|
||||
def display_line_item_tax_rates(line_item)
|
||||
|
||||
@@ -41,8 +41,8 @@ class CustomerSchema < JsonApiSchema
|
||||
street_address_2: "",
|
||||
postal_code: "1234",
|
||||
locality: "Melbourne",
|
||||
region: "Victoria",
|
||||
country: "Australia",
|
||||
region: { code: "Vic", name: "Victoria" },
|
||||
country: { code: "AU", name: "Australia" },
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ class Customer < ApplicationRecord
|
||||
belongs_to :enterprise
|
||||
belongs_to :user, class_name: "Spree::User"
|
||||
has_many :orders, class_name: "Spree::Order"
|
||||
before_destroy :check_for_orders
|
||||
before_destroy :update_orders_and_delete_canceled_subscriptions
|
||||
|
||||
belongs_to :bill_address, class_name: "Spree::Address"
|
||||
alias_attribute :billing_address, :bill_address
|
||||
@@ -52,10 +52,12 @@ class Customer < ApplicationRecord
|
||||
self.user = user || Spree::User.find_by(email: email)
|
||||
end
|
||||
|
||||
def check_for_orders
|
||||
return true unless orders.any?
|
||||
|
||||
errors.add(:base, I18n.t('admin.customers.destroy.has_associated_orders'))
|
||||
throw :abort
|
||||
def update_orders_and_delete_canceled_subscriptions
|
||||
if Subscription.where(customer_id: id).not_canceled.any?
|
||||
errors.add(:base, I18n.t('admin.customers.destroy.has_associated_subscriptions'))
|
||||
throw :abort
|
||||
end
|
||||
Subscription.where(customer_id: id).destroy_all
|
||||
orders.update_all(customer_id: nil)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -84,8 +84,8 @@ class Enterprise < ApplicationRecord
|
||||
has_one_attached :promo_image
|
||||
has_one_attached :terms_and_conditions
|
||||
|
||||
validates :logo, content_type: %r{\Aimage/.*\Z}
|
||||
validates :promo_image, content_type: %r{\Aimage/.*\Z}
|
||||
validates :logo, content_type: %r{\Aimage/(png|jpeg|gif|jpg|svg\+xml|webp)\Z}
|
||||
validates :promo_image, content_type: %r{\Aimage/(png|jpeg|gif|jpg|svg\+xml|webp)\Z}
|
||||
validates :terms_and_conditions, content_type: {
|
||||
in: "application/pdf",
|
||||
message: I18n.t(:enterprise_terms_and_conditions_type_error),
|
||||
@@ -312,6 +312,10 @@ class Enterprise < ApplicationRecord
|
||||
correct_instagram_url self[:instagram]
|
||||
end
|
||||
|
||||
def whatsapp_url
|
||||
correct_whatsapp_url self[:whatsapp_phone]
|
||||
end
|
||||
|
||||
def inventory_variants
|
||||
if prefers_product_selection_from_inventory_only?
|
||||
Spree::Variant.visible_for(self)
|
||||
@@ -448,6 +452,10 @@ class Enterprise < ApplicationRecord
|
||||
url&.sub(%r{(https?://)?}, '')
|
||||
end
|
||||
|
||||
def correct_whatsapp_url(phone_number)
|
||||
phone_number && "https://wa.me/" + phone_number.tr('+ ', '')
|
||||
end
|
||||
|
||||
def correct_instagram_url(url)
|
||||
url && strip_url(url).sub(%r{www.instagram.com/}, '').delete("@")
|
||||
end
|
||||
|
||||
@@ -28,8 +28,8 @@ class EnterpriseGroup < ApplicationRecord
|
||||
has_one_attached :logo
|
||||
has_one_attached :promo_image
|
||||
|
||||
validates :logo, content_type: %r{\Aimage/.*\Z}
|
||||
validates :promo_image, content_type: %r{\Aimage/.*\Z}
|
||||
validates :logo, content_type: %r{\Aimage/(png|jpeg|gif|jpg|svg\+xml|webp)\Z}
|
||||
validates :promo_image, content_type: %r{\Aimage/(png|jpeg|gif|jpg|svg\+xml|webp)\Z}
|
||||
|
||||
scope :by_position, -> { order('position ASC') }
|
||||
scope :on_front_page, -> { where(on_front_page: true) }
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
# This reduces the need to keep Orders in sync with their parent Subscriptions
|
||||
|
||||
class ProxyOrder < ApplicationRecord
|
||||
belongs_to :order, class_name: 'Spree::Order', dependent: :destroy
|
||||
belongs_to :order, class_name: 'Spree::Order'
|
||||
belongs_to :subscription
|
||||
belongs_to :order_cycle
|
||||
|
||||
|
||||
@@ -11,15 +11,19 @@ module Spree
|
||||
|
||||
has_one_attached :attachment
|
||||
|
||||
validates :attachment, attached: true, content_type: %r{\Aimage/.*\Z}
|
||||
validates :attachment, attached: true, content_type: %r{\Aimage/(png|jpeg|gif|jpg|svg\+xml|webp)\Z}
|
||||
validate :no_attachment_errors
|
||||
|
||||
def variant(name)
|
||||
attachment.variant(SIZES[name])
|
||||
if attachment.variable?
|
||||
attachment.variant(SIZES[name])
|
||||
else
|
||||
attachment
|
||||
end
|
||||
end
|
||||
|
||||
def url(size)
|
||||
return unless attachment.variable?
|
||||
return unless attachment.attached?
|
||||
|
||||
Rails.application.routes.url_helpers.url_for(variant(size))
|
||||
end
|
||||
|
||||
@@ -433,7 +433,7 @@ module Spree
|
||||
all_adjustments.destroy_all
|
||||
payments.clear
|
||||
shipments.destroy_all
|
||||
restart_checkout_flow if state == "payment"
|
||||
restart_checkout_flow if state.in?(["payment", "confirmation"])
|
||||
end
|
||||
|
||||
def state_changed(name)
|
||||
|
||||
@@ -71,6 +71,10 @@ module Spree
|
||||
set_reset_password_token
|
||||
end
|
||||
|
||||
def generate_api_key
|
||||
self.spree_api_key = SecureRandom.hex(24)
|
||||
end
|
||||
|
||||
def known_users
|
||||
if admin?
|
||||
Spree::User.where(nil)
|
||||
@@ -132,16 +136,6 @@ module Spree
|
||||
end
|
||||
end
|
||||
|
||||
def generate_spree_api_key!
|
||||
self.spree_api_key = SecureRandom.hex(24)
|
||||
save!
|
||||
end
|
||||
|
||||
def clear_spree_api_key!
|
||||
self.spree_api_key = nil
|
||||
save!
|
||||
end
|
||||
|
||||
def last_incomplete_spree_order
|
||||
spree_orders.incomplete.where(created_by_id: id).order('created_at DESC').first
|
||||
end
|
||||
|
||||
@@ -17,9 +17,9 @@ class Subscription < ApplicationRecord
|
||||
belongs_to :payment_method, class_name: 'Spree::PaymentMethod'
|
||||
belongs_to :bill_address, class_name: "Spree::Address"
|
||||
belongs_to :ship_address, class_name: "Spree::Address"
|
||||
has_many :subscription_line_items, inverse_of: :subscription
|
||||
has_many :subscription_line_items, inverse_of: :subscription, dependent: :destroy
|
||||
has_many :order_cycles, through: :schedule
|
||||
has_many :proxy_orders
|
||||
has_many :proxy_orders, dependent: :destroy
|
||||
has_many :orders, through: :proxy_orders
|
||||
|
||||
alias_attribute :billing_address, :bill_address
|
||||
|
||||
@@ -14,9 +14,9 @@ module Api
|
||||
|
||||
attributes :name, :id, :description, :latitude, :longitude,
|
||||
:long_description, :website, :instagram, :linkedin, :twitter,
|
||||
:facebook, :is_primary_producer, :is_distributor, :phone, :visible,
|
||||
:email_address, :hash, :logo, :promo_image, :path, :pickup, :delivery,
|
||||
:icon, :icon_font, :producer_icon_font, :category
|
||||
:facebook, :is_primary_producer, :is_distributor, :phone, :whatsapp_phone,
|
||||
:whatsapp_url, :visible, :email_address, :hash, :logo, :promo_image, :path, :pickup,
|
||||
:delivery, :icon, :icon_font, :producer_icon_font, :category
|
||||
|
||||
attributes :taxons, :supplied_taxons
|
||||
|
||||
|
||||
@@ -7,9 +7,9 @@ module Api
|
||||
|
||||
attributes :name, :id, :description, :latitude, :longitude, :long_description, :website,
|
||||
:instagram, :linkedin, :twitter, :facebook, :is_primary_producer, :is_distributor,
|
||||
:phone, :visible, :email_address, :hash, :logo, :promo_image, :path, :category,
|
||||
:active, :producers, :orders_close_at, :hubs, :taxons, :supplied_taxons, :pickup,
|
||||
:delivery, :preferred_product_low_stock_display
|
||||
:phone, :whatsapp_phone, :whatsapp_url, :visible, :email_address, :hash, :logo,
|
||||
:promo_image, :path, :category, :active, :producers, :orders_close_at, :hubs,
|
||||
:taxons, :supplied_taxons, :pickup, :delivery, :preferred_product_low_stock_display
|
||||
|
||||
has_one :address, serializer: Api::AddressSerializer
|
||||
has_many :supplied_properties, serializer: Api::PropertySerializer
|
||||
|
||||
@@ -11,8 +11,18 @@ module Api
|
||||
attribute :street_address_2, &:address2
|
||||
attribute :postal_code, &:zipcode
|
||||
attribute :locality, &:city
|
||||
attribute :region, &:state_name
|
||||
attribute :country, ->(object, _) { object.country.name }
|
||||
attribute :region do |object|
|
||||
{
|
||||
name: object.state.name,
|
||||
code: object.state.abbr,
|
||||
}
|
||||
end
|
||||
attribute :country do |object|
|
||||
{
|
||||
name: object.country.name,
|
||||
code: object.country.iso,
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -68,12 +68,12 @@ class EmbeddedPageService
|
||||
end
|
||||
|
||||
def current_referer
|
||||
return if @request.referer.blank?
|
||||
|
||||
uri = URI(@request.referer)
|
||||
return if uri.host.blank?
|
||||
uri = URI.parse(@request.referer)
|
||||
return unless uri.is_a?(URI::HTTP) && uri.host.present?
|
||||
|
||||
uri.host.downcase
|
||||
rescue URI::InvalidURIError
|
||||
false
|
||||
end
|
||||
|
||||
def current_referer_without_www
|
||||
|
||||
@@ -12,9 +12,9 @@ module PermittedAttributes
|
||||
:email, :special_instructions,
|
||||
:existing_card_id, :shipping_method_id,
|
||||
{ payments_attributes: [
|
||||
:payment_method_id,
|
||||
{ source_attributes: PermittedAttributes::PaymentSource.attributes }
|
||||
],
|
||||
:payment_method_id,
|
||||
{ source_attributes: PermittedAttributes::PaymentSource.attributes }
|
||||
],
|
||||
ship_address_attributes: PermittedAttributes::Address.attributes,
|
||||
bill_address_attributes: PermittedAttributes::Address.attributes }
|
||||
],
|
||||
|
||||
@@ -25,10 +25,10 @@ module PermittedAttributes
|
||||
def self.basic_permitted_attributes
|
||||
[
|
||||
:id, :name, :visible, :permalink, :owner_id, :contact_name, :email_address, :phone,
|
||||
:is_primary_producer, :sells, :website, :facebook, :instagram, :linkedin, :twitter,
|
||||
:description, :long_description, :logo, :promo_image, :terms_and_conditions,
|
||||
:allow_guest_orders, :allow_order_changes, :require_login, :enable_subscriptions,
|
||||
:abn, :acn, :charges_sales_tax, :display_invoice_logo, :invoice_text,
|
||||
:whatsapp_phone, :is_primary_producer, :sells, :website, :facebook, :instagram, :linkedin,
|
||||
:twitter, :description, :long_description, :logo, :promo_image, :terms_and_conditions,
|
||||
:allow_guest_orders, :allow_order_changes, :require_login, :enable_subscriptions, :abn,
|
||||
:acn, :charges_sales_tax, :display_invoice_logo, :invoice_text,
|
||||
:preferred_product_selection_from_inventory_only, :preferred_shopfront_message,
|
||||
:preferred_shopfront_closed_message, :preferred_shopfront_taxon_order,
|
||||
:preferred_shopfront_producer_order, :preferred_shopfront_order_cycle_order,
|
||||
|
||||
@@ -97,6 +97,7 @@ module Sets
|
||||
variants_attributes.each do |attributes|
|
||||
create_or_update_variant(product, attributes)
|
||||
end
|
||||
product.errors.empty?
|
||||
end
|
||||
|
||||
def create_or_update_variant(product, variant_attributes)
|
||||
@@ -114,6 +115,11 @@ module Sets
|
||||
|
||||
variant = product.variants.create(variant_attributes)
|
||||
|
||||
if variant.errors.present?
|
||||
product.errors.merge!(variant.errors)
|
||||
return false
|
||||
end
|
||||
|
||||
begin
|
||||
variant.on_demand = on_demand if on_demand.present?
|
||||
variant.on_hand = on_hand.to_i if on_hand.present?
|
||||
|
||||
@@ -56,7 +56,7 @@ module VariantUnits
|
||||
def option_value_value_unit_scaled
|
||||
unit_scale, unit_name = scale_for_unit_value
|
||||
|
||||
value = @variant.unit_value / unit_scale
|
||||
value = BigDecimal(@variant.unit_value / unit_scale, 6)
|
||||
|
||||
[value, unit_name]
|
||||
end
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
= render 'spree/shared/error_messages', target: @enterprise
|
||||
|
||||
= form_for [main_app, :admin, @enterprise_group] do |f|
|
||||
.row{ ng: {app: 'admin.enterprise_groups', controller: 'enterpriseGroupCtrl'} }
|
||||
.row{ ng: {app: 'admin.enterprise_groups', controller: 'enterpriseGroupCtrl'}, data: { controller: 'tabs-and-panels', "tabs-and-panels-class-name-value": "selected" } }
|
||||
.sixteen.columns.alpha
|
||||
.four.columns.alpha
|
||||
= render 'admin/shared/side_menu'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='about'" } }
|
||||
%legend {{menu.selected.label}}
|
||||
%fieldset.alpha.no-border-bottom#about_panel{ data: { "tabs-and-panels-target": "panel" } }
|
||||
%legend= t('about')
|
||||
= f.field_container :long_description do
|
||||
%text-angular{'id' => 'enterprise_group_long_description', 'name' => 'enterprise_group[long_description]', 'class' => 'text-angular', "textangular-links-target-blank" => true,
|
||||
'ta-toolbar' => "[['h1','h2','h3','h4','p'],['bold','italics','underline','clear'],['insertLink']]"}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
= f.fields_for :address do |af|
|
||||
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='contact'" } }
|
||||
%legend {{menu.selected.label}}
|
||||
%fieldset.alpha.no-border-bottom#contact_panel{ data: { "tabs-and-panels-target": "panel" } }
|
||||
%legend= t('admin_enterprise_groups_contact')
|
||||
.row
|
||||
.alpha.three.columns
|
||||
= af.label :phone
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='images'" } }
|
||||
%legend {{menu.selected.label}}
|
||||
%fieldset.alpha.no-border-bottom#images_panel{ data: { "tabs-and-panels-target": "panel" } }
|
||||
%legend= t('images')
|
||||
.row
|
||||
.alpha.three.columns
|
||||
= f.label :logo, 'ofn-with-tip' => t('admin_enterprise_groups_data_powertip_logo')
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='primary_details'" } }
|
||||
%legend {{menu.selected.label}}
|
||||
%fieldset.alpha.no-border-bottom#primary_details_panel{ data: { "tabs-and-panels-target": "panel default" } }
|
||||
%legend= t('primary_details')
|
||||
= f.field_container :name do
|
||||
= f.label :name
|
||||
%br/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='users'" } }
|
||||
%legend {{menu.selected.label}}
|
||||
%fieldset.alpha.no-border-bottom#users_panel{ data: { "tabs-and-panels-target": "panel" } }
|
||||
%legend= t('users')
|
||||
.row
|
||||
.three.columns.alpha
|
||||
=f.label :owner_id, t(:admin_enterprise_groups_owner)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='web'" } }
|
||||
%legend {{menu.selected.label}}
|
||||
%fieldset.alpha.no-border-bottom#web_panel{ data: { "tabs-and-panels-target": "panel" } }
|
||||
%legend= t('admin_enterprise_groups_web')
|
||||
.row
|
||||
.alpha.three.columns
|
||||
= f.label :website
|
||||
|
||||
@@ -1,63 +1,21 @@
|
||||
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='primary_details'" } }
|
||||
%legend {{menu.selected.label}}
|
||||
= render 'admin/enterprises/form/primary_details', f: f
|
||||
- enterprise_side_menu_items(@enterprise).each do |item|
|
||||
- case item[:name]
|
||||
- when 'primary_details'
|
||||
%fieldset.alpha.no-border-bottom{ id: "#{item[:name]}_panel", data: { controller: "primary-details", "primary-details-primary-producer-value": @enterprise.is_primary_producer.to_s, "primary-details-enterprise-sells-value": @enterprise.sells, "tabs-and-panels-target": "panel default" }}
|
||||
%legend= t("#{ item[:name] }")
|
||||
= render "admin/enterprises/form/#{ item[:form_name] || item[:name] }", f: f
|
||||
|
||||
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='users'" } }
|
||||
%legend {{menu.selected.label}}
|
||||
= render 'admin/enterprises/form/users', f: f
|
||||
- when 'address'
|
||||
= f.fields_for :address do |af|
|
||||
%fieldset.alpha.no-border-bottom{ id: "#{item[:name]}_panel", data: { "tabs-and-panels-target": "panel" }}
|
||||
%legend= t("#{ item[:name] }")
|
||||
= render 'admin/enterprises/form/address', af: af
|
||||
|
||||
= f.fields_for :address do |af|
|
||||
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='address'" } }
|
||||
%legend {{menu.selected.label}}
|
||||
= render 'admin/enterprises/form/address', af: af
|
||||
- when 'enterprise_permissions'
|
||||
%fieldset.alpha.no-border-bottom{ id: "#{item[:name]}_panel", data: { "tabs-and-panels-target": "panel" }}
|
||||
%legend= t("#{ item[:name] }")
|
||||
|
||||
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='contact'" } }
|
||||
%legend {{menu.selected.label}}
|
||||
= render 'admin/enterprises/form/contact', f: f
|
||||
|
||||
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='social'" } }
|
||||
%legend {{menu.selected.label}}
|
||||
= render 'admin/enterprises/form/social', f: f
|
||||
|
||||
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='business_details'" } }
|
||||
%legend {{menu.selected.label}}
|
||||
= render 'admin/enterprises/form/business_details', f: f
|
||||
|
||||
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='about'" } }
|
||||
%legend {{menu.selected.label}}
|
||||
= render 'admin/enterprises/form/about_us', f: f
|
||||
|
||||
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='images'" } }
|
||||
%legend {{menu.selected.label}}
|
||||
= render 'admin/enterprises/form/images', f: f
|
||||
|
||||
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='properties'" } }
|
||||
%legend {{menu.selected.label}}
|
||||
= render 'admin/enterprises/form/properties', f: f
|
||||
|
||||
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='shipping_methods'" } }
|
||||
%legend {{menu.selected.label}}
|
||||
= render 'admin/enterprises/form/shipping_methods', f: f
|
||||
|
||||
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='payment_methods'" } }
|
||||
%legend {{menu.selected.label}}
|
||||
= render 'admin/enterprises/form/payment_methods', f: f
|
||||
|
||||
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='enterprise_fees'" } }
|
||||
%legend {{menu.selected.label}}
|
||||
= render 'admin/enterprises/form/enterprise_fees', f: f
|
||||
|
||||
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='enterprise_permissions'" } }
|
||||
%legend {{menu.selected.label}}
|
||||
|
||||
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='inventory_settings'" } }
|
||||
%legend {{menu.selected.label}}
|
||||
= render 'admin/enterprises/form/inventory_settings', f: f
|
||||
|
||||
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='shop_preferences'" } }
|
||||
%legend {{menu.selected.label}}
|
||||
= render 'admin/enterprises/form/shop_preferences', f: f
|
||||
|
||||
%fieldset.alpha.no-border-bottom{ ng: { if: "menu.selected.name=='tag_rules'" } }
|
||||
%legend {{menu.selected.label}}
|
||||
= render 'admin/enterprises/form/tag_rules', f: f
|
||||
- else
|
||||
%fieldset.alpha.no-border-bottom{ id: "#{item[:name]}_panel", data: { "tabs-and-panels-target": "panel" }}
|
||||
%legend= t("#{ item[:name] }")
|
||||
= render "admin/enterprises/form/#{ item[:form_name] || item[:name] }", f: f
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
%input.red{ type: "button", value: t(:update), ng: { click: "submit()", disabled: "!enterprise_form.$dirty" } }
|
||||
%input{ type: "button", ng: { value: "enterprise_form.$dirty ? '#{t(:cancel)}' : '#{t(:close)}'", click: "cancel('#{main_app.admin_enterprises_path}')" } }
|
||||
|
||||
.row
|
||||
.row{ data: {
|
||||
controller: "tabs-and-panels", "tabs-and-panels-class-name-value": "selected" }}
|
||||
.sixteen.columns.alpha
|
||||
.four.columns.alpha
|
||||
= render 'admin/shared/side_menu'
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
.row
|
||||
.alpha.three.columns
|
||||
= f.label :email_address, t('.email_address')
|
||||
%div{'ofn-with-tip' => t('.email_address_tip')}
|
||||
%a= t('admin.whats_this')
|
||||
= render partial: 'admin/shared/tooltip', locals: {tooltip_text: t('.email_address_tip')}
|
||||
|
||||
.omega.eight.columns
|
||||
= f.text_field :email_address, { placeholder: t('.email_address_placeholder') }
|
||||
.row
|
||||
@@ -15,6 +15,13 @@
|
||||
= f.label :phone, t('.phone')
|
||||
.omega.eight.columns
|
||||
= f.text_field :phone, { placeholder: t('.phone_placeholder') }
|
||||
.row
|
||||
.alpha.three.columns
|
||||
= f.label :whatsapp_phone, t('.whatsapp_phone')
|
||||
= render partial: 'admin/shared/tooltip', locals: {tooltip_text: t('.whatsapp_phone_tip')}
|
||||
|
||||
.omega.eight.columns
|
||||
= f.text_field :whatsapp_phone, { placeholder: t('.whatsapp_phone_placeholder') }
|
||||
.row
|
||||
.alpha.three.columns
|
||||
= f.label :website, t('.website')
|
||||
|
||||
32
app/views/admin/enterprises/form/_permalink.html.haml
Normal file
32
app/views/admin/enterprises/form/_permalink.html.haml
Normal file
@@ -0,0 +1,32 @@
|
||||
.permalink#permalink{ data: { controller: 'permalink', permalink: { 'initial-permalink-value': @enterprise.permalink, 'url-value': check_permalink_enterprises_url } }}
|
||||
- unless @enterprise.sells == 'none'
|
||||
.row
|
||||
.three.columns.alpha
|
||||
= label_tag :permalink, t('.permalink')
|
||||
= render partial: 'admin/shared/tooltip', locals: {tooltip_text: t('.permalink_tip', link: main_app.root_url)}
|
||||
.eight.columns
|
||||
= text_field_tag "enterprise[permalink]", @enterprise.permalink, data: { action: "input->permalink#validate", "permalink-target": "permalinkField" }
|
||||
.two.columns.omega
|
||||
%div{ style: "width: 30px; height: 30px;", class: "hidden", data: { "permalink-target": "spinner" } }
|
||||
= render partial: "components/admin_spinner"
|
||||
%span.available.hidden{data: { "permalink-target": "available" }}
|
||||
= t('available')
|
||||
%i.icon-ok-sign
|
||||
%span.unavailable.hidden{data: { "permalink-target": "unavailable" }}
|
||||
= t('js.unavailable')
|
||||
%i.icon-remove-sign
|
||||
|
||||
- unless @enterprise.sells == 'none'
|
||||
.row
|
||||
.three.columns.alpha
|
||||
%label= t('.link_to_front')
|
||||
= render partial: 'admin/shared/tooltip', locals: {tooltip_text: t('.link_to_front_tip')}
|
||||
.eight.columns.omega
|
||||
- front_shop_path = "#{main_app.root_url}#{@enterprise.permalink}/shop"
|
||||
= link_to front_shop_path, front_shop_path , target: "_blank"
|
||||
.row
|
||||
.three.columns.alpha
|
||||
= label_tag :id, t('.ofn_uid')
|
||||
= render partial: 'admin/shared/tooltip', locals: {tooltip_text: t('.ofn_uid_tip')}
|
||||
.six.columns
|
||||
= @enterprise.id
|
||||
@@ -8,39 +8,34 @@
|
||||
.row
|
||||
.three.columns.alpha
|
||||
= f.label :group_ids, t('.groups')
|
||||
%div{'ofn-with-tip' => t('.groups_tip')}
|
||||
%a= t('admin.whats_this')
|
||||
= render partial: 'admin/shared/tooltip', locals: {tooltip_text: t('.groups_tip')}
|
||||
.eight.columns.omega
|
||||
= f.collection_select :group_ids, @groups, :id, :name, {}, class: "select2 fullwidth", multiple: true, placeholder: t('.groups_placeholder')
|
||||
|
||||
= f.collection_select :group_ids, @groups, :id, :name, {}, data: { controller: "tom-select", "tom-select-options-value": { plugins: ['remove_button'], maxItems: nil } }, class: "full-width", multiple: true, placeholder: t('.groups_placeholder')
|
||||
.row
|
||||
.three.columns.alpha
|
||||
%label= t('.primary_producer')
|
||||
%div{'ofn-with-tip' => t('.primary_producer_tip')}
|
||||
%a= t('admin.whats_this')
|
||||
= render partial: 'admin/shared/tooltip', locals: {tooltip_text: t('.primary_producer_tip')}
|
||||
.five.columns.omega
|
||||
= f.check_box :is_primary_producer, 'ng-model' => 'Enterprise.is_primary_producer'
|
||||
= f.check_box :is_primary_producer, data: { action: "change->primary-details#primaryProducerChanged" }
|
||||
= f.label :is_primary_producer, t('.producer')
|
||||
- if spree_current_user.admin?
|
||||
.row
|
||||
.three.columns.alpha
|
||||
= f.label :sells, t('.sells')
|
||||
%div{'ofn-with-tip' => t('.sells_tip')}
|
||||
%a= t('admin.whats_this')
|
||||
= render partial: 'admin/shared/tooltip', locals: {tooltip_text: t('.sells_tip')}
|
||||
.two.columns
|
||||
= f.radio_button :sells, "none", 'ng-model' => 'Enterprise.sells'
|
||||
= f.radio_button :sells, "none", 'ng-model' => 'Enterprise.sells', data: {action: "change->primary-details#enterpriseSellsChanged"}
|
||||
= f.label :sells, t('.none'), value: "none"
|
||||
.two.columns
|
||||
= f.radio_button :sells, "own", 'ng-model' => 'Enterprise.sells'
|
||||
= f.radio_button :sells, "own", 'ng-model' => 'Enterprise.sells', data: {action: "change->primary-details#enterpriseSellsChanged"}
|
||||
= f.label :sells, t('.own'), value: "own"
|
||||
.four.columns.omega
|
||||
= f.radio_button :sells, "any", 'ng-model' => 'Enterprise.sells'
|
||||
= f.radio_button :sells, "any", 'ng-model' => 'Enterprise.sells', data: {action: "change->primary-details#enterpriseSellsChanged"}
|
||||
= f.label :sells, t('.any'), value: "any"
|
||||
.row
|
||||
.three.columns.alpha
|
||||
%label= t('.visible_in_search')
|
||||
%div{'ofn-with-tip' => t('.visible_in_search_tip')}
|
||||
%a= t('admin.whats_this')
|
||||
= render partial: 'admin/shared/tooltip', locals: {tooltip_text: t('.visible_in_search_tip')}
|
||||
.two.columns
|
||||
= f.radio_button :visible, "public", 'ng-model' => 'Enterprise.visible'
|
||||
= f.label :visible, t('.visible'), value: 'public'
|
||||
@@ -50,32 +45,5 @@
|
||||
.four.columns.omega
|
||||
= f.radio_button :visible, "hidden", 'ng-model' => 'Enterprise.visible'
|
||||
= f.label :visible, t('.hidden'), value: 'hidden'
|
||||
.permalink{ ng: { controller: "permalinkCtrl" } }
|
||||
.row{ ng: { show: "Enterprise.sells == 'own' || Enterprise.sells == 'any'" } }
|
||||
.three.columns.alpha
|
||||
= f.label :permalink, t('.permalink')
|
||||
%div{'ofn-with-tip' => t('.permalink_tip', link: main_app.root_url)}
|
||||
%a= t('admin.whats_this')
|
||||
.eight.columns
|
||||
= f.text_field :permalink, { 'ng-model' => "Enterprise.permalink", placeholder: "eg. your-shop-name", 'ng-model-options' => "{ updateOn: 'default blur', debounce: {'default': 300, 'blur': 0} }" }
|
||||
.two.columns.omega
|
||||
%div{ng: {show: "checking", cloak: true}, style: "width: 30px; height: 30px;"}
|
||||
= render partial: "components/admin_spinner"
|
||||
%span{ ng: { class: 'availability.toLowerCase()', hide: "checking" } }
|
||||
{{ availability }}
|
||||
%i{ ng: { class: "{'icon-ok-sign': availability == 'Available', 'icon-remove-sign': availability == 'Unavailable'}" } }
|
||||
.row{ ng: { show: "Enterprise.sells == 'own' || Enterprise.sells == 'any'" } }
|
||||
.three.columns.alpha
|
||||
%label= t('.link_to_front')
|
||||
%div{'ofn-with-tip' => t('.link_to_front_tip')}
|
||||
%a= t('admin.whats_this')
|
||||
.eight.columns.omega
|
||||
= surround main_app.root_url, "/shop" do
|
||||
{{Enterprise.permalink}}
|
||||
.row
|
||||
.three.columns.alpha
|
||||
= f.label :id, t('.ofn_uid')
|
||||
%div{'ofn-with-tip' => t('.ofn_uid_tip')}
|
||||
%a= t('admin.whats_this')
|
||||
.six.columns
|
||||
{{Enterprise.id}}
|
||||
|
||||
= render partial: 'admin/enterprises/form/permalink'
|
||||
|
||||
@@ -19,6 +19,10 @@
|
||||
%tr.products
|
||||
%td{ ng: { include: "'admin/panels/exchange_products_simple.html'" } }
|
||||
|
||||
%br
|
||||
= label_tag t('.tags')
|
||||
%tags-with-translation{ object: 'order_cycle.outgoing_exchanges[0]', form: 'order_cycle_form' }
|
||||
|
||||
%br/
|
||||
= label_tag t('.fees')
|
||||
= render 'coordinator_fees', f: f
|
||||
|
||||
@@ -7,19 +7,27 @@
|
||||
.omega.fourteen.columns
|
||||
= select_tag(:report_subtype, options_for_select(@report_subtypes, @report_subtype))
|
||||
|
||||
.row.rendering-options{ "data-controller": "csv-select" }
|
||||
.alpha.two.columns
|
||||
= label_tag :report_format, t(".generate_report")
|
||||
.omega.fourteen.columns{ style: "margin-bottom: 1.5em;" }
|
||||
= select_tag :report_format, grouped_options_for_select({ |
|
||||
t('.formatted_data') => { t('.on_screen') => '', "PDF" => 'pdf', t('.spreadsheet') => 'xlsx' }, |
|
||||
t('.raw_data') => { "CSV" => 'csv' }, |
|
||||
}), { "data-csv-select-target": "reportType", "data-action": "csv-select#handleSelectChange" }
|
||||
|
||||
- if @report.header_option? || @report.summary_row_option?
|
||||
.row
|
||||
.alpha.two.columns= label_tag nil, t(".display")
|
||||
.omega.fourteen.columns
|
||||
- if @report.header_option?
|
||||
%span.inline-checkbox{ style: "margin-right: 1rem;" }
|
||||
= check_box_tag :display_header_row, true, params[:display_header_row]
|
||||
= label_tag :display_header_row, t(".header_row")
|
||||
- if @report.summary_row_option?
|
||||
%span.inline-checkbox
|
||||
= check_box_tag :display_summary_row, true, params[:display_summary_row]
|
||||
= label_tag :display_summary_row, t(".summary_row")
|
||||
- if @report.header_option? || @report.summary_row_option?
|
||||
.row
|
||||
.alpha.two.columns= label_tag nil, t(".display")
|
||||
.omega.fourteen.columns
|
||||
- if @report.header_option?
|
||||
%span.inline-checkbox{ style: "margin-right: 1rem;" }
|
||||
= check_box_tag :display_header_row, true, params[:display_header_row]
|
||||
= label_tag :display_header_row, t(".header_row")
|
||||
- if @report.summary_row_option?
|
||||
%span.inline-checkbox
|
||||
= check_box_tag :display_summary_row, true, params[:display_summary_row], { "data-csv-select-target": "checkbox" }
|
||||
= label_tag :display_summary_row, t(".summary_row"), { "data-csv-select-target": "label" }
|
||||
|
||||
- if @report.available_headers.present?
|
||||
.row
|
||||
@@ -33,14 +41,3 @@
|
||||
.omega.fourteen.columns
|
||||
= select_tag(:fields_to_hide, options_for_select(@report.available_headers, params[:fields_to_hide]),
|
||||
class: "select2 fullwidth", multiple: true)
|
||||
|
||||
.row.rendering-options
|
||||
.alpha.two.columns
|
||||
= label_tag :report_format, t(".generate_report")
|
||||
.omega.fourteen.columns
|
||||
= select_tag :report_format, grouped_options_for_select({ |
|
||||
t('.formatted_data') => { t('.on_screen') => '', "PDF" => 'pdf', t('.spreadsheet') => 'xlsx' }, |
|
||||
t('.raw_data') => { "CSV" => 'csv' }, |
|
||||
})
|
||||
|
||||
|
||||
|
||||
2
app/views/admin/reports/filters/_revenues_by_hub.haml
Normal file
2
app/views/admin/reports/filters/_revenues_by_hub.haml
Normal file
@@ -0,0 +1,2 @@
|
||||
= render 'admin/reports/date_range_form', f: f
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
.side_menu{ ng: { controller: 'sideMenuCtrl' } }
|
||||
%a.menu_item{ href: "", id: "{{ item.name.toLowerCase().replace(' ', '_') }}",
|
||||
ng: { repeat: '(index,item) in menu.items | filter:{visible:true}',
|
||||
click: 'select(index)',
|
||||
show: '!showItem || showItem(item)',
|
||||
class: '{ selected: item.selected }' } }
|
||||
%i{ class: "{{item.icon_class}}" }
|
||||
%span {{ item.label }}
|
||||
.side_menu#side_menu
|
||||
- if @enterprise
|
||||
- enterprise_side_menu_items(@enterprise).each do |item|
|
||||
- next unless item[:show]
|
||||
%a.menu_item{ href: item[:href] || "##{item[:name]}_panel", id: item[:name], data: { action: "tabs-and-panels#changeActivePanel tabs-and-panels#changeActiveTab", "tabs-and-panels-target": "tab" }, class: item[:selected] }
|
||||
%i{ class: item[:icon_class] }
|
||||
%span= t("#{item[:name] }")
|
||||
- else
|
||||
- enterprise_group_side_menu_items.each do |item|
|
||||
%a.menu_item{ href: "##{item[:name]}_panel", class: item[:selected], id: item[:name], data: { action: "tabs-and-panels#changeActivePanel tabs-and-panels#changeActiveTab", "tabs-and-panels-target": "tab" } }
|
||||
%i{ class: item[:icon_class] }
|
||||
%span= t("#{item[:label] }")
|
||||
|
||||
|
||||
6
app/views/admin/shared/_tooltip.html.haml
Normal file
6
app/views/admin/shared/_tooltip.html.haml
Normal file
@@ -0,0 +1,6 @@
|
||||
%div{"data-controller": "tooltip"}
|
||||
%a{"data-tooltip-target": "element", "data-action": "mouseenter->tooltip#showTooltip mouseleave->tooltip#hideTooltip"}= t('admin.whats_this')
|
||||
.tooltip-container
|
||||
.tooltip{"data-tooltip-target": "tooltip"}
|
||||
= sanitize tooltip_text
|
||||
.arrow{"data-tooltip-target": "arrow"}
|
||||
@@ -14,6 +14,6 @@
|
||||
= t(".using_default_terms_html", tos_link: link_to_platform_terms)
|
||||
|
||||
= form_for [main_app, :admin, @new_file] do |f|
|
||||
= f.label :attachment
|
||||
= f.label :attachment, t(".attachment")
|
||||
= f.file_field :attachment
|
||||
= f.submit
|
||||
= f.submit t(".create_terms_of_service")
|
||||
|
||||
8
app/views/errors/internal_server_error.html.haml
Normal file
8
app/views/errors/internal_server_error.html.haml
Normal file
@@ -0,0 +1,8 @@
|
||||
- content_for :title do
|
||||
= I18n.t("errors.internal_server_error.title")
|
||||
.dialog
|
||||
%a{href: "/"}
|
||||
%img{src: "/500.jpg"}
|
||||
%h1
|
||||
= t("errors.internal_server_error.title")
|
||||
= t("errors.internal_server_error.message_html")
|
||||
8
app/views/errors/not_found.html.haml
Normal file
8
app/views/errors/not_found.html.haml
Normal file
@@ -0,0 +1,8 @@
|
||||
- content_for :title do
|
||||
= I18n.t("errors.not_found.title")
|
||||
.dialog
|
||||
%a{href: "/"}
|
||||
%img{src: "/500.jpg"}
|
||||
%h1
|
||||
= t("errors.not_found.title")
|
||||
= t("errors.not_found.message_html")
|
||||
26
app/views/errors/unprocessable_entity.html.haml
Normal file
26
app/views/errors/unprocessable_entity.html.haml
Normal file
@@ -0,0 +1,26 @@
|
||||
:css
|
||||
body {
|
||||
text-align: center;
|
||||
}
|
||||
a {
|
||||
font-size: 100%;
|
||||
color: black;
|
||||
line-height: 1.5em;
|
||||
text-decoration: none;
|
||||
border-bottom: 1px dotted black;
|
||||
padding: 0 0.2rem;
|
||||
}
|
||||
a:hover, a:focus, a:active{
|
||||
background: #8f301d;
|
||||
color: white;
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
- content_for :title do
|
||||
= I18n.t("errors.unprocessable_entity.title")
|
||||
.dialog
|
||||
%a{href: "/", style: "border: none; background: none;"}
|
||||
%img{src: "/422.jpg"}
|
||||
%h1
|
||||
= t("errors.unprocessable_entity.title")
|
||||
= t("errors.unprocessable_entity.message_html")
|
||||
@@ -1,24 +1,8 @@
|
||||
|
||||
- if Spree::Config.matomo_tag_manager_url.present?
|
||||
:javascript
|
||||
var _mtm = _mtm || [];
|
||||
var _mtm = window._mtm = window._mtm || [];
|
||||
_mtm.push({'mtm.startTime': (new Date().getTime()), 'event': 'mtm.Start'});
|
||||
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
|
||||
var u="#{Spree::Config.matomo_tag_manager_url}";
|
||||
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u; s.parentNode.insertBefore(g,s);
|
||||
|
||||
- if Spree::Config.matomo_url.present?
|
||||
:javascript
|
||||
var _paq = window._paq || [];
|
||||
_paq.push(["setDocumentTitle", document.domain + "/" + document.title]);
|
||||
_paq.push(["setCookieDomain", "*.#{Spree::Config.site_url}"]);
|
||||
_paq.push(["setDomains", ["*.#{Spree::Config.site_url}"]]);
|
||||
_paq.push(['trackPageView']);
|
||||
_paq.push(['enableLinkTracking']);
|
||||
(function() {
|
||||
var u="#{Spree::Config.matomo_url}";
|
||||
_paq.push(['setTrackerUrl', u+'matomo.php']);
|
||||
_paq.push(['setSiteId', '#{Spree::Config.matomo_site_id}']);
|
||||
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
|
||||
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
|
||||
})();
|
||||
|
||||
16
app/views/layouts/_matomo_tracking.html.haml
Normal file
16
app/views/layouts/_matomo_tracking.html.haml
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
- if Spree::Config.matomo_url.present?
|
||||
:javascript
|
||||
var _paq = window._paq || [];
|
||||
_paq.push(["setDocumentTitle", document.domain + "/" + document.title]);
|
||||
_paq.push(["setCookieDomain", "*.#{Spree::Config.site_url}"]);
|
||||
_paq.push(["setDomains", ["*.#{Spree::Config.site_url}"]]);
|
||||
_paq.push(['trackPageView']);
|
||||
_paq.push(['enableLinkTracking']);
|
||||
(function() {
|
||||
var u="#{Spree::Config.matomo_url}";
|
||||
_paq.push(['setTrackerUrl', u+'matomo.php']);
|
||||
_paq.push(['setSiteId', '#{Spree::Config.matomo_site_id}']);
|
||||
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
|
||||
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
|
||||
})();
|
||||
@@ -14,6 +14,8 @@
|
||||
= favicon_link_tag "/favicon-staging.ico"
|
||||
%link{href: "https://fonts.googleapis.com/css?family=Roboto:400,300italic,400italic,300,700,700italic|Oswald:300,400,700", rel: "stylesheet", type: "text/css"}
|
||||
%link{href: asset_pack_path("media/fonts/OFN-v2.woff"), rel: "preload", as: "font", crossorigin: "anonymous"}
|
||||
= render "layouts/matomo_tag"
|
||||
= render "layouts/matomo_tracking"
|
||||
= language_meta_tags
|
||||
|
||||
= stylesheet_pack_tag "darkswarm", "data-turbo-track": "reload"
|
||||
@@ -57,6 +59,5 @@
|
||||
= inject_currency_config
|
||||
= yield :injection_data
|
||||
|
||||
= render "layouts/matomo_tag"
|
||||
|
||||
= render "layouts/login_modal"
|
||||
|
||||
28
app/views/layouts/errors.html.haml
Normal file
28
app/views/layouts/errors.html.haml
Normal file
@@ -0,0 +1,28 @@
|
||||
%html
|
||||
%head
|
||||
:css
|
||||
body {
|
||||
background-color: #fff;
|
||||
color: #666;
|
||||
font-family: arial, sans-serif;
|
||||
|
||||
}
|
||||
div.dialog {
|
||||
width: 600px;
|
||||
margin: auto;
|
||||
}
|
||||
@media only screen
|
||||
and (min-width: 320px)
|
||||
and (max-width: 568px) {
|
||||
div.dialog, div.dialog img {
|
||||
width: 95%;
|
||||
}
|
||||
}
|
||||
div.dialog h1 {
|
||||
font-size: 1.8em;
|
||||
}
|
||||
%title
|
||||
= yield(:title)
|
||||
|
||||
%body
|
||||
= yield
|
||||
@@ -9,6 +9,7 @@
|
||||
- else
|
||||
= favicon_link_tag "/favicon-staging.ico"
|
||||
%link{href: "https://fonts.googleapis.com/css?family=Roboto:400,300italic,400italic,300,700,700italic|Oswald:300,400,700", rel: "stylesheet", type: "text/css"}
|
||||
= render "layouts/matomo_tag"
|
||||
= language_meta_tags
|
||||
|
||||
= stylesheet_pack_tag "darkswarm"
|
||||
|
||||
@@ -38,6 +38,11 @@
|
||||
= t :producers_contact_phone
|
||||
%span{"ng-bind" => "::producer.phone"}
|
||||
|
||||
%p.word-wrap{"ng-if" => "::producer.whatsapp_phone"}
|
||||
%a{"ng-href" => "{{::producer.whatsapp_url}}", target: "_blank"}
|
||||
%img{ src: image_pack_path("social-logos/whatsapp.svg") }
|
||||
%span{"ng-bind" => "::producer.whatsapp_phone"}
|
||||
|
||||
%p.word-wrap{"ng-if" => "::producer.email_address"}
|
||||
%a{"ng-href" => "{{::producer.email_address | stripUrl}}", target: "_blank", mailto: true}
|
||||
%span.obfuscatedEmail.email{"ng-bind" => "::producer.email_address | stripUrl"}
|
||||
|
||||
@@ -24,6 +24,10 @@
|
||||
.small-12.columns.field
|
||||
%label{ for: 'enterprise_phone' }= t(".phone_field")+":"
|
||||
%input.chunky.small-12.columns{ id: 'enterprise_phone', name: 'phone', placeholder: "{{'registration.steps.contact.phone_field_placeholder' | t}}", ng: { model: 'enterprise.phone' } }
|
||||
.row
|
||||
.small-12.columns.field
|
||||
%label{ "for" => 'enterprise_whatsapp_phone', 'data-toggle' => "tooltip", 'title' => "{{'registration.steps.contact.whatsapp_phone_tooltip' | t}}" }= t(".whatsapp_phone_field")+":"
|
||||
%input.chunky.small-12.columns{ id: 'enterprise_whatsapp_phone', name: 'whatsapp_phone', placeholder: "{{'registration.steps.contact.whatsapp_phone_field_placeholder' | t}}", ng: { model: 'enterprise.whatsapp_phone' } }
|
||||
.small-12.medium-12.large-5.hide-for-small-only
|
||||
|
||||
.row.buttons
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
= current_distributor.address.zipcode
|
||||
|
||||
.small-12.large-4.columns
|
||||
- if current_distributor.website || current_distributor.email_address || current_distributor.phone
|
||||
- if current_distributor.website || current_distributor.email_address || current_distributor.phone || current_distributor.whatsapp_phone
|
||||
%div.center
|
||||
.header
|
||||
= t :shopping_contact_web
|
||||
@@ -26,6 +26,11 @@
|
||||
- if current_distributor.phone.present?
|
||||
= current_distributor.phone
|
||||
%br
|
||||
- if current_distributor.whatsapp_phone.present?
|
||||
%a{href: current_distributor.whatsapp_url, target: "_blank" }
|
||||
%img{ src: image_pack_path("social-logos/whatsapp.svg") }
|
||||
= current_distributor.whatsapp_phone
|
||||
%br
|
||||
- if current_distributor.website.present?
|
||||
%a{href: "http://#{current_distributor.website}", target: "_blank" }
|
||||
= current_distributor.website
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
= render 'spree/admin/orders/insufficient_stock_lines', insufficient_stock_lines: @order.insufficient_stock_lines
|
||||
|
||||
= render :partial => "spree/admin/orders/shipment", :collection => @order.shipments, :locals => { :order => order }
|
||||
- if order.line_items.exists?
|
||||
= render partial: "spree/admin/orders/note", locals: { order: @order }
|
||||
|
||||
= render :partial => "spree/admin/orders/_form/adjustments", :locals => { :adjustments => @order.line_item_adjustments, :title => t(".line_item_adjustments")}
|
||||
= render :partial => "spree/admin/orders/_form/adjustments", :locals => { :adjustments => order_adjustments_for_display(@order), :title => t(".order_adjustments")}
|
||||
|
||||
@@ -47,12 +47,12 @@
|
||||
%strong= @order.has_taxes_included ? t(:total_incl_tax) : t(:total_excl_tax)
|
||||
%td{:align => "right", :colspan => "2"}
|
||||
%strong= @order.has_taxes_included ? @order.display_total : display_checkout_total_less_tax(@order)
|
||||
- display_checkout_taxes_hash(@order).each do |tax_rate, tax_value|
|
||||
- display_checkout_taxes_hash(@order).each do |tax|
|
||||
%tr
|
||||
%td{:align => "right", :colspan => "3"}
|
||||
= t(:tax_total, rate: tax_rate)
|
||||
= t(:tax_total, rate: tax[:percentage])
|
||||
%td{:align => "right", :colspan => "2"}
|
||||
= tax_value
|
||||
= tax[:amount]
|
||||
%tr
|
||||
%td{:align => "right", :colspan => "3"}
|
||||
= @order.has_taxes_included ? t(:total_excl_tax) : t(:total_incl_tax)
|
||||
|
||||
26
app/views/spree/admin/orders/_note.html.haml
Normal file
26
app/views/spree/admin/orders/_note.html.haml
Normal file
@@ -0,0 +1,26 @@
|
||||
%table.index.edit-note-table
|
||||
%tr.edit-note.hidden.total
|
||||
%td{ colspan: "5", data: { controller: "input-char-count" }, style: "position: relative;" }
|
||||
%label
|
||||
= t(".note_label")
|
||||
= text_field_tag :note, @order.note, { maxLength: 280, data: { "input-char-count-target": "input" } }
|
||||
%span.edit-note-count{ data: { "input-char-count-target": "count" }, style: "position: absolute; right: 7px; top: 7px; font-size: 11px;" }
|
||||
|
||||
%td.actions
|
||||
= link_to '', '', class: 'save-note icon_link icon-ok no-text with-tip', data: { action: 'save' }, title: I18n.t('actions.save')
|
||||
= link_to '', '', class: 'cancel-note icon_link icon-cancel no-text with-tip', data: { action: 'cancel' }, title: I18n.t('actions.cancel')
|
||||
|
||||
%tr.show-note.total
|
||||
%td{ :colspan => "5" }
|
||||
- if order.note.present?
|
||||
%strong
|
||||
= t(".note_label")
|
||||
= order.note
|
||||
- else
|
||||
= t(".no_note_present")
|
||||
|
||||
%td.actions
|
||||
= link_to '', '', class: 'edit-note icon_link icon-edit no-text with-tip', data: { action: 'edit' }, title: Spree.t('edit')
|
||||
- if @order.note.present?
|
||||
= link_to '', '', class: 'delete-note icon_link icon-trash no-text with-tip', data: { action: 'remove' }, title: Spree.t('delete')
|
||||
|
||||
@@ -85,3 +85,5 @@
|
||||
%td.actions
|
||||
- if can?(:update, shipment) && shipment.can_modify?
|
||||
= link_to '', '', :class => 'edit-tracking icon_link icon-edit no-text with-tip', :data => { :action => 'edit' }, :title => Spree.t('edit')
|
||||
- if shipment.tracking.present?
|
||||
= link_to '', '', :class => 'delete-tracking icon_link icon-trash no-text with-tip', :data => { 'shipment-number' => shipment.number, :action => 'remove' }, :title => Spree.t('delete')
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
- if Spree::Config[:enable_invoices?]
|
||||
.ofn-drop-down-with-prepend
|
||||
.ofn-drop-down-prepend{"ng-class": "selected_orders.length == 0 ? 'disabled' : ''"}
|
||||
{{ selected_orders.length }}
|
||||
=t('.selected')
|
||||
{{ "spree.admin.orders.index.selected" | t:{count: selected_orders.length} }}
|
||||
.ofn-drop-down{"ng-class": "selected_orders.length == 0 ? 'disabled' : ''"}
|
||||
%span{ :class => 'icon-reorder' }
|
||||
="#{t('admin.actions')}".html_safe
|
||||
|
||||
@@ -77,3 +77,6 @@
|
||||
= @order.distributor.invoice_text
|
||||
|
||||
= render 'spree/shared/payment'
|
||||
|
||||
- if @order.note.present?
|
||||
= render partial: 'spree/shared/order_note'
|
||||
|
||||
@@ -89,3 +89,6 @@
|
||||
= @order.distributor.invoice_text
|
||||
|
||||
= render 'spree/shared/payment'
|
||||
|
||||
- if @order.note.present?
|
||||
= render partial: 'spree/shared/order_note'
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
\#
|
||||
= @order.number
|
||||
|
||||
= render 'spree/admin/shared/order_tabs', :current => 'Order Details'
|
||||
= render 'spree/admin/shared/order_tabs', :current => 'Customer Details'
|
||||
|
||||
= csrf_meta_tags
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
= render 'spree/admin/orders/_form/distribution_fields'
|
||||
-# This param passed to stop validation error in next page due to no line items in order yet:
|
||||
= hidden_field_tag 'suppress_error_msg', "true"
|
||||
= hidden_field_tag "set_distribution_step", "true"
|
||||
= button_tag :class => 'secondary radius expand small', :id => 'update-button' do
|
||||
%i.icon-arrow-right
|
||||
= t(:next)
|
||||
|
||||
@@ -58,10 +58,10 @@
|
||||
j(@order.display_total.format(with_currency: false))]}",
|
||||
'\x1B' + '\x45' + '\x0A', // bold off
|
||||
'\x0A',
|
||||
"#{display_checkout_taxes_hash(@order).map { |tax_rate, tax_value|
|
||||
"#{display_checkout_taxes_hash(@order).map { |tax|
|
||||
'%31s%10s' %
|
||||
[j(t(:tax_total, rate: tax_rate)),
|
||||
j(tax_value.format(with_currency: false))] +
|
||||
[j(t(:tax_total, rate: tax[:percentage])),
|
||||
j(tax[:amount].format(with_currency: false))] +
|
||||
'" + \'\x0A\' + "'}.join }",
|
||||
"#{'%31s%10s' %
|
||||
[j(t(:total_excl_tax)),
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
%fieldset#calculator_fields.no-border-bottom
|
||||
%legend{align: "center"}= t(:calculator)
|
||||
%legend{align: "center"}= t(:fees)
|
||||
#preference-settings
|
||||
.row
|
||||
.alpha.four.columns
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user