Skip to content

Commit

Permalink
Show what versions of InfluxDB Flux functions are supported in (influ…
Browse files Browse the repository at this point in the history
…xdata#4219)

* automatically build flux version data file

* rendered modals on each stdlib page

* polish on flux-influxdb version support

* reverted modified frontmatter

* added new page that shows what flux versions are packaged with each InfluxDB version

* added comment to js file

* updated to address PR feedback

* moved flux build scripts into their own directory

* updated inject-flux-frontmatter script to work in subdirectory

* updated flux-versions script to work in nested directory

* fixed bug in flux-versions script
  • Loading branch information
sanderson authored Jul 19, 2022
1 parent b15f2fd commit 5ce0d1e
Show file tree
Hide file tree
Showing 24 changed files with 644 additions and 13 deletions.
5 changes: 4 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ jobs:
command: cd api-docs && bash generate-api-docs.sh
- run:
name: Inject Flux stdlib frontmatter
command: node ./inject-flux-stdlib-frontmatter.js
command: node ./flux-build-scripts/inject-flux-stdlib-frontmatter.js
- run:
name: Update Flux/InfluxDB versions
command: node ./flux-build-scripts/update-flux-versions.js
- save_cache:
key: install-{{ .Environment.CACHE_VERSION }}-{{ checksum ".circleci/config.yml" }}
paths:
Expand Down
25 changes: 25 additions & 0 deletions assets/js/flux-influxdb-versions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
Interactions related to the Flux/InfluxDB version modal
*/

const fluxInfluxDBModal = '.modal-content#flux-influxdb-versions'

// Check for deprecated or pending versions
function keysPresent() {
var list = $(fluxInfluxDBModal + ' .version-list')

return {
pending: list.find('.pending').length !== 0,
deprecated: list.find('.deprecated').length !== 0,
}
}

// Only execute if the Flux/InfluxDB modal is present in the DOM
if ($(fluxInfluxDBModal).length > 0) {
var presentKeys = keysPresent()

// Remove color key list items if the colors/states are present in the version list
if (presentKeys.pending === false) { $(fluxInfluxDBModal + ' .color-key #pending-key' ).remove() }
if (presentKeys.deprecated === false) { $(fluxInfluxDBModal + ' .color-key #deprecated-key' ).remove() }
if (presentKeys.pending === false && presentKeys.deprecated === false) { $(fluxInfluxDBModal + ' .color-key' ).remove() }
}
6 changes: 4 additions & 2 deletions assets/styles/layouts/_modals.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
position: relative;
display: flex;
overflow: hidden;
width: 100%;
// width: 100%;
max-width: 650px;
max-height: 97.5vh;
margin-top: 10vh;
Expand Down Expand Up @@ -60,7 +60,8 @@
.modal-content{
display: none;
overflow: visible;
width: 100%;
width: 586px;
max-width: 100%;

h3 {
color: $article-heading;
Expand Down Expand Up @@ -110,6 +111,7 @@

@import "modals/url-selector";
@import "modals/page-feedback";
@import "modals/flux-versions";

}

Expand Down
2 changes: 1 addition & 1 deletion assets/styles/layouts/article/_code.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ h1,h2,h3,h4,h5,h6 {
background: inherit !important;
font-size: inherit !important;
font-weight: inherit !important;
font-family: $rubik;
font-family: $proxima;
color: inherit !important;
}
}
Expand Down
12 changes: 12 additions & 0 deletions assets/styles/layouts/article/_tables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,15 @@ p.table-group-key {
font-weight: $medium;
font-size: .95rem;
}

// Reverse the order of InfluxDB version rows in Flux versions table
// Hugo doesn't support sorting maps (objects) by keys
table.flux-influxdb-versions tbody {
display: flex;
flex-direction: column-reverse;

tr {
display: flex;
justify-content: space-between;
}
}
11 changes: 10 additions & 1 deletion assets/styles/layouts/article/_title.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
border-radius: 1em;
display: inline-block;

&.updated-in, &.date {
&.updated-in,
&.date,
&.flux-influxdb {
padding: 0 0 0 .4em;
background: none;
font-weight: normal;
Expand All @@ -32,6 +34,13 @@
display: inline;
margin-right: .5rem;
}

.flux-influxdb a {
cursor: pointer;
opacity: .9;
transition: color .2s, opacity .2s;
&:hover {opacity: 1;}
}
}
}

Expand Down
88 changes: 88 additions & 0 deletions assets/styles/layouts/modals/_flux-versions.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
#flux-influxdb-versions {

max-width: 375px;

.flex-wrapper {
display: flex;
flex-direction: column;
height: 100%;
}

.influxdb-versions {
margin-top: 1.5rem;
overflow: scroll;
}
.version-list {
display: flex;
flex-direction: column-reverse;
}
.version-row {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
padding: .15rem 0;
border-bottom: 1px solid $article-hr;
&:last-child { border-top: 1px solid $article-hr; }

.version-col {
&:last-child { padding-right: 1rem; text-align: right; }
}
}

h4 {margin-top: 1.5rem;}

h4, span.medium {
font-size: 1.15rem;
}

h3 code {
background: $article-code-bg;
font-family: $code;
color: $article-code;
padding: .1rem .4rem .2rem;
border-radius: $radius;
white-space: nowrap;
font-size: .85em;
font-style: normal;
}

span{
&.medium {
font-weight: $medium;
color: $article-heading;
}
&.flux-version {
opacity: .5;
font-size: .9rem;
}
&.deprecated:before{
content: '';
color: rgba($article-text, .5);
margin-right: .4rem;
}
&.checkmark-new {
font-size: 1.1rem;
font-weight: bold;
color: $gr-rainforest;
&.pending { color: $b-dodger }
}
}

.color-key {
margin-top: 1.5rem;
padding: 0;
list-style: none;

li {
font-style: italic;
color: rgba($article-text, .65);

&#deprecated-key span {margin-left: .25rem;}
}
}

.more-info {
margin-top: 1.5rem;
}
}
16 changes: 16 additions & 0 deletions content/flux/v0.x/influxdb-versions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
title: Flux versions in InfluxDB
description: |
View what versions of Flux are packaged with each version of InfluxDB.
menu:
flux_0_x_ref:
weight: 10
---

View which versions of InfluxDB are packaged with each version of InfluxDB.

- [InfluxDB Cloud](#influxdb-cloud)
- [InfluxDB Open Source (OSS)](#influxdb-open-source-oss)
- [InfluxDB Enterprise](#influxdb-enterprise)

{{< flux/influxdb-versions >}}
52 changes: 52 additions & 0 deletions content/flux/v0.x/stdlib/internal/debug/unpivot.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
title: debug.unpivot() function
description: >
`debug.unpivot()` removes the `_time` column and any other column not in the group key and outputs a new table with `_field` and `_value` columns pairs.
The output stream retains the group key and all group key columns of the input stream.
Specialized to transform the pivoted output from `iox.from()` into the unpivoted format.
menu:
flux_0_x_ref:
name: debug.unpivot
parent: internal/debug
identifier: internal/debug/unpivot
weight: 201
---

<!------------------------------------------------------------------------------
IMPORTANT: This page was generated from comments in the Flux source code. Any
edits made directly to this page will be overwritten the next time the
documentation is generated.
To make updates to this documentation, update the function comments above the
function definition in the Flux source code:
https://github.com/influxdata/flux/blob/master/stdlib/internal/debug/debug.flux#L62-L65
Contributing to Flux: https://github.com/influxdata/flux#contributing
Fluxdoc syntax: https://github.com/influxdata/flux/blob/master/docs/fluxdoc.md
------------------------------------------------------------------------------->

`debug.unpivot()` removes the `_time` column and any other column not in the group key and outputs a new table with `_field` and `_value` columns pairs.
The output stream retains the group key and all group key columns of the input stream.
Specialized to transform the pivoted output from `iox.from()` into the unpivoted format.



##### Function type signature

```js
(<-tables: stream[{A with _time: time}]) => stream[{B with _value: C, _field: string}] where A: Record, B: Record
```

{{% caption %}}For more information, see [Function type signatures](/flux/v0.x/function-type-signatures/).{{% /caption %}}

## Parameters

### tables

Input data. Default is piped-forward data (`<-`).



78 changes: 78 additions & 0 deletions content/flux/v0.x/stdlib/join/join.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
---
title: join.join() function
description: >
`join.join()` is under active development and is not yet ready for public consumption.
menu:
flux_0_x_ref:
name: join.join
parent: join
identifier: join/join
weight: 101
---

<!------------------------------------------------------------------------------
IMPORTANT: This page was generated from comments in the Flux source code. Any
edits made directly to this page will be overwritten the next time the
documentation is generated.
To make updates to this documentation, update the function comments above the
function definition in the Flux source code:
https://github.com/influxdata/flux/blob/master/stdlib/join/join.flux#L13-L23
Contributing to Flux: https://github.com/influxdata/flux#contributing
Fluxdoc syntax: https://github.com/influxdata/flux/blob/master/docs/fluxdoc.md
------------------------------------------------------------------------------->

`join.join()` is under active development and is not yet ready for public consumption.



##### Function type signature

```js
(
<-left: stream[A],
as: (l: A, r: B) => C,
method: string,
on: (l: A, r: B) => bool,
right: stream[B],
) => stream[C] where A: Record, B: Record, C: Record
```

{{% caption %}}For more information, see [Function type signatures](/flux/v0.x/function-type-signatures/).{{% /caption %}}

## Parameters

### left

left:



### right
({{< req >}})
right:



### on
({{< req >}})
on:



### as
({{< req >}})
as:



### method
({{< req >}})
method:



2 changes: 1 addition & 1 deletion content/flux/v0.x/stdlib/testing/benchmark.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ documentation is generated.
To make updates to this documentation, update the function comments above the
function definition in the Flux source code:
https://github.com/influxdata/flux/blob/master/stdlib/testing/testing.flux#L372-L376
https://github.com/influxdata/flux/blob/master/stdlib/testing/testing.flux#L353-L357
Contributing to Flux: https://github.com/influxdata/flux#contributing
Fluxdoc syntax: https://github.com/influxdata/flux/blob/master/docs/fluxdoc.md
Expand Down
2 changes: 1 addition & 1 deletion content/flux/v0.x/stdlib/testing/inspect.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ documentation is generated.
To make updates to this documentation, update the function comments above the
function definition in the Flux source code:
https://github.com/influxdata/flux/blob/master/stdlib/testing/testing.flux#L256-L268
https://github.com/influxdata/flux/blob/master/stdlib/testing/testing.flux#L237-L249
Contributing to Flux: https://github.com/influxdata/flux#contributing
Fluxdoc syntax: https://github.com/influxdata/flux/blob/master/docs/fluxdoc.md
Expand Down
2 changes: 1 addition & 1 deletion content/flux/v0.x/stdlib/testing/run.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ documentation is generated.
To make updates to this documentation, update the function comments above the
function definition in the Flux source code:
https://github.com/influxdata/flux/blob/master/stdlib/testing/testing.flux#L315-L317
https://github.com/influxdata/flux/blob/master/stdlib/testing/testing.flux#L296-L298
Contributing to Flux: https://github.com/influxdata/flux#contributing
Fluxdoc syntax: https://github.com/influxdata/flux/blob/master/docs/fluxdoc.md
Expand Down
Loading

0 comments on commit 5ce0d1e

Please sign in to comment.