Skip to content

Commit

Permalink
Merge pull request #524 from bluewave-labs/agent-1.0.2
Browse files Browse the repository at this point in the history
merge request Agent 1.0.2 into develop branch
  • Loading branch information
erenfn authored Jan 28, 2025
2 parents 9f4be58 + 6c56b43 commit 91fac05
Show file tree
Hide file tree
Showing 10 changed files with 206 additions and 140 deletions.
5 changes: 3 additions & 2 deletions backend/src/controllers/guide.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,14 @@ class GuideController {
const popupIds = completePopupLogs.map(log => log.guideId);
const bannerIds = completeBannerLogs.map(log => log.guideId);
const hintIds = completeHintLogs.map(log => log.guideId);
const helperLinkIds = completeHelperLogs.map(log => log.guideId);
//const helperLinkIds = completeHelperLogs.map(log => log.guideId);

const [popup, banner, hint, helperLink] = await Promise.all([
popupService.getIncompletePopupsByUrl(url, popupIds),
bannerService.getIncompleteBannersByUrl(url, bannerIds),
hintService.getIncompleteHintsByUrl(url, hintIds),
helperLinkService.getAllHelpersWithLinks(),
//helperLinkService.getIncompleteHelpers(helperLinkIds),
helperLinkService.getAllHelpersWithLinks()
]);
res.status(200).json({popup, banner, hint, helperLink });

Expand Down
12 changes: 12 additions & 0 deletions frontend/Dockerfile_nginx_html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM node:22-alpine3.21 as builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build

FROM nginx:alpine
COPY --from=builder /app/dist /usr/share/nginx/html
#COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD [ "nginx", "-g", "daemon off;" ]
4 changes: 2 additions & 2 deletions frontend/dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Guidefox</title>
<link rel="icon" type="image/svg+xml" href="/svg/favicon.svg" />
<script type="module" crossorigin src="/assets/index-DBm1Hrdr.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-x2uT4T0p.css">
<script type="module" crossorigin src="/assets/index-4Qqfvg46.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-B2RrmTqS.css">
</head>

<body>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/styles/globals.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import url(variables.css);
@use './variables.css';

$base-font-size: var(--font-header);

Expand Down
23 changes: 10 additions & 13 deletions jsAgent/banner.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
let temp_banner_html = `
<div class="bw-banner" id="bw-banner-{{id}}" data-id="{{dataId}}" style="position: fixed; {{position}}: 50px; z-index: 999999; height:50px; width:435px; background-color:{{backGroundColor}}; left: 50%; transform: translate(-50%, -50%);
line-height: 13px; font-weight: 400; display: flex; align-items: center; justify-content: space-between; padding: 0.7rem; border-radius: 5px; height:50px; width:435px;">
<div style="color:{{textColor}}; width: 100%; text-align: center;font-family: Inter; font-size: 13px; font-weight: 400; line-height: 24px; text-align: left; text-underline-position: from-font; text-decoration-skip-ink: none;">
{{content}}
</div>
<svg class="bw-banner-close-icon" aria-hidden="true" viewBox="0 0 24 24" style="fill:{{textColor}}; font-size: 20px; cursor: pointer; width: 25px; height: 25px; padding: 12px;">
<path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"></path>
</svg>
<div class="bw-banner" id="bw-banner-{{id}}" data-id="{{dataId}}" style="position: absolute !important; top: 25px !important; z-index: 999999 !important; background-color: #5e4b7b !important; left: calc(50% - 435px / 2) !important; line-height: 13px !important; font-weight: 400 !important; display: flex !important; align-items: center !important; justify-content: space-between !important; border-radius: 5px !important; width: 435px !important;">
<div style="color:{{textColor}} !important; width: 100% !important; text-align: center !important; font-family: Inter !important; font-size: 13px !important; font-weight: 400 !important; line-height: 24px !important; text-align: left !important; text-underline-position: from-font !important; text-decoration-skip-ink: none !important; padding-left: 28px !important;">
{{content}}
</div>
<svg class="bw-banner-close-icon" aria-hidden="true" viewBox="0 0 24 24" style="fill:{{textColor}} !important; font-size: 20px !important; cursor: pointer !important; width: 25px !important; height: 25px !important; padding: 12px !important;">
<path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"></path>
</svg>
</div>`;

bw.banner = {
init: function () {
bw.banner.putHtml();
bw.banner.bindClick();
},
putHtml: function () {
putHtml:async function () {
const bannersData = window.bwonboarddata.banner;
let bannerHtml = '';
for (let i = 0; i < bannersData.length; i++) {
Expand All @@ -29,18 +28,16 @@ bw.banner = {
bannerHtml += temp_html;
}
document.body.insertAdjacentHTML('afterbegin', bannerHtml);


},
bindClick: function () {
let closeBtns = document.getElementsByClassName('bw-banner-close-icon');
for (let i = 0; i < closeBtns.length; i++) {
const element = closeBtns[i];
element.addEventListener('click', function (e) {
element.addEventListener('click',async function (e) {
const clickedElement = document.getElementById("bw-banner-" + i);
clickedElement.style.display = 'none';
const dataId = clickedElement.getAttribute('data-id');
bw.data.sendData(bw.GuideType.BANNER, bw.user.getUserID(), true, dataId);
await bw.data.sendData(bw.GuideType.BANNER, bw.user.getUserID(), true, dataId);
});
}
},
Expand Down
Loading

0 comments on commit 91fac05

Please sign in to comment.