Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metadata #1642

Merged
7 commits merged into from
May 23, 2022
Merged

Metadata #1642

7 commits merged into from
May 23, 2022

Conversation

ghost
Copy link

@ghost ghost commented May 19, 2022

No description provided.

@ghost ghost self-requested a review May 19, 2022 17:07
@codecov
Copy link

codecov bot commented May 19, 2022

Codecov Report

Merging #1642 (2ac8d34) into master (c7d7d39) will increase coverage by 0.03%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #1642      +/-   ##
==========================================
+ Coverage   77.83%   77.87%   +0.03%     
==========================================
  Files         232      234       +2     
  Lines       18209    18156      -53     
==========================================
- Hits        14173    14139      -34     
+ Misses       4036     4017      -19     
Impacted Files Coverage Δ
lib/cosmos/script/calendar.rb 38.46% <0.00%> (-3.65%) ⬇️
config/routes.rb 100.00% <0.00%> (ø)
lib/cosmos/models/narrative_model.rb
app/controllers/notes_controller.rb 55.07% <0.00%> (ø)
lib/cosmos/models/sorted_model.rb 97.01% <0.00%> (ø)
lib/cosmos/models/note_model.rb 97.91% <0.00%> (ø)
lib/cosmos/utilities/metric.rb 90.19% <0.00%> (+0.83%) ⬆️
lib/cosmos/models/metadata_model.rb 97.67% <0.00%> (+4.59%) ⬆️
app/controllers/metadata_controller.rb 98.66% <0.00%> (+33.14%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c7d7d39...2ac8d34. Read the comment docs.

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also are there script methods for metadata that need to be updated?

@@ -79,7 +79,7 @@ def search
start, stop = parse_time_input(x_start: params[:start], x_stop: params[:stop])
q = params[:q]
raise NarrativeInputError "Must include q value" if q.nil?
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still Narrative

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I haven't made it up the chain yet to the controller and frontend

@@ -79,7 +79,7 @@ def search
start, stop = parse_time_input(x_start: params[:start], x_stop: params[:stop])
q = params[:q]
raise NarrativeInputError "Must include q value" if q.nil?
model_array = @model_class.get(scope: params[:scope], start: start, stop: stop)
model_array = @model_class.range(scope: params[:scope], start: start, stop: stop)
model_array.find { |model| model.description.include? q }
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is q?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment says "The string to contain in the narrative description". Worst variable name ever though.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@@ -18,26 +18,25 @@
# copyright holder

require 'cosmos/models/metadata_model'
require 'time'

class MetadataController < ApplicationController
def initialize
@model_class = Cosmos::MetadataModel
end

def parse_time_input(x_start:, x_stop:)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this? Why does it default to +/- 7 days?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know but I didn't change it. It doesn't match the comment either which says start is minus 12 hrs and end is plus 2 days. I'm honestly not sure when the search feature is used.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

@ghost ghost merged commit 46be551 into master May 23, 2022
@ghost ghost deleted the metadata branch May 23, 2022 19:33
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant