Skip to content

Commit

Permalink
Merge pull request #124 from SzymCode/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
SzymCode authored Sep 1, 2024
2 parents 8092ddb + bdccb35 commit c31d743
Show file tree
Hide file tree
Showing 24 changed files with 121 additions and 41 deletions.
4 changes: 4 additions & 0 deletions atomic/_old_structure/sass/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ body {
background: $body-bg;
}

main {
overflow: hidden;
}

body:has(
#home,
#login,
Expand Down
2 changes: 1 addition & 1 deletion atomic/_old_structure/sass/styles/components/card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
.myCard {
width: $card-width;
background: $content-bg;
box-shadow: $box-shadow-none;
box-shadow: $my-card-box-shadow;
border: $border-none;
border-radius: $border-radius-none;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
}
.actionColumn {
width: $action-column-width;
min-width: 49px;

.actionColumnContent {
display: $action-column-content-display;
Expand Down
34 changes: 26 additions & 8 deletions atomic/_old_structure/sass/styles/components/panel_container.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,36 @@
display: $panel-container-display;
flex-direction: $panel-container-flex-direction;
gap: $panel-container-gap;
}

// Min width 992px
@media (min-width: $min-width-lg2) {
top: $panel-container-top-lg2;
body:has(.p-dock.p-dock-top) {
.panelContainer {
padding-top: $panel-container-top;
}
}

body:has(.p-dock.p-dock-top) .panelContainer {
top: $panel-container-top;
body:has(.p-dock.p-dock-right) {
.panelContainer {
padding-top: 8px;
padding-right: 80px;
}
}

body:has(.p-dock.p-dock-left) {
.panelContainer {
padding-top: 8px;
padding-left: 80px;
}
}

body:has(.p-dock.p-dock-bottom) {
.panelContainer {
padding-bottom: $panel-container-top;

// Min width 992px
@media (min-width: $min-width-lg2) {
top: $panel-container-top-lg2;
// Min width 992px
@media (min-width: $min-width-lg2) {
padding-top: 8px;
padding-bottom: 81px;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@import '../../../variables/pages/admin/admin_bricks_variables';

@import '../../../variables/base/box_shadows_variables';
@import '../../../variables/base/colors_variables';
@import '../../../variables/base/fonts_variables';
@import '../../../variables/base/medias_variables';
Expand Down Expand Up @@ -55,6 +56,7 @@
max-height: $admin-bricks-grid-item-max-height;
aspect-ratio: $admin-bricks-grid-item-aspect-ratio;
font-size: $font-size-big;
box-shadow: $my-card-box-shadow;

.pi {
margin-top: $admin-bricks-grid-item-pi-margin-top;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ $primary-box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
$secondary-card-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);

$my-card-box-shadow:
inset 0.5px 0.5px 1px rgba(0, 0, 0, 0.1),
2px 2px 4px rgba(0, 0, 0, 0.1);
0px 4px 10px rgba(0, 0, 0, 0.03),
0px 0px 2px rgba(0, 0, 0, 0.06),
0px 2px 6px rgba(0, 0, 0, 0.12);
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
$panel-container-position: relative;
$panel-container-top: 71px;
$panel-container-padding: 7px;
$panel-container-top: 80px;
$panel-container-padding: 8px;
$panel-container-display: flex;
$panel-container-flex-direction: column;
$panel-container-gap: 7px;
$panel-container-gap: 8px;

// Min width 992px
$panel-container-top-lg2: 0;
$panel-container-top-lg2: 4px;
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ $admin-bricks-padding-xs2: 4px !important;
// Min width 519px
$admin-bricks-display-sm0: flex !important;
$admin-bricks-gap-sm0: 12px;
$admin-bricks-padding-sm0: 0 0 8px 0 !important;
$admin-bricks-padding-sm0: 0 0 12px 0 !important;
$admin-bricks-circle-width-sm0: 100px;
$admin-bricks-circle-height-sm0: 100px;
$admin-bricks-circle-number-top-sm0: 3px !important;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const { results, loading, getAllActivities, deleteActivity } =
const { activityStyle } = handleStyles()
onMounted(() => {
getAllActivities(500)
getAllActivities()
})
const dialogs = computed(() => [
Expand Down
6 changes: 3 additions & 3 deletions atomic/_old_structure/ts/components/Admin/AdminPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ const {
const { results: users, loading: usersLoading, getAllUsers } = userApiMethods()
onMounted(() => {
getAllArticles(500)
getAllContacts(500)
getAllUsers(500)
getAllArticles()
getAllContacts()
getAllUsers()
})
const {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const {
const { articleStyle } = handleStyles()
onMounted(() => {
getAllArticles(500)
getAllArticles()
})
const dialogs = computed(() => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const {
const { contactStyle } = handleStyles()
onMounted(() => {
getAllContacts(500)
getAllContacts()
})
const dialogs = computed(() => [
Expand Down
7 changes: 4 additions & 3 deletions atomic/_old_structure/ts/utils/activity/activityApiMethods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ export default function activityApiMethods(): ActivityLogApiMethodsInterface {
async function getAllActivities(
timeout?: number
): GetAllActivitiesAxiosFunctionType {
if (timeout) {
setLoading(true)
}
setLoading(true)

return await axios
.get('/api/activity-log')
.then((response: AxiosResponse<ActivityLogInterface[]>) => {
Expand All @@ -50,6 +49,8 @@ export default function activityApiMethods(): ActivityLogApiMethodsInterface {
.finally((): void => {
if (timeout) {
setLoading(false, timeout)
} else {
setLoading(false)
}
})
}
Expand Down
7 changes: 4 additions & 3 deletions atomic/_old_structure/ts/utils/article/articleApiMethods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ export default function articleApiMethods(): ArticleApiMethodsInterface {
async function getAllArticles(
timeout?: number
): GetAllArticlesFunctionType {
if (timeout) {
setLoading(true)
}
setLoading(true)

return await axios
.get('/api/articles')
.then((response: GetAllArticlesAxiosFunctionType) => {
Expand All @@ -52,6 +51,8 @@ export default function articleApiMethods(): ArticleApiMethodsInterface {
.finally((): void => {
if (timeout) {
setLoading(false, timeout)
} else {
setLoading(false)
}
})
}
Expand Down
7 changes: 4 additions & 3 deletions atomic/_old_structure/ts/utils/contact/contactApiMethods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ export default function contactApiMethods(): ContactApiMethodsInterface {
async function getAllContacts(
timeout?: number
): GetAllContactsFunctionType {
if (timeout) {
setLoading(true)
}
setLoading(true)

return await axios
.get('/api/contacts')
.then((response: GetAllContactsAxiosFunctionType) => {
Expand All @@ -53,6 +52,8 @@ export default function contactApiMethods(): ContactApiMethodsInterface {
.finally((): void => {
if (timeout) {
setLoading(false, timeout)
} else {
setLoading(false)
}
})
}
Expand Down
7 changes: 4 additions & 3 deletions atomic/_old_structure/ts/utils/user/userApiMethods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ export default function userApiMethods(): UserApiMethodsInterface {
useToast()

async function getAllUsers(timeout?: number): GetAllUsersFunctionType {
if (timeout) {
setLoading(true)
}
setLoading(true)

return await axios
.get('/api/users')
.then((response: GetAllUsersAxiosFunctionType) => {
Expand All @@ -51,6 +50,8 @@ export default function userApiMethods(): UserApiMethodsInterface {
.finally((): void => {
if (timeout) {
setLoading(false, timeout)
} else {
setLoading(false)
}
})
}
Expand Down
1 change: 0 additions & 1 deletion atomic/bosons/styles/molecules/_index.scss
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
@use 'dock';
@use 'item';
1 change: 1 addition & 0 deletions atomic/bosons/styles/organisms/_index.scss
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
@use 'datatable';
@use 'dialog';
@use 'dock';
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,34 @@
position: fixed;
z-index: 999;

@media (min-width: 992px) {
&.p-dock-top,
&.p-dock-bottom {
width: 100%;

.p-dock-list-container {
width: 100%;

ul {
width: 100%;
}
}
}
}

&.p-dock-left,
&.p-dock-right {
height: 100%;

.p-dock-list-container {
height: 100%;

ul {
height: 100%;
}
}
}

.p-dock-list-container {
padding: 0;
border: 0;
Expand All @@ -15,7 +43,7 @@
background: $white-body-bg;
padding: 0;
margin: 0;
border-radius: 8px;
border-radius: 0;

.p-dock-item {
@include center-content;
Expand Down Expand Up @@ -87,6 +115,10 @@
}
}
}

@media (min-width: $min-width-lg) {
gap: 4px;
}
}
}
}
2 changes: 1 addition & 1 deletion atomic/bosons/types/atoms/Toast/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ export type ToastPositionType =
export type FlashToastFunctionType = (
messageOrMessages: MessageOrMessagesType,
severity: ToastSeverityType,
life: number
life?: number
) => void
2 changes: 1 addition & 1 deletion atomic/bosons/utils/atoms/Toast/useToast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function useToast(): UseToastInterface {
function flashToast(
messageOrMessages: MessageOrMessagesType,
severity: ToastSeverityType,
life: number
life?: number
): void {
closeToast()

Expand Down
24 changes: 21 additions & 3 deletions atomic/organisms/Dock.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,32 @@
</template>

<script setup lang="ts">
import { onMounted, Ref, ref } from 'vue'
import { onMounted, Ref, ref, watch } from 'vue'
import { useIsAdmin } from '@/utils'
import { dockItems, positions } from 'atomic/bosons/constants'
import { PositionType } from 'atomic/bosons/types'
import { useItemStyles } from 'atomic/bosons/utils'
const { getItemStyles } = useItemStyles()
const position: Ref<PositionType> = ref('bottom')
const LOCAL_STORAGE_KEY = 'dockPosition'
const position = ref<PositionType>('bottom')
let isAdmin: Ref<boolean> = ref(false)
function setDockPositionForScreenSize() {
if (window.innerWidth == 992) {
position.value = 'bottom'
}
}
onMounted(async () => {
const savedPosition = localStorage.getItem(LOCAL_STORAGE_KEY)
if (savedPosition) {
position.value = savedPosition as PositionType
}
const { isAdmin: isAdminStatus } = await useIsAdmin()
// eslint-disable-next-line
Expand All @@ -58,5 +70,11 @@ onMounted(async () => {
url: '/admin',
})
}
window.addEventListener('resize', setDockPositionForScreenSize)
})
watch(position, (newPosition) => {
localStorage.setItem(LOCAL_STORAGE_KEY, newPosition)
})
</script>

0 comments on commit c31d743

Please sign in to comment.