Skip to content

Commit

Permalink
Added deprecated to enums
Browse files Browse the repository at this point in the history
  • Loading branch information
imolorhe committed Dec 3, 2023
1 parent 08033fe commit 9c4d139
Show file tree
Hide file tree
Showing 9 changed files with 77 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<div *ngIf="item?.isDeprecated" class="doc-viewer-item-query-deprecated">
<span class="doc-viewer-item-query-deprecated-title">
{{ 'DOCS_DEPRECATED_TEXT' | translate }}
</span>
<span markdown [data]="item?.deprecationReason ?? ''"> </span>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { DocViewerDeprecatedComponent } from './doc-viewer-deprecated.component';

describe('DocViewerDeprecatedComponent', () => {
let component: DocViewerDeprecatedComponent;
let fixture: ComponentFixture<DocViewerDeprecatedComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ DocViewerDeprecatedComponent ]
})
.compileComponents();

fixture = TestBed.createComponent(DocViewerDeprecatedComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Component, Input } from '@angular/core';
import { GraphQLEnumValue, GraphQLField } from 'graphql';

@Component({
selector: 'app-doc-viewer-deprecated',
templateUrl: './doc-viewer-deprecated.component.html',
styles: [],
})
export class DocViewerDeprecatedComponent {
@Input() item?: GraphQLField<any, any> | GraphQLEnumValue;
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
markdown
[data]="data.description || ''"
></div>
<app-doc-viewer-deprecated
[item]="data"
></app-doc-viewer-deprecated>
<div class="doc-viewer-item-query-inner">
<button
class="doc-viewer-item-query-add-btn"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
<span class="doc-viewer-item-type">
{{ item.value }}
</span>
<app-doc-viewer-deprecated [item]="item"></app-doc-viewer-deprecated>
</div>
<div
*ngIf="item.description"
Expand Down Expand Up @@ -173,10 +174,7 @@
{{ item.type.inspect() }}
</span>
</div>
<div *ngIf="item.isDeprecated" class="doc-viewer-item-query-deprecated">
{{ 'DOCS_DEPRECATED_TEXT' | translate }}:
<span markdown [data]="item.deprecationReason || ''"> </span>
</div>
<app-doc-viewer-deprecated [item]="item"></app-doc-viewer-deprecated>
<div
class="doc-viewer-item-query-description"
markdown
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { DocViewerTypeComponent } from './doc-viewer-type/doc-viewer-type.compon
import { DocViewerSearchResultsComponent } from './doc-viewer-search-results/doc-viewer-search-results.component';
import { ComponentModule } from '../components.module';
import { PipesModule } from '../../pipes';
import { DocViewerDeprecatedComponent } from './doc-viewer-deprecated/doc-viewer-deprecated.component';

@NgModule({
imports: [
Expand All @@ -24,6 +25,7 @@ import { PipesModule } from '../../pipes';
DocViewerFieldComponent,
DocViewerTypeComponent,
DocViewerSearchResultsComponent,
DocViewerDeprecatedComponent,
],
exports: [
DocViewerComponent,
Expand Down
10 changes: 9 additions & 1 deletion packages/altair-app/src/scss/components/_doc-viewer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -356,12 +356,20 @@ app-doc-viewer {
}

.doc-viewer-item-query-deprecated {
display: inline-block;
display: inline-flex;
align-items: center;
gap: 4px;
font-size: fontsize(12);
padding: 3px;
margin: 3px 0;
background: rgba(var(--rgb-red), 0.05);
border-radius: 4px;
color: var(--red-color);
}
.doc-viewer-item-query-deprecated-title {
font-weight: 600;
font-size: fontsize(10);
}

.doc-viewer-item-query-description {
font-size: fontsize(13);
Expand Down
5 changes: 2 additions & 3 deletions packages/altair-koa-middleware/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
"@types/supertest": "^2.0.11",
"jest": "29.4.1",
"koa": "^2.13.1",
"koa-send": "^5.0.1",
"nodemon": "^2.0.12",
"supertest": "^6.1.6",
"ts-jest": "29.0.5",
"ts-node": "^10.2.1",
"typescript": "4.9.5"
},
"peerDependencies": {
"@koa/router": "~11.0.2",
"koa-send": "^5.0.1"
"@koa/router": "^12.0.1"
},
"engines": {
"node": ">= 12"
Expand All @@ -32,7 +32,6 @@
"type": "opencollective",
"url": "https://opencollective.com/altair"
},
"gitHead": "e5ce60f5a14997f1471a961ac76efacbb044df46",
"homepage": "https://github.com/altair-graphql/altair#readme",
"keywords": [
"altair",
Expand Down
21 changes: 19 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -17928,7 +17928,7 @@ [email protected]:
statuses "2.0.1"
toidentifier "1.0.1"

http-errors@^1.6.3, http-errors@~1.8.0:
http-errors@^1.6.3, http-errors@^1.7.3, http-errors@~1.8.0:
version "1.8.1"
resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.8.1.tgz#7c3f28577cbc8a207388455dbd62295ed07bd68c"
integrity sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==
Expand Down Expand Up @@ -20416,6 +20416,15 @@ koa-convert@^2.0.0:
co "^4.6.0"
koa-compose "^4.1.0"

koa-send@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/koa-send/-/koa-send-5.0.1.tgz#39dceebfafb395d0d60beaffba3a70b4f543fe79"
integrity sha512-tmcyQ/wXXuxpDxyNXv5yNNkdAMdFRqwtegBXUaowiQzUKqJehttS0x2j0eOZDQAyloAth5w6wwBImnFzkUz3pQ==
dependencies:
debug "^4.1.1"
http-errors "^1.7.3"
resolve-path "^1.4.0"

koa@^2.13.1:
version "2.13.4"
resolved "https://registry.yarnpkg.com/koa/-/koa-2.13.4.tgz#ee5b0cb39e0b8069c38d115139c774833d32462e"
Expand Down Expand Up @@ -23785,7 +23794,7 @@ path-exists@^5.0.0:
resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-5.0.0.tgz#a6aad9489200b21fab31e49cf09277e5116fb9e7"
integrity sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==

path-is-absolute@^1.0.0:
path-is-absolute@1.0.1, path-is-absolute@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18=
Expand Down Expand Up @@ -25832,6 +25841,14 @@ resolve-from@^4.0.0:
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6"
integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==

resolve-path@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/resolve-path/-/resolve-path-1.4.0.tgz#c4bda9f5efb2fce65247873ab36bb4d834fe16f7"
integrity sha512-i1xevIst/Qa+nA9olDxLWnLk8YZbi8R/7JPbCMcgyWaFR6bKWaexgJgEB5oc2PKMjYdrHynyz0NY+if+H98t1w==
dependencies:
http-errors "~1.6.2"
path-is-absolute "1.0.1"

[email protected]:
version "5.0.0"
resolved "https://registry.yarnpkg.com/resolve-url-loader/-/resolve-url-loader-5.0.0.tgz#ee3142fb1f1e0d9db9524d539cfa166e9314f795"
Expand Down

0 comments on commit 9c4d139

Please sign in to comment.