feature - chat component on the right view

This commit is contained in:
Alexandre Bourlier 2018-07-31 23:42:43 +02:00
parent 687afddf50
commit bbb8e0a24c
18 changed files with 61 additions and 43 deletions

1
.gitignore vendored
View File

@ -12,3 +12,4 @@ dist/html/*
index.html
config.php
issues.md
oidc-client-preprod-config.json

2
dist/lib/sib-chat vendored

@ -1 +1 @@
Subproject commit ab4fc15f5f4476e111dfb5bbdb43c7b88af18bf9
Subproject commit b00af6aa4e2412468d5ca7b293d7f2517f1b0c28

2
dist/lib/sib-router vendored

@ -1 +1 @@
Subproject commit 6109962852d523b23d47fb344083e77917ec1a9c
Subproject commit 3914e3736e66a96c42fb9a20c5412ed948eabf86

View File

@ -36,5 +36,25 @@
<?php require_once('src/html/channel.php'); ?>
<?php require_once('src/html/search.html'); ?>
</main>
<sib-chat
id="chat-singleton"
data-authentication="login"
data-auto-login="true"
data-bosh-service-url="https://jabber.happy-dev.fr/http-bind/"
data-debug="false"
data-locales-url="en"
bind-resources
></sib-chat>
<script>
window.addEventListener('navigate', event => {
var chatSingleton = document.querySelector("#chat-singleton");
var view = document.getElementById(event.detail.route);
view.querySelector(".chat-view").appendChild(chatSingleton);
chatSingleton.dataset.src = view.dataset.src;
});
</script>
</body>
</html>

10
oidc-client-config.json Normal file
View File

@ -0,0 +1,10 @@
{
"authority": "https://test-paris.happy-dev.fr/openid/",
"client_id": "125356",
"redirect_uri": "http://hd-app.local",
"response_type": "id_token token",
"scope": "openid profile email",
"automaticSilentRenew": true,
"silent_redirect_uri": "http://hd-app.local",
"loadUserInfo": true
}

View File

@ -1,11 +1,13 @@
#!/bin/bash
export DN="https://staging-app.happy-dev.fr"
export SDN="https://staging-hd-app-server.happy-dev.fr"
export SDN="https://test-paris.happy-dev.fr"
export CDN="https://cdn.happy-dev.fr"
php index.php > index.html
grunt
ssh hd-app@ssh-hd-app.alwaysdata.net "rm -R staging-hd-app; mkdir staging-hd-app; cd staging-hd-app; mkdir -p src/fonts; mkdir -p dist/css;"
scp index.html hd-app@ssh-hd-app.alwaysdata.net:~/staging-hd-app/
scp .htaccess hd-app@ssh-hd-app.alwaysdata.net:~/staging-hd-app/
scp -r dist/css/ hd-app@ssh-hd-app.alwaysdata.net:~/staging-hd-app/dist/
scp -r src/fonts/ hd-app@ssh-hd-app.alwaysdata.net:~/staging-hd-app/src/
scp -r src/js/ hd-app@ssh-hd-app.alwaysdata.net:~/staging-hd-app/src/
ssh staging-app@ssh-staging-app.happy-dev.fr "rm -R staging-app.happy-dev.fr; mkdir staging-app.happy-dev.fr; cd staging-app.happy-dev.fr; mkdir -p src/fonts; mkdir -p dist/css;"
scp index.html staging-app@ssh-staging-app.happy-dev.fr:~/staging-app.happy-dev.fr/
scp .htaccess staging-app@ssh-staging-app.happy-dev.fr:~/staging-app.happy-dev.fr/
scp oidc-client-preprod-config.json staging-app@ssh-staging-app.happy-dev.fr:~/staging-app.happy-dev.fr/oidc-client-config.json
scp -r dist/css/ staging-app@ssh-staging-app.happy-dev.fr:~/staging-app.happy-dev.fr/dist/
scp -r src/fonts/ staging-app@ssh-staging-app.happy-dev.fr:~/staging-app.happy-dev.fr/src/
scp -r src/js/ staging-app@ssh-staging-app.happy-dev.fr:~/staging-app.happy-dev.fr/src/

View File

@ -1,4 +1,2 @@
<div id="channel-chat" style="display: none">
<i>Chat coming soon...</i>
</div>
<div id="channel-chat" class="chat-view" style="display: none" bind-resources></div>

View File

@ -1,6 +1,6 @@
<div id="channel-create" style="display: none">
<sib-form
data-src="http://localhost:8000/channels/"
data-src="<?php echo $sdn; ?>/channels/"
range-owner="<?php echo $sdn; ?>/members/"
widget-members="sib-form-multiple-dropdown"
range-members="<?php echo $sdn; ?>/members/"

View File

@ -1,6 +1,6 @@
<div id="client-create" style="display: none">
<sib-form
data-src="http://localhost:8000/clients/"
data-src="<?php echo $sdn; ?>/clients/"
data-fields="name, address, logo"
></sib-form>
</div>

View File

@ -1,8 +1,8 @@
<!-- Stylesheets -->
<link rel="stylesheet" href="<?php echo $dn; ?>/node_modules/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="<?php echo $dn; ?>/node_modules/cropper/dist/cropper.min.css" />
<link rel="stylesheet" href="<?php echo $dn; ?>/dist/css/hd-app.css?v=<?php echo $v ?>" />
<link rel="stylesheet" href="<?php echo $dn; ?>/node_modules/font-awesome/css/font-awesome.min.css" />
<link rel="stylesheet" href="<?php echo $dn; ?>/dist/css/hd-app.css?v=<?php echo $v ?>" />
<!-- Javascript -->
<script type="text/javascript" src="<?php echo $dn; ?>/node_modules/jquery/dist/jquery.min.js"></script>
@ -15,5 +15,5 @@
<!-- Web components -->
<link rel="import" href="<?php echo $dn; ?>/dist/lib/sib-core/sib-display.html?v=<?php echo $v ?>" />
<link rel="import" href="<?php echo $dn; ?>/dist/lib/sib-router/sib-router.html?v=<?php echo $v ?>" />
<link rel="import" href="<?php echo $dn; ?>/dist/lib/sib-chat/sib-chat.html?v=<?php echo $v ?>">
<link rel="import" href="<?php echo $dn; ?>/dist/lib/sib-chat/sib-chat.html">

View File

@ -1,7 +1,7 @@
<!-- Stylesheets -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" integrity="sha384-9gVQ4dYFwwWSjIDZnLEWnxCjeSWFphJiwGPXr1jddIhOegiu1FwO5qRGvFXOdJZ4" crossorigin="anonymous">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link href="https://cdn.bootcss.com/cropper/4.0.0/cropper.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="<?php echo $dn; ?>/dist/css/hd-app.css?v=<?php echo $v ?>" />
<!-- Javascript -->
@ -10,9 +10,10 @@
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js" integrity="sha384-uefMccjFJAIv6A+rW+L4AHf99KvxDjWSu1z9VI8SKNVmz4sk7buKt/6v9KI65qnm" crossorigin="anonymous"></script>
<script src="https://cdn.bootcss.com/cropper/4.0.0/cropper.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/webcomponentsjs/1.2.0/webcomponents-loader.js" integrity="sha256-fUVqCtpScUF69qkFkeuHmcShr2N2UleRQJhRG4etHds=" crossorigin="anonymous"></script>
<script type="text/javascript" src="<?php echo $dn; ?>/src/js/hd-app.js?v=<?php echo $v ?>"></script>
<script src="<?php echo $dn; ?>/src/js/hd-app.js?v=<?php echo $v ?>"></script>
<script src="<?php echo $cdn; ?>/sib-chat/3rdparty/sib-oidc-client.js?v=<?php echo $v ?>"></script>
<!-- Web components -->
<link rel="import" href="https://cdn.happy-dev.fr/sib-core/sib-display.html?v=<?php echo $v ?>" />
<link rel="import" href="https://cdn.happy-dev.fr/sib-router/sib-router.html?v=<?php echo $v ?>" />
<link rel="import" href="https://xmpp-chat-component.happy-dev.fr/chat-window-component.html?v=<?php echo $v ?>">
<link rel="import" href="<?php echo $cdn; ?>/sib-core/sib-display.html?v=<?php echo $v ?>" />
<link rel="import" href="<?php echo $cdn; ?>/sib-router/sib-router.html?v=<?php echo $v ?>" />
<link rel="import" href="<?php echo $cdn; ?>/sib-chat/sib-chat.html">

View File

@ -1,12 +1 @@
<div id="member-chat" style="display: none">
<sib-chat
id="chat-singleton"
data-src="https://djangoldp.happy-dev.fr/users/1/"
data-authentication="login"
data-auto-login="true"
data-bosh-service-url="http://jabber.happy-dev.fr/http-bind/"
data-debug="false"
data-locales-url="node_modules/converse.js/locale/{{{locale}}}/LC_MESSAGES/converse.json"
bind-resources>
</sib-chat>
</div>
<div id="member-chat" class="chat-view" style="display: none" bind-resources></div>

View File

@ -18,9 +18,9 @@
<div id="member-edit" style="display: none">
<label for="avatar-input" class="d-none">
<img id="avatar-preview" src="http://cdn.local/hdapp/members/alexandre-bourlier.jpg" style="width: 100%;"/>
<img id="avatar-preview" src="" style="width: 100%;"/>
</label>
<input class="d-none" type="file" accept="image/*" id="avatar-input" name="avatar" value="http://cdn.hd-app.local/members/alexandre-bourlier.jpg" />
<input class="d-none" type="file" accept="image/*" id="avatar-input" name="avatar" value="" />
<sib-form
class="edit-form"

View File

@ -24,7 +24,6 @@
<span class="d-none d-md-inline"> Network</span>
</sib-route>
<sib-route class="d-none" name="channel" id-prefix="<?php echo $sdn; ?>/channels/"></sib-route>
<sib-route class="d-none" name="channel-edition" id-prefix="<?php echo $sdn; ?>/channels/"></sib-route>
</div>
<div class="col-2 col-md-1"></div>

View File

@ -1,3 +1 @@
<div id="project-chat" style="display: none">
<i>Chat coming soon...</i>
</div>
<div id="project-chat" class="chat-view" style="display: none" bind-resources></div>

View File

@ -1,8 +1,8 @@
<div id="project-create" style="display: none">
<sib-form
data-src="http://localhost:8000/projects/"
data-src="<?php echo $sdn; ?>/projects/"
range-client="<?php echo $sdn; ?>/clients/"
widget-team="sib-form-multiple-dropdown"
range-team="<?php echo $sdn; ?>/team/"
range-team="<?php echo $sdn; ?>/members/"
></sib-form>
</div>

View File

@ -2,7 +2,7 @@
<sib-form
range-client="<?php echo $sdn; ?>/clients/"
widget-team="sib-form-multiple-dropdown"
range-team="<?php echo $sdn; ?>/team/"
range-team="<?php echo $sdn; ?>/members/"
bind-resources
></sib-form>
</div>

View File

@ -8,7 +8,7 @@ sib-chat {
display: none;
}
#member-chat {
.chat-view {
sib-chat {
display: block;
top: $menu-height + 30px;