Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

main UI - directives and table views #168

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,117 changes: 2,086 additions & 31 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,26 @@
"chai-as-promised": "^7.1.1",
"chai-exclude": "^2.1.0",
"commander": "^12.0.0",
"concurrently": "^8.2.2",
"eslint": "^8.57.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^6.1.1",
"mocha": "^10.2.0",
"node-sass": "^9.0.0",
"rewire": "^7.0.0",
"sinon": "^17.0.1",
"ts-mocha": "^10.0.0",
"tsc-watch": "^6.0.4"
},
"scripts": {
"cp-package-json": "cp package.json ./src",
"scss-compile": "npx node-sass ./src/scss -o ./src/public/css --output-style compressed",
"watch-scss": "npx node-sass --watch ./src/scss -o ./src/public/css --output-style compressed",
"test": "npx ts-mocha test/{,**}/*.spec.ts",
"build": "npm run cp-package-json && npx tsc",
"build": "npm run cp-package-json && npx tsc && npm run scss-compile",
"lint": "npx eslint --color --cache .",
"start": "node dist/index.js",
"dev": "tsc-watch --onSuccess \"node dist/index.js\"",
"dev": "npx concurrently \"npm run watch-scss\" \"tsc-watch --onSuccess 'node dist/index.js'\"",
"publish": "node scripts/publish.js"
},
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion src/config/chis-ug/config.json

Large diffs are not rendered by default.

171 changes: 171 additions & 0 deletions src/css/custom-bootstrap.css
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting that you still rely on bootstrap. Did bulma not provide this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i can customized bootstrap to get only the elements i want for this its tooltips, badges and breadcrumbs keeping the file very small
not sure you can do that with bulma

Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
/*!
* Generated using the Bootstrap Customizer (https://getbootstrap.com/docs/3.4/customize/)
*/
/*!
* Bootstrap v3.4.1 (https://getbootstrap.com/)
* Copyright 2011-2019 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */

.badge {
display: inline-block;
min-width: 10px;
padding: 3px 7px;
font-size: 12px;
font-weight: bold;
line-height: 1;
color: #ffffff;
text-align: center;
white-space: nowrap;
vertical-align: middle;
background-color: #777777;
border-radius: 10px;
}
.badge:empty {
display: none;
}
.btn .badge {
position: relative;
top: -1px;
}
.btn-xs .badge,
.btn-group-xs > .btn .badge {
top: 0;
padding: 1px 5px;
}
a.badge:hover,
a.badge:focus {
color: #ffffff;
text-decoration: none;
cursor: pointer;
}
.list-group-item.active > .badge,
.nav-pills > .active > a > .badge {
color: #337ab7;
background-color: #ffffff;
}
.list-group-item > .badge {
float: right;
}
.list-group-item > .badge + .badge {
margin-right: 5px;
}
.nav-pills > li > a > .badge {
margin-left: 3px;
}

.tooltip {
position: absolute;
z-index: 1070;
display: block;
font-family: inherit;
font-style: normal;
font-weight: 400;
line-height: 1.42857143;
line-break: auto;
text-align: left;
text-align: start;
text-decoration: none;
text-shadow: none;
text-transform: none;
letter-spacing: normal;
word-break: normal;
word-spacing: normal;
word-wrap: normal;
white-space: normal;
font-size: 12px;
filter: alpha(opacity=0);
opacity: 0;
}
.tooltip.in {
filter: alpha(opacity=90);
opacity: 0.9;
}
.tooltip.top {
padding: 5px 0;
margin-top: -3px;
}
.tooltip.right {
padding: 0 5px;
margin-left: 3px;
}
.tooltip.bottom {
padding: 5px 0;
margin-top: 3px;
}
.tooltip.left {
padding: 0 5px;
margin-left: -3px;
}
.tooltip.top .tooltip-arrow {
bottom: 0;
left: 50%;
margin-left: -5px;
border-width: 5px 5px 0;
border-top-color: #000000;
}
.tooltip.top-left .tooltip-arrow {
right: 5px;
bottom: 0;
margin-bottom: -5px;
border-width: 5px 5px 0;
border-top-color: #000000;
}
.tooltip.top-right .tooltip-arrow {
bottom: 0;
left: 5px;
margin-bottom: -5px;
border-width: 5px 5px 0;
border-top-color: #000000;
}
.tooltip.right .tooltip-arrow {
top: 50%;
left: 0;
margin-top: -5px;
border-width: 5px 5px 5px 0;
border-right-color: #000000;
}
.tooltip.left .tooltip-arrow {
top: 50%;
right: 0;
margin-top: -5px;
border-width: 5px 0 5px 5px;
border-left-color: #000000;
}
.tooltip.bottom .tooltip-arrow {
top: 0;
left: 50%;
margin-left: -5px;
border-width: 0 5px 5px;
border-bottom-color: #000000;
}
.tooltip.bottom-left .tooltip-arrow {
top: 0;
right: 5px;
margin-top: -5px;
border-width: 0 5px 5px;
border-bottom-color: #000000;
}
.tooltip.bottom-right .tooltip-arrow {
top: 0;
left: 5px;
margin-top: -5px;
border-width: 0 5px 5px;
border-bottom-color: #000000;
}
.tooltip-inner {
max-width: 200px;
padding: 3px 8px;
color: #ffffff;
text-align: center;
background-color: #000000;
border-radius: 4px;
}
.tooltip-arrow {
position: absolute;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
}
10 changes: 8 additions & 2 deletions src/liquid/app/fragment_home.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
<div class="tile is-child" hx-ext="sse" sse-connect="/events/connection">
<div id="places_parent" class="tile is-child">
<div hx-ext="sse" sse-connect="/events/connection">
<div id="places_parent">
{% capture totalCount %}{{directiveModel.totalCount}} {% endcapture %}
{%if totalCount > 0 %}
{% include "place/directive.html" %}
{% include "place/place_navbar.html" %}
{% include "place/list_lazy.html" %}
{%else%}
{% include "place/directive_1_get_started.html" %}
{%endif%}
</div>
</div>
42 changes: 42 additions & 0 deletions src/liquid/app/header.html
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see we removed most of the actions from the nav but i don't see any alternatives introduced for clearing the place list, refreshing the place list, creating places etc

Copy link
Author

@jonathanbataire jonathanbataire May 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was following this for design thats why options moved away from then header bar

must have missed the clear option though will add that nice catch

Copy link
Collaborator

@freddieptf freddieptf May 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since there's no alternative for the actions in the Users drop down menu i think we should just maintain it for now or provide alternatives

Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<nav class="navbar">
<div class="navbar-branding" id="logo">
<a href="/"><img src="{{ logo }}" /></a>
</div>
<div class="navbar-branding" id="title"><a>User Management</a></div>
<ul>
<li class="dropdown">
<div id="dropdown-btn">
<img src="/public/icons/cloud.svg" alt="dropdown-button">
<i>{{ session.authInfo.friendly }}</i>
</div>
<div class="hamburger-icon">
<span></span>
<span></span>
<span></span>
</div>
<ul class="dropdown-menu" id="dd-menu">
<a href="/logout">
<li><img src="/public/icons/logout.svg">Logout</li>
</a>
<li><i>Logged in as {{ session.username }}</i></li>
</ul>
</li>
</ul>
</nav>

<script>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be great to keep scripts like this in an app.js or something

document.addEventListener('click', function () {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why this listener is added to the document and not the element being targeted

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aah i see, to hide the drop down menu when we click anywhere on the page, correct?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now I'm confused, since the drop down disappears when it's not hovered on, why is this needed?

const dropDownMenu = document.getElementById('dd-menu');
if(dropDownMenu.classList.contains('active-dropdown')) {
document.querySelector('.dropdown-menu').classList.toggle('active-dropdown');
document.querySelector('.hamburger-icon').classList.toggle('open');
}
});

document.querySelector('.hamburger-icon')
.addEventListener('click', function(event){
event.stopPropagation();
document.querySelector('.dropdown-menu').classList.toggle('active-dropdown');
document.querySelector('.hamburger-icon').classList.toggle('open');
});
</script>
97 changes: 0 additions & 97 deletions src/liquid/app/nav.html
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renamed to header.html to distinguish between header and nav bar

This file was deleted.

Loading
Loading