alterm4nn / ChronoZoom

ChronoZoom is an interactive timeline for all of history.
http://www.chronozoom.com
159 stars 127 forks source link

Search: Enhanced to Search Other Collections #1353

Closed NeilCresswell closed 10 years ago

NeilCresswell commented 10 years ago

Publicly Searchable flag added to Collections:

UI changes were also made so this flag is editable with a checkbox when editing your collection's settings. (Same panel as when granting permissions to other users.)

Scope added to search:

If search result selected is in current collection, user has a visual zoom from current location in collection to where search result resides. (Existing behavior.)

If search result is in a different collection, user is taken straight to the search result. (New behavior.)

Note on merging: Was unable to merge a minified CSS file but I regenerated this from the source file.

NeilCresswell commented 10 years ago

There's no XML tag 'format', please use 'example' instead.

Will do, and will resubmit with this change shortly. Thanks for spotting.


Do you use some automatic tool that deletes code comments?

No I don't use any automated tool that zaps comments.

Generally I add new comments to explain anything that isn't self-documenting or straightforward, plus update existing ones if they're incorrect/no longer correct in an area where I'm working. Sometimes though a comment is removed as it is completely invalid, or is totally superfluous and adds no useful information. I like clean readable comments that help future maintainers and am very much for adding comments to that aim, and for removing comments where they add zero value in order to make the code more readable.

For example, I reworked the following code and all of the /// comments shown here were removed as totally superfluous. Being more specific, "The ID of the search result" does not need to exist as a comment since the class is SearchResult and the property name is ID. This is immediately obvious to a developer who knows nothing about CZ in particular.

    /// <summary>
    /// Contains a search result.
    /// </summary>
    [DataContract]
    public class SearchResult
    {
        /// <summary>
        /// The ID of the search result.
        /// </summary>
        [DataMember(Name = "id")]
        public Guid Id { get; set; }

        /// <summary>
        /// The title of the search result.
        /// </summary>
        [DataMember(Name = "title")]
        public string Title { get; set; }

        /// <summary>
        /// The type of object contained by the search result.
        /// </summary>
        [DataMember(Name = "objectType")]
        public ObjectType ObjectType { get; set; }

FWIW, I don't go out of my way to look for things but if I come upon them in an area I'm working in, I try and clean them up if I can do so quickly so as to improve the quality of the code base. I hope this information is useful.

NeilCresswell commented 10 years ago

Added another commit with additional search enhancements, and as a first step to allowing users' to maintain multiple collections. Please note that one will need to edit one's web.config appKeys to change BaseCollectionsAdministrator from "NotDefined" to "ChronoZoom".

This update now displays collection names and their curators' names in search results, so "NotDefined" is an inappropriate user name. Additionally, the default collection name was renamed from "Beta Content" to "Cosmos".

NeilCresswell commented 10 years ago

Fixed search SQL changes to work with the data in www.chronozoom.com's production db. (Still works for new install.) Please note that one will need to edit one's web.config appKeys to change DefaultSuperCollection from "Beta Content" to "ChronoZoom". This is in addition to the other appKeys change mentioned earlier.