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

NGSTACK-883 add missing icons and replace base64 with svg icons #199

Open
wants to merge 65 commits into
base: netgen-org-site
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
7ec42e5
NGSTACK-849 initial dev setup for netgen organization site
iherak Apr 19, 2024
6d0cc0f
NGSTACK-849 update captainhook config
iherak Apr 19, 2024
f381a8b
NGSTACK-861: configure peak siteaccess
pspanja Apr 24, 2024
0737b59
NGSTACK-851 create skeleton for back office
PetraMiseta Apr 23, 2024
ee64109
NGSTACK-852 add conversations module in back office
PetraMiseta Apr 23, 2024
07df816
NGSTACK-851 rename module to backoffice
PetraMiseta Apr 23, 2024
dea77b9
NGSTACK-851 remove lock files
PetraMiseta Apr 23, 2024
86a0c0c
NGSTACK-851 remove unrelated diffs
PetraMiseta Apr 23, 2024
9bc55c8
NGSTACK-851 delete unused filed, rename project specific stuff, refac…
PetraMiseta Apr 23, 2024
58086d3
NGSTACK-851 delete commented lines
PetraMiseta Apr 23, 2024
c3124ca
NGSTACK-851 remove project specific name
PetraMiseta Apr 23, 2024
cd5c823
NGSTACK-867: restructure routes and limit backoffice siteaccess
pspanja Apr 24, 2024
3623bc6
NGSTACK-851: remove duplicate property
pspanja Apr 24, 2024
dc8c009
NGSTACK-851 delete unused css files
PetraMiseta Apr 24, 2024
10a4178
NGSTACK-851 remove unused assets
PetraMiseta Apr 24, 2024
585a0f2
NGSTACK-851 update translation domain
PetraMiseta Apr 24, 2024
1a1c76e
NGSTACK-851 remove slimselect and flatpikr
PetraMiseta Apr 24, 2024
6d75081
NGSTACK-851 remove unused icons
PetraMiseta Apr 24, 2024
86970c8
NGSTACK-851 add dashboard menu item
PetraMiseta Apr 24, 2024
30d6a06
NGSTACK-851 fix erros in components
PetraMiseta Apr 24, 2024
4a33528
NGSTACK-851 separate backoffice from frontend variables
PetraMiseta Apr 24, 2024
01be399
NGSTACK-868 change class name in main menu, fix/add variables, replac…
TTrakostanec Apr 26, 2024
5a61350
NGSTACK-868 fix typo, change color to hex, revert color to original v…
TTrakostanec Apr 26, 2024
d21e26b
NGSTACK-868 change variable to rgba
TTrakostanec Apr 26, 2024
acb4e7d
NGSTACK-851 move backoffice folder, update paths
PetraMiseta Apr 25, 2024
0b132a5
NGSTACK-851 add modal component
PetraMiseta Apr 25, 2024
9453412
NGSTACK-851 add bookmarks module in backoffice
PetraMiseta Apr 25, 2024
b77deec
NGSTACK-851 delete unused class
PetraMiseta Apr 25, 2024
0e8382c
NGSTACK-854 add listener to update bookmarks title on content update
PetraMiseta Apr 25, 2024
2df35c5
NGSTACK-854 move parameter to baseline neon file
PetraMiseta Apr 25, 2024
9fe0977
NGSTACK-854 delete subscriptions css, not used yet
PetraMiseta Apr 25, 2024
7e7feb3
NGSTACK-854 move bookmarks routes to separate file
PetraMiseta Apr 25, 2024
54f2879
NGSTACK-854 move doctrine listeners to separate folder
PetraMiseta Apr 25, 2024
987a0ec
NGSTACK-854 move entity and repository to doctrine folder
PetraMiseta Apr 25, 2024
78b6f42
NGSTACK-854 update project structure
PetraMiseta Apr 25, 2024
9e14767
NGSTACK-855 add notifications module
PetraMiseta Apr 30, 2024
5a01fe0
NGSTACK-855 limit notifications module to a version
PetraMiseta Apr 30, 2024
439ca6c
NGSTACK-855 move mail sender to env variable
PetraMiseta Apr 30, 2024
01e2fc3
NGSTACK-859 add login and register
PetraMiseta May 2, 2024
7d54d72
NGSTACK-859 intagrate user edit and forgot password module in backoffice
PetraMiseta May 2, 2024
29b1f92
NGSTACK-859 remove unused condition, update route
PetraMiseta May 2, 2024
31fc1b0
NGSTACK-881 display user menu only on peak_eng
PetraMiseta May 6, 2024
95db43a
NGSTACK-852 add conversations module in back office
PetraMiseta Apr 23, 2024
f7ba540
NGSTACK-876 add scss files for notification module
TTrakostanec May 2, 2024
e3f4e5f
NGSTACK-876 remove php file and update package json after rebase
TTrakostanec May 7, 2024
73e1fc5
Merge pull request #190 from netgen/NGSTACK-876-notification-modul-st…
emodric May 7, 2024
7f2c2cf
NGSTACK-873 add html and scss files for form
TTrakostanec Apr 29, 2024
6f56b80
NGSTACK-873 rename class names and move button style to buttons scss
TTrakostanec Apr 29, 2024
418db53
NGSTACK-873 add js files for filter funcionality and datepicker
TTrakostanec Apr 29, 2024
25b154a
NGSTACK-873 add style and js for datepicker
TTrakostanec Apr 30, 2024
0947c53
NGSTACK-873 remove unnecessary widgets
TTrakostanec Apr 30, 2024
edcf4bb
NGSTACK-873 change form and table html and css to match notification …
TTrakostanec May 2, 2024
d4f7c39
NGSTACK-873 remove php file after rebase and add fontawesome
TTrakostanec May 7, 2024
06cbda7
Merge pull request #188 from netgen/NGSTACK-873-bookmarks-styling
emodric May 7, 2024
31bb133
Modify token validity to use seconds
emodric May 7, 2024
1c5c7e4
NGSTACK-852 add conversations module in back office
PetraMiseta Apr 23, 2024
79168ea
NGSTACK-859 add login and register
PetraMiseta May 2, 2024
e563d8c
NGSTACK-853 add impersonation module in ibexa and backoffice
PetraMiseta May 3, 2024
6e1c980
NGSTACK-853 delete unnecessary listener
PetraMiseta May 6, 2024
876a0cf
NGSTACK-853 delete files added by mistake in rebase
PetraMiseta May 7, 2024
493c360
NGSTACK-853 move parameters to app/server
PetraMiseta May 7, 2024
05e4a2f
NGSTACK-853 delete unused parameter and move impersonation params to …
PetraMiseta May 7, 2024
f8654b2
NGSTACK-853 remove unnecessary spaces
PetraMiseta May 7, 2024
b44a2fc
Merge pull request #194 from netgen/NGSTACK-853-impersonation-module
emodric May 7, 2024
7febb61
NGSTACK-883 add missing icons and replace base64 with svg icons
TTrakostanec May 8, 2024
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: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,5 @@ SENTRY_DSN=
# postgresql+advisory://db_user:db_password@localhost/db_name
LOCK_DSN=flock
###< symfony/lock ###

MAIL_SENDER='[email protected]'
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
APP_ENV = dev
PHP_VERSION = php8.1
PHP_VERSION = php8.2
PHP_RUN = /usr/bin/env $(PHP_VERSION)
COMPOSER_PATH = /usr/local/bin/composer2
ifeq ("$(wildcard $(COMPOSER_PATH))","")
Expand Down
58 changes: 58 additions & 0 deletions assets/js/backoffice/components.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
// This file contains only import, configuration and initialization of components
import addDocumentEventListeners from '../utilities/components/add-document-event-listeners';

import ModalConfirmControl from '../components/backoffice/ModalConfirmControl.component';
import NgConversationsMarkThreadAsRead from '../components/backoffice/NgConversationsMarkThreadAsRead.component';
import Sidebar from '../components/backoffice/Sidebar.component';
import EnableFilterButtons from '../components/backoffice/EnableFilterButtons.component';
import HideOverflowingFilters from '../components/backoffice/HideOverflowingFilters.component';
import DateRangeInput from '../components/backoffice/DateRangeInput.component';

const componentConfiguration = [
{
Component: NgConversationsMarkThreadAsRead,
selector: '#ngconversations-app-root',
options: {
menuItemSelector: '#menu_item_conversations',
menuItemCountClass: 'menu-ntf-count',
menuItemIconSelector: '.icon-conversations',
markAsReadEvent: 'ngconversations-change-thread-read-state',
},
},
{
Component: Sidebar,
selector: '.app-container',
options: {
hasSubmenu: '.has-submenu',
submenu: '.menu_level_1',
child: 'div:first-child',
currentItems:
'.app-sidebar .sidebar-wrapper .current, .app-sidebar .sidebar-wrapper .current_ancestor',
},
},
{
Component: ModalConfirmControl,
selector: '.js-modal-confirm',
},
{
Component: EnableFilterButtons,
selector: '.js-filter-form',
options: {
hasActiveFilterClass: 'has-active-filter',
hasNewInputClass: 'has-new-input',
},
},
{
Component: HideOverflowingFilters,
selector: '.js-filter-wrapper',
options: {
filterWrapSelector: '.js-filters',
},
},
{
Component: DateRangeInput,
selector: '.js-date-range-input',
},
];

addDocumentEventListeners(componentConfiguration);
34 changes: 34 additions & 0 deletions assets/js/backoffice/date.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import flatpickr from 'flatpickr';

const date = document.querySelector('.js-date-filter');

if (date) {
flatpickr(date, {
mode: 'range',
minDate: '2022-01-01',
dateFormat: 'Y-m-d',
wrap: true,

onChange(selectedDates) {
// eslint-disable-next-line no-empty
if (!selectedDates || selectedDates.length < 1) return;

const dateFrom = new Date(selectedDates[0]);
dateFrom.setHours(0, 0, 0, 0);

let dateTo = selectedDates[0];
if (selectedDates.length > 1) {
// eslint-disable-next-line prefer-destructuring
dateTo = selectedDates[1];
}
dateTo = new Date(dateTo);
dateTo.setHours(23, 59, 59, 0);

const formattedDateFrom = dateFrom.toISOString().split('.')[0];
const formattedDateTo = dateTo.toISOString().split('.')[0];

document.getElementById('dateFromHidden').value = formattedDateFrom;
document.getElementById('dateToHidden').value = formattedDateTo;
},
});
}
4 changes: 4 additions & 0 deletions assets/js/backoffice/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import '../../sass/backoffice/style.scss';
import './components';
import 'bootstrap';
import './date';
23 changes: 23 additions & 0 deletions assets/js/components-noncritical.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ import PageHeader from './components/PageHeader.component';
import LoginFormFragment from './components/LoginFormFragment.component';
import ResponsiveVideo from './components/ResponsiveVideo.component';
import SwiperBase from './components/SwiperBase.component';
import SubscriptionWidget from './components/SubscriptionWidget.component';
import SwiperThumb from './components/SwiperThumb.component';
import VideoPoster from './components/VideoPoster.component';
import SkipToMainContent from './components/SkipToMainContent.component';
import BookmarkWidget from './components/BookmarkWidget.component';

// Configuration
const componentConfiguration = [
Expand Down Expand Up @@ -214,6 +216,27 @@ const componentConfiguration = [
Component: SkipToMainContent,
selector: '#skip-to-main-content',
},
{
Component: BookmarkWidget,
selector: '.js-bookmark-widget',
options: {
bookmarkIcon: '.fa-bookmark',
bookmarkTooltip: '.bookmark-tooltip',
},
},
{
Component: SubscriptionWidget,
selector: '#subscription-modal-body',
options: {
modalBody: '.modal-body',
subscriptionForm: '.ntf-subscribe-widget',
subscriptionTypeWrapper: '#subscription_widget_type',
subscriptionTypeRadios: 'input[type=radio]',
digestType: '#subscription_widget_type_1',
digestOptions: '.digest-options',
buttonSubscribe: 'button[type=submit]',
},
},
];

addDocumentEventListeners(componentConfiguration);
40 changes: 40 additions & 0 deletions assets/js/components/BookmarkWidget.component.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
export default class BookmarkWidget {
constructor(element, options) {
this.element = element;
this.bookmarkIcon = this.element.querySelector(options.bookmarkIcon);
this.bookmarkTooltip = this.element.querySelector(options.bookmarkTooltip);
this.createBookmarkEndpoint = element.dataset.createBookmarkEndpoint;
this.deleteBookmarkEndpoint = element.dataset.deleteBookmarkEndpoint;
this.isBookmarked = element.dataset.isBookmarked === 'true';

this.onInit();
}

onInit() {
console.log('bookmark component');

this.element.addEventListener('click', this.updateBookmarkData.bind(this));
}

updateBookmarkData() {
this.bookmarkTooltip.classList.remove('tooltip-animated');

if (this.isBookmarked) {
this.bookmarkTooltip.innerHTML = 'Bookmark removed';
} else {
this.bookmarkTooltip.innerHTML = 'Bookmarked';
}

return fetch(this.isBookmarked ? this.deleteBookmarkEndpoint : this.createBookmarkEndpoint, {
method: 'POST',
}).then((response) => {
['far', 'fas'].forEach((faTypeClass) => this.bookmarkIcon.classList.toggle(faTypeClass));

this.bookmarkTooltip.classList.add('tooltip-animated');

this.isBookmarked = !this.isBookmarked;

return response;
});
}
}
17 changes: 13 additions & 4 deletions assets/js/components/PageHeader.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ export default class PageHeader {
if (this.mainNav === null) {
return;
}

this.level1Menus = this.mainNav.querySelectorAll(this.options.menuLevel1);
if (this.level1Menus.length === 0) {
return;
Expand All @@ -116,9 +115,19 @@ export default class PageHeader {
this.submenuTriggerElements.push(submenuTriggerContent);
});

this.submenuTriggerElements.forEach((submenuTrigger) => {
submenuTrigger.addEventListener('click', () => {
this.toggleMobileSubmenu(submenuTrigger);
window.addEventListener('click', (e) => {
this.submenuTriggerElements.forEach((submenuTrigger) => {
const submenuTriggered = submenuTrigger.contains(e.target);

if (e.target.closest('.prevent-user-menu-cta')) {
e.preventDefault();
}

if (!submenuTriggered || submenuTrigger.classList.contains('submenu-active')) {
submenuTrigger.classList.remove('submenu-active');
} else {
submenuTrigger.classList.add('submenu-active');
}
});
});
}
Expand Down
74 changes: 74 additions & 0 deletions assets/js/components/SubscriptionWidget.component.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
export default class SubscriptionWidget {
constructor(element, options) {
this.el = element;
this.options = options;
this.modalBody = this.el.querySelector(options.modalBody);
this.subscriptionForm = this.el.querySelector(options.subscriptionForm);
this.digestType = this.el.querySelector(options.digestType);
this.digestOptions = this.el.querySelector(options.digestOptions);
this.buttonSubscribe = this.el.querySelector(options.buttonSubscribe);

this.onInit();
}

onInit() {
if (this.digestType && this.digestType.checked) {
this.digestOptions.classList.remove('d-none');
SubscriptionWidget.activateSubscribeButton(this.buttonSubscribe);
}

this.el.addEventListener('click', (e) => {
const buttonSubscribe = e.currentTarget.querySelector(this.options.buttonSubscribe);

if (e.target.matches(this.options.subscriptionTypeRadios)) {
this.changeType(e);
SubscriptionWidget.activateSubscribeButton(buttonSubscribe);
}
});

this.el.addEventListener('submit', (e) => {
if (e.target.matches(this.options.subscriptionForm)) {
const modalBody = e.currentTarget.querySelector(this.options.modalBody);

e.preventDefault();
this.formSubmit(modalBody, e.target);
}
});
}

changeType(e) {
const digestOptions = e.currentTarget.querySelector(this.options.digestOptions);
const digestType = e.currentTarget.querySelector(this.options.digestType);

if (e.target === digestType || digestType.checked) {
digestOptions.classList.remove('d-none');
} else {
digestOptions.classList.add('d-none');
}
}

static activateSubscribeButton(button) {
if (button) {
button.removeAttribute('disabled');
button.classList.replace('btn-tertiary', 'btn-primary');
}
}

formSubmit(modalBody, subscriptionForm) {
const xhr = new XMLHttpRequest();
xhr.open('POST', this.subscriptionForm.action);
xhr.onload = function (event) {
modalBody.innerHTML = event.target.response;
const errorMessage = modalBody.querySelector('.errors');
const subscribeButton = modalBody.querySelector('button[type=submit]');

if (errorMessage && errorMessage.closest('.digest-options')) {
errorMessage.closest('.digest-options').classList.remove('d-none');
}

SubscriptionWidget.activateSubscribeButton(subscribeButton);
};
const formData = new FormData(subscriptionForm);
xhr.send(formData);
}
}
41 changes: 41 additions & 0 deletions assets/js/components/backoffice/DateRangeInput.component.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import flatpickr from 'flatpickr';

export default class Date {
constructor(element) {
this.element = element;

this.init();
}

init() {
flatpickr(this.element, {
mode: 'range',
minDate: '2022-01-01',
dateFormat: 'Y-m-d',
wrap: true,

onChange(selectedDates) {
if (!selectedDates || selectedDates.length < 1) {
return;
}

const dateFrom = selectedDates[0];
dateFrom.setHours(0, 0, 0, 0);

let dateTo = selectedDates[0];
if (selectedDates.length > 1) {
// eslint-disable-next-line prefer-destructuring
dateTo = selectedDates[1];
}

dateTo.setHours(23, 59, 59, 0);

const formattedDateFrom = dateFrom.toISOString().split('.')[0];
const formattedDateTo = dateTo.toISOString().split('.')[0];

document.getElementById('dateFromHidden').value = formattedDateFrom;
document.getElementById('dateToHidden').value = formattedDateTo;
},
});
}
}
30 changes: 30 additions & 0 deletions assets/js/components/backoffice/EnableFilterButtons.component.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
export default class EnableFilterButtons {
constructor(element, options) {
this.form = element;
this.options = options;
this.onInit();
}

onInit() {
this.searchParams = new URLSearchParams(window.location.search);
this.inputs = this.form.querySelectorAll('input, select');

if ([...this.searchParams.keys()].some((query) => query !== 'page')) {
this.form.classList.add(this.options.hasActiveFilterClass);
}

this.form.addEventListener('input', this.checkInputs.bind(this));

this.checkInputs();
}

checkInputs() {
const action = [...this.inputs].some(
({ value, name }) => value && value !== this.searchParams.get(name)
)
? 'add'
: 'remove';

this.form.classList[action](this.options.hasNewInputClass);
}
}
Loading