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

[#405] Add switch component #439

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from

Conversation

ludovic35
Copy link
Member

@ludovic35 ludovic35 commented Feb 3, 2025

Note: Please transform - [ ] into - (NA) in the description when things are not applicable

Related issues

#405

Description

  • Implementation of switch component
  • Update of documentation
  • Update of unit tests

Motivation & Context

Implement component of design system

Types of change

  • New feature (non-breaking change which adds functionality)

Previews

Checklist

Contribution

Accessibility

  • My change follows accessibility good practices

Design

  • My change respects the design guidelines of Orange Unified Design System

Development

  • My change follows the developer guide
  • I checked my changes do not add new SwiftLint warnings
  • I have added unit tests to cover my changes (optional)

Documentation

  • My change introduces changes to the documentation and/or I have updated the documentation accordingly

Checklist (for Core Team only)

  • The evolution have been tested and the project builds for iPhones and iPads
  • Code review has been done by reviewers according to CODEOWNERS file
  • Design review has been done
  • Accessibiltiy review has been done
  • Q/A team has tested the evolution
  • Documentation has been updated if relevant
  • Internal files have been updated if relevant (like CONTRIBUTING, DEVELOP, THIRD_PARTY, CONTRIBUTORS, NOTICE)
  • CHANGELOG has been updated respecting keep a changelog rules and reference the issues
  • The wiki has been updated if needed (optional)

@ludovic35 ludovic35 linked an issue Feb 3, 2025 that may be closed by this pull request
@ludovic35 ludovic35 force-pushed the 405-component-create-component---switch branch from 759bc02 to 0c0542a Compare February 4, 2025 14:01
@ludovic35 ludovic35 marked this pull request as ready for review February 4, 2025 16:26
@ludovic35 ludovic35 requested a review from pylapp as a code owner February 4, 2025 16:26
@ludovic35
Copy link
Member Author

UI tests are missing
Some constants in code (waiting for tokens)

Copy link
Member

@pylapp pylapp left a comment

Choose a reason for hiding this comment

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

Pas mal de typos à corriger.
Un peu de réorganisation de code.
Un peu de renaming.
Le fichier NOTICE pas à jour.

@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- [DesignToolbox] Add text field in component configuration to customize text ([#436](https://github.com/Orange-OpenSource/ouds-ios/issues/436))
- [Library] Switch component ([#405](https://github.com/Orange-OpenSource/ouds-ios/issues/405))
Copy link
Member

Choose a reason for hiding this comment

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

Je mettrais cette ligne en haut, avant celle relative à la carte n°436

@@ -197,7 +197,7 @@ struct ButtonConfiguration: View {
}

if model.layout == .iconAndText || model.layout == .textOnly {
DesignToolboxTextField(text: $model.text, prompt: "app_component_common_userText_prompt")
DesignToolboxTextField(text: $model.text, prompt: "app_components_common_userText_prompt")
Copy link
Member

Choose a reason for hiding this comment

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

Je trouve curieux d'utiliser du camel case en plus du snake case, c'est normal d'avoir "userText" et pas par exemple "user_text" ? Je ne connais pas les règles appliquées au wording ici :)

Copy link
Member Author

Choose a reason for hiding this comment

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

cf. règles de naming dans le fichier

@@ -26,9 +26,9 @@ struct EmptyState: View {
.frame(width: 160, height: 160, alignment: .center)

VStack(alignment: .center, spacing: theme.spaces.spaceFixedShorter) {
Text("app_component_emptyContent_text")
Text("app_components_emptyContent_text")
Copy link
Member

Choose a reason for hiding this comment

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

Idem que précédemment, "empty_content" plutôt ?

Copy link
Member Author

Choose a reason for hiding this comment

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

cf règles de naming

@@ -167,7 +167,7 @@ struct LinkConfiguration: View {
}
}

DesignToolboxTextField(text: $model.text, prompt: "app_component_common_userText_prompt")
DesignToolboxTextField(text: $model.text, prompt: "app_components_common_userText_prompt")
Copy link
Member

Choose a reason for hiding this comment

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

"user_text" plutôt que "userText" ?


// MARK: - Switch Configuration Model

/// The model shared between `SwitchPageConfiguration` view and `SwitchPageComponent` view.
Copy link
Member

Choose a reason for hiding this comment

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

SwitchPageConfiguration n'existe pas, SwitchPage plutôt ?
De même, SwitchPageComponent n'existe pas.


// MARK: - Stored properties

@Environment(\.theme) private var theme
Copy link
Member

Choose a reason for hiding this comment

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

Pmutôt :

    let show: Bool    
    @Environment(\.theme) private var theme
    @Environment(\.colorScheme) private var colorScheme

Copy link
Member Author

Choose a reason for hiding this comment

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

on mis les env en début partout dans le code

import SwiftUI

/// A `ViewModifier` which will apply a specific divider under a `View` using color semantic token.
public struct DividerModifier: ViewModifier {
Copy link
Member

Choose a reason for hiding this comment

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

Attention, c'est une API publique, donc il faut indiquer dans la doc le "Since"

/// ```swift
/// var body: some View {
/// SomeView()
/// .divider()
Copy link
Member

Choose a reason for hiding this comment

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

Le code sample n'est ps cohérent ; tu utilsies "divider" et non "oudsDivider(show:)", c'est normal ?


extension View {

/// Modifies the current `View` to apply a divider under.
Copy link
Member

Choose a reason for hiding this comment

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

"below" plus que "under"

/// SomeView()
/// .divider()
/// ```
/// - Parameter:
Copy link
Member

Choose a reason for hiding this comment

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

Si tu builds al doc en local tu verras un warning sur ça.

Il faut que ce soit "Parameter show:" plutôt que de faire un saut de ligne (ça amrche avec "Parameters"

@ludovic35 ludovic35 changed the title [#405] Component Switch [#405] Add switch component Feb 5, 2025
@ludovic35 ludovic35 marked this pull request as draft February 5, 2025 11:06
@ludovic35 ludovic35 marked this pull request as ready for review February 5, 2025 11:06
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.

[Component] Create component - Switch
2 participants