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

Begin Discord rework, Matrix integration #6

Merged
merged 9 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
19 changes: 11 additions & 8 deletions actions/authActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ const login = (username, password) => {

const session = await response.json();

// Assign to cookie
document.cookie = `token=${session.token}; path=/;`;

// Here we create the database and store the session
const dbRequest = indexedDB.open(BROWSER_DATABASE_NAME, 1);

Expand Down Expand Up @@ -103,16 +106,15 @@ const login = (username, password) => {
};
};


const reLogin = (token) => {
return async dispatch => {
dispatch(loginRequest());
try {
const response = await fetch('/sessionRestore', {
const response = await fetch('/sessions/current', {
method: "GET",
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
'Content-Type': 'application/json',
},
});

Expand All @@ -124,6 +126,7 @@ const reLogin = (token) => {
isAdmin: user.isAdmin,
isBeta: user.isBeta,
isCompliant: user.isCompliant,
user_discord: user.user_discord,
id: user.id
}

Expand Down Expand Up @@ -169,11 +172,10 @@ const register = (username, password) => {
const fullRegister = (username, password, email, firstName, lastName, firmName, firmSize) => {
return async (dispatch) => {
dispatch(fullRegisterRequest());
try {

try {
//this creates a timeout promise of 15000 ms, which returns the string msg there.
const timeoutPromise = createTimeoutPromise(15000, 'Registration could not be completed due to a timeout error. Please check your network connection and try again. For ongoing issues, contact our support team at support@novo.com.');

const timeoutPromise = createTimeoutPromise(15000, 'Registration could not be completed due to a timeout error. Please check your network connection and try again. For ongoing issues, contact our support team at support@sensemaker.io.');
const fetchPromise = fetch('/users/full', {
method: 'POST',
headers: {
Expand All @@ -185,7 +187,7 @@ const fullRegister = (username, password, email, firstName, lastName, firmName,
//promise.race runs the two promises, and returns the answer from the one that ends up first
//this means if the fetch goes well it will return with the answer, but if there are some network problems
//the timeout will end up first, and cuts, this is to stop the app to hang loading waiting for an api answer forever

const response = await Promise.race([timeoutPromise, fetchPromise]);
if (!response.ok) {
const errorData = await response.json();
Expand All @@ -196,7 +198,6 @@ const fullRegister = (username, password, email, firstName, lastName, firmName,
} catch (error) {
dispatch(fullRegisterFailure(error.message));
}

}
}

Expand All @@ -216,10 +217,12 @@ const logout = () => {

deleteRequest.onsuccess = function (event) {
console.log('The token has been removed from IndexedDB');
document.cookie = 'token=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT'; // write over cookie
};

deleteRequest.onerror = function (event) {
console.error("IndexedDB delete error:", event.target.errorCode);
alert('Something went wrong while securely erasing your session. Please try again.');
};
};
}
Expand Down
2 changes: 1 addition & 1 deletion assets/bundles/browser.min.js

Large diffs are not rendered by default.

Binary file added assets/images/sensemaker-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 8 additions & 8 deletions assets/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,30 @@
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta property="og:url" content="http://sensemaker.io">
<meta property="og:type" content="website">
<meta property="og:title" content="Novo · Your Legal Assistant">
<meta property="og:description" content="Draft impeccable arguments with Novo, the legal AI.">
<meta property="og:title" content="sensemaker · digital intelligence">
<meta property="og:description" content="Sensemaker is a robust AI-powered intelligence platform — making sense of a digital world.">
<meta property="og:image" content="https://sensemaker.io/images/fabric-labs.png">
<title>Novo &middot; Your Legal Assistant</title>
<title>sensemaker &middot; digital intelligence</title>
<!-- <link rel="manifest" href="/manifest.json"> -->
<link rel="stylesheet" type="text/css" href="/semantic.min.css" />
<link rel="stylesheet" type="text/css" href="/styles/screen.css" />
<link rel="stylesheet" type="text/css" href="/styles/styles.css" />
<link rel="stylesheet" type="text/css" href="/styles/ReactToastify.css">
<script src="/scripts/jquery-3.4.1.js"></script>
<script src="/semantic.min.js"></script>
<link rel="icon" href="/images/favicon.svg" />
<link rel="icon" href="/images/sensemaker-icon.png" />
</head>
<body>
<div data-hash="d2a01705a9f249ab99e8529e7796e44eaa4d7fe4cef183828226b68f9051fe4f" id="application-target">
<jeeves-ui class="fabric-site">
<div data-hash="8e32c69876a99ff156e19c5e8bb6a820170703dcce77eedcd786382de2f200b5" id="application-target">
<sensemaker-ui class="fabric-site">
<fabric-container id="react-application"></fabric-container>
<fabric-react-component id="jeeves-application" style="height:100vh;display:flex;flex-direction:column">
<fabric-react-component id="sensemaker-application" style="height:100vh;display:flex;flex-direction:column">
<sensemaker-splash class="fade-in splash">
<fabric-component class="ui primary action fluid container"></fabric-component>
<section style="display:flex;justify-content:center"></section>
</sensemaker-splash>
</fabric-react-component>
</jeeves-ui>
</sensemaker-ui>
</div>
<script src="/bundles/browser.min.js"></script>
</body>
Expand Down
50 changes: 25 additions & 25 deletions assets/semantic.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* http://opensource.org/licenses/MIT
*
*/
@import url('https://fonts.googleapis.com/css2?family=AvGardd:ital,wght@0,400%3B0,700%3B1,400%3B1,700&subset=latin&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Arvo:ital,wght@0,400%3B0,700%3B1,400%3B1,700&subset=latin&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Baskerville:ital,wght@0,400%3B0,700%3B1,400%3B1,700&subset=latin&display=swap');
/*!
* # Fomantic-UI 2.8.8 - Reset
Expand Down Expand Up @@ -849,7 +849,7 @@ body {
overflow-x: hidden;
min-width: 320px;
background: #3A3A3A;
font-family: 'AvGardd', 'Helvetica Neue', Arial, Helvetica, sans-serif;
font-family: 'Arvo', 'Helvetica Neue', Arial, Helvetica, sans-serif;
font-size: 14px;
line-height: 1.4285em;
color: rgba(0, 0, 0, 0.87);
Expand All @@ -864,7 +864,7 @@ h2,
h3,
h4,
h5 {
font-family: 'AvGardd', 'Helvetica Neue', Arial, Helvetica, sans-serif;
font-family: 'Arvo', 'Helvetica Neue', Arial, Helvetica, sans-serif;
line-height: 1.28571429em;
margin: calc(2rem - 0.1428571428571429em) 0 1rem;
font-weight: bold;
Expand Down Expand Up @@ -1045,6 +1045,8 @@ body .ui.inverted:not(.dimmer)::-webkit-scrollbar-thumb:hover {
Global Overrides
*******************************/

/* @fontName : 'Martian Mono'; */

/*******************************
Site Overrides
*******************************/
Expand All @@ -1071,7 +1073,7 @@ body .ui.inverted:not(.dimmer)::-webkit-scrollbar-thumb:hover {
vertical-align: baseline;
background: #E0E1E2 none;
color: rgba(0, 0, 0, 0.6);
font-family: 'AvGardd', 'Helvetica Neue', Arial, Helvetica, sans-serif;
font-family: 'Arvo', 'Helvetica Neue', Arial, Helvetica, sans-serif;
margin: 0 0.25em 0 0;
padding: 0.78571429em 1.5em 0.78571429em;
text-transform: none;
Expand Down Expand Up @@ -6181,7 +6183,7 @@ body .ui.inverted:not(.dimmer)::-webkit-scrollbar-thumb:hover {
/* Text Container */

.ui.text.container {
font-family: 'AvGardd', 'Helvetica Neue', Arial, Helvetica, sans-serif;
font-family: 'Arvo', 'Helvetica Neue', Arial, Helvetica, sans-serif;
max-width: 700px;
line-height: 1.5;
font-size: 1.14285714rem;
Expand Down Expand Up @@ -6211,7 +6213,6 @@ body .ui.inverted:not(.dimmer)::-webkit-scrollbar-thumb:hover {

.ui.justified.container {
text-align: justify;
-webkit-hyphens: auto;
-ms-hyphens: auto;
hyphens: auto;
}
Expand Down Expand Up @@ -45895,7 +45896,7 @@ i.flag.zimbabwe:before {
border: none;
margin: calc(2rem - 0.1428571428571429em) 0 1rem;
padding: 0 0;
font-family: 'AvGardd', 'Helvetica Neue', Arial, Helvetica, sans-serif;
font-family: 'Arvo', 'Helvetica Neue', Arial, Helvetica, sans-serif;
font-weight: bold;
line-height: 1.28571429em;
text-transform: none;
Expand Down Expand Up @@ -64683,7 +64684,7 @@ img.ui.bordered.image {
-webkit-tap-highlight-color: rgba(255, 255, 255, 0);
text-align: left;
line-height: 1.21428571em;
font-family: 'AvGardd', 'Helvetica Neue', Arial, Helvetica, sans-serif;
font-family: 'Arvo', 'Helvetica Neue', Arial, Helvetica, sans-serif;
padding: 0.67857143em 1em;
background: #FFFFFF;
border: 1px solid rgba(34, 36, 38, 0.15);
Expand Down Expand Up @@ -68050,7 +68051,7 @@ ol.ui.list ol li,
.ui.list > .item .header {
display: block;
margin: 0;
font-family: 'AvGardd', 'Helvetica Neue', Arial, Helvetica, sans-serif;
font-family: 'Arvo', 'Helvetica Neue', Arial, Helvetica, sans-serif;
font-weight: bold;
color: rgba(0, 0, 0, 0.87);
}
Expand Down Expand Up @@ -71579,7 +71580,7 @@ ol.ui.suffixed.list li:before,
/* Title */

.ui.steps .step .title {
font-family: 'AvGardd', 'Helvetica Neue', Arial, Helvetica, sans-serif;
font-family: 'Arvo', 'Helvetica Neue', Arial, Helvetica, sans-serif;
font-size: 1.14285714em;
font-weight: bold;
}
Expand Down Expand Up @@ -72478,7 +72479,7 @@ ol.ui.suffixed.list li:before,
.ui.form input[type="text"],
.ui.form input[type="file"],
.ui.form input[type="url"] {
font-family: 'AvGardd', 'Helvetica Neue', Arial, Helvetica, sans-serif;
font-family: 'Arvo', 'Helvetica Neue', Arial, Helvetica, sans-serif;
margin: 0;
outline: none;
-webkit-appearance: none;
Expand Down Expand Up @@ -72514,7 +72515,7 @@ ol.ui.suffixed.list li:before,
-webkit-transition: color 0.1s ease, border-color 0.1s ease;
transition: color 0.1s ease, border-color 0.1s ease;
font-size: 1em;
font-family: 'AvGardd', 'Helvetica Neue', Arial, Helvetica, sans-serif;
font-family: 'Arvo', 'Helvetica Neue', Arial, Helvetica, sans-serif;
line-height: 1.2857;
resize: vertical;
}
Expand Down Expand Up @@ -75881,7 +75882,6 @@ ol.ui.suffixed.list li:before,
.ui.grid > .justified.column.column,
.ui.grid > .row > .justified.column.column {
text-align: justify;
-webkit-hyphens: auto;
-ms-hyphens: auto;
hyphens: auto;
}
Expand Down Expand Up @@ -76781,7 +76781,7 @@ ol.ui.suffixed.list li:before,
display: -ms-flexbox;
display: flex;
margin: 1rem 0;
font-family: 'AvGardd', 'Helvetica Neue', Arial, Helvetica, sans-serif;
font-family: 'Arvo', 'Helvetica Neue', Arial, Helvetica, sans-serif;
background: #FFFFFF;
font-weight: normal;
border: 1px solid rgba(34, 36, 38, 0.15);
Expand Down Expand Up @@ -79335,7 +79335,7 @@ Floated Menu / Item

.ui.message .header {
display: block;
font-family: 'AvGardd', 'Helvetica Neue', Arial, Helvetica, sans-serif;
font-family: 'Arvo', 'Helvetica Neue', Arial, Helvetica, sans-serif;
font-weight: bold;
margin: -0.14285714em 0 0 0;
}
Expand Down Expand Up @@ -83165,7 +83165,7 @@ Floated Menu / Item
.ui.card > .content > .header {
display: block;
margin: '';
font-family: 'AvGardd', 'Helvetica Neue', Arial, Helvetica, sans-serif;
font-family: 'Arvo', 'Helvetica Neue', Arial, Helvetica, sans-serif;
color: rgba(0, 0, 0, 0.85);
}

Expand Down Expand Up @@ -85375,7 +85375,7 @@ a.inverted.ui.card:hover,
.ui.items > .item > .content > .header {
display: inline-block;
margin: -0.21425em 0 0;
font-family: 'AvGardd', 'Helvetica Neue', Arial, Helvetica, sans-serif;
font-family: 'Arvo', 'Helvetica Neue', Arial, Helvetica, sans-serif;
font-weight: bold;
color: rgba(0, 0, 0, 0.85);
}
Expand Down Expand Up @@ -85968,7 +85968,7 @@ a.inverted.ui.card:hover,

.ui.statistics .statistic > .value,
.ui.statistic > .value {
font-family: 'AvGardd', 'Helvetica Neue', Arial, Helvetica, sans-serif;
font-family: 'Arvo', 'Helvetica Neue', Arial, Helvetica, sans-serif;
font-size: 4rem;
font-weight: normal;
line-height: 1em;
Expand All @@ -85983,7 +85983,7 @@ a.inverted.ui.card:hover,

.ui.statistics .statistic > .label,
.ui.statistic > .label {
font-family: 'AvGardd', 'Helvetica Neue', Arial, Helvetica, sans-serif;
font-family: 'Arvo', 'Helvetica Neue', Arial, Helvetica, sans-serif;
font-size: 1em;
font-weight: bold;
color: rgba(0, 0, 0, 0.87);
Expand Down Expand Up @@ -86609,7 +86609,7 @@ a.inverted.ui.card:hover,

.ui.accordion .title:not(.ui) {
padding: 0.5em 0;
font-family: 'AvGardd', 'Helvetica Neue', Arial, Helvetica, sans-serif;
font-family: 'Arvo', 'Helvetica Neue', Arial, Helvetica, sans-serif;
font-size: 1em;
color: rgba(0, 0, 0, 0.87);
}
Expand Down Expand Up @@ -91134,7 +91134,7 @@ select.ui.dropdown {

.ui.modal > .header {
display: block;
font-family: 'AvGardd', 'Helvetica Neue', Arial, Helvetica, sans-serif;
font-family: 'Arvo', 'Helvetica Neue', Arial, Helvetica, sans-serif;
background: #FFFFFF;
margin: 0;
padding: 1.25rem 1.5rem;
Expand Down Expand Up @@ -92601,7 +92601,7 @@ a.ui.nag {

.ui.popup > .header {
padding: 0;
font-family: 'AvGardd', 'Helvetica Neue', Arial, Helvetica, sans-serif;
font-family: 'Arvo', 'Helvetica Neue', Arial, Helvetica, sans-serif;
font-size: 1.14285714em;
line-height: 1.2;
font-weight: bold;
Expand Down Expand Up @@ -96097,7 +96097,7 @@ a.ui.nag {

.ui.search > .results .result .title {
margin: -0.14285714em 0 0;
font-family: 'AvGardd', 'Helvetica Neue', Arial, Helvetica, sans-serif;
font-family: 'Arvo', 'Helvetica Neue', Arial, Helvetica, sans-serif;
font-weight: bold;
font-size: 1em;
color: rgba(0, 0, 0, 0.85);
Expand All @@ -96123,7 +96123,7 @@ a.ui.nag {
}

.ui.search > .results > .message .header {
font-family: 'AvGardd', 'Helvetica Neue', Arial, Helvetica, sans-serif;
font-family: 'Arvo', 'Helvetica Neue', Arial, Helvetica, sans-serif;
font-size: 1rem;
font-weight: bold;
color: rgba(0, 0, 0, 0.87);
Expand Down Expand Up @@ -96336,7 +96336,7 @@ a.ui.nag {
width: 100px;
white-space: nowrap;
background: transparent;
font-family: 'AvGardd', 'Helvetica Neue', Arial, Helvetica, sans-serif;
font-family: 'Arvo', 'Helvetica Neue', Arial, Helvetica, sans-serif;
font-size: 1em;
padding: 0.4em 1em;
font-weight: bold;
Expand Down
2 changes: 1 addition & 1 deletion assets/semantic.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/semantic.min.js

Large diffs are not rendered by default.

Loading
Loading