Skip to content

Commit

Permalink
Merge branch 'develop' into bugfix/MARP-1016-reduntdant-api-called
Browse files Browse the repository at this point in the history
  • Loading branch information
ntqdinh-axonivy committed Sep 9, 2024
2 parents ad5f619 + a1e6514 commit 8e3b6ee
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 1 deletion.
28 changes: 28 additions & 0 deletions marketplace-build/config/nginx/dev/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
events {}

http {
include /etc/nginx/mime.types;

server {
listen 80;
server_name marketplace;

root /usr/share/nginx/html;
index index.html;

location / {
try_files $uri $uri/ /index.html;
}

location /marketplace-service {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://service:8080/marketplace-service;
proxy_ssl_session_reuse off;
proxy_set_header Host $http_host;
proxy_cache_bypass $http_upgrade;
proxy_redirect off;
}
}
}
2 changes: 1 addition & 1 deletion marketplace-build/dev/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ services:
- BUILD_ENV=${BUILD_ENV}
restart: always
volumes:
- ../../marketplace-build/config/nginx/nginx.conf:/etc/nginx/nginx.conf
- ../../marketplace-build/config/nginx/dev/nginx.conf:/etc/nginx/nginx.conf
ports:
- "4200:80"
depends_on:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
}

.dropdown-menu {
max-height: 27.5rem;
overflow: auto;
@media (max-width: 990px) {
max-height: 13.75rem;
}

.dropdown-item {
&.active {
background-color: var(--ivy-textarea-background-color);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
import { CommonDropdownComponent } from './common-dropdown.component';
import { By } from '@angular/platform-browser';
import { TranslateModule, TranslateService } from '@ngx-translate/core';
import { Viewport } from 'karma-viewport/dist/adapter/viewport';
import { ItemDropdown } from '../../models/item-dropdown.model';
import { ElementRef } from '@angular/core';

declare const viewport: Viewport;
describe('CommonDropdownComponent', () => {
let component: CommonDropdownComponent<string>;
let fixture: ComponentFixture<CommonDropdownComponent<string>>;
Expand Down Expand Up @@ -87,4 +89,34 @@ describe('CommonDropdownComponent', () => {
expect(result).toBeTrue();
expect(translateService.instant).toHaveBeenCalledWith('originalLabel');
});

it('should apply scrollbar when dropdown is opened and items overflow', () => {
viewport.set(1920);

component.isDropdownOpen = true;
fixture.detectChanges();

const dropdownMenu = fixture.debugElement.query(By.css('.dropdown-menu')).nativeElement;

const maxHeight = getComputedStyle(dropdownMenu).maxHeight;
const overflow = getComputedStyle(dropdownMenu).overflow;

expect(maxHeight).toBe('440px');
expect(overflow).toBe('auto');
});

it('should apply scrollbar when dropdown is opened in smaller screen', () => {
viewport.set(430);

component.isDropdownOpen = true;
fixture.detectChanges();

const dropdownMenu = fixture.debugElement.query(By.css('.dropdown-menu')).nativeElement;

const maxHeight = getComputedStyle(dropdownMenu).maxHeight;
const overflow = getComputedStyle(dropdownMenu).overflow;

expect(maxHeight).toBe('220px');
expect(overflow).toBe('auto');
});
});

0 comments on commit 8e3b6ee

Please sign in to comment.