Skip to content
This repository has been archived by the owner on May 5, 2022. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Lantzify/move-dictionaries
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.0.0
Choose a base ref
...
head repository: Lantzify/move-dictionaries
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 13 commits
  • 2,648 files changed
  • 1 contributor

Commits on Jun 6, 2021

  1. Copy the full SHA
    1d1c25f View commit details

Commits on Jun 26, 2021

  1. Update README.md

    Lantzify authored Jun 26, 2021
    Copy the full SHA
    0bc571a View commit details

Commits on Jul 14, 2021

  1. Included local DB

    Lantzify committed Jul 14, 2021
    Copy the full SHA
    ebd276d View commit details
  2. Copy the full SHA
    3eecec6 View commit details
  3. Update issue templates

    Lantzify authored Jul 14, 2021
    Copy the full SHA
    2267b53 View commit details

Commits on Oct 10, 2021

  1. Copy the full SHA
    b4280e0 View commit details
  2. Copy the full SHA
    e42a613 View commit details
  3. Update README.md

    Lantzify authored Oct 10, 2021
    Copy the full SHA
    3b8352f View commit details

Commits on Oct 16, 2021

  1. Update README.md

    Lantzify authored Oct 16, 2021
    Copy the full SHA
    bb9aed4 View commit details
  2. Update README.md

    Lantzify authored Oct 16, 2021
    Copy the full SHA
    b2a0e4c View commit details

Commits on Mar 10, 2022

  1. Fixed project structure

    Lantzify committed Mar 10, 2022
    Copy the full SHA
    595bae5 View commit details

Commits on Mar 12, 2022

  1. Update README.md

    Lantzify authored Mar 12, 2022
    Copy the full SHA
    18d3275 View commit details

Commits on May 5, 2022

  1. Update README.md

    Lantzify authored May 5, 2022
    Copy the full SHA
    87968e2 View commit details
Showing 2,648 changed files with 4,606 additions and 520 deletions.
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/---bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: "\U0001F99F Bug report"
about: Something doesn't work how it should.
title: ''
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/---feature-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: "\U0001F4A1 Feature request"
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,38 @@
## ⚠️ This repository is no longer maintained

> [This got added in Umbraco v9.5](https://our.umbraco.com/download/releases/950)
# Move dictionaries

Hindsight is 20/20 move existing dictionaries instead of recreating them! Move dictionaries is a package for umbraco v8 that allows you to move dictionaries
Hindsight is 20/20 move existing dictionaries instead of recreating them! Move dictionaries is a package for umbraco v8 that allows you to move dictionaries.

![version](https://img.shields.io/nuget/v/MoveDictionaries?label=version)
[![Nuget](https://img.shields.io/nuget/dt/MoveDictionaries?color=2346c018&logo=Nuget)](https://www.nuget.org/packages/MoveDictionaries)
[![Umbraco](https://img.shields.io/badge/our-umbraco-%233544b1)](https://our.umbraco.com/packages/backoffice-extensions/move-dictionaries/)

![preview](assets/move.gif)

## Installation

### Umbraco v8
You can install MoveDictionaries for umbraco v8 via Nuget Or via Umbraco backoffice!
```
PM> Install-Package MoveDictionaries
```

### Umbraco v9
You can install MoveDictionaries for umbraco v9 via Nuget.
```
PM> dotnet add package MoveDictionaries
```


## Contributing

If you would like to help me improve this package, feel free to create a pull request!
Login details:
- Email: admin@admin.com
- Password: password123

## Issues

Binary file added assets/move.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/move.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
angular.module("umbraco").controller("moveDictionaries.controller", function ($scope, $http, $routeParams, dictionaryResource, navigationService, notificationsService) {

var vm = this;
var dictionaries = [];

vm.dictionaries = [];
vm.dictionary = {};
vm.rootKey = "00000000-0000-0000-0000-000000000000";
vm.selectedKey = "";

$scope.moveDictionariesTreeApi = {};

//Get clicked dictionary
dictionaryResource.getById($scope.model.dictionaryId).then(function (response) {
vm.dictionary = response;
@@ -17,24 +19,53 @@
//getList dosen't return dictionary key.
response.forEach(function (dictionary) {
dictionaryResource.getById(dictionary.id).then(function (additionalInfoDictionary) {
vm.dictionaries.push(additionalInfoDictionary);
console.log(additionalInfoDictionary)
dictionaries.push(additionalInfoDictionary);

});
});
});

vm.toggleSelect = function (dictionaryKey) {
var nodeSelectHandler = function (args) {

if (args && args.event) {
args.event.preventDefault();
args.event.stopPropagation();
}

if (vm.selectedKey === dictionaryKey) {
vm.selectedKey = "";
if ($scope.target) {
$scope.target.selected = false;
}

$scope.target = args.node;
$scope.target.selected = true;

if ($scope.target.id === "-1") {
vm.selectedKey = vm.rootKey;
} else {
vm.selectedKey = dictionaryKey;
dictionaries.forEach(function (child) {
if ($scope.target.id == child.id) {
vm.selectedKey = child.key;

return;
}
});
}
}

vm.submit = function () {
var nodeExpandedHandler = function (args) {
args.children.forEach(function (child, index) {
if (child.name === vm.dictionary.name) {
args.children.splice(index, 1);
}
});
}


$scope.onTreeInit = function () {
$scope.moveDictionariesTreeApi.callbacks.treeNodeSelect(nodeSelectHandler);
$scope.moveDictionariesTreeApi.callbacks.treeNodeExpanded(nodeExpandedHandler);
};

vm.submit = function () {
vm.buttonState = "busy";

if ($scope.model.submit) {
@@ -47,7 +78,14 @@
}
}).then(function (response) {
if (response.data) {
navigationService.syncTree({ "tree": "dictionary", "path": [-1, $routeParams.id], "forceReload": true });
var path = [];

if ($routeParams.method === "list") {
path.push("list");
} else {
path.push("edit", $routeParams.id);
}
navigationService.syncTree({ "tree": "dictionary", "path": path, "forceReload": true });
notificationsService.success("Dictionary", "Successfully saved dictionary item!");
} else {
notificationsService.error("Dictionary", "Failed to save dictionary item");
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<div ng-controller="moveDictionaries.controller as vm">
<umb-editor-view>

<umb-editor-header name="model.title"
name-locked="true"
hide-alias="true"
hide-icon="true"
hide-description="true">
</umb-editor-header>

<umb-editor-container>
<umb-box>
<umb-box-content>

<p>Choose where to move <strong>{{vm.dictionary.name}}</strong> to in the tree structure below</p>

<umb-tree section="translation"
hideheader="false"
hideoptions="true"
isdialog="true"
api="moveDictionariesTreeApi"
on-init="onTreeInit()"
enablelistviewexpand="true"
enablecheckboxes="true">
</umb-tree>

</umb-box-content>
</umb-box>
</umb-editor-container>

<umb-editor-footer>
<umb-editor-footer-content-right>
<umb-button type="button"
button-style="link"
label-key="general_close"
shortcut="esc"
action="vm.close()">
</umb-button>
<umb-button type="button"
button-style="success"
state="vm.buttonState"
disabled="vm.selectedKey == ''"
label-key="general_submit"
action="vm.submit(model)">
</umb-button>
</umb-editor-footer-content-right>
</umb-editor-footer>

</umb-editor-view>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#if NETCOREAPP
using Umbraco.Cms.Core.Events;
using MoveDictionaries.Core.Helpers;
using Umbraco.Cms.Core.Notifications;

namespace MoveDictionaries.Core.Compositions
{
public class MenuRenderingNotificationHandler : INotificationHandler<MenuRenderingNotification>
{
public void Handle(MenuRenderingNotification notification)
{
if (notification.TreeAlias == "dictionary" && notification.NodeId != "-1")
{
notification.Menu.Items.Insert(2, MenuItemHelper.CreateMenuItem());
}
}
}
}
#endif
53 changes: 53 additions & 0 deletions src/MoveDictionaries.Core/Compositions/MoveDictionariesComposer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#if NETCOREAPP
using Umbraco.Cms.Core.Composing;
using Umbraco.Cms.Core.Notifications;
using Umbraco.Cms.Core.DependencyInjection;
#else
using Umbraco.Core;
using Umbraco.Web.Trees;
using Umbraco.Core.Composing;
using MoveDictionaries.Core.Helpers;
#endif

namespace MoveDictionaries.Core.Compositions
{
#if NETCOREAPP
public class MoveDictionariesMigrationComposer : IComposer
{
public void Compose(IUmbracoBuilder builder)
{
builder.AddNotificationHandler<MenuRenderingNotification, MenuRenderingNotificationHandler>();
}
}
#else
[RuntimeLevel(MinLevel = RuntimeLevel.Run)]
public class MoveDictionariesComposer : ComponentComposer<MoveDictionariesComponent>, IUserComposer
{
public override void Compose(Composition composition)
{
composition.Components().Append<MoveDictionariesComponent>();
}
}

public class MoveDictionariesComponent : IComponent
{
public void Initialize()
{
TreeControllerBase.MenuRendering += TreeControllerBase_MenuRendering;
}

void TreeControllerBase_MenuRendering(TreeControllerBase sender, MenuRenderingEventArgs e)
{
if (sender.TreeAlias.Equals("dictionary") && e.NodeId != "-1")
{
e.Menu.Items.Insert(2, MenuItemHelper.CreateMenuItem());
}
}

public void Terminate()
{
TreeControllerBase.MenuRendering -= TreeControllerBase_MenuRendering;
}
}
#endif
}
41 changes: 0 additions & 41 deletions src/MoveDictionaries.Core/Compositions/TreeComposer.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
using MoveDictionaries.Core.Dtos;
#if NETCOREAPP
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Web.BackOffice.Controllers;
#else
using Umbraco.Core.Services;
using Umbraco.Web.WebApi;
using System.Web.Http;
#endif

using System;
using System.Collections;
using System.Collections.Generic;
using Umbraco.Core.Models;
using System.Linq;
using MoveDictionaries.Core.Dtos;

namespace MoveDictionaries.Core.Controllers
{
@@ -40,4 +43,4 @@ public bool MoveDictionary(DictionaryDto dto)
return true;
}
}
}
}
Loading