-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7802 from fjordllc/main
Release 2024-06-04 14:22:37 +0000
- Loading branch information
Showing
76 changed files
with
763 additions
and
394 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# frozen_string_literal: true | ||
|
||
class Works::WorkComponent < ViewComponent::Base | ||
def initialize(work:) | ||
@work = work | ||
end | ||
|
||
def thumbnail | ||
if work.thumbnail.attached? | ||
image_tag work.thumbnail_url, class: 'thumbnail-card__image' | ||
else | ||
image_tag('work-blank.svg', class: 'thumbnail-card__image') | ||
end | ||
end | ||
|
||
def creator_avatar | ||
image_tag work.user.avatar_url, title: work.user.icon_title, class: 'a-user-icons__item-icon a-user-icon' | ||
end | ||
|
||
private | ||
|
||
attr_reader :work | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# frozen_string_literal: true | ||
|
||
class Admin::InvitationUrlController < AdminController | ||
def index | ||
@invitation_url_template = new_user_url( | ||
company_id: 'dummy_company_id', | ||
role: 'dummy_role', | ||
course_id: 'dummy_course_id', | ||
token: ENV['TOKEN'] || 'token' | ||
) | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
# frozen_string_literal: true | ||
|
||
class Reports::UncheckedController < ApplicationController | ||
PAGER_NUMBER = 25 | ||
|
||
before_action :require_staff_login | ||
def index; end | ||
def index | ||
@reports = Report.unchecked.not_wip.list.page(params[:page]).per(PAGER_NUMBER) | ||
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
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 |
---|---|---|
@@ -1,11 +1,14 @@ | ||
import React from 'react' | ||
|
||
export default function CommentUserIcon({ comment }) { | ||
const roleClass = `is-${comment.primary_role}` | ||
return ( | ||
<a | ||
className="card-list-item__user-icons-icon" | ||
href={`/users/${comment.user_id}`}> | ||
<img className="a-user-icon" src={comment.user_icon} /> | ||
<span className={`a-user-role ${roleClass}`}> | ||
<img className="a-user-icon" src={comment.user_icon} /> | ||
</span> | ||
</a> | ||
) | ||
} |
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 was deleted.
Oops, something went wrong.
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,40 @@ | ||
document.addEventListener('DOMContentLoaded', async () => { | ||
const invitationElements = Array.from( | ||
document.querySelectorAll('.invitation__element select') | ||
) | ||
const invitationUrl = document.querySelector('.js-invitation-url') | ||
const invitationUrlText = document.querySelector('.js-invitation-url-text') | ||
|
||
if (invitationElements.length === 0 || !invitationUrlText || !invitationUrl) { | ||
return | ||
} | ||
|
||
const updateInvitationURL = async () => { | ||
const invitationCompany = document.querySelector('.js-invitation-company') | ||
const invitationRole = document.querySelector('.js-invitation-role') | ||
const invitationCourse = document.querySelector('.js-invitation-course') | ||
|
||
const selectedCompanyId = | ||
invitationCompany.options[invitationCompany.selectedIndex].value | ||
const selectedRole = | ||
invitationRole.options[invitationRole.selectedIndex].value | ||
const selectedCourseId = | ||
invitationCourse.options[invitationCourse.selectedIndex].value | ||
|
||
const invitationUrlTemplate = | ||
document.querySelector('.invitation__url').dataset.invitationUrlTemplate | ||
const targetUrl = invitationUrlTemplate | ||
.replace(/company_id=[^&]*/, `company_id=${selectedCompanyId}`) | ||
.replace(/role=[^&]*/, `role=${selectedRole}`) | ||
.replace(/course_id=[^&]*/, `course_id=${selectedCourseId}`) | ||
|
||
invitationUrl.href = targetUrl | ||
invitationUrlText.value = targetUrl | ||
} | ||
|
||
invitationElements.forEach((invitationElement) => { | ||
invitationElement.addEventListener('change', updateInvitationURL) | ||
}) | ||
|
||
window.addEventListener('pageshow', updateInvitationURL) | ||
}) |
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
Oops, something went wrong.