Browse Source

fix(admin-ui): Add links according to Unsplash guidelines (#1911)

David Höck 3 years ago
parent
commit
e703304b71

+ 1 - 1
packages/admin-ui/src/lib/login/src/components/login/login.component.html

@@ -6,7 +6,7 @@
                     {{ 'common.login-image-title' | translate }}
                 </div>
                 <div class="login-wrapper-image-copyright">
-                    <p *ngIf="imageCreator" class="creator">Photo by  {{ imageCreator }} on Unsplash</p>
+                    <p *ngIf="imageCreator" class="creator">Photo by  <a [href]="imageCreatorUrl" target="_blank">{{ imageCreator }}</a> on <a [href]="imageUnsplashUrl" target="_blank">Unsplash</a></p>
                     <p *ngIf="imageLocation" class="location">{{ imageLocation }}</p>
                 </div>
             </div>

+ 5 - 0
packages/admin-ui/src/lib/login/src/components/login/login.component.scss

@@ -78,6 +78,11 @@
                         color: white;
                         margin: 0 !important;
                     }
+                    
+                    a{
+                        color: white;
+                        text-decoration: underline;
+                    }
                 }
             }
         }

+ 6 - 2
packages/admin-ui/src/lib/login/src/components/login/login.component.ts

@@ -19,8 +19,10 @@ export class LoginComponent {
     hideVersion = getAppConfig().hideVersion;
     customImageUrl = getAppConfig().loginImage;
     imageUrl = '';
+    imageUnsplashUrl = '';
     imageLocation = '';
     imageCreator = '';
+    imageCreatorUrl = '';
 
     constructor(private authService: AuthService, private router: Router, private httpClient: HttpClient) {
         if (this.customImageUrl) {
@@ -55,13 +57,15 @@ export class LoginComponent {
             });
     }
 
-    updateImage(res) {
+    updateImage(res: any) {
         const user: any = (res as any).user;
         const location: any = (res as any).location;
 
-        this.imageUrl = (res as any).urls.regular;
+        this.imageUrl = res.urls.regular;
         this.imageCreator = user.name;
         this.imageLocation = location.name;
+        this.imageCreatorUrl = user.links.html;
+        this.imageUnsplashUrl = res.links.html;
     }
 
     /**