Skip to content

Commit

Permalink
Merge branch 'dtq-dev' into ufal/item-view-page-detailing
Browse files Browse the repository at this point in the history
  • Loading branch information
milanmajchrak authored Mar 6, 2024
2 parents 2802841 + 8b4974f commit d9f8393
Show file tree
Hide file tree
Showing 35 changed files with 219 additions and 55 deletions.
5 changes: 3 additions & 2 deletions .github/actions/erase-db/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ runs:
env:
NAME: ${{ inputs.NAME }}
run: |
# # condition below was found by accident and appears to be useless. Investigate later.
# be sure to have INSTANCE set
if [[ "x${NAME}" != "dspace-" ]]; then
# if [[ "x${NAME}" != "dspace-" ]]; then
docker volume rm $(docker volume ls --filter name="${NAME}_" -q) || true
fi;
# fi;
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ jobs:
# The ci step will test the dspace-angular code against DSpace REST.
# Direct that step to utilize a DSpace REST service that has been started in docker.
# Spin up UI on 127.0.0.1 to avoid host resolution issues in e2e tests with Node 18+
INSTANCE: '2'
DSPACE_CI_IMAGE: 'dataquest/dspace:dspace-7_x-test'
DSPACE_SOLR_IMAGE: dataquest/dspace-solr:dspace-7_x
DSPACE_REST_HOST: 127.0.0.1
DSPACE_REST_PORT: 8080
DSPACE_REST_NAMESPACE: '/server'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
deploy-5:
if: inputs.INSTANCE == '*' || inputs.INSTANCE == '5'
runs-on: dspace-dep-1
timeout-minutes: 5
timeout-minutes: 10
env:
INSTANCE: '5'
ENVFILE: /opt/dspace-envs/.env.dspace.dev-5
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ jobs:
deploy:
needs: dspace-angular
uses: dataquest-dev/dspace-angular/.github/workflows/deploy.yml@dtq-dev
if: ${{ github.event_name != 'pull_request' }}
with:
INSTANCE: '5'
IMPORT: false
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/tag-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Release

on:
push:
tags:
- '**'

env:
IMAGE_BASE_NAME: dataquest/dspace-angular

jobs:
retag-FE-image:
runs-on: ubuntu-latest
steps:
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}

- name: retag image
run: |
docker pull ${{ env.IMAGE_BASE_NAME }}:${{ github.sha }}
docker tag ${{ env.IMAGE_BASE_NAME }}:${{ github.sha }} ${{ env.IMAGE_BASE_NAME }}:${{ github.ref_name }}
- name: push image
run: docker push ${{ env.IMAGE_BASE_NAME }}:${{ github.ref_name }}

6 changes: 0 additions & 6 deletions docker/cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,3 @@ volumes:

networks:
dspacenet:
ipam:
config:
# Define a custom subnet for our DSpace network, so that we can easily trust requests from host to container.
# If you customize this value, be sure to customize the 'proxies.trusted.ipranges' env variable below.
- subnet: 172.23.0.0/16

5 changes: 2 additions & 3 deletions docker/docker-compose-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ services:
# This SQL is available from https://github.com/DSpace-Labs/AIP-Files/releases/tag/demo-entities-data
LOADSQL: https://github.com/dataquest-dev/DSpace/releases/download/data/dspace-test-database-dump_29.1.2024.sql
PGDATA: /pgdata
image: dspace/dspace-postgres-pgcrypto:loadsql
image: ${DSPACE_DB_IMAGE:-dspace/dspace-postgres-pgcrypto:loadsql}
networks:
dspacenet:
stdin_open: true
Expand All @@ -79,8 +79,7 @@ services:
# DSpace Solr container
dspacesolr:
container_name: dspacesolr
# Uses official Solr image at https://hub.docker.com/_/solr/
image: solr:8.11
image: ${DSPACE_SOLR_IMAGE:-dataquest/dspace-solr:dspace-7_x}
# Needs main 'dspace' container to start first to guarantee access to solr_configs
depends_on:
- dspace
Expand Down
3 changes: 3 additions & 0 deletions docker/docker-compose-rest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ services:
db__P__url: 'jdbc:postgresql://dspacedb:543${INSTANCE}/dspace'
# solr.server: Ensure we are using the 'dspacesolr' image for Solr
solr__P__server: http://dspacesolr:898${INSTANCE}/solr
# proxies.trusted.ipranges: This setting is required for a REST API running in Docker to trust requests
# from the host machine. This IP range MUST correspond to the 'dspacenet' subnet defined above.
proxies__P__trusted__P__ipranges: '172.2${INSTANCE}.0'
#S3 config
assetstore__P__index__P__primary: ${S3_STORAGE:-0}
assetstore__P__s3__P__enabled: ${S3_ENABLED:-false}
Expand Down
27 changes: 21 additions & 6 deletions scripts/sourceversion.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
import subprocess
import sys
from datetime import datetime

# when next editing this script, please introduce argparse.
# do not forget, it is called in BE by .github\workflows\reusable-docker-build.yml
# argparse must be introduced there.
# that action also calls BE version of this script, which is different (BE: scripts/sourceversion.py).
# It must also cooperate with argparse

# the idea is, that this will be different on each branch, but could be possibly passed by argv/argparse
RELEASE_TAG_BASE='none'

if __name__ == '__main__':
ts = datetime.now()
print(f"timestamp: {ts}")
# we have html tags, since this script ends up creating VERSION_D.html
print(f"<h4>This info was generated on: <br> <strong> {ts} </strong> </h4>")

cmd = 'git log -1 --pretty=format:"%h - %ai"'
print(f">{cmd}")
cmd = 'git log -1 --pretty=format:"<h4>Git hash: <br><strong> %H </strong> <br> Date of commit: <br> <strong> %ai </strong></h4>"'
subprocess.check_call(cmd, shell=True)

cmd = 'git status --porcelain'
print(f">{cmd}:")
subprocess.check_call(cmd, shell=True)
# when adding argparse, this should be a bit more obvious
link = sys.argv[1] + sys.argv[2]
print('<br> <h4>Build run: </h4> <a href="' + link + '"> ' + link + '</a> ')

link = "https://github.com/dataquest-dev/dspace-angular/releases/tag/" \
+ RELEASE_TAG_BASE + "-" + datetime.now().strftime('%Y.%m.') + sys.argv[2]

print('<br> <br> <h4>Release link: </h4><a href="' + link + '"> ' + link + '</a> (if it does not work, then this is not an official release instance) ')
2 changes: 1 addition & 1 deletion src/aai/discojuice/discojuice.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 31 additions & 10 deletions src/app/home-page/home-page.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,38 +47,56 @@ <h5 class="h5-font carousel-deposit-cite">{{'home-page.carousel.deposit.cite' |
</div>
<div class="container clarin-home-page-color pt-4 pb-5">
<div class="row justify-content-center pt-4">
<div class="input-group input-group-lg col-md-6 col-md-offset-3">
<span class="input-group-addon">
<div class="col-6 d-flex justify-content-center">
<span class="flex-fill input-group-addon">
<i style="color: #7479B8;" class="fas fa-search fa-lg"></i>
</span>
<input type="text" class="form-control" name="query" #searchValue>
<button class="btn btn-repository" (click)="redirectToSearch(searchValue.value)">{{'home-page.search' | translate}}
</button>
<ds-themed-search-form id="search-form"
class="flex-fill"
[currentUrl]="searchLink"
[inPlaceSearch]="false"
[searchPlaceholder]="'home-page.search' | translate">
</ds-themed-search-form>
</div>
</div>
<div class="row justify-content-center pt-3">
<a href="javascript:void(0);" (click)="redirectToSearch('')">{{'home-page.advanced-search' | translate}}</a>
</div>
<div class="row justify-content-center pt-5">
<div class="col-md-9">
<div class="row">
<div class="offset-md-1 col-md-3 border-bottom">
<div class="row offset-md-1">
<div class="col-md-4 border-bottom">
<strong>{{'home-page.hyperlink.author.message' | translate}}</strong>
<div *ngFor="let authorLink of (authors$| async); let i = index">
<span><a [href]="authorLink.url">{{ authorLink.name }} ({{ authorLink.occurrences }})</a></span>
</div>
<div>
<a href="javascript:void(0);" (click)="redirectToBrowseByField('author')">
{{ 'home-page.hyperlink.view-more.message' | translate }}
</a>
</div>
</div>
<div class="col-md-3 mx-3 border-bottom">
<div class="col-md-4 border-bottom">
<strong>{{'home-page.hyperlink.subject.message' | translate}}</strong>
<div *ngFor="let subjectLink of (subjects$| async); let i = index">
<span><a [href]="subjectLink.url">{{ subjectLink.name }} ({{ subjectLink.occurrences }})</a></span>
</div>
<div>
<a href="javascript:void(0);" (click)="redirectToBrowseByField('subject')">
{{ 'home-page.hyperlink.view-more.message' | translate }}
</a>
</div>
</div>
<div class="col-md-3 px-3 border-bottom">
<div class="col-md-4 border-bottom">
<strong>{{'home-page.hyperlink.language.message' | translate}}</strong>
<div *ngFor="let languageLink of (languages$| async); let i = index">
<span><a [href]="languageLink.url">{{ languageLink.name }} ({{ languageLink.occurrences }})</a></span>
</div>
<div>
<a href="javascript:void(0);" (click)="redirectToBrowseByField('language')">
{{ 'home-page.hyperlink.view-more.message' | translate }}
</a>
</div>
</div>
</div>
</div>
Expand All @@ -88,7 +106,10 @@ <h5 class="h5-font carousel-deposit-cite">{{'home-page.carousel.deposit.cite' |
<div class="container pt-3">
<div class="card clarin-home-page-items-color">
<div class="card-body">
<div class="recent-submissions-head">{{'home-page.whats-new.message' | translate}}</div>
<div class="justify-content-between d-flex">
<div class="recent-submissions-head flex-fill">{{'home-page.whats-new.message' | translate}}</div>
<ds-rss class="ml-1 override-css"></ds-rss>
</div>
<ds-clarin-item-box-view
*ngFor="let newItem of (newItems$ | async)"
[object]="newItem"></ds-clarin-item-box-view>
Expand Down
7 changes: 2 additions & 5 deletions src/app/home-page/home-page.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
background-color: #eee;
border: 1px solid #ccc;
border-right: 0px;
max-width: fit-content;
}

.btn-repository {
Expand Down Expand Up @@ -152,11 +153,6 @@
margin-top: -10px;
}






@media (max-width: 991.98px) {
.carousel-ldata-info {
left: 42%;
Expand Down Expand Up @@ -188,4 +184,5 @@
width: 100%;
}
}

}
11 changes: 11 additions & 0 deletions src/app/home-page/home-page.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ export class HomePageComponent implements OnInit {

baseUrl = '';

/**
* Link to the search page
*/
searchLink: string;

constructor(
private route: ActivatedRoute, config: NgbCarouselConfig,
protected searchService: SearchService,
Expand Down Expand Up @@ -90,6 +95,8 @@ export class HomePageComponent implements OnInit {
// Load the most viewed Items and the new Items
this.loadTopItems();
this.loadNewItems();

this.searchLink = this.searchService.getSearchLink();
}

/**
Expand Down Expand Up @@ -253,6 +260,10 @@ export class HomePageComponent implements OnInit {
redirectToSearch(searchValue) {
this.router.navigateByUrl('/search?query=' + searchValue);
}

redirectToBrowseByField(field) {
this.router.navigateByUrl('/browse/' + field);
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
<div>
<div *ngIf="itemAuthors.value.length <= 5" class="item-author-wrapper pb-1">
<span *ngFor="let author of (itemAuthors | async); let i = index">
<span *ngIf="i > 0 && i < itemAuthors.value.length -1"> ; </span>
<span *ngIf="i == itemAuthors.value.length -1 && itemAuthors.value.length > 1"> and </span>
<span *ngIf="i > 0 && i < itemAuthors.value.length -1">; </span>
<span *ngIf="i == itemAuthors.value.length -1 && itemAuthors.value.length > 1">
{{'item.view.box.author.preview.and' | translate}}
</span>
<a [href]="author.url" class="item-author">{{ author.name }}</a>
</span>
</div>
<div *ngIf="itemAuthors.value.length > 5">
<div *ngFor="let author of (itemAuthors | async); let i = index">
<span *ngIf="i == 0" ><a [href]="author.url" class="item-author">{{ author.name }}</a> ; et al.</span>
<span *ngIf="i == 0" ><a [href]="author.url" class="item-author">{{ author.name }}</a>; et al.</span>
</div>
<div class="item-author-wrapper">
<span (click)="toggleShowEveryAuthor()" class="clarin-font-size cursor-pointer">
<i [hidden]="showEveryAuthor | async" class="fas fa-caret-right"></i>
<i [hidden]="!(showEveryAuthor | async)" class="fas fa-caret-down"></i>
Show everyone
{{'item.view.box.author.preview.show-everyone' | translate}}
</span>

<div [hidden]="!(showEveryAuthor | async)">
<span *ngFor="let author of (itemAuthors | async); let i = index">
<span *ngIf="i > 1 && i < itemAuthors.value.length -1"> ; </span>
<span *ngIf="i == itemAuthors.value.length -1"> and </span>
<span *ngIf="i > 1 && i < itemAuthors.value.length -1">; </span>
<span *ngIf="i == itemAuthors.value.length -1">
{{'item.view.box.author.preview.and' | translate}}
</span>
<a *ngIf="i > 0" [href]="author.url" class="item-author">{{author.name}}</a>
</span>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,27 @@
</div>
<div class="pl-3">
<div class="row pt-3 justify-content-between">
<div class="">
<div class="col-10 pl-0">
<div><a [routerLink]="itemUri" class="item-name">{{ itemName }}</a></div>
<div class="pt-1"><strong>{{'item.view.box.author.message' | translate}}</strong></div>
</div>
<div>
<img class="artifact-icon" src="assets/images/corpus.png">
<div class="col-2">
<img class="artifact-icon"
[src]="ITEM_TYPE_IMAGES_PATH + itemType + '.png'"
(error)="handleImageError($event)">
</div>
</div>
<div class="row">
<ds-clarin-item-author-preview [item]="item"></ds-clarin-item-author-preview>
</div>
<div class="row d-block pt-1">
<div><strong>Description:</strong></div>
<div><strong>{{'item.view.box.description.message' | translate}}</strong></div>
<div class="clarin-item-description pr-3">{{itemDescription}}</div>
</div>
<div class="row d-flex pt-1">
<div class="label label-info label-icon"><i class="fas fa-paperclip fa-sm"></i></div>
<div *ngIf="(itemCountOfFiles | async) !== -1" class="label label-info"> {{'item.view.box.files.message.0' | translate}} {{ (itemCountOfFiles | async) }} {{'item.view.box.files.message.1' | translate}} ({{(itemFilesSizeBytes | async) | dsFileSize }}). </div>
<div *ngIf="hasMoreFiles()" class="label label-info"> {{'item.view.box.files.message.0' | translate}} {{ (itemCountOfFiles | async) }} {{'item.view.box.files.message.1' | translate}} ({{(itemFilesSizeBytes | async) | dsFileSize }}). </div>
<div *ngIf="(itemCountOfFiles | async) === 1" class="label label-info"> {{'item.view.box.one.file.message' | translate}} ({{(itemFilesSizeBytes | async) | dsFileSize }}). </div>
<div *ngIf="(itemCountOfFiles | async) === -1" class="label label-info"> {{'item.view.box.no-files.message' | translate}}</div>
</div>
</div>
Expand All @@ -38,9 +41,7 @@
<img [ngClass]="{'clarin-license-icon-mr':licenseLabelIcons.value.length > 1}" [src]="secureImageData(icon)" alt="" width="16px">
</div>
</div>

</div>
</div>
</div>

</div>
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

.artifact-icon {
position: absolute;
right: 2%;
right: 7%;
width: 60px;
}

Expand Down Expand Up @@ -79,7 +79,6 @@

.item-name {
color: #428bca;
text-decoration: none;
}

.item-author {
Expand Down
Loading

0 comments on commit d9f8393

Please sign in to comment.