mirror of
https://github.com/goharbor/harbor.git
synced 2025-01-11 10:27:58 +01:00
Show banner message on log in page (#19078)
1. Fixes #19076 Signed-off-by: AllForNothing <sshijun@vmware.com>
This commit is contained in:
parent
1d81b3d8ad
commit
26b53ef343
@ -1,4 +1,5 @@
|
||||
<clr-main-container>
|
||||
<app-app-level-alerts></app-app-level-alerts>
|
||||
<navigator (showDialogModalAction)="openModal($event)"></navigator>
|
||||
<search-result></search-result>
|
||||
<div
|
||||
|
@ -22,7 +22,6 @@ import { PasswordSettingComponent } from './password-setting/password-setting.co
|
||||
import { AccountSettingsModalComponent } from './account-settings/account-settings-modal.component';
|
||||
import { ForgotPasswordComponent } from './password-setting/forgot-password/forgot-password.component';
|
||||
import { GlobalConfirmationDialogComponent } from './global-confirmation-dialog/global-confirmation-dialog.component';
|
||||
import { AppLevelAlertsComponent } from './harbor-shell/app-level-alerts/app-level-alerts.component';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
@ -173,7 +172,6 @@ const routes: Routes = [
|
||||
AccountSettingsModalComponent,
|
||||
ForgotPasswordComponent,
|
||||
GlobalConfirmationDialogComponent,
|
||||
AppLevelAlertsComponent,
|
||||
],
|
||||
})
|
||||
export class BaseModule {}
|
||||
|
@ -443,6 +443,7 @@
|
||||
min="{{ currentDate | date : 'yyyy-MM-dd' }}"
|
||||
max="{{ messageToDate | date : 'yyyy-MM-dd' }}"
|
||||
clrDate
|
||||
readonly
|
||||
[(ngModel)]="messageFromDate"
|
||||
[ngModelOptions]="{ standalone: true }"
|
||||
[disabled]="
|
||||
@ -463,6 +464,7 @@
|
||||
<input
|
||||
class="date"
|
||||
clrDate
|
||||
readonly
|
||||
type="date"
|
||||
id="to"
|
||||
min="{{ minDateForEndDay() | date : 'yyyy-MM-dd' }}"
|
||||
|
@ -1,10 +1,10 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { AppLevelAlertsComponent } from './app-level-alerts.component';
|
||||
import { SharedTestingModule } from '../../../shared/shared.module';
|
||||
import { SharedTestingModule } from '../../shared.module';
|
||||
import { HttpHeaders, HttpResponse } from '@angular/common/http';
|
||||
import { of } from 'rxjs';
|
||||
import { delay } from 'rxjs/operators';
|
||||
import { Scanner } from '../../left-side-nav/interrogation-services/scanner/scanner';
|
||||
import { Scanner } from '../../../base/left-side-nav/interrogation-services/scanner/scanner';
|
||||
import { ScannerService } from 'ng-swagger-gen/services/scanner.service';
|
||||
import { SessionService } from 'src/app/shared/services/session.service';
|
||||
import { AppConfigService } from '../../../services/app-config.service';
|
@ -1,24 +1,21 @@
|
||||
import { Component, OnDestroy, OnInit } from '@angular/core';
|
||||
import { SCANNERS_DOC } from '../../left-side-nav/interrogation-services/scanner/scanner';
|
||||
import { SessionService } from '../../../shared/services/session.service';
|
||||
import { DEFAULT_PAGE_SIZE, delUrlParam } from '../../../shared/units/utils';
|
||||
import { SCANNERS_DOC } from '../../../base/left-side-nav/interrogation-services/scanner/scanner';
|
||||
import { SessionService } from '../../services/session.service';
|
||||
import { DEFAULT_PAGE_SIZE, delUrlParam } from '../../units/utils';
|
||||
import { forkJoin, Observable, Subscription } from 'rxjs';
|
||||
import { Project } from '../../../../../ng-swagger-gen/models/project';
|
||||
import { ScannerService } from '../../../../../ng-swagger-gen/services/scanner.service';
|
||||
import { UN_LOGGED_PARAM } from '../../../account/sign-in/sign-in.service';
|
||||
import {
|
||||
CommonRoutes,
|
||||
httpStatusCode,
|
||||
} from '../../../shared/entities/shared.const';
|
||||
import { CommonRoutes, httpStatusCode } from '../../entities/shared.const';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { MessageService } from '../../../shared/components/global-message/message.service';
|
||||
import { Message } from '../../../shared/components/global-message/message';
|
||||
import { JobServiceDashboardHealthCheckService } from '../../left-side-nav/job-service-dashboard/job-service-dashboard-health-check.service';
|
||||
import { MessageService } from '../global-message/message.service';
|
||||
import { Message } from '../global-message/message';
|
||||
import { JobServiceDashboardHealthCheckService } from '../../../base/left-side-nav/job-service-dashboard/job-service-dashboard-health-check.service';
|
||||
import { AppConfigService } from '../../../services/app-config.service';
|
||||
import {
|
||||
BannerMessage,
|
||||
BannerMessageType,
|
||||
} from '../../left-side-nav/config/config';
|
||||
} from '../../../base/left-side-nav/config/config';
|
||||
const HAS_SHOWED_SCANNER_INFO: string = 'hasShowScannerInfo';
|
||||
const YES: string = 'yes';
|
||||
@Component({
|
||||
@ -191,13 +188,10 @@ export class AppLevelAlertsComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
hasValidBannerMessage(): boolean {
|
||||
if (
|
||||
this.appConfigService.getConfig()?.banner_message &&
|
||||
this.appConfigService.getConfig()?.current_time
|
||||
) {
|
||||
const current = new Date(
|
||||
this.appConfigService.getConfig()?.current_time
|
||||
);
|
||||
const current: Date = this.appConfigService.getConfig()?.current_time
|
||||
? new Date(this.appConfigService.getConfig()?.current_time)
|
||||
: new Date();
|
||||
if (this.appConfigService.getConfig()?.banner_message) {
|
||||
const bm = JSON.parse(
|
||||
this.appConfigService.getConfig()?.banner_message
|
||||
) as BannerMessage;
|
@ -78,6 +78,7 @@ import { LabelSelectorComponent } from './components/label-selector/label-select
|
||||
import { ScrollSectionDirective } from './directives/scroll/scroll-section.directive';
|
||||
import { ScrollManagerService } from './directives/scroll/scroll-manager.service';
|
||||
import { ScrollAnchorDirective } from './directives/scroll/scroll-anchor.directive';
|
||||
import { AppLevelAlertsComponent } from './components/app-level-alerts/app-level-alerts.component';
|
||||
|
||||
// ClarityIcons is publicly accessible from the browser's window object.
|
||||
declare const ClarityIcons: ClarityIconsApi;
|
||||
@ -147,6 +148,7 @@ ClarityIcons.add({
|
||||
HarborDatetimePipe,
|
||||
RemainingTimeComponent,
|
||||
LabelSelectorComponent,
|
||||
AppLevelAlertsComponent,
|
||||
],
|
||||
exports: [
|
||||
TranslateModule,
|
||||
@ -188,6 +190,7 @@ ClarityIcons.add({
|
||||
HarborDatetimePipe,
|
||||
RemainingTimeComponent,
|
||||
LabelSelectorComponent,
|
||||
AppLevelAlertsComponent,
|
||||
],
|
||||
providers: [
|
||||
{ provide: EndpointService, useClass: EndpointDefaultService },
|
||||
|
Loading…
Reference in New Issue
Block a user