Compare commits

..

No commits in common. "5a9e874d529bed2377b79aae39f43e5b2875ce2c" and "4d3b19b23b7221eebc38c2045a69c2e84e0e00ec" have entirely different histories.

20 changed files with 1236 additions and 1398 deletions

View file

@ -101,8 +101,7 @@ module ApplicationHelper
def impress_2020_meta_tags
origin = Rails.configuration.impress_2020_origin
support_secret = Rails.application.credentials.dig(
:impress_2020, :support_secret)
support_secret = Rails.application.credentials.impress_2020.support_secret
capture do
concat tag("meta", name: "impress-2020-origin", content: origin)

View file

@ -1,9 +1,4 @@
module OutfitsHelper
LAST_DAY_OF_NEOPASS_ANNOUNCEMENT = Date.parse("2024-05-05")
def show_neopass_announcement?
Date.today <= LAST_DAY_OF_NEOPASS_ANNOUNCEMENT
end
def destination_tag(value)
hidden_field_tag 'destination', value, :id => nil
end

View file

@ -14,6 +14,7 @@ import { ApolloProvider } from "@apollo/client";
import { BrowserRouter } from "react-router-dom";
import { css, Global } from "@emotion/react";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import produce from "immer";
import apolloClient from "./apolloClient";

View file

@ -31,6 +31,7 @@ import getVisibleLayers from "../components/getVisibleLayers";
import { OutfitLayers } from "../components/OutfitPreview";
import SupportOnly from "./support/SupportOnly";
import { useAltStylesForSpecies } from "../loaders/alt-styles";
import useSupport from "./support/useSupport";
import { useLocalStorage } from "../util";
// From https://twemoji.twitter.com/, thank you!
@ -80,6 +81,7 @@ function PosePicker({
"DTIPosePickerIsInSupportMode",
false,
);
const { isSupportUser } = useSupport();
const toast = useToast();
const loading = posesQuery.loading || altStylesQuery.isLoading;
@ -278,31 +280,30 @@ function PosePicker({
);
}
const PosePickerButton = React.forwardRef(
({ pose, altStyle, isOpen, loading, ...props }, ref) => {
const theme = useTheme();
function PosePickerButton({ pose, altStyle, isOpen, loading, ...props }, ref) {
const theme = useTheme();
const icon = altStyle != null ? twemojiSunglasses : getIcon(pose);
const label = altStyle != null ? altStyle.seriesName : getLabel(pose);
const icon = altStyle != null ? twemojiSunglasses : getIcon(pose);
const label = altStyle != null ? altStyle.seriesName : getLabel(pose);
return (
<ClassNames>
{({ css, cx }) => (
<Button
variant="unstyled"
textShadow={`${theme.colors.blackAlpha["700"]} 0 1px 2px`}
d="flex"
alignItems="center"
justifyContent="center"
_focus={{ borderColor: "gray.50" }}
_hover={{ borderColor: "gray.50" }}
outline="initial"
fontSize="sm"
fontWeight="normal"
minWidth="12ch"
disabled={loading}
className={cx(
css`
return (
<ClassNames>
{({ css, cx }) => (
<Button
variant="unstyled"
textShadow={`${theme.colors.blackAlpha["700"]} 0 1px 2px`}
d="flex"
alignItems="center"
justifyContent="center"
_focus={{ borderColor: "gray.50" }}
_hover={{ borderColor: "gray.50" }}
outline="initial"
fontSize="sm"
fontWeight="normal"
minWidth="12ch"
disabled={loading}
className={cx(
css`
border: 1px solid transparent !important;
color: ${theme.colors.gray["100"]};
cursor: ${loading ? "wait" : "pointer"} !important;
@ -330,22 +331,22 @@ const PosePickerButton = React.forwardRef(
border-width: 2px !important;
}
`,
isOpen && "is-open",
)}
{...props}
ref={ref}
>
<EmojiImage src={icon} alt="Style" />
<Box width=".5em" />
{label}
<Box width=".5em" />
<ChevronDownIcon />
</Button>
)}
</ClassNames>
);
},
);
isOpen && "is-open",
)}
{...props}
ref={ref}
>
<EmojiImage src={icon} alt="Style" />
<Box width=".5em" />
{label}
<Box width=".5em" />
<ChevronDownIcon />
</Button>
)}
</ClassNames>
);
}
PosePickerButton = React.forwardRef(PosePickerButton);
function PosePickerTable({ poseInfos, onChange, initialFocusRef }) {
return (

View file

@ -1,3 +1,5 @@
import * as React from "react";
import { getSupportSecret } from "../../impress-2020-config";
/**

View file

@ -700,7 +700,7 @@ function getZonesAndItems(itemsById, wornItemIds, closetedItemIds) {
// used. Then, loop over them again, appending the ID number if count > 1.
const labelCounts = new Map();
for (const itemZoneGroup of zonesAndItems) {
const { zoneLabel } = itemZoneGroup;
const { zoneId, zoneLabel } = itemZoneGroup;
const count = labelCounts.get(zoneLabel) ?? 0;
labelCounts.set(zoneLabel, count + 1);

View file

@ -429,8 +429,6 @@ class Item < ApplicationRecord
species_support_strs = info['species_support'] || []
self.species_support_ids = species_support_strs.map(&:to_i)
# NOTE: If some of these fields are missing, it could cause saving the item
# to fail, because many of these columns are non-nullable.
self.name = info['name']
self.description = info['description']
self.thumbnail_url = info['thumbnail_url']

View file

@ -68,7 +68,6 @@
%li.terms{"data-updated-recently": terms_updated_recently }
= link_to t('.footer.terms', date: terms_updated_timestamp),
terms_path
%li= link_to t('.footer.about_neopass'), about_neopass_path
%div
#{t('.footer.contact')}:

View file

@ -4,26 +4,41 @@
%p#pet-not-found.alert= t 'pets.load.not_found'
- if show_neopass_announcement?
%section.neopass-announcement
= image_tag "about/neopass-survey.png", width: 70, height: 70,
srcset: {"about/neopass-survey@2x.png": "2x"},
class: "neopass-thumbnail"
.neopass-content
%p
%strong
💭 Thank you for sending us your NeoPass feedback!
%section.neopass-announcement
= image_tag "about/neopass-survey.png", width: 70, height: 70,
srcset: {"about/neopass-survey@2x.png": "2x"},
class: "neopass-thumbnail"
.neopass-content
%p
%strong
💭 Can you help us and TNT decide what to build next with NeoPass?
%p
We're working with TNT now to build new integrations, based on what you
told us! We're glad
= link_to "log in with NeoPass", about_neopass_path
is working well, and we're excited to do the next part! More info soon!
%p
- if user_signed_in?
- if current_user.uses_neopass?
= link_to "Login with NeoPass", about_neopass_path
is ready—and you're already on it, thank you! 🥰
- else
= link_to "Login with NeoPass", about_neopass_path
is ready! You can connect via the
#{link_to "Settings page", edit_auth_user_path}.
- else
= link_to "Login with NeoPass", about_neopass_path
is ready! If you're new to Dress to Impress, try logging in right now!!
🎉
%p
Thanks again to everyone for helping us out! We're grateful, as always 💖
%br
%em —Matchu
%p
Now that we've built the foundation, TNT are looking for our help deciding what integration to build
next.
= link_to "Would you fill out this survey for us, please?",
"https://docs.google.com/forms/d/e/1FAIpQLSdyi7bZB3-gyztdOVSmikRrfts6KM5mK2r37D0SBla3JO3GbQ/viewform"
We've got some ideas, and we're looking for more! Even if you don't use
NeoPass yet, your input would be <em>super</em> useful.
%p
Thanks again to everyone for helping us out! We're grateful, as always 💖
%br
%em —Matchu
#outfit-forms
- localized_cache :action_suffix => 'outfit_forms_intro' do

View file

@ -31,9 +31,11 @@ en-MEEP:
login: Meep in
footer:
blog: Bleep
source_code: Source Meep
terms: Terms of Use (meeped Sep 2022)
contact: Meeptact
suggestions: Suggesteeps
email: Questions, comments, meepits
copyright: Images © 1999%{year} World of Neopets, Inc. All Rights Reserved.
Used With Permission. Meep.

View file

@ -31,10 +31,11 @@ en:
login: Log in
footer:
blog: Blog
source_code: Source Code
terms: Terms of Use (updated %{date})
about_neopass: About NeoPass
contact: Contact
suggestions: Suggestions
email: Questions, comments, bugs
copyright: Images © 1999%{year} World of Neopets, Inc. All Rights Reserved.
Used With Permission

View file

@ -24,8 +24,10 @@ pt:
logout: Sair
login: Entrar
footer:
blog: Blog
source_code: Código Fonte
contact: Contato
suggestions: Sugestões
email: Perguntas, comentários, erros
copyright: Images © 1999%{year} World of Neopets, Inc. All Rights Reserved. Used With Permission
items:

View file

@ -1,8 +0,0 @@
class FixDefaultValueForItemsDescription < ActiveRecord::Migration[7.1]
def change
# Idk why, but this column's default value is specified in our schema as
# an empty string, but setting up the dev environment on my macOS machine
# is saying on latest MariaDB that this isn't allowed.
change_column_default :items, :description, from: "", to: nil
end
end

View file

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[7.1].define(version: 2024_05_02_195157) do
ActiveRecord::Schema[7.1].define(version: 2024_04_21_033509) do
create_table "alt_styles", charset: "utf8mb4", collation: "utf8mb4_unicode_520_ci", force: :cascade do |t|
t.integer "species_id", null: false
t.integer "color_id", null: false
@ -132,7 +132,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_05_02_195157) do
t.column "modeling_status_hint", "enum('done','glitchy')"
t.boolean "is_manually_nc", default: false, null: false
t.string "name", null: false
t.text "description", size: :medium, null: false
t.text "description", size: :medium, default: "", null: false
t.string "rarity", default: "", null: false
t.index ["modeling_status_hint", "created_at", "id"], name: "items_modeling_status_hint_and_created_at_and_id"
t.index ["modeling_status_hint", "created_at"], name: "items_modeling_status_hint_and_created_at"
@ -149,7 +149,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_05_02_195157) do
end
create_table "modeling_logs", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_520_ci", force: :cascade do |t|
t.datetime "created_at", precision: nil, default: -> { "CURRENT_TIMESTAMP" }, null: false
t.datetime "created_at", precision: nil, default: -> { "current_timestamp()" }, null: false
t.text "log_json", size: :long, null: false
t.string "pet_name", limit: 128, null: false
end

View file

@ -178,9 +178,9 @@
when: not ruby_dir.stat.exists
- name: Add Ruby 3.3.0 to the global PATH, for developer convenience
copy:
dest: /etc/profile.d/ruby_path.sh
content: PATH="/opt/ruby-3.3.0/bin:$PATH"
lineinfile:
dest: /etc/profile
line: 'PATH="/opt/ruby-3.3.0/bin:$PATH" # Added by impress deploy setup script'
- name: Install system dependencies for impress's Ruby gems
apt:
@ -444,7 +444,7 @@
weekday: "0" # Sunday
hour: "1" # 1:15am
minute: "15" # 1:15am
job: "bash -c 'source /etc/profile && source ~/.bash_profile && cd /srv/impress/current && bin/rails public_data:commit[scheduled]'"
job: "cd /srv/impress/current && bin/rails public_data:commit[scheduled]"
handlers:
- name: Reload nginx

View file

@ -30,9 +30,6 @@ namespace :public_data do
# Don't lock the database to do it!
args << "--single-transaction"
# Skip dumping tablespaces, so this requires fewer privileges.
args << "--no-tablespaces"
# Dump the public data tables from the primary database.
args << config.fetch(:database)
args += %w(species colors zones) # manual constants
@ -56,7 +53,7 @@ namespace :public_data do
# Link this latest dump as `latest.sql.gz`.
latest_path = Rails.configuration.public_data_root / "latest.sql.gz"
File.unlink(latest_path) if File.symlink?(latest_path)
File.unlink(latest_path) if File.exist?(latest_path)
File.symlink(dest_path, latest_path)
puts "Linked dump to #{latest_path}"

View file

@ -48,6 +48,5 @@
"dev": "yarn build:dev --watch",
"lint": "eslint app/javascript",
"prepare": "husky install"
},
"packageManager": "yarn@4.2.1"
}
}

Binary file not shown.

Binary file not shown.

2451
yarn.lock

File diff suppressed because it is too large Load diff