Skip to content

Commit 64068b4

Browse files
committed
Drop unused tags-scanned count and howToUse; tighten ItemTag labels
- Drop scannedItemTagsCount from Shop model, adapter, demo repo, and tests; remove the "tags scanned by customers" stat from ShopListCardView. - Replace ShopDetailView "Learn More" link with a left-aligned shopDetailInstruction ("Swipe an item tag to change its status."). - Swap the OnboardingView "How to use" link for the Support Website link; trim onboarding from 13 to 8 descriptions and drop unused String(localized:) wrap. - Normalize ItemTag string keys: editTag/addTag/deleteTag/etc. -> editItemTag/addItemTag/deleteItemTag/etc. - Drop unused constants: howToUseUrl, learnMore, createShops, createTags.
1 parent d6039a0 commit 64068b4

21 files changed

Lines changed: 42 additions & 95 deletions

NativeAppTemplate/Constants.swift

Lines changed: 20 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ extension String {
166166
static let createShopsLabel = "Create shops"
167167
static let tapShopBelow = "Tap a shop below."
168168
static let haveFun = "Have fun!"
169+
static let shopDetailInstruction = "Swipe an item tag to change its status."
169170

170171
// MARK: Shop Settings View
171172

@@ -178,11 +179,11 @@ extension String {
178179
static let nameLabel = "Name"
179180
static let descriptionLabel = "Description"
180181
static let itemTagNamePlaceholder = "Name"
181-
static let editTag = "Edit Tag"
182-
static let addTag = "Add Tag"
183-
static let addTagDescription = "Add a new item tag and start changing the tag status."
184-
static let deleteTag = "Delete tag"
185-
static let buttonDeleteTag = "Delete Tag"
182+
static let editItemTag = "Edit Item Tag"
183+
static let addItemTag = "Add Item Tag"
184+
static let addItemTagDescription = "Add a new item tag and start changing the item tag status."
185+
static let deleteItemTag = "Delete item tag"
186+
static let buttonDeleteItemTag = "Delete Item Tag"
186187
static let itemTagNameIsInvalid = "Item tag name is invalid."
187188
static let itemTagDescriptionIsInvalid = "Item tag description is too long."
188189
static let completedAtLabel = "Completed at"
@@ -201,7 +202,6 @@ extension String {
201202

202203
static let supportMail: String = "support@nativeapptemplate.com"
203204
static let supportWebsiteUrl: String = "https://nativeapptemplate.com"
204-
static let howToUseUrl: String = "https://myturntag.com/how"
205205
static let faqsUrl: String = "https://nativeapptemplate.com/faqs"
206206
static let privacyPolicyUrl: String = "https://nativeapptemplate.com/privacy"
207207
static let termsOfUseUrl: String = "https://nativeapptemplate.com/terms"
@@ -235,12 +235,12 @@ extension String {
235235
static let shopDeleted = "Shop deleted successfully."
236236
static let shopDeletedError = "There was a problem deleting the shop."
237237

238-
static let itemTagCreated = "Tag created successfully."
239-
static let itemTagUpdated = "Tag updated successfully."
240-
static let itemTagDeleted = "Tag deleted successfully."
241-
static let itemTagDeletedError = "There was a problem deleting the tag."
242-
static let itemTagCompletedError = "There was a problem completing the tag."
243-
static let itemTagIdledError = "There was a problem idling the tag."
238+
static let itemTagCreated = "Item tag created successfully."
239+
static let itemTagUpdated = "Item tag updated successfully."
240+
static let itemTagDeleted = "Item tag deleted successfully."
241+
static let itemTagDeletedError = "There was a problem deleting the item tag."
242+
static let itemTagCompletedError = "There was a problem completing the item tag."
243+
static let itemTagIdledError = "There was a problem idling the item tag."
244244

245245
static let shopkeeperCreated = "Account created successfully."
246246
static let shopkeeperCreatedError = "There was a problem creating the account."
@@ -285,19 +285,14 @@ extension String {
285285
static let email = "Email"
286286
static let password = "Password"
287287

288-
static let onboardingDescription1 = String(localized: "Welcome to NativeAppTemplate.")
289-
static let onboardingDescription2 = String(localized: "Sign in to manage your shops and item tags.")
290-
static let onboardingDescription3 = String(localized: "Organize your work across multiple organizations.")
291-
static let onboardingDescription4 = String(localized: "Invite teammates to collaborate.")
292-
static let onboardingDescription5 = String(localized: "Track item tags with a simple idle/completed state.")
293-
static let onboardingDescription6 = String(localized: "Create, edit, and delete item tags from your shop.")
294-
static let onboardingDescription7 = String(localized: "Switch between personal and shared organizations.")
295-
static let onboardingDescription8 = String(localized: "Have fun!")
296-
static let onboardingDescription9 = String(localized: "Have fun!")
297-
static let onboardingDescription10 = String(localized: "Have fun!")
298-
static let onboardingDescription11 = String(localized: "Have fun!")
299-
static let onboardingDescription12 = String(localized: "Have fun!")
300-
static let onboardingDescription13 = String(localized: "Have fun!")
288+
static let onboardingDescription1 = "Welcome to NativeAppTemplate."
289+
static let onboardingDescription2 = "Sign in to manage your shops and item tags."
290+
static let onboardingDescription3 = "Organize your work across multiple organizations."
291+
static let onboardingDescription4 = "Invite teammates to collaborate."
292+
static let onboardingDescription5 = "Track item tags with a simple idle/completed state."
293+
static let onboardingDescription6 = "Create, edit, and delete item tags from your shop."
294+
static let onboardingDescription7 = "Switch between personal and shared organizations."
295+
static let onboardingDescription8 = "Have fun!"
301296

302297
// MARK: Other
303298

@@ -320,11 +315,8 @@ extension String {
320315
static let passwordIsRequired = "Password is required."
321316
static let passwordIsInvalid = "Password is invalid."
322317
static let role = "Role"
323-
static let createShops = "Create shops."
324-
static let createTags = "Create tags."
325318
static let complete = "Complete"
326319
static let open = "Open"
327-
static let learnMore = "Learn More"
328320
static let instructions = "Instructions"
329321
static let forceSignOut = "Force Sign Out?"
330322
static let signOut = "Sign Out"

NativeAppTemplate/Login/OnboardingRepository.swift

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,7 @@ import OrderedCollections
1616
5: false,
1717
6: false,
1818
7: true,
19-
8: true,
20-
9: false,
21-
10: false,
22-
11: true,
23-
12: false,
24-
13: false
19+
8: true
2520
]
2621

2722
func reload() {

NativeAppTemplate/Models/Shop.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ struct Shop: Codable, Identifiable, Sendable {
1111
var description: String
1212
var timeZone: String
1313
var itemTagsCount: Int = 0
14-
var scannedItemTagsCount: Int = 0
1514
var completedItemTagsCount: Int = 0
1615
}
1716

NativeAppTemplate/Networking/Adapters/EntityAdapters/ShopAdapter.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ struct ShopAdapter: EntityAdapter {
2525
description: resource.attributes["description"] as? String ?? "",
2626
timeZone: timeZone,
2727
itemTagsCount: resource.attributes["item_tags_count"] as? Int ?? 0,
28-
scannedItemTagsCount: resource.attributes["scanned_item_tags_count"] as? Int ?? 0,
2928
completedItemTagsCount: resource.attributes["completed_item_tags_count"] as? Int ?? 0
3029
)
3130
}

NativeAppTemplate/UI/App Root/OnboardingView.swift

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import SwiftUI
77

88
struct OnboardingView: View {
9-
let isAppStorePromotion = false
109
@State private var viewModel: OnboardingViewModel
1110

1211
init(onboardingRepository: OnboardingRepositoryProtocol) {
@@ -39,17 +38,15 @@ private extension OnboardingView {
3938
)
4039
}
4140
}
42-
.tabViewStyle(.page(indexDisplayMode: isAppStorePromotion ? .never : .always))
41+
.tabViewStyle(.page(indexDisplayMode: .always))
4342
.toolbar {
44-
if !isAppStorePromotion {
45-
ToolbarItem(placement: .navigationBarLeading) {
46-
Link(String.howToUse, destination: URL(string: String.howToUseUrl)!)
47-
}
48-
ToolbarItem(placement: .navigationBarTrailing) {
49-
NavigationLink(destination: SignUpOrSignInView()) {
50-
Text(verbatim: "Start")
51-
.font(.title)
52-
}
43+
ToolbarItem(placement: .navigationBarLeading) {
44+
Link(String.supportWebsite, destination: URL(string: String.supportWebsiteUrl)!)
45+
}
46+
ToolbarItem(placement: .navigationBarTrailing) {
47+
NavigationLink(destination: SignUpOrSignInView()) {
48+
Text(verbatim: "Start")
49+
.font(.title)
5350
}
5451
}
5552
}

NativeAppTemplate/UI/App Root/OnboardingViewModel.swift

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,6 @@ final class OnboardingViewModel {
4040
String.onboardingDescription7
4141
case 8:
4242
String.onboardingDescription8
43-
case 9:
44-
String.onboardingDescription9
45-
case 10:
46-
String.onboardingDescription10
47-
case 11:
48-
String.onboardingDescription11
49-
case 12:
50-
String.onboardingDescription12
51-
case 13:
52-
String.onboardingDescription13
5343
default:
5444
String.onboardingDescription1
5545
}

NativeAppTemplate/UI/Shop Detail/ShopDetailView.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,10 @@ private extension ShopDetailView {
5151
}
5252

5353
func header(shop: Shop) -> some View {
54-
ScrollView(.horizontal) {
55-
VStack(alignment: .leading, spacing: 0) {
56-
Link(String.learnMore, destination: URL(string: String.howToUseUrl)!)
57-
}
58-
}
54+
Text(String.shopDetailInstruction)
55+
.foregroundStyle(.contentText)
56+
.frame(maxWidth: .infinity, alignment: .leading)
57+
.padding(.leading)
5958
}
6059

6160
var cardsView: some View {

NativeAppTemplate/UI/Shop List/ShopListCardView.swift

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,6 @@ struct ShopListCardView: View {
2121
horizontalSpacing: NativeAppTemplateConstants.Spacing.xs,
2222
verticalSpacing: NativeAppTemplateConstants.Spacing.xxxs
2323
) {
24-
GridRow {
25-
Image(systemName: "person.2")
26-
.frame(width: statImageSize, height: statImageSize)
27-
.foregroundStyle(.secondaryText)
28-
Text(String(shop.scannedItemTagsCount))
29-
.font(.uiLabelBold)
30-
.gridColumnAlignment(.trailing)
31-
Text(verbatim: "tags scanned by customers")
32-
.font(.uiFootnote)
33-
.foregroundStyle(.contentText)
34-
}
35-
3624
GridRow {
3725
Image(systemName: "flag.checkered")
3826
.frame(width: statImageSize, height: statImageSize)

NativeAppTemplate/UI/Shop Settings/ItemTag Detail/ItemTagDetailView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ private extension ItemTagDetailView {
6767
}
6868
)
6969
.alert(
70-
String.buttonDeleteTag,
70+
String.buttonDeleteItemTag,
7171
isPresented: $viewModel.isShowingDeleteConfirmationDialog
7272
) {
73-
Button(String.buttonDeleteTag, role: .destructive) {
73+
Button(String.buttonDeleteItemTag, role: .destructive) {
7474
viewModel.destroyItemTag()
7575
}
7676
Button(String.cancel, role: .cancel) {

NativeAppTemplate/UI/Shop Settings/ItemTag Detail/ItemTagEditView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ private extension ItemTagEditView {
7979
}
8080
}
8181
}
82-
.navigationTitle(String.editTag)
82+
.navigationTitle(String.editItemTag)
8383
.toolbar {
8484
ToolbarItem(placement: .navigationBarTrailing) {
8585
Button {

0 commit comments

Comments
 (0)