Skip to content

Commit

Permalink
Merge pull request #44 from milewski/master
Browse files Browse the repository at this point in the history
Improvements
  • Loading branch information
pktharindu authored Feb 6, 2022
2 parents 3c17596 + 707aaf3 commit 71d11a3
Show file tree
Hide file tree
Showing 14 changed files with 17,204 additions and 255 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/.idea
/vendor
/node_modules
package-lock.json
composer.phar
composer.lock
phpunit.xml
Expand Down
3 changes: 2 additions & 1 deletion dist/js/tool.js

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions dist/js/tool.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*!
* Determine if an object is a Buffer
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/

/**
* @license
* Lodash <https://lodash.com/>
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/
5 changes: 2 additions & 3 deletions dist/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"/js/tool.js": "/js/tool.js",
"/css/tool.css": "/css/tool.css"
}
"/js/tool.js": "/js/tool.js"
}
16,893 changes: 16,893 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
"development": "mix",
"watch": "mix watch",
"watch-poll": "mix watch -- --watch-options-poll=1000",
"hot": "mix watch --hot",
"production": "mix --production"
},
"devDependencies": {
"cross-env": "^5.0.0",
"laravel-mix": "^1.0",
"laravel-nova": "^1.0.8",
"sass-loader": "^7.1.0"
},
"dependencies": {
"vue": "^2.5.0"
"cross-env": "^7.0.3",
"laravel-mix": "^6.0.41",
"laravel-nova": "^1.12.3",
"resolve-url-loader": "^5.0.0",
"vue": "^2.6.14",
"vue-loader": "^15.9.8",
"sass": "^1.42.1",
"sass-loader": "^12.1.0",
"vue-template-compiler": "^2.6.14"
}
}
128 changes: 67 additions & 61 deletions resources/js/components/DetailField.vue
Original file line number Diff line number Diff line change
@@ -1,68 +1,74 @@
<template>
<panel-item :field="field">
<p
slot="value"
class="text-90 flex"
>
<span
class="w-full flex flex-wrap -mx-2"
v-if="field.withGroups"
>
<div
v-for="(permissions, group) in field.options"
:key="group"
class="mb-4 permission-group mx-2"
>
<h3 class="my-2">{{ __(group) }}</h3>
<div
v-for="(permission, option) in permissions"
:key="option"
class="flex-auto"
:title="permission.description"
>
<span
class="inline-block rounded-full w-2 h-2 mr-1"
:class="optionClass(permission.option)"
/>
<span>{{ permission.label }}</span>
</div>
</div>
</span>
<span
class="w-full flex flex-wrap -mx-2"
v-else
>
<div
v-for="(permission, option) in field.options"
:key="option"
class="flex-auto mx-2"
:title="permission.description"
>
<span
class="inline-block rounded-full w-2 h-2 mr-1"
:class="optionClass(option)"
/>
<span>{{ permission.label }}</span>

<panel-item class="nova-permissions" :field="field">

<div slot="value" class="text-90 flex">

<div class="w-full flex flex-wrap -mx-2" v-if="field.withGroups">

<div v-for="(permissions, group) in field.options" :key="group" class="mb-4 permission-group mx-2">

<h3 class="mb-3">{{ __(group) }}</h3>

<div v-for="(permission, option) in permissions"
:key="option"
class="flex-auto"
:title="permission.description">

<span class="inline-block rounded-full w-2 h-2 mr-1" :class="optionClass(permission.option)"/>
<span>{{ permission.label }}</span>

</div>

</div>

</div>

<div class="w-full flex flex-wrap -mx-2" v-else>

<div v-for="(permission, option) in field.options"
:key="option"
class="flex-auto mx-2"
:title="permission.description">

<div class="inline-block rounded-full w-2 h-2 mr-1" :class="optionClass(option)"/>

<div>{{ permission.label }}</div>

</div>

</div>

</div>
</span>
</p>
</panel-item>

</panel-item>

</template>

<script>
export default {
props: ["resource", "resourceName", "resourceId", "field"],
methods: {
optionClass(option) {
return {
"bg-success": this.field.value
? this.field.value.includes(option)
: false,
"bg-danger": this.field.value
? !this.field.value.includes(option)
: true
};
export default {
props: [ 'resource', 'resourceName', 'resourceId', 'field' ],
methods: {
optionClass(option) {
return {
'bg-success': this.field.value
? this.field.value.includes(option)
: false,
'bg-danger': this.field.value
? !this.field.value.includes(option)
: true,
}
},
},
}
}
};
</script>

<style lang="scss">
.nova-permissions .permission-group {
flex: 1 1 300px;
}
</style>
Loading

0 comments on commit 71d11a3

Please sign in to comment.