Skip to content

Commit

Permalink
Merge pull request #159 from glideapps/add-deprecation-label
Browse files Browse the repository at this point in the history
feat: 🏷️ add deprecated fields to JSON and fetch
  • Loading branch information
timwellswa committed Oct 6, 2023
2 parents 4908bfe + 70c19a7 commit 3053f78
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/columns/create-json-object.ts
Expand Up @@ -80,6 +80,7 @@ const run: glide.Column = (

export default glide.column({
name: "Make JSON Object",
deprecated: true,
category: "Code",
released: "direct",
description: "Returns a JSON Object String",
Expand Down
1 change: 1 addition & 0 deletions src/columns/fetch.ts
Expand Up @@ -26,6 +26,7 @@ const run: glide.Column = async (url, query) => {
};

export default glide.column({
deprecated: true,
name: "Fetch JSON",
category: "Data & APIs",
released: "sandboxed",
Expand Down
1 change: 1 addition & 0 deletions src/columns/jq.ts
Expand Up @@ -23,6 +23,7 @@ const run: glide.Column = async (json, query) => {

export default glide.column({
name: "Transform JSON",
deprecated: true,
category: "Data & APIs",
released: "direct",
description: "Transform JSON with JQ",
Expand Down
7 changes: 7 additions & 0 deletions src/components/REPL.tsx
Expand Up @@ -13,6 +13,7 @@ const REPL: React.VFC<ColumnDefinition<any>> = props => {
run,
tests = [],
example = tests.length > 0 ? tests[0].params : {},
deprecated
} = props;

const [result, setResult] = useState<any>();
Expand All @@ -37,6 +38,12 @@ const REPL: React.VFC<ColumnDefinition<any>> = props => {

return (
<div className="p-5">
{deprecated ? (
<div className="bg-yellow-100 border-l-4 border-yellow-500 text-yellow-700 p-4 mb-4" role="alert">
<p className="font-bold">Deprecated Column</p>
<p className="my-2">Glide apps that already use this column will continue to work, but the column will no longer be available for new configurations.</p>
</div>
) : null}
<div className="space-y-6">
{Object.values(params).map((p, i) => (
<div key={i}>
Expand Down
4 changes: 3 additions & 1 deletion src/glide.ts
Expand Up @@ -85,6 +85,7 @@ type Released = "direct" | "sandboxed";
export type Manifest = {
name: string;
category: Category;
deprecated?: boolean;
released?: Released;
description: string;
author: string;
Expand Down Expand Up @@ -125,7 +126,7 @@ export function column<TColumnParams>(manifest: ColumnDefinition<TColumnParams>)
export function toStrictManifest(convenient: ManifestConvenient<any>): Manifest {
// We carefully pick out just the props in manifest, because more
// could come in from the component.
const { name, category, released, description, author, result, params, about, video } = convenient;
const { name, category, released, description, author, result, params, about, video, deprecated } = convenient;
const icon = getIconForManifest(convenient);

return {
Expand All @@ -138,6 +139,7 @@ export function toStrictManifest(convenient: ManifestConvenient<any>): Manifest
about,
icon,
video,
deprecated,
params: Object.entries(params).map(([name, param]) => ({
name,
...param,
Expand Down

0 comments on commit 3053f78

Please sign in to comment.