Skip to content
This repository was archived by the owner on Jul 8, 2025. It is now read-only.

Commit fa45377

Browse files
Merge pull request #59 from jacamo-lang/move-agent-graph
Move agent graph
2 parents 5db44f8 + 6952306 commit fa45377

File tree

10 files changed

+49
-44
lines changed

10 files changed

+49
-44
lines changed

build.gradle

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ task javadocJar (type: Jar, dependsOn: javadoc) {
137137
classifier = 'javadoc'
138138
from '${docsDir}/../../doc/api'
139139
}
140+
140141
/*
141142
*
142143
* Maven publication
@@ -239,6 +240,20 @@ task buildYarn(type: YarnTask, dependsOn: 'yarn') {
239240
}
240241
build.dependsOn buildYarn
241242

243+
244+
/*
245+
*
246+
* Compile javascript if bundle does not exists
247+
*
248+
*/
249+
250+
if ( !file("src/resources/js/jacamoweb.js").exists() ) {
251+
allprojects {
252+
tasks.shadowJar.dependsOn tasks.build
253+
tasks.run.dependsOn tasks.build
254+
}
255+
}
256+
242257
/*
243258
*
244259
* Clean compiled files
@@ -250,4 +265,4 @@ clean {
250265
delete 'build'
251266
delete 'log'
252267
delete testsExecutedMarkerName /*Used on testYarn*/
253-
}
268+
}

src/js/git.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ function commitChanges() {
208208
toastr.error('Operation cancelled.', { timeOut: 10000 });
209209
} else {
210210
h.post('/commit?email=' + getCookieValue('username'), message).then(function(response) {
211-
toastr.info(`Commit result: ${response}`, { timeOut: 10000 });
211+
toastr.success(`Commit result: ${response}`, { timeOut: 10000 });
212212
}).catch(function(error) {
213213
toastr.error(error, { timeOut: 10000 });
214214
});

src/js/organisation.js

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
//const d3 = require('d3')
66
const h = require('./helpers')
77
const p = require('./parameters')
8+
const toastr = require('toastr')
9+
10+
/** LOCK NOTIFICATIONS */
11+
toastr.options.preventDuplicates = true;
812

913
/**
1014
* ORGANISATION FUNCTIONS
@@ -60,13 +64,25 @@ function newRole(org, gr) {
6064
var org = firstPart.substring(0, firstDot);
6165
var group = firstPart.substring(firstDot + 1);
6266

63-
http.open("POST", '/organisations/' + org + '/groups/' + group + '/roles/' + role, false);
64-
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
6567
var data = "role=" + encodeURIComponent(role);
66-
http.send(data);
67-
window.location.assign('/oe.html');
68+
h.post('/organisations/' + org + '/groups/' + group + '/roles/' + role, data, "application/x-www-form-urlencoded")
69+
.then(
70+
function(resolve) {
71+
localStorage.setItem("organisationBuffer", `Role '${role}' on group '${group}' of organisation ${org} created!`);
72+
window.location.assign('/oe.html');
73+
},
74+
function(error) { toastr.error(error, { timeOut: 10000 }); }
75+
);
6876
}
6977

78+
/* SHOW MESSAGE IN THE BUFFER IF EXISTS */
79+
80+
const showBuffer = () => {
81+
var buffer = localStorage.getItem("organisationBuffer");
82+
if ((typeof(buffer) == "string") && (buffer != "")) toastr.info(buffer, { timeOut: 3000 });
83+
localStorage.removeItem("organisationBuffer");
84+
};
85+
7086
function getGroupsDetails() {
7187
const selectedItem = new URL(location.href).searchParams.get('organisation');
7288
h.get("./organisations/" + selectedItem).then(function(r) {
@@ -464,6 +480,7 @@ window.getOrgGroupGraph = getOrgGroupGraph;
464480
window.getOrgSchemeGraph = getOrgSchemeGraph;
465481
window.getOrgNormGraph = getOrgNormGraph;
466482
window.setOrganisationModalWindow = setOrganisationModalWindow;
483+
window.showBuffer = showBuffer;
467484

468485
/**
469486
* END OF FILE

src/resources/css/style.css

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2312,7 +2312,7 @@ table.hoverable tr:hover, table.hoverable tr:hover > td, table.hoverable tr:focu
23122312

23132313
.toast {
23142314
margin-top: 75px !important;
2315-
color: #000 !important;
2315+
color: #030303 !important;
23162316
opacity: 1 !important;
23172317
}
23182318

@@ -2322,10 +2322,18 @@ table.hoverable tr:hover, table.hoverable tr:hover > td, table.hoverable tr:focu
23222322

23232323
.toast-info {
23242324
width: 550px !important;
2325-
background-color:#73A790;
2325+
background-color:#3276b1;
23262326
color: #fff !important;
23272327
}
23282328

2329+
.toast-error {
2330+
background-color: #bd362f;
2331+
}
2332+
2333+
.toast-success {
2334+
background-color: #51a351;
2335+
}
2336+
23292337
#git-dialog-full, #commit-dialog-full {
23302338
position: absolute;
23312339
height: 100vh;

src/resources/html/oe.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
<script>
5959
getOE();
6060
getOrganisationsNonVolatileGraph();
61+
showBuffer();
6162
</script>
6263
</body>
6364

src/resources/js/d3-graphviz.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/resources/js/jacamoweb.js

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/resources/js/vendors~d3-graphviz.js

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/resources/js/vendors~d3.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/resources/js/vendors~d3~d3-graphviz.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)