~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/registry/browser/distroseries.py

[r=benji][bug=795573,
 796233] On DistroSeries:+localpackagediffs ensure that the comment
 form is hidden after adding a new comment to a DistroSeriesDifference,
 prevent empty comments from being submitted,
 and add some animations and effects to make the UI less jarring and easier to
 follow.

Show diffs side-by-side

added added

removed removed

Lines of Context:
647
647
        return getFeatureFlag("soyuz.derived_series_ui.enabled") is not None
648
648
 
649
649
    @property
 
650
    def show_derivation_not_yet_available(self):
 
651
        return not self.is_derived_series_feature_enabled
 
652
 
 
653
    @property
 
654
    def show_derivation_form(self):
 
655
        return (
 
656
            self.is_derived_series_feature_enabled and
 
657
            not self.context.isInitializing() and
 
658
            not self.context.isInitialized())
 
659
 
 
660
    @property
 
661
    def show_already_initialized_message(self):
 
662
        return (
 
663
            self.is_derived_series_feature_enabled and
 
664
            self.context.isInitialized())
 
665
 
 
666
    @property
 
667
    def show_already_initializing_message(self):
 
668
        return (
 
669
            self.is_derived_series_feature_enabled and
 
670
            self.context.isInitializing())
 
671
 
 
672
    @property
650
673
    def rebuilding_allowed(self):
651
674
        """If the distribution has got any initialized series already,
652
675
        rebuilding is not allowed.
816
839
        else:
817
840
            destination_pocket = PackagePublishingPocket.RELEASE
818
841
 
 
842
        # When syncing we *must* do it asynchronously so that a package
 
843
        # copy job is created.  This gives the job a chance to inspect
 
844
        # the copy and create a PackageUpload if required.
819
845
        if self.do_copy(
820
846
            'selected_differences', sources, self.context.main_archive,
821
847
            self.context, destination_pocket, include_binaries=False,
822
848
            dest_url=series_url, dest_display_name=series_title,
823
 
            person=self.user):
 
849
            person=self.user, force_async=True):
824
850
            # The copy worked so we can redirect back to the page to
825
851
            # show the results.
826
852
            self.next_url = self.request.URL
1070
1096
    def requestUpgrades(self):
1071
1097
        """Request sync of packages that can be easily upgraded."""
1072
1098
        target_distroseries = self.context
1073
 
        target_archive = target_distroseries.main_archive
1074
 
        job_source = getUtility(IPlainPackageCopyJobSource)
1075
 
 
1076
 
        for dsd in self.getUpgrades():
1077
 
            job_source.create(
 
1099
        copies = [
 
1100
            (
1078
1101
                dsd.source_package_name.name,
1079
 
                dsd.parent_series.main_archive, target_archive,
1080
 
                target_distroseries, PackagePublishingPocket.UPDATES,
1081
 
                package_version=dsd.parent_source_version,
1082
 
                copy_policy=PackageCopyPolicy.MASS_SYNC)
 
1102
                dsd.parent_source_version,
 
1103
                dsd.parent_series.main_archive,
 
1104
                target_distroseries.main_archive,
 
1105
                PackagePublishingPocket.RELEASE,
 
1106
            )
 
1107
            for dsd in self.getUpgrades()]
 
1108
        getUtility(IPlainPackageCopyJobSource).createMultiple(
 
1109
            target_distroseries, copies,
 
1110
            copy_policy=PackageCopyPolicy.MASS_SYNC)
1083
1111
 
1084
1112
        self.request.response.addInfoNotification(
1085
1113
            (u"Upgrades of {context.displayname} packages have been "