Skip to content
Snippets Groups Projects
Commit f8cc52b6 authored by Xiao Gui's avatar Xiao Gui
Browse files

bugfix: saneurl

parent d7f661c7
No related branches found
No related tags found
No related merge requests found
...@@ -104,7 +104,8 @@ router.post('/:name', ...@@ -104,7 +104,8 @@ router.post('/:name',
limiterMiddleware(), limiterMiddleware(),
express.json(), express.json(),
async (req, res) => { async (req, res) => {
if (req.headers['x-noop']) return res.status(200).end() if (/bot/i.test(req.headers['user-agent'])) return res.status(201).end()
if (req.headers['x-noop']) return res.status(201).end()
const { name } = req.params const { name } = req.params
try { try {
await proxyStore.set(req, name, req.body) await proxyStore.set(req, name, req.body)
......
...@@ -68,6 +68,7 @@ ...@@ -68,6 +68,7 @@
- [ ] saneurl generation functions properly - [ ] saneurl generation functions properly
- [ ] try existing key (human), and get unavailable error - [ ] try existing key (human), and get unavailable error
- [ ] try non existing key, and get available - [ ] try non existing key, and get available
- [ ] create use key `x-tmp-foo` and new url works
- [ ] [saneUrl](https://atlases.ebrains.eu/viewer-staging/saneUrl/bigbrainGreyWhite) redirects to big brain - [ ] [saneUrl](https://atlases.ebrains.eu/viewer-staging/saneUrl/bigbrainGreyWhite) redirects to big brain
- [ ] [saneUrl](https://atlases.ebrains.eu/viewer-staging/saneUrl/julichbrain) redirects to julich brain (colin 27) - [ ] [saneUrl](https://atlases.ebrains.eu/viewer-staging/saneUrl/julichbrain) redirects to julich brain (colin 27)
- [ ] [saneUrl](https://atlases.ebrains.eu/viewer-staging/saneUrl/whs4) redirects to waxholm v4 - [ ] [saneUrl](https://atlases.ebrains.eu/viewer-staging/saneUrl/whs4) redirects to waxholm v4
......
...@@ -8,6 +8,7 @@ import { ReactiveFormsModule, FormsModule } from "@angular/forms"; ...@@ -8,6 +8,7 @@ import { ReactiveFormsModule, FormsModule } from "@angular/forms";
import { AuthModule } from "src/auth"; import { AuthModule } from "src/auth";
import { ShareSheetComponent } from "./shareSheet/shareSheet.component"; import { ShareSheetComponent } from "./shareSheet/shareSheet.component";
import { ShareDirective } from "./share.directive"; import { ShareDirective } from "./share.directive";
import { StateModule } from "src/state";
@NgModule({ @NgModule({
imports: [ imports: [
...@@ -17,6 +18,7 @@ import { ShareDirective } from "./share.directive"; ...@@ -17,6 +18,7 @@ import { ShareDirective } from "./share.directive";
FormsModule, FormsModule,
ReactiveFormsModule, ReactiveFormsModule,
AuthModule, AuthModule,
StateModule,
], ],
declarations: [ declarations: [
ClipboardCopy, ClipboardCopy,
......
import { Component } from "@angular/core"; import { Component, TemplateRef } from "@angular/core";
import { MatDialog } from "@angular/material/dialog"; import { MatDialog } from "@angular/material/dialog";
import { ARIA_LABELS } from 'common/constants' import { ARIA_LABELS } from 'common/constants'
import { SaneUrl } from "../saneUrl/saneUrl.component"
@Component({ @Component({
selector: 'sxplr-share-sheet', selector: 'sxplr-share-sheet',
...@@ -18,7 +17,7 @@ export class ShareSheetComponent{ ...@@ -18,7 +17,7 @@ export class ShareSheetComponent{
} }
openShareSaneUrl(){ openDialog(templateRef: TemplateRef<unknown>){
this.dialog.open(SaneUrl, { ariaLabel: ARIA_LABELS.SHARE_CUSTOM_URL }) this.dialog.open(templateRef, { ariaLabel: ARIA_LABELS.SHARE_CUSTOM_URL })
} }
} }
...@@ -17,8 +17,10 @@ ...@@ -17,8 +17,10 @@
<mat-list-item <mat-list-item
[attr.aria-label]="ARIA_LABELS.SHARE_CUSTOM_URL" [attr.aria-label]="ARIA_LABELS.SHARE_CUSTOM_URL"
[attr.tab-index]="10" [attr.tab-index]="10"
(click)="openShareSaneUrl()" (click)="openDialog(saneUrlTmpl)"
[matTooltip]="ARIA_LABELS.SHARE_CUSTOM_URL" [matTooltip]="ARIA_LABELS.SHARE_CUSTOM_URL"
iav-state-aggregator
#stateAggregator="iavStateAggregator"
> >
<mat-icon <mat-icon
class="mr-4" class="mr-4"
...@@ -32,3 +34,9 @@ ...@@ -32,3 +34,9 @@
</mat-list-item> </mat-list-item>
</mat-nav-list> </mat-nav-list>
<ng-template #saneUrlTmpl>
<iav-sane-url [stateTobeSaved]="stateAggregator.jsonifiedState$ | async">
</iav-sane-url>
</ng-template>
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment