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

fix(outlook): xml manifest version #252

Merged
merged 2 commits into from
Feb 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions OPENAPI_DOC.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8098,6 +8098,9 @@ components:
- all_day
- attachments
nullable: true
event_metadata:
type: string
nullable: true
required:
- id
- email
Expand Down Expand Up @@ -9578,6 +9581,9 @@ components:
- all_day
- attachments
nullable: true
event_metadata:
type: string
nullable: true
required:
- id
- email
Expand Down Expand Up @@ -9923,6 +9929,9 @@ components:
source_location:
type: string
nullable: true
version:
type: string
nullable: true
required:
- app_id
nullable: true
Expand Down
3 changes: 2 additions & 1 deletion src/controllers/outlook.cr
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class Outlook < ActionController::Base
render :bad_request, json: "Missing app_id" if outlook_config.app_id.blank?

base_path = outlook_config.base_path || "outlook"
version = outlook_config.version || "1.0.0.01"

manifest = OutlookManifest.new(
app_id: outlook_config.app_id,
Expand All @@ -19,7 +20,7 @@ class Outlook < ActionController::Base
taskpane_url: "https://#{tenant.domain}/#{base_path}/#/book/meeting",
rooms_button_url: "https://#{tenant.domain}/#{base_path}/#/upcoming",
desks_button_url: "https://#{tenant.domain}/#{base_path}/#/book/desks",
version: (tenant.updated_at.to_unix || tenant.created_at.to_unix).to_s,
version: version,
)

render xml: manifest.to_xml
Expand Down
3 changes: 3 additions & 0 deletions src/models/tenant/outlook_config.cr
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class Tenant
property app_domain : String?
property app_resource : String?
property source_location : String?
property version : String?

def clean
config = self
Expand All @@ -17,6 +18,7 @@ class Tenant
config.app_domain = (c = config.app_domain) && !c.blank? ? c.strip.downcase : nil
config.app_resource = (c = config.app_resource) && !c.blank? ? c.strip.downcase : nil
config.source_location = (c = config.source_location) && !c.blank? ? c.strip.downcase : nil
config.version = (c = config.version) && !c.blank? ? c.strip : nil
config
end

Expand All @@ -27,6 +29,7 @@ class Tenant
app_domain: @app_domain,
app_resource: @app_resource,
source_location: @source_location,
version: @version,
}
end

Expand Down