Skip to content

Commit 2aa786b

Browse files
authored
chore(ui): don't display push instructions for non vendors (#788)
Signed-off-by: Philip Miglinci <[email protected]>
1 parent 2033559 commit 2aa786b

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

frontend/ui/src/app/artifacts/artifacts/artifacts.component.html

+10-2
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
>
1515
and log in to the registry from your machine:
1616
<code class="mt-1 select-all block text-sm text-gray-900 dark:text-gray-200 whitespace-pre-line">
17-
echo "your-personal-access-token-here" | docker login {{ host }} --password-stdin -u -
17+
echo "YOUR-ACCESS-TOKEN" | docker login {{ host }} --password-stdin -u -
1818
</code>
1919
</div>
20-
<div class="font-medium mt-1">
20+
<div class="font-medium mt-1" *appRequiredRole="'vendor'">
2121
Then you can start tagging and pushing your images. For example, you can try the following commands to
2222
push your own
2323
<a
@@ -37,6 +37,14 @@
3737
docker push {{ host }}/{{ slug }}/hello-world:v1.0.0
3838
</code>
3939
</div>
40+
<div *appRequiredRole="'customer'">
41+
<div class="font-medium mt-1">
42+
After the login you can start pulling images from the registry. For example, you can try the following
43+
</div>
44+
<code class="mt-1 select-all block text-sm text-gray-900 dark:text-gray-200 whitespace-pre-line">
45+
docker pull {{ host }}/{{ slug }}/IMAGE:VERSION
46+
</code>
47+
</div>
4048
} @else {
4149
Your Distr Hub does not have the registry enabled. You can enable it by setting the corresponding
4250
environment variables of the Distr Hub.

frontend/ui/src/app/artifacts/artifacts/artifacts.component.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ import {Component, inject} from '@angular/core';
33
import {FormControl, FormGroup, ReactiveFormsModule} from '@angular/forms';
44
import {RouterLink} from '@angular/router';
55
import {FaIconComponent} from '@fortawesome/angular-fontawesome';
6-
import {faBox, faDownload, faLightbulb, faMagnifyingGlass} from '@fortawesome/free-solid-svg-icons';
6+
import {faBox, faLightbulb, faMagnifyingGlass} from '@fortawesome/free-solid-svg-icons';
77
import {combineLatest, map, startWith} from 'rxjs';
88
import {UuidComponent} from '../../components/uuid';
99
import {ArtifactsService} from '../../services/artifacts.service';
1010
import {ArtifactsDownloadCountComponent, ArtifactsDownloadedByComponent} from '../components';
11-
import {faDocker} from '@fortawesome/free-brands-svg-icons';
1211
import {AutotrimDirective} from '../../directives/autotrim.directive';
1312
import {getRemoteEnvironment} from '../../../env/remote';
1413
import {fromPromise} from 'rxjs/internal/observable/innerFrom';
1514
import {OrganizationService} from '../../services/organization.service';
15+
import {RequireRoleDirective} from '../../directives/required-role.directive';
1616

1717
@Component({
1818
selector: 'app-artifacts',
@@ -25,6 +25,7 @@ import {OrganizationService} from '../../services/organization.service';
2525
ArtifactsDownloadCountComponent,
2626
ArtifactsDownloadedByComponent,
2727
AutotrimDirective,
28+
RequireRoleDirective,
2829
],
2930
templateUrl: './artifacts.component.html',
3031
})
@@ -33,7 +34,6 @@ export class ArtifactsComponent {
3334

3435
protected readonly faMagnifyingGlass = faMagnifyingGlass;
3536
protected readonly faBox = faBox;
36-
protected readonly faDownload = faDownload;
3737

3838
protected readonly filterForm = new FormGroup({
3939
search: new FormControl(''),
@@ -48,7 +48,6 @@ export class ArtifactsComponent {
4848
artifacts.filter((it) => !formValue.search || it.name.toLowerCase().includes(formValue.search.toLowerCase()))
4949
)
5050
);
51-
protected readonly faDocker = faDocker;
5251
protected readonly faLightbulb = faLightbulb;
5352

5453
private readonly organizationService = inject(OrganizationService);

0 commit comments

Comments
 (0)