diff --git a/src/app/cdk/platform-info/browserlist.regexp.ts b/src/app/cdk/platform-info/browserlist.regexp.ts index dd011b22dc..954be17405 100644 --- a/src/app/cdk/platform-info/browserlist.regexp.ts +++ b/src/app/cdk/platform-info/browserlist.regexp.ts @@ -1,3 +1,2 @@ // tslint:disable-next-line: max-line-length -export const BROWSERLIST_REGEXP = - /((CPU[ +]OS|iPhone[ +]OS|CPU[ +]iPhone|CPU IPhone OS)[ +]+(13[_.]4|13[_.]([5-9]|\d{2,})|13[_.]7|13[_.]([8-9]|\d{2,})|(1[4-9]|[2-9]\d|\d{3,})[_.]\d+|14[_.]0|14[_.]([1-9]|\d{2,})|14[_.]4|14[_.]([5-9]|\d{2,})|14[_.]8|14[_.](9|\d{2,})|(1[5-9]|[2-9]\d|\d{3,})[_.]\d+|15[_.]0|15[_.]([1-9]|\d{2,})|(1[6-9]|[2-9]\d|\d{3,})[_.]\d+|16[_.]0|16[_.]([1-9]|\d{2,})|(1[7-9]|[2-9]\d|\d{3,})[_.]\d+)(?:[_.]\d+)?)|((?:Chrome).*OPR\/(74|(7[5-9]|[8-9]\d|\d{3,}))\.\d+\.\d+)|(Edge\/(80|(8[1-9]|9\d|\d{3,})|83|(8[4-9]|9\d|\d{3,}))(?:\.\d+)?)|((Chromium|Chrome)\/(80|(8[1-9]|9\d|\d{3,})|83|(8[4-9]|9\d|\d{3,}))\.\d+(?:\.\d+)?)|(Version\/(13\.1|13\.([2-9]|\d{2,})|(1[4-9]|[2-9]\d|\d{3,})\.\d+|14\.0|14\.([1-9]|\d{2,})|(1[5-9]|[2-9]\d|\d{3,})\.\d+|15\.0|15\.([1-9]|\d{2,})|(1[6-9]|[2-9]\d|\d{3,})\.\d+|16\.0|16\.([1-9]|\d{2,})|(1[7-9]|[2-9]\d|\d{3,})\.\d+)(?:\.\d+)? Safari\/)|(Firefox\/(78|(79|[8-9]\d|\d{3,}))\.\d+\.\d+)|(Firefox\/(78|(79|[8-9]\d|\d{3,}))\.\d+(pre|[ab]\d+[a-z]*)?)/ +export const BROWSERLIST_REGEXP = /((CPU[ +]OS|iPhone[ +]OS|CPU[ +]iPhone|CPU IPhone OS)[ +]+(13[_.]4|13[_.]([5-9]|\d{2,})|13[_.]7|13[_.]([8-9]|\d{2,})|(1[4-9]|[2-9]\d|\d{3,})[_.]\d+|14[_.]0|14[_.]([1-9]|\d{2,})|14[_.]4|14[_.]([5-9]|\d{2,})|14[_.]8|14[_.](9|\d{2,})|(1[5-9]|[2-9]\d|\d{3,})[_.]\d+|15[_.]0|15[_.]([1-9]|\d{2,})|(1[6-9]|[2-9]\d|\d{3,})[_.]\d+|16[_.]0|16[_.]([1-9]|\d{2,})|(1[7-9]|[2-9]\d|\d{3,})[_.]\d+)(?:[_.]\d+)?)|((?:Chrome).*OPR\/(74|(7[5-9]|[8-9]\d|\d{3,}))\.\d+\.\d+)|(Edge\/(80|(8[1-9]|9\d|\d{3,})|83|(8[4-9]|9\d|\d{3,}))(?:\.\d+)?)|((Chromium|Chrome)\/(80|(8[1-9]|9\d|\d{3,})|83|(8[4-9]|9\d|\d{3,}))\.\d+(?:\.\d+)?)|(Version\/(13\.1|13\.([2-9]|\d{2,})|(1[4-9]|[2-9]\d|\d{3,})\.\d+|14\.0|14\.([1-9]|\d{2,})|(1[5-9]|[2-9]\d|\d{3,})\.\d+|15\.0|15\.([1-9]|\d{2,})|(1[6-9]|[2-9]\d|\d{3,})\.\d+|16\.0|16\.([1-9]|\d{2,})|(1[7-9]|[2-9]\d|\d{3,})\.\d+)(?:\.\d+)? Safari\/)|(Firefox\/(78|(79|[8-9]\d|\d{3,}))\.\d+\.\d+)|(Firefox\/(78|(79|[8-9]\d|\d{3,}))\.\d+(pre|[ab]\d+[a-z]*)?)/ diff --git a/src/app/developer-tools/components/code-panel/code-panel.component.ts b/src/app/developer-tools/components/code-panel/code-panel.component.ts index a35b8f1ecd..3122b69e59 100644 --- a/src/app/developer-tools/components/code-panel/code-panel.component.ts +++ b/src/app/developer-tools/components/code-panel/code-panel.component.ts @@ -11,7 +11,7 @@ import { Component, Input, OnInit } from '@angular/core' export class CodePanelComponent implements OnInit { collapseAriaLabel = $localize`:@@developerTools.collapse:Collapse` expandAriaLabel = $localize`:@@developerTools.expand:Expand` - exampleCodeAriaLabel = $localize`:@@developerTools.exampleCode:example code` + exampleCodeAriaLabel = $localize`:@@developerTools.exampleCode2:example code` openState = false @Input() title: string diff --git a/src/app/developer-tools/pages/developer-tools/developer-tools.component.html b/src/app/developer-tools/pages/developer-tools/developer-tools.component.html index 76ce022153..b6c1322401 100644 --- a/src/app/developer-tools/pages/developer-tools/developer-tools.component.html +++ b/src/app/developer-tools/pages/developer-tools/developer-tools.component.html @@ -11,10 +11,10 @@ Developer tools Back to my record @@ -85,7 +85,11 @@ >Application name - + - - +
>delete - - +
+
access token and an authenticated ORCID iD.

- Ednpoint + Endpoint

{{ baseURL }}/oauth/authorize

Scope @@ -368,7 +373,7 @@

be used to read public information on the record.

- Ednpoint + Endpoint

{{ baseURL }}/oauth/token

>

- Ednpoint + Endpoint

{{ baseURL }}/oauth/token

Scope @@ -456,9 +461,10 @@

id="cy-register-for-public-api" (click)="save()" [disabled]="form.pristine" - class="save-button" + class="save-button mat-button-wrap-text" > diff --git a/src/app/developer-tools/pages/developer-tools/developer-tools.component.scss b/src/app/developer-tools/pages/developer-tools/developer-tools.component.scss index 032682f464..6cc8a6bf49 100644 --- a/src/app/developer-tools/pages/developer-tools/developer-tools.component.scss +++ b/src/app/developer-tools/pages/developer-tools/developer-tools.component.scss @@ -150,6 +150,7 @@ app-client-secret { .save-button { margin-top: 32px; + margin-bottom: 32px; } .save-message { @@ -158,3 +159,30 @@ app-client-secret { margin-top: 32px; margin-bottom: 0; } + + +.input-container { + display: flex; + flex-direction: column; + width: 100%; + + .input-group { + display: flex; + flex-direction: row; + + .mat-icon-button { + top: -5px; + } + } + + +} + + +.columns-8 :host, +.columns-4 :host { + .title-container { + flex-direction: column; + align-items: flex-start; + } +} \ No newline at end of file diff --git a/src/app/developer-tools/pages/developer-tools/developer-tools.component.spec.ts b/src/app/developer-tools/pages/developer-tools/developer-tools.component.spec.ts index 1d81c9c163..52ce3e00aa 100644 --- a/src/app/developer-tools/pages/developer-tools/developer-tools.component.spec.ts +++ b/src/app/developer-tools/pages/developer-tools/developer-tools.component.spec.ts @@ -9,6 +9,7 @@ import { UserInfoService } from 'src/app/core/user-info/user-info.service' import { of } from 'rxjs' import { WINDOW_PROVIDERS } from 'src/app/cdk/window' import { DeveloperToolsComponent } from './developer-tools.component' +import { PlatformInfoService } from 'src/app/cdk/platform-info' describe('DeveloperToolsComponent', () => { let component: DeveloperToolsComponent @@ -19,6 +20,10 @@ describe('DeveloperToolsComponent', () => { declarations: [DeveloperToolsComponent], providers: [ WINDOW_PROVIDERS, + { + provide: PlatformInfoService, + useValue: { get: () => of({}) }, + }, { provide: FormBuilder, useValue: {}, diff --git a/src/app/developer-tools/pages/developer-tools/developer-tools.component.ts b/src/app/developer-tools/pages/developer-tools/developer-tools.component.ts index 9432eb5f9f..16cdaf6a94 100644 --- a/src/app/developer-tools/pages/developer-tools/developer-tools.component.ts +++ b/src/app/developer-tools/pages/developer-tools/developer-tools.component.ts @@ -34,6 +34,7 @@ import { RecordService } from 'src/app/core/record/record.service' import { MatInput } from '@angular/material/input' import { environment } from 'src/environments/environment' import { WINDOW } from 'src/app/cdk/window' +import { PlatformInfoService } from 'src/app/cdk/platform-info' @Component({ selector: 'app-developer-tools', @@ -63,6 +64,8 @@ export class DeveloperToolsComponent implements OnInit, OnDestroy { sucessSave: boolean loadingUserDevTolsState: boolean baseURL: string + isMobile: boolean + @ViewChild('firstInput') firstInput: ElementRef constructor( @@ -72,7 +75,8 @@ export class DeveloperToolsComponent implements OnInit, OnDestroy { private matDialog: MatDialog, private recordService: RecordService, private _changeDetectorRef: ChangeDetectorRef, - @Inject(WINDOW) private window: Window + @Inject(WINDOW) private window: Window, + private _platform: PlatformInfoService ) {} ngOnDestroy(): void { this.destroy$.next(true) @@ -80,6 +84,13 @@ export class DeveloperToolsComponent implements OnInit, OnDestroy { } ngOnInit(): void { + this._platform + .get() + .pipe(takeUntil(this.destroy$)) + .subscribe((platform) => { + this.isMobile = platform.columns4 || platform.columns8 + }) + this.baseURL = this.window.location.origin this.getDeveloperToolsEnableState() .pipe( diff --git a/src/locale/properties/developer-tools/developer-tools.en.properties b/src/locale/properties/developer-tools/developer-tools.en.properties index 5c72e14e83..19f2984f3e 100644 --- a/src/locale/properties/developer-tools/developer-tools.en.properties +++ b/src/locale/properties/developer-tools/developer-tools.en.properties @@ -52,7 +52,7 @@ developerTools.changesHaveBeenSavedSuccessfully=Changes have been saved successf developerTools.saveApplicationAndGenerate=Save application and generate my client ID and secret developerTools.saveApplication=Save application developerTools.providesAnAuthorizationCode=Provides an authorization code that can be exchanged for an access token and an authenticated ORCID iD. -developerTools.endpoint=Ednpoint +developerTools.endpoint=Endpoint developerTools.scope=Scope developerTools.code=code developerTools.providesAnAuthenticatd=Provides an authenticated ORCID iD and an access token that can be used to read public information on the record. @@ -61,7 +61,7 @@ developerTools.providesAnAccess=Provides an access token that can be used to rea developerTools.moreInformation=More information on OpenID Connect Endpoint developerTools.responseType=Response type developerTools.clientId=Client ID -developerTools.exampleCode=example code +developerTools.exampleCode=Example code developerTools.ariaLabelWebsiteDelete=Delete redirect URI developerTools.labelAuthorizeRequest=Authorize request developerTools.labelTokenRequest=Token request @@ -75,3 +75,5 @@ developerTools.expand=Expand developerTools.replaceWithRedirect=REPLACE WITH REDIRECT URI developerTools.replaceWithOauth=REPLACE WITH OAUTH CODE developerTools.backToMyRecod=Back to my record +developerTools.exampleCode2=example code +