-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'TAN-449-data-for-reports' into
TAN-459-narrow-mode-and-report-context
- Loading branch information
Showing
35 changed files
with
704 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
back/db/migrate/20231031175023_create_dimension_user_custom_field_values.analytics.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# frozen_string_literal: true | ||
|
||
# This migration comes from analytics (originally 20231031174154) | ||
class CreateDimensionUserCustomFieldValues < ActiveRecord::Migration[7.0] | ||
def change | ||
create_view :analytics_dimension_user_custom_field_values | ||
end | ||
end |
11 changes: 11 additions & 0 deletions
11
back/db/migrate/20231103094549_create_published_graph_data_units.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class CreatePublishedGraphDataUnits < ActiveRecord::Migration[7.0] | ||
def change | ||
create_table :report_builder_published_graph_data_units, id: :uuid do |t| | ||
t.references :report_builder_report, null: false, foreign_key: true, index: { name: :report_builder_published_data_units_report_id_idx }, type: :uuid | ||
t.string :graph_id, null: false | ||
t.jsonb :data, null: false | ||
|
||
t.timestamps | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
back/db/views/analytics_dimension_user_custom_field_values_v01.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
SELECT | ||
DISTINCT u.id as dimension_user_id, | ||
cf.key, | ||
cf.value | ||
FROM | ||
users u | ||
LEFT JOIN LATERAL ( | ||
SELECT | ||
key, | ||
custom_field_values ->> key AS value | ||
FROM | ||
custom_fields | ||
where | ||
custom_fields.resource_type = 'User' | ||
) cf ON true | ||
LEFT JOIN LATERAL ( | ||
SELECT | ||
jsonb_object_keys(u.custom_field_values) AS key | ||
) cfv ON true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
back/engines/commercial/analytics/app/models/analytics/dimension_user_custom_field_value.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# frozen_string_literal: true | ||
|
||
# == Schema Information | ||
# | ||
# Table name: analytics_dimension_user_custom_field_values | ||
# | ||
# dimension_user_id :uuid | ||
# key :string | ||
# value :text | ||
# | ||
module Analytics | ||
class DimensionUserCustomFieldValue < Analytics::ApplicationRecordView | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
...mmercial/analytics/db/migrate/20231031174154_create_dimension_user_custom_field_values.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# frozen_string_literal: true | ||
|
||
class CreateDimensionUserCustomFieldValues < ActiveRecord::Migration[7.0] | ||
def change | ||
create_view :analytics_dimension_user_custom_field_values | ||
end | ||
end |
Oops, something went wrong.