Skip to content

Commit

Permalink
Merge pull request #15 from uasoft-indonesia/develop
Browse files Browse the repository at this point in the history
do some bug fixes
  • Loading branch information
sulfanoaf authored Mar 30, 2021
2 parents 2ddd478 + b4515f5 commit 639218c
Show file tree
Hide file tree
Showing 11 changed files with 224 additions and 115 deletions.
14 changes: 12 additions & 2 deletions src/Controllers/BadasoMenuController.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,15 @@ public function addMenuItem(Request $request)
'target' => ['required'],
]);

$url = $request->get('url');
if (filter_var($url, FILTER_VALIDATE_URL) === false) {
$url = substr($request->get('url'), 0, 1) != '/' ? '/'.$request->get('url') : $request->get('url');
}

$new_menu_item = new MenuItem();
$new_menu_item->menu_id = $request->get('menu_id');
$new_menu_item->title = $request->get('title');
$new_menu_item->url = substr($request->get('url'), 0, 1) != '/' ? '/'.$request->get('url') : $request->get('url');
$new_menu_item->url = $url;
$new_menu_item->target = $request->get('target') ? $request->get('target') : '_self';
$new_menu_item->icon_class = $request->get('icon_class');
$new_menu_item->color = $request->get('color');
Expand Down Expand Up @@ -233,10 +238,15 @@ public function editMenuItem(Request $request)
'target' => ['required'],
]);

$url = $request->get('url');
if (filter_var($url, FILTER_VALIDATE_URL) === false) {
$url = substr($request->get('url'), 0, 1) != '/' ? '/'.$request->get('url') : $request->get('url');
}

$menu_item = MenuItem::find($request->menu_item_id);
$menu_item->menu_id = $request->get('menu_id');
$menu_item->title = $request->get('title');
$menu_item->url = substr($request->get('url'), 0, 1) != '/' ? '/'.$request->get('url') : $request->get('url');
$menu_item->url = $url;
$menu_item->target = $request->get('target') ? $request->get('target') : '_self';
$menu_item->icon_class = $request->get('icon_class');
$menu_item->color = $request->get('color');
Expand Down
2 changes: 1 addition & 1 deletion src/Mail/ForgotPassword.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ public function __construct($user, $token)
public function build()
{
return $this
->markdown('Badaso::mail.forgot-password');
->markdown('badaso::mail.forgot-password');
}
}
2 changes: 1 addition & 1 deletion src/Mail/SendUserVerification.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ public function build()
{
return $this
->subject('Email Verification | Badaso')
->markdown('Badaso::mail.email-verification');
->markdown('badaso::mail.email-verification');
}
}
2 changes: 1 addition & 1 deletion src/Seeder/Configurations/SiteManagementSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function run()
3 => [
'key' => 'adminPanelHeaderColor',
'display_name' => 'Admin Panel Header Color',
'value' => '#000',
'value' => '#fff',
'details' => '',
'type' => 'color_picker',
'order' => 4,
Expand Down
1 change: 1 addition & 0 deletions src/resources/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ Vue.prototype.$constants = {
};
Vue.prototype.$loadingConfig = {
type: "sound",
color: "#06bbd3"
};

let baseUrl = process.env.MIX_ADMIN_PANEL_ROUTE_PREFIX
Expand Down
10 changes: 10 additions & 0 deletions src/resources/js/assets/scss/layout/_vs-modified.scss
Original file line number Diff line number Diff line change
Expand Up @@ -234,4 +234,14 @@ th .vs-table-text {
.vs-checkbox-primary input:checked+.vs-checkbox {
border: 2px solid $primary!important;
background: $primary;
}

.vs-progress-primary {
.vs-progress--foreground {
background: $primary;
}

.vs-progress--indeterminate {
background: $primary;
}
}
2 changes: 1 addition & 1 deletion src/resources/js/components/BadasoColorPicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export default {
this.updateColors(val);
this.$emit("input", val);
}
},
}
},
mounted() {
this.setColor(this.color || "#000000");
Expand Down
78 changes: 78 additions & 0 deletions src/resources/js/components/BadasoSidebarItem.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<template>
<div
:class="{'vs-sidebar-item-active':getActive}"
class="vs-sidebar--item"
@click="setIndexActive">
<router-link
v-if="to && target === '_self'"
:to="to">
<vs-icon
:icon-pack="iconPack"
:icon="icon">
</vs-icon>
<slot></slot>
</router-link>
<a
v-else-if="to && target != '_self'"
:target="target"
:href="to">
<vs-icon
:icon-pack="iconPack"
:icon="icon">
</vs-icon>
<slot></slot>
</a>
<a
v-else
:target="target"
:href="href">
<vs-icon
:icon-pack="iconPack"
:icon="icon">
</vs-icon>
<slot></slot>
</a>
</div>
</template>
<script>
export default {
name:'BadasoSidebarItem',
props:{
icon: {
default: null,
type: String
},
iconPack: {
default: 'material-icons',
type: String
},
href: {
default:'#',
type: String
},
target: {
default:'_self',
type: String
},
to: {
default:null,
type: [String, Object]
},
index: {
default: null,
type: [String, Number]
},
},
computed:{
getActive () {
return this.$parent.getActive() == this.index
}
},
methods:{
setIndexActive () {
this.$parent.setIndexActive(this.index)
this.$emit('click')
}
}
}
</script>
7 changes: 4 additions & 3 deletions src/resources/js/layout/admin/header/Navbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,16 @@
left
class="cursor-pointer ml-1 mr-md-3"
>
<a class="text-white-dark" href="#"
<a class="text-white-dark" href="#" :style="{ color: topbarFontColor }"
><vs-icon icon="notifications"></vs-icon
></a>
<vs-dropdown-menu class="topbar-dd">
<div
class="d-flex align-items-center p-3 bg-danger text-white mb-2 preview"
class="d-flex align-items-center p-3 mb-2 preview"
:style="{ backgroundColor: topbarFontColor, color: topbarColor }"
>
<div class="ml-2">
<h4 class="mb-0 text-white">0 New</h4>
<h4 class="mb-0">0 New</h4>
<p class="mb-0">Notification</p>
</div>
</div>
Expand Down
60 changes: 34 additions & 26 deletions src/resources/js/layout/admin/sidebar/SideBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@
:subTitle="user.email"
icon="person_pin"
>
<vs-sidebar-item
<badaso-sidebar-item
v-if="user.id"
icon="person_outline"
:to="{
name: 'UserProfile',
}"
>
Profile
</vs-sidebar-item>
<vs-sidebar-item icon="logout" @click="logout()">
</badaso-sidebar-item>
<badaso-sidebar-item icon="logout" @click="logout()">
Logout
</vs-sidebar-item>
</badaso-sidebar-item>
</badaso-sidebar-group>
<vs-select
v-model="selectedLang"
Expand All @@ -54,9 +54,9 @@
/>
</vs-select>
</div>
<vs-sidebar-item icon="dashboard" :to="`/${prefix}/home`">
<badaso-sidebar-item icon="dashboard" :to="`/${prefix}/home`">
<span class="hide-in-minisidebar">{{ $t("sidebar.dashboard") }}</span>
</vs-sidebar-item>
</badaso-sidebar-item>
<badaso-sidebar-group
:title="mainMenu.menu.displayName"
open
Expand All @@ -71,49 +71,53 @@
:icon="menu.iconClass"
>
<template v-for="(childMenu, indexChildMenu) in menu.children">
<vs-sidebar-item
<badaso-sidebar-item
v-if="$helper.isValidHttpUrl(childMenu.url)"
:icon="childMenu.iconClass ? childMenu.iconClass : 'remove'"
@click="open(childMenu.url)"
:href="menu.url"
:key="`menu-${index}-${indexChildMenu}`"
:index="`${index}.${indexChildMenu}`"
:style="`color: ${childMenu.color}`"
:target="menu.target"
>
<span class="hide-in-minisidebar">{{ childMenu.title }}</span>
</vs-sidebar-item>
<vs-sidebar-item
</badaso-sidebar-item>
<badaso-sidebar-item
v-else
:icon="childMenu.iconClass ? childMenu.iconClass : 'remove'"
:to="childMenu.url"
:key="`menu-${index}-${indexChildMenu}`"
:index="`${index}.${indexChildMenu}`"
:style="`color: ${childMenu.color}`"
:target="menu.target"
>
<span class="hide-in-minisidebar">{{ childMenu.title }}</span>
</vs-sidebar-item>
</badaso-sidebar-item>
</template>
</badaso-sidebar-group>
<div v-else>
<vs-sidebar-item
<badaso-sidebar-item
v-if="$helper.isValidHttpUrl(menu.url)"
:icon="menu.iconClass ? menu.iconClass : 'remove'"
@click="open(menu.url)"
:href="menu.url"
:key="`menu-${index}`"
:index="index"
:style="`color: ${menu.color}`"
:target="menu.target"
>
<span class="hide-in-minisidebar">{{ menu.title }}</span>
</vs-sidebar-item>
<vs-sidebar-item
</badaso-sidebar-item>
<badaso-sidebar-item
v-else
:icon="menu.iconClass ? menu.iconClass : 'remove'"
:to="menu.url"
:key="`menu-${index}`"
:index="index"
:style="`color: ${menu.color}`"
:target="menu.target"
>
<span class="hide-in-minisidebar">{{ menu.title }}</span>
</vs-sidebar-item>
</badaso-sidebar-item>
</div>
</template>
</badaso-sidebar-group>
Expand All @@ -134,49 +138,53 @@
:icon="menu.iconClass"
>
<template v-for="(childMenu, indexChildMenu) in menu.children">
<vs-sidebar-item
<badaso-sidebar-item
v-if="$helper.isValidHttpUrl(childMenu.url)"
:icon="childMenu.iconClass ? childMenu.iconClass : 'remove'"
@click="open(childMenu.url)"
:href="menu.url"
:key="`menu-${index}-${indexChildMenu}`"
:index="`${index}.${indexChildMenu}`"
:style="`color: ${childMenu.color}`"
:target="menu.target"
>
<span class="hide-in-minisidebar">{{ childMenu.title }}</span>
</vs-sidebar-item>
<vs-sidebar-item
</badaso-sidebar-item>
<badaso-sidebar-item
v-else
:icon="childMenu.iconClass ? childMenu.iconClass : 'remove'"
:to="childMenu.url"
:key="`menu-${index}-${indexChildMenu}`"
:index="`${index}.${indexChildMenu}`"
:style="`color: ${childMenu.color}`"
:target="menu.target"
>
<span class="hide-in-minisidebar">{{ childMenu.title }}</span>
</vs-sidebar-item>
</badaso-sidebar-item>
</template>
</badaso-sidebar-group>
<div v-else>
<vs-sidebar-item
<badaso-sidebar-item
v-if="$helper.isValidHttpUrl(menu.url)"
:icon="menu.iconClass ? menu.iconClass : 'remove'"
:key="`menu-${index}`"
:index="index"
:style="`color: ${menu.color}`"
@click="open(menu.url)"
:href="menu.url"
:target="menu.target"
>
<span class="hide-in-minisidebar">{{ menu.title }}</span>
</vs-sidebar-item>
<vs-sidebar-item
</badaso-sidebar-item>
<badaso-sidebar-item
v-else
:icon="menu.iconClass ? menu.iconClass : 'remove'"
:key="`menu-${index}`"
:index="index"
:style="`color: ${menu.color}`"
:to="menu.url"
:target="menu.target"
>
<span class="hide-in-minisidebar">{{ menu.title }}</span>
</vs-sidebar-item>
</badaso-sidebar-item>
</div>
</template>
</badaso-sidebar-group>
Expand Down
Loading

0 comments on commit 639218c

Please sign in to comment.