Skip to content

Commit

Permalink
Merge pull request mvnpm#5127 from phillip-kruger/main
Browse files Browse the repository at this point in the history
Better screen clearing
  • Loading branch information
phillip-kruger authored Mar 6, 2024
2 parents 852a7d6 + 64b238e commit ba5ff9b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .locker/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.mvnpm</groupId>
<version>3.0.26-SNAPSHOT</version>
<version>3.0.27-SNAPSHOT</version>
<artifactId>mvnpm-locker</artifactId>
<packaging>pom</packaging>

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>io.mvnpm</groupId>
<artifactId>mvnpm</artifactId>
<version>3.0.26-SNAPSHOT</version>
<version>3.0.27-SNAPSHOT</version>
<name>mvnpm</name>
<description>Maven on NPM</description>
<url>https://mvnpm.org/</url>
Expand Down
34 changes: 22 additions & 12 deletions src/main/resources/web/app/mvnpm-home.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ interface Coordinates {
version: string;
}

const DEFAULT_COORDS = {
name: '',
version: '',
};

/**
* This component shows the Home screen
*
Expand Down Expand Up @@ -244,10 +239,18 @@ export class MvnpmHome extends LitElement {
.infoCard {
width: 100%;
}
.emptyScreen{
display: flex;
align-items: center;
height: 70%;
font-size: xxx-large;
opacity: 0.2;
}
`;

@state()
private _coordinates = DEFAULT_COORDS;
private _coordinates = {};
@state()
private _info = null;
@state()
Expand Down Expand Up @@ -342,10 +345,12 @@ export class MvnpmHome extends LitElement {
}

_renderMiddlePane(){
if(this._coordinates.version) {
if(this._coordinates && this._coordinates.version) {
return this._renderTabPane();
} else if(this._searchResults){
return this._renderSearchResults();
} else {
return html`<div class="emptyScreen">mvnpm - a maven repository for npm registry</div>`;
}
}

Expand Down Expand Up @@ -631,9 +636,10 @@ export class MvnpmHome extends LitElement {
}

_findVersionsAndShowLatest(e){
const name = this._coordinates.name.trim();
if ((e.which == 13 || e.which == 0)){
this._showGA(name);
this._showGA(this._coordinates.name.trim());
}else{

}
}

Expand Down Expand Up @@ -837,7 +843,6 @@ export class MvnpmHome extends LitElement {
}

_clearCoordinates(){
this._coordinates = DEFAULT_COORDS;
this._info = null;
this._baseUrl = null;
this._baseFile = null;
Expand All @@ -850,11 +855,16 @@ export class MvnpmHome extends LitElement {
this._loadingIcon = "hidden";
this._searchResults = null;
this._disabled = "disabled";
this._coordinates = {};
}

_coordinatesNameChanged(e){
this._coordinates.name = e.target.value;
this._disabled = "disabled";
if(e.target.value.trim() === ''){
this._clearCoordinates();
}else{
this._coordinates.name = e.target.value;
this._disabled = "disabled";
}
}

_versionChanged(e){
Expand Down

0 comments on commit ba5ff9b

Please sign in to comment.