mirror of
				https://github.com/nitnelave/lldap.git
				synced 2023-04-12 14:25:13 +00:00 
			
		
		
		
	Display the UUID on the user and group details
This commit is contained in:
		
							parent
							
								
									25647eadc0
								
							
						
					
					
						commit
						18862010cc
					
				@ -3,6 +3,7 @@ query GetGroupDetails($id: Int!) {
 | 
			
		||||
    id
 | 
			
		||||
    displayName
 | 
			
		||||
    creationDate
 | 
			
		||||
    uuid
 | 
			
		||||
    users {
 | 
			
		||||
      id
 | 
			
		||||
      displayName
 | 
			
		||||
 | 
			
		||||
@ -6,6 +6,7 @@ query GetUserDetails($id: String!) {
 | 
			
		||||
    firstName
 | 
			
		||||
    lastName
 | 
			
		||||
    creationDate
 | 
			
		||||
    uuid
 | 
			
		||||
    groups {
 | 
			
		||||
      id
 | 
			
		||||
      displayName
 | 
			
		||||
 | 
			
		||||
@ -92,6 +92,15 @@ impl GroupDetails {
 | 
			
		||||
                  <span id="creationDate" class="form-constrol-static">{g.creation_date.date().naive_local()}</span>
 | 
			
		||||
                </div>
 | 
			
		||||
              </div>
 | 
			
		||||
              <div class="form-group row mb-3">
 | 
			
		||||
                <label for="uuid"
 | 
			
		||||
                  class="form-label col-4 col-form-label">
 | 
			
		||||
                  {"UUID: "}
 | 
			
		||||
                </label>
 | 
			
		||||
                <div class="col-8">
 | 
			
		||||
                  <span id="uuid" class="form-constrol-static">{g.uuid.to_string()}</span>
 | 
			
		||||
                </div>
 | 
			
		||||
              </div>
 | 
			
		||||
            </form>
 | 
			
		||||
          </div>
 | 
			
		||||
        </>
 | 
			
		||||
 | 
			
		||||
@ -195,6 +195,15 @@ impl Component for UserDetailsForm {
 | 
			
		||||
                  <span id="creationDate" class="form-constrol-static">{&self.common.user.creation_date.date().naive_local()}</span>
 | 
			
		||||
                </div>
 | 
			
		||||
              </div>
 | 
			
		||||
              <div class="form-group row mb-3">
 | 
			
		||||
                <label for="uuid"
 | 
			
		||||
                class="form-label col-4 col-form-label">
 | 
			
		||||
                {"UUID: "}
 | 
			
		||||
                </label>
 | 
			
		||||
                <div class="col-8">
 | 
			
		||||
                  <span id="creationDate" class="form-constrol-static">{&self.common.user.uuid}</span>
 | 
			
		||||
                </div>
 | 
			
		||||
              </div>
 | 
			
		||||
              <div class="form-group row justify-content-center">
 | 
			
		||||
                <button
 | 
			
		||||
                  type="submit"
 | 
			
		||||
@ -267,6 +276,7 @@ impl UserDetailsForm {
 | 
			
		||||
                    first_name: model.first_name,
 | 
			
		||||
                    last_name: model.last_name,
 | 
			
		||||
                    creation_date: self.common.user.creation_date,
 | 
			
		||||
                    uuid: self.common.user.uuid.clone(),
 | 
			
		||||
                    groups: self.common.user.groups.clone(),
 | 
			
		||||
                };
 | 
			
		||||
                self.just_updated = true;
 | 
			
		||||
 | 
			
		||||
@ -18,6 +18,7 @@ type Group {
 | 
			
		||||
  id: Int!
 | 
			
		||||
  displayName: String!
 | 
			
		||||
  creationDate: DateTimeUtc!
 | 
			
		||||
  uuid: String!
 | 
			
		||||
  "The groups to which this user belongs."
 | 
			
		||||
  users: [User!]!
 | 
			
		||||
}
 | 
			
		||||
@ -68,6 +69,7 @@ type User {
 | 
			
		||||
  firstName: String!
 | 
			
		||||
  lastName: String!
 | 
			
		||||
  creationDate: DateTimeUtc!
 | 
			
		||||
  uuid: String!
 | 
			
		||||
  "The groups to which this user belongs."
 | 
			
		||||
  groups: [Group!]!
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -221,6 +221,10 @@ impl<Handler: BackendHandler + Sync> User<Handler> {
 | 
			
		||||
        self.user.creation_date
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    fn uuid(&self) -> &str {
 | 
			
		||||
        self.user.uuid.as_str()
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /// The groups to which this user belongs.
 | 
			
		||||
    async fn groups(&self, context: &Context<Handler>) -> FieldResult<Vec<Group<Handler>>> {
 | 
			
		||||
        let span = debug_span!("[GraphQL query] user::groups");
 | 
			
		||||
@ -260,6 +264,7 @@ pub struct Group<Handler: BackendHandler> {
 | 
			
		||||
    group_id: i32,
 | 
			
		||||
    display_name: String,
 | 
			
		||||
    creation_date: chrono::DateTime<chrono::Utc>,
 | 
			
		||||
    uuid: String,
 | 
			
		||||
    members: Option<Vec<String>>,
 | 
			
		||||
    _phantom: std::marker::PhantomData<Box<Handler>>,
 | 
			
		||||
}
 | 
			
		||||
@ -275,6 +280,9 @@ impl<Handler: BackendHandler + Sync> Group<Handler> {
 | 
			
		||||
    fn creation_date(&self) -> chrono::DateTime<chrono::Utc> {
 | 
			
		||||
        self.creation_date
 | 
			
		||||
    }
 | 
			
		||||
    fn uuid(&self) -> String {
 | 
			
		||||
        self.uuid.clone()
 | 
			
		||||
    }
 | 
			
		||||
    /// The groups to which this user belongs.
 | 
			
		||||
    async fn users(&self, context: &Context<Handler>) -> FieldResult<Vec<User<Handler>>> {
 | 
			
		||||
        let span = debug_span!("[GraphQL query] group::users");
 | 
			
		||||
@ -303,6 +311,7 @@ impl<Handler: BackendHandler> From<GroupDetails> for Group<Handler> {
 | 
			
		||||
            group_id: group_details.group_id.0,
 | 
			
		||||
            display_name: group_details.display_name,
 | 
			
		||||
            creation_date: group_details.creation_date,
 | 
			
		||||
            uuid: group_details.uuid.into_string(),
 | 
			
		||||
            members: None,
 | 
			
		||||
            _phantom: std::marker::PhantomData,
 | 
			
		||||
        }
 | 
			
		||||
@ -315,6 +324,7 @@ impl<Handler: BackendHandler> From<DomainGroup> for Group<Handler> {
 | 
			
		||||
            group_id: group.id.0,
 | 
			
		||||
            display_name: group.display_name,
 | 
			
		||||
            creation_date: group.creation_date,
 | 
			
		||||
            uuid: group.uuid.into_string(),
 | 
			
		||||
            members: Some(group.users.into_iter().map(UserId::into_string).collect()),
 | 
			
		||||
            _phantom: std::marker::PhantomData,
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user