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

#623 remove subheader when it is desktop and update css without it #624

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
14 changes: 12 additions & 2 deletions src/esn.calendar.libs/app/app.constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,28 @@
weekNumbers: true,
weekNumberCalculation: 'ISO',
firstDay: 1,
customButtons: {
refresh_cal: {
text: 'Refresh'
},
planning_cal: {
text: 'Planning'
}
},
header: {
left: 'agendaDay, agendaWeek, month',
center: 'title',
right: 'prev, today, next'
right: 'refresh_cal,prev, today, next , planning_cal'
},
themeButtonIcons: {
today: ' mdi mdi-calendar-today',
month: ' mdi mdi-view-module',
agendaWeek: ' mdi mdi-view-week',
agendaDay: ' mdi mdi-view-day',
prev: ' mdi mdi-chevron-left',
next: ' mdi mdi-chevron-right'
next: ' mdi mdi-chevron-right',
refresh_cal: ' mdi mdi-refresh',
planning_cal: ' mdi mdi-view-list'
},
handleWindowResize: false,
views: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const _ = require('lodash');
$window,
usSpinnerService,
calCachedEventSource,
calendarSidebarService,
calendarCurrentView,
calendarEventSource,
calendarService,
Expand Down Expand Up @@ -95,6 +96,9 @@ const _ = require('lodash');
$scope.uiConfig.calendar.select = select;
$scope.uiConfig.calendar.loading = loading;
$scope.uiConfig.calendar.nextDayThreshold = '00:00';
$scope.uiConfig.calendar.customButtons.refresh_cal.click = refreshCalendar;
$scope.uiConfig.calendar.customButtons.planning_cal.click = showPlanning;

$scope.calendarReady = calendarDeffered.resolve.bind(calendarDeffered);

var rootScopeListeners = [
Expand Down Expand Up @@ -143,6 +147,28 @@ const _ = require('lodash');

windowJQuery.resize($scope.resizeCalendarHeight);
$window.addEventListener('beforeunload', gracePeriodService.flushAllTasks);
toggleSideMenuEvent();
}

function refreshCalendar() {
calCachedEventSource.resetCache();
$rootScope.$broadcast(CAL_EVENTS.CALENDAR_REFRESH);
}

function showPlanning() {
if ($state.includes('calendar.main.planning')) {
$state.go('calendar.main');
} else {
$state.go('calendar.main.planning');
}
}

function toggleSideMenuEvent() {
$rootScope.$on('toggleSideMenu', function() {
const sidebarVisibility = calendarSidebarService.getSidebarVisibility();

calendarSidebarService.setSidebarVisibility(!sidebarVisibility);
});
}

function render(event, element, view) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

/* global chai */
/* global chai,sinon */

var expect = chai.expect;

Expand Down Expand Up @@ -34,7 +34,12 @@ describe('calendarView directive', function() {
this.$scope = this.$rootScope.$new();
this.elementScrollService = _elementScrollService_;
this.$scope.uiConfig = {
calendar: {}
calendar: {
customButtons: {
refresh_cal: sinon.spy(),
planning_cal: sinon.spy()
}
}
};

this.initDirective = function(scope) {
Expand Down
11 changes: 10 additions & 1 deletion src/linagora.esn.calendar/app/commons.less
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@spaceNeededForSubheader: 50px;
@spaceNeededForSubheader: 0;
@calendarLeftPaneWidth: 270px;
@calendarRightPaneWidth: 285px;
@scrollbarWidth: 15px;
Expand Down Expand Up @@ -33,3 +33,12 @@
background-color: @darkenBgColor;
}
}

#sub-header{
display : none !important
}
@media (max-width: @screen-sm-min) {
#sub-header{
display : flex !important
}
}
6 changes: 3 additions & 3 deletions src/linagora.esn.calendar/app/sidebar/sidebar.less
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@

@media (min-width: @screen-md-min) {
.calendar-sidebar {
top: ~"calc(@{header-height-md} + @{sub-header-height-md})";
top: ~"calc(@{header-height-md})";
}
}

@media (min-width: @screen-xl-min) {
.calendar-sidebar {
top: ~"calc(@{header-height-xl} + @{sub-header-height-xl})";
top: ~"calc(@{header-height-xl})";
}
}
}