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

Pa table header refresh #24

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
008f85b
update documentation
aschwanden1 Jul 25, 2022
7243e79
Fix customization.js, instance directory was not accessible by cherry…
aschwanden1 Jul 25, 2022
48a9532
style buttons and tabs
aschwanden1 Jul 26, 2022
1650109
breadcrumb styling to give it a more clean and professional look
aschwanden1 Jul 27, 2022
0ffb581
merge
aschwanden1 Aug 3, 2022
08aa9f3
add styling for the main summary table
aschwanden1 Aug 3, 2022
552f594
debug assistance for resp object
aschwanden1 Aug 3, 2022
ee7795f
testing commit
aschwanden1 Aug 3, 2022
78e0e51
Add configurations for curated sight and intro blurbs
aschwanden1 Aug 3, 2022
53c7db3
added new home tab for new curate sites page
aschwanden1 Aug 4, 2022
60b7def
update mongoDB restore documentation
aschwanden1 Aug 4, 2022
6c3ae41
Dashboard title styling and CSS in header, as well as making it confi…
aschwanden1 Aug 4, 2022
8a1481e
Implementation of intro and outro blurbs in a vue component
aschwanden1 Aug 4, 2022
5036863
Implement persistance layer reusable for many uses. Now integrated w…
aschwanden1 Aug 5, 2022
c76829b
Update intro text to give example of intro blurbs we could use
aschwanden1 Aug 5, 2022
26fa56a
move lib.js to js directory and update references
aschwanden1 Aug 5, 2022
279d722
move imgs to img directory and update references
aschwanden1 Aug 5, 2022
e3fedf5
RowAccordian setup and implementation, initial
aschwanden1 Aug 6, 2022
a87335d
Update curated sites
aschwanden1 Aug 6, 2022
93e5100
Implement property passing and toggle functionality
aschwanden1 Aug 6, 2022
3f95ca3
Refactor summary site view into its own page
aschwanden1 Aug 6, 2022
86ad558
Documentation changes, as per code review
aschwanden1 Aug 9, 2022
0bc50c0
remove extraneous debug code
aschwanden1 Aug 9, 2022
0ed5fa9
remove curated sites
aschwanden1 Aug 9, 2022
165860c
Removing ALL CSS styling changes.
aschwanden1 Aug 9, 2022
0c539f0
IntroBlurb styling and banner position
aschwanden1 Aug 10, 2022
45786e2
delete localstorage file
aschwanden1 Aug 10, 2022
fe280cc
rename summarySiteView.js
aschwanden1 Aug 10, 2022
1391065
remove JSON not used yet
aschwanden1 Aug 10, 2022
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
49 changes: 48 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,48 @@
# psi-j-testing-service
# psi-j-testing-service

# make virtual environment
virtualvenv psi
source psi/bin/activate

# install some things.

pip3 install -r requirements.txt

cd ~/psi-j-testing-service/src/psij/testing
python3 service.py

# you will need mongoDB, follow the instructions here, it takes a while to install.
https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-os-x/

the last step is:
brew services start [email protected]
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is OS X specific. Perhaps that should be made more clear.



This starts the service witch allows things to run locally:
cd ~/psi-j-testing-service;
python3 src/psij/testing/service.py
Comment on lines +24 to +26
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe this belongs in a README-dev.md document or under a section that specifies that this allows one to create a local development environment.


then you can see it at this url:
http://0.0.0.0:9909/summary.html
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 about 0.0.0.0. It seems to work, but, from what I understand, it's not meant to signify "loopback address", which is 127.0.0.1




To populate the data i need to run psi-j-python:
you need to edit testing.conf first and, at a minimum, update the url to point to your server
Copy link
Collaborator

Choose a reason for hiding this comment

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

There's both first person and third person here. Is this document meant for other people? If so, it may be a bit confusing.

server_url = http://0.0.0.0:9909

~/psi-j-python: pip3 install -r requirements-dev.txt
~/psi-j-python: make tests -- --upload-results


Restoring a mongodump DB:
You'll want to get a full dump, that way you can play with the data:

First untar these:
mongodump-psij.tar
mongodump-sdk.tar.gz

mongorestore dump/



111 changes: 88 additions & 23 deletions src/psij/web/style.css → src/psij/web/css/style.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
body {
background-color: #f0f0f0;
background-color: #ffffff;
Copy link
Collaborator

Choose a reason for hiding this comment

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

As discussed, can we hold off on temporary style changes?

font-family: "open sans", Helvetica, sans;
}

Expand All @@ -8,7 +8,6 @@ body {
}

#container {
margin: 8pt;
max-width: 700pt;
margin-left: auto;
margin-right: auto;
Expand Down Expand Up @@ -70,10 +69,6 @@ body {
height: 16pt;
}

.highlightable:hover {
box-shadow: 1pt 1pt 5pt #80a0ff !important;
}

.clickable {
cursor: pointer;
}
Expand Down Expand Up @@ -143,9 +138,14 @@ body {
}

#toolbar {
position: relative;
width: 100%;
text-align: right;
margin-bottom: 32pt;
background-color: #2d3436;
background-image: linear-gradient(180deg, #4d5456 0%, #000000 74%);
padding: 15px 0 0 0;
height: 52px;
}

#toolbar .spacer {
Expand All @@ -154,38 +154,68 @@ body {
}

#breadcrumbs {
float: left;
position: absolute;
top: 33px;
background-color: #444444;
border: 1px solid #666666;
z-index: 2;
}

#breadcrumbs .v-breadcrumbs__divider {
color: white;
}

#breadcrumbs .v-breadcrumbs {
margin: 0pt;
padding-bottom: 4pt;
padding-top: 4pt;
padding-bottom: 0;
padding-top: 0;
}

#breadcrumbs li:not(.v-breadcrumbs__divider) {
display: inline-block;
box-shadow: 1pt 1pt 3pt #606060;
cursor: pointer;
background-color: #ffffff;
padding: 4pt;
padding: 1pt;
color: white;
}

#breadcrumbs li {
font-size: 12px;
}

#breadcrumbs a:visited {
color: white;
}

#breadcrumbs li:hover:not(.v-breadcrumbs__divider) {
box-shadow: 1pt 1pt 5pt #80a0ff !important;
color: white;
}

.dashboard-title {
position: absolute;
left: 15px;
top: 6px;
color: #d0d0d0;
font-size: 14px;
font-weight: bold;
}

#toolbar .button {
display: inline-block;
box-shadow: 1pt 1pt 3pt #606060;
cursor: pointer;
background-color: #ffffff;
padding: 3pt;
background-color: #b2b2b2;
padding: 5px 9px 6px 9px;
border-top: 1px solid black;
border-left: 1px solid black;
border-right: 1px solid black;
border-bottom: 1px solid black;
margin: 0 5px 0 0;
border-top-right-radius: 5px;
border-top-left-radius: 5px;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Think of the view modes more like the "view as list" / "view as icons" in windows explorer and Finder. They are not tabs, since the information doesn't change. What changes is how the same information is represented.

}

.button.selected {
background-color: #d0e0ff !important;
#toolbar .button.selected {
background-color: #ffffff !important;
border-bottom: 1px solid white;
}

.branch-heading {
Expand Down Expand Up @@ -289,7 +319,6 @@ body {

#run-table th, #run-table td {
padding: 6pt;
padding-right
}

td.run-id {
Expand Down Expand Up @@ -463,17 +492,36 @@ td.run-id {

#status-calendar table {
position: relative;
width:100%;
border-spacing: 0;
}

#status-calendar table tr:first-child th {
position: sticky;
top: 0pt;
}

#status-calendar tr:first-child th {
background-color: #666666;
color: white;
font-weight: bold;
}

#status-calendar tr td, tr th {
background-color: #e2e2e2;
border-bottom: 1px solid #cfcfcf;
}

#status-calendar tr:nth-child(even) td,
tr:nth-child(even) th {
background-color: #f2f2f2;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

May I recommend Butterick's Practical Typography (https://practicaltypography.com/), in particular the sections on tables and grids? It's a good resource in general for creating readable textual content, but it applies in good measure to other things, like websites.


.calendar-month {
height: 14pt;
font-weight: normal;
font-size: 11pt;
font-size: 9pt;
padding-top: 5px;
width: 60pt;
}

Expand All @@ -482,8 +530,6 @@ td.run-id {
font-weight: normal;
font-size: 11pt;
padding-bottom: 4pt;
border-bottom: 2pt solid #e0e0e0;
margin-bottom: 2pt;
}

.calendar-site {
Expand All @@ -492,7 +538,6 @@ td.run-id {
font-size: 11pt;
height: 24pt;
padding: 4pt;
border-radius: 4pt;
}

.calendar-tile {
Expand Down Expand Up @@ -547,3 +592,23 @@ td.run-id {
.calendar-cell {
text-align: center;
}

.IntroBlurb {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Perhaps we may want to be consistent with naming conventions. Either use CamelCase for everything or use dashes, as in intro-blurb.

background-color: #f1f0f0;
border: 1px solid #e2e2e2;
border-radius: 5px;
padding: 9px;
margin: 10px 0 10px 0;
font-size: 13px;
color: #000000;
position: relative;
}

.IntroBlurb .close_me {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here. Either all camel case or underscores.

position: absolute;
top: 7px;
right: 10px;
color: #999999;
font-size: 17px;
cursor: pointer;
}
File renamed without changes
39 changes: 39 additions & 0 deletions src/psij/web/js/IntroBlurb.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
var VC = VC || {};

VC.IntroBlurb = Vue.component("intro-blurb", {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I worry a bit here about an inner platform, in which we are developing a complex solution for something that can already be done with standard tools. It may be better to have a simple variable in customization.js that allows one to distinguish between the projects. Then, in the html source, we can have two divs with the relevant blurbs and corresponding v-if conditions. For example:

<div v-if="CUSTOMIZATION.projectName == 'PSI/J'">intro for psi-j</div>
<div v-if="CUSTOMIZATION.projectName == 'SDK'">intro for sdk</div>

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You may not have been at the meeting. I was told that we would have different deployments and that people wanted to be able to change the text without having to make changes in the code, other than a config file. The idea was that the config file could be changed to accomodate any text string changes OR you could have one config file for PSI/J and another one for SDK and another one for another use case.

Copy link
Collaborator

Choose a reason for hiding this comment

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

It's possible that things weren't that clear during the meeting. I apologize for that. We already have different deployments and we don't want to maintain two codebases, which we don't. But changing html or changing a .js file, that is still changing some form of code. So again, let's try to keep this simple with text in a single place rather than spread around.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

What I meant was just keep all the text in one file. It doesn't have to be customization.js. It could be any other config file, whatever you want me to call it. The reason they want it in 1 file is because that way it's easier to make text changes because it's all in one place. Also, they want to be able to specify which machines to show. And, as another requirement, they told me they want to be able to do more than 1 or 2 deployments. And so, if we do it in the HTML file, we'll have to add a new IF statement for every place where we do a text replacement, whenever we add a new deployment. However, if all the text is in one config file, we just add or create a new config file.

data: function () {

return {
show: 0
}
},
template: '<div v-if="this.show == 1" ref="myRef" class="IntroBlurb" v-on:click="close( $event )">' +
'<div class="main_slot"><slot></slot></div>' +
'<div class="close_me">X</div>' +
'</div>',
mounted: function( event ) {
console.log('mounted');
var content = this.$slots.default[0].text;
console.dir( content );

if( sqs.IntroBlurb && sqs.IntroBlurb[ content ] ) {
// hide
this.show = 0;
} else {
this.show = 1;
}
},
methods: {
close: function( event ) {

var ihtml = this.$el.firstChild.innerHTML;
console.log(ihtml);

sqs.IntroBlurb = sqs.IntroBlurb || {};
sqs.IntroBlurb[ ihtml ] = 1;
sq.save();

this.show = 0;
}
}
});
26 changes: 26 additions & 0 deletions src/psij/web/js/RowAccordian.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
var VC = VC || {};

VC.RowAccordian = Vue.component("row-accordian", {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think vuetify already has the necessary component: https://vuetifyjs.com/en/components/expansion-panels/

Maybe we can use that instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

They want to do it in a Table format and we want that table to look seamless to the user with triangle open/closers on the side (so we would need to find one that does that). Also, it's been my experience that if we want the accordian to do anything else in the future, it'll be easier if we just make it ourselves.

Copy link
Collaborator

Choose a reason for hiding this comment

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

We should keep styling separate from functionality. I would rather have one consistent styling coming from vuetify than coming up with something else for every component.

It is important here to not only think of what is easy for us, but what would be easy for external contributors to quickly jump into. I think we are already doing a bit too much customization (and I am very much guilty of this), but I also think that in cases such as this, when a component already exists, we should use it.

props: [
'logo_name',
'machines',
'logo_results',
'machine_row_results'
],
data: function () {

return {
open: 1
}
},
template: '<table>' +
'</table>',
mounted: function( event ) {
},
methods: {
toggle: function( event ) {

this.open = this.open ? 0 : 1;
}
}
});
Loading