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

[WIP] dead code removal #1941

Draft
wants to merge 5 commits into
base: edge
Choose a base branch
from
Draft
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions client-admin/.eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ env:
browser: true
es2020: true
jquery: true
globals:
FB: readonly
plugins:
- babel
- react
Expand Down
5 changes: 0 additions & 5 deletions client-admin/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@

FROM docker.io/node:18-alpine

ARG ENABLE_TWITTER_WIDGETS
ARG FB_APP_ID
ENV ENABLE_TWITTER_WIDGETS=${ENABLE_TWITTER_WIDGETS}
ENV FB_APP_ID=${FB_APP_ID}

# Set default NODE_ENV to production unless overridden at build time with --build-arg NODE_ENV=development
ARG NODE_ENV
ENV NODE_ENV=${NODE_ENV:-production}
Expand Down
15 changes: 0 additions & 15 deletions client-admin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,6 @@ docker run -p 8080:8080 --name polis-client-admin polis-client-admin:local npm s
Now you can see the web interface at [http://localhost:8080], but if it is not connected to the Server API you won't
get very far. Still it can be useful for developing and debugging builds.

## Configuration

### Facebook App Integration

Optionally, you can [register with Facebook](https://developers.facebook.com/docs/development) and get a Facebook App ID
to use the Facebook auth features.

If you do so, set the FB_APP_ID environment variable in the top level `.env` file, or manually pass it in
when building and running this application.

### Twitter Integration

To enable twitter widgets for user authentication, set the ENABLE_TWITTER_WIDGETS environment variable to `true` in the
top level `.env` file, or manually pass it in when building and running this application.

### Common Problems

If you having troubles with npm dependencies try run the commands below:
Expand Down
99 changes: 45 additions & 54 deletions client-admin/public/embed.html
Original file line number Diff line number Diff line change
@@ -1,54 +1,58 @@
<!DOCTYPE html>
<html>

<head>
<title>Polis Embed Demo</title>

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<style>
.banner {
background-color: #ccc;
border-radius: 3px;
height: 80px;
width: 620px;
margin-top: 40px;
margin-inline-start: 10px;
margin-inline-end: 10px;
margin-bottom: 40px;
}
.paragraph {
background-color: #ddd;
border-radius: 3px;
height: 20px;
width: 620px;
margin-top: 20px;
margin-inline-start: 10px;
margin-inline-end: 10px;
}
.last-line {
width: 100px;
}
.spacer {
height: 20px;
}
.banner {
background-color: #ccc;
border-radius: 3px;
height: 80px;
width: 620px;
margin-top: 40px;
margin-inline-start: 10px;
margin-inline-end: 10px;
margin-bottom: 40px;
}

.paragraph {
background-color: #ddd;
border-radius: 3px;
height: 20px;
width: 620px;
margin-top: 20px;
margin-inline-start: 10px;
margin-inline-end: 10px;
}

.last-line {
width: 100px;
}

.spacer {
height: 20px;
}
</style>

</head>

<body style="width: 100%">

<script>
var polis = window.polis = window.polis || {};
polis.on = polis.on || {};
polis.on.resize = [
function(o) {
var iframe = o.iframe;
var data = o.data;
// Here's where you can do something with the resize event
console.dir(data);
return false; // Return true to prevent default resize handler found in https://pol.is/embed.js
}
];
var polis = window.polis = window.polis || {};
polis.on = polis.on || {};
polis.on.resize = [
function (o) {
var iframe = o.iframe;
var data = o.data;
// Here's where you can do something with the resize event
console.dir(data);
return false; // Return true to prevent default resize handler found in https://pol.is/embed.js
}
];
</script>

<div style="width: 620px; margin: auto;">
Expand All @@ -72,7 +76,7 @@



<!--
<!--

data-ucv="0"
data-ucw="0"
Expand All @@ -83,30 +87,17 @@
data-show_vis="false"
data-auth_needed_to_vote="true"
data-auth_needed_to_write="false"
data-auth_opt_fb="true"
data-auth_opt_tw="false"
data-auth_opt_allow_3rdparty="true"
-->

<div
class="polis"

data-border="none"
data-border_radius="0px";
data-padding="0px";

data-width="320px"

data-ucsf="0"
data-ui_lang="fr"

data-conversation_id="2arcefpshi"
>
<div class="polis" data-border="none" data-border_radius="0px" ; data-padding="0px" ; data-width="320px"
data-ucsf="0" data-ui_lang="fr" data-conversation_id="2arcefpshi">
</div>
</div>

<script async="true" src="https://pol.is/embed.js"></script>


</body>
</html>

</html>
118 changes: 54 additions & 64 deletions client-admin/public/embedPreprod.html
Original file line number Diff line number Diff line change
@@ -1,64 +1,68 @@
<!DOCTYPE html>
<html>

<head>
<title>Polis Embed Demo</title>

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<style>
.banner {
background-color: #ccc;
border-radius: 3px;
height: 80px;
width: 620px;
margin-top: 40px;
margin-inline-start: 10px;
margin-inline-end: 10px;
margin-bottom: 40px;
}
.paragraph {
background-color: #ddd;
border-radius: 3px;
height: 20px;
width: 620px;
margin-top: 20px;
margin-inline-start: 10px;
margin-inline-end: 10px;
}
.last-line {
width: 100px;
}
.spacer {
height: 20px;
}
.banner {
background-color: #ccc;
border-radius: 3px;
height: 80px;
width: 620px;
margin-top: 40px;
margin-inline-start: 10px;
margin-inline-end: 10px;
margin-bottom: 40px;
}

.paragraph {
background-color: #ddd;
border-radius: 3px;
height: 20px;
width: 620px;
margin-top: 20px;
margin-inline-start: 10px;
margin-inline-end: 10px;
}

.last-line {
width: 100px;
}

.spacer {
height: 20px;
}
</style>

</head>

<body style="width: 100%">

<script>
var polis = window.polis = window.polis || {};
polis.on = polis.on || {};
polis.on.resize = [
function(o) {
var iframe = o.iframe;
var data = o.data;
// Here's where you can do something with the resize event
console.dir(data);
return false; // Return true to prevent default resize handler found in https://pol.is/embed.js
}
];
polis.on.init = [
function(o) {
if (o.status === "ok") {
console.log("polis loaded");
console.log(o.conversation);
} else {
console.error("error loading");
var polis = window.polis = window.polis || {};
polis.on = polis.on || {};
polis.on.resize = [
function (o) {
var iframe = o.iframe;
var data = o.data;
// Here's where you can do something with the resize event
console.dir(data);
return false; // Return true to prevent default resize handler found in https://pol.is/embed.js
}
}
];
];
polis.on.init = [
function (o) {
if (o.status === "ok") {
console.log("polis loaded");
console.log(o.conversation);
} else {
console.error("error loading");
}
}
];
</script>

<div style="width: 620px; margin: auto;">
Expand All @@ -82,7 +86,7 @@



<!--
<!--

data-ucv="0"
data-ucw="0"
Expand All @@ -93,31 +97,17 @@
data-show_vis="false"
data-auth_needed_to_vote="true"
data-auth_needed_to_write="false"
data-auth_opt_fb="true"
data-auth_opt_tw="false"
data-auth_opt_allow_3rdparty="true"
-->

<div
class="polis"

data-border="none"
data-border_radius="0px";
data-padding="0px";

data-width="320px"

data-ucsf="0"
data-ui_lang="es"

data-demo="true"
data-conversation_id="2arcefpshi"
>
<div class="polis" data-border="none" data-border_radius="0px" ; data-padding="0px" ; data-width="320px"
data-ucsf="0" data-ui_lang="es" data-demo="true" data-conversation_id="2arcefpshi">
</div>
</div>

<script async="true" src="https://preprod.pol.is/embedPreprod.js"></script>


</body>
</html>

</html>
33 changes: 9 additions & 24 deletions client-admin/public/index.ejs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<!DOCTYPE html>
<html lang="en">

<head>
<title>Polis</title>
<meta charset="UTF-8">
Expand All @@ -8,33 +9,17 @@

<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
<link rel="icon" href="/favicon.ico" type="image/x-icon" />
<link
href="https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap"
rel="stylesheet"
/>
<link href="https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap"
rel="stylesheet" />
<style>
* { font-variant-ligatures: none; }
* {
font-variant-ligatures: none;
}
</style>
</head>
<body class="viewport avenir">
<% if (enableTwitterWidgets) { %>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
<% } %>

<% if (fbAppId) { %>
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '<%= fbAppId %>',
xfbml : true,
version : 'v2.1'
});
};
</script>
<script async defer crossorigin="anonymous" src="https://connect.facebook.net/en_US/sdk.js"></script>
<% } %>

<body class="viewport avenir">
<div id="root"></div>
</body>
</html>

</html>
Loading
Loading